text: (()=>{var t,e={757:(t,e,n)=>{t.exports=n(666)},351:(t,e,n)=>{"use strict";var i,r,o,a,s=Object.create,u=Object.defineProperty,l=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,h=Object.getOwnPropertyNames,d=Object.getOwnPropertyDescriptor,f=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),p=f((t=>{function e(t,e){const n=Object.create(null),i=t.split(",");for(let t=0;t<i.length;t++)n[i[t]]=!0;return e?t=>!!n[t.toLowerCase()]:t=>!!n[t]}Object.defineProperty(t,"__esModule",{value:!0});var i={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"HYDRATE_EVENTS",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"HOISTED",[-2]:"BAIL"},r={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},o=e("Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt");var a="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",s=e(a),u=e(a+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected"),l=/[>/="'\u0009\u000a\u000c\u0020]/,c={};var h=e("animation-iteration-count,border-image-outset,border-image-slice,border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width"),d=e("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap");var f=/;(?![^(]*\))/g,p=/:(.+)/;function g(t){const e={};return t.split(f).forEach((t=>{if(t){const n=t.split(p);n.length>1&&(e[n[0].trim()]=n[1].trim())}})),e}var m=e("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"),v=e("svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"),y=e("area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"),b=/["'&<>]/;var _=/^-?>|<!--|-->|--!>|<!-$/g;function E(t,e){if(t===e)return!0;let n=R(t),i=R(e);if(n||i)return!(!n||!i)&&t.getTime()===e.getTime();if(n=S(t),i=S(e),n||i)return!(!n||!i)&&function(t,e){if(t.length!==e.length)return!1;let n=!0;for(let i=0;n&&i<t.length;i++)n=E(t[i],e[i]);return n}(t,e);if(n=P(t),i=P(e),n||i){if(!n||!i)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t){const i=t.hasOwnProperty(n),r=e.hasOwnProperty(n);if(i&&!r||!i&&r||!E(t[n],e[n]))return!1}}return String(t)===String(e)}var x,A=(t,e)=>I(e)?{[`Map(${e.size})`]:[...e.entries()].reduce(((t,[e,n])=>(t[`${e} =>`]=n,t)),{})}:O(e)?{[`Set(${e.size})`]:[...e.values()]}:!P(e)||S(e)||N(e)?e:String(e),D=Object.freeze({}),w=Object.freeze([]),k=/^on[^a-z]/,T=Object.assign,C=Object.prototype.hasOwnProperty,S=Array.isArray,I=t=>"[object Map]"===B(t),O=t=>"[object Set]"===B(t),R=t=>t instanceof Date,M=t=>"function"==typeof t,L=t=>"string"==typeof t,P=t=>null!==t&&"object"==typeof t,F=Object.prototype.toString,B=t=>F.call(t),N=t=>"[object Object]"===B(t),j=e(",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),V=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},z=/-(\w)/g,U=V((t=>t.replace(z,((t,e)=>e?e.toUpperCase():"")))),G=/\B([A-Z])/g,W=V((t=>t.replace(G,"-$1").toLowerCase())),H=V((t=>t.charAt(0).toUpperCase()+t.slice(1))),q=V((t=>t?`on${H(t)}`:""));t.EMPTY_ARR=w,t.EMPTY_OBJ=D,t.NO=()=>!1,t.NOOP=()=>{},t.PatchFlagNames=i,t.babelParserDefaultPlugins=["bigInt","optionalChaining","nullishCoalescingOperator"],t.camelize=U,t.capitalize=H,t.def=(t,e,n)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:n})},t.escapeHtml=function(t){const e=""+t,n=b.exec(e);if(!n)return e;let i,r,o="",a=0;for(r=n.index;r<e.length;r++){switch(e.charCodeAt(r)){case 34:i="&quot;";break;case 38:i="&amp;";break;case 39:i="&#39;";break;case 60:i="&lt;";break;case 62:i="&gt;";break;default:continue}a!==r&&(o+=e.substring(a,r)),a=r+1,o+=i}return a!==r?o+e.substring(a,r):o},t.escapeHtmlComment=function(t){return t.replace(_,"")},t.extend=T,t.generateCodeFrame=function(t,e=0,n=t.length){const i=t.split(/\r?\n/);let r=0;const o=[];for(let t=0;t<i.length;t++)if(r+=i[t].length+1,r>=e){for(let a=t-2;a<=t+2||n>r;a++){if(a<0||a>=i.length)continue;const s=a+1;o.push(`${s}${" ".repeat(Math.max(3-String(s).length,0))}|  ${i[a]}`);const u=i[a].length;if(a===t){const t=e-(r-u)+1,i=Math.max(1,n>r?u-t:n-e);o.push("   |  "+" ".repeat(t)+"^".repeat(i))}else if(a>t){if(n>r){const t=Math.max(Math.min(n-r,u),1);o.push("   |  "+"^".repeat(t))}r+=u+1}}break}return o.join("\n")},t.getGlobalThis=()=>x||(x="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{}),t.hasChanged=(t,e)=>t!==e&&(t==t||e==e),t.hasOwn=(t,e)=>C.call(t,e),t.hyphenate=W,t.invokeArrayFns=(t,e)=>{for(let n=0;n<t.length;n++)t[n](e)},t.isArray=S,t.isBooleanAttr=u,t.isDate=R,t.isFunction=M,t.isGloballyWhitelisted=o,t.isHTMLTag=m,t.isIntegerKey=t=>L(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,t.isKnownAttr=d,t.isMap=I,t.isModelListener=t=>t.startsWith("onUpdate:"),t.isNoUnitNumericStyleProp=h,t.isObject=P,t.isOn=t=>k.test(t),t.isPlainObject=N,t.isPromise=t=>P(t)&&M(t.then)&&M(t.catch),t.isReservedProp=j,t.isSSRSafeAttrName=function(t){if(c.hasOwnProperty(t))return c[t];const e=l.test(t);return e&&console.error(`unsafe attribute name: ${t}`),c[t]=!e},t.isSVGTag=v,t.isSet=O,t.isSpecialBooleanAttr=s,t.isString=L,t.isSymbol=t=>"symbol"==typeof t,t.isVoidTag=y,t.looseEqual=E,t.looseIndexOf=function(t,e){return t.findIndex((t=>E(t,e)))},t.makeMap=e,t.normalizeClass=function t(e){let n="";if(L(e))n=e;else if(S(e))for(let i=0;i<e.length;i++){const r=t(e[i]);r&&(n+=r+" ")}else if(P(e))for(const t in e)e[t]&&(n+=t+" ");return n.trim()},t.normalizeStyle=function t(e){if(S(e)){const n={};for(let i=0;i<e.length;i++){const r=e[i],o=t(L(r)?g(r):r);if(o)for(const t in o)n[t]=o[t]}return n}if(P(e))return e},t.objectToString=F,t.parseStringStyle=g,t.propsToAttrMap={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},t.remove=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},t.slotFlagsText=r,t.stringifyStyle=function(t){let e="";if(!t)return e;for(const n in t){const i=t[n],r=n.startsWith("--")?n:W(n);(L(i)||"number"==typeof i&&h(r))&&(e+=`${r}:${i};`)}return e},t.toDisplayString=t=>null==t?"":P(t)?JSON.stringify(t,A,2):String(t),t.toHandlerKey=q,t.toNumber=t=>{const e=parseFloat(t);return isNaN(e)?t:e},t.toRawType=t=>B(t).slice(8,-1),t.toTypeString=B})),g=f(((t,e)=>{e.exports=p()})),m=f((t=>{Object.defineProperty(t,"__esModule",{value:!0});var e,n=g(),i=new WeakMap,r=[],o=Symbol("iterate"),a=Symbol("Map key iterate");function s(t,i=n.EMPTY_OBJ){(function(t){return t&&!0===t._isEffect})(t)&&(t=t.raw);const o=function(t,n){const i=function(){if(!i.active)return t();if(!r.includes(i)){l(i);try{return f(),r.push(i),e=i,t()}finally{r.pop(),p(),e=r[r.length-1]}}};return i.id=u++,i.allowRecurse=!!n.allowRecurse,i._isEffect=!0,i.active=!0,i.raw=t,i.deps=[],i.options=n,i}(t,i);return i.lazy||o(),o}var u=0;function l(t){const{deps:e}=t;if(e.length){for(let n=0;n<e.length;n++)e[n].delete(t);e.length=0}}var c=!0,h=[];function d(){h.push(c),c=!1}function f(){h.push(c),c=!0}function p(){const t=h.pop();c=void 0===t||t}function m(t,n,r){if(!c||void 0===e)return;let o=i.get(t);o||i.set(t,o=new Map);let a=o.get(r);a||o.set(r,a=new Set),a.has(e)||(a.add(e),e.deps.push(a),e.options.onTrack&&e.options.onTrack({effect:e,target:t,type:n,key:r}))}function v(t,r,s,u,l,c){const h=i.get(t);if(!h)return;const d=new Set,f=t=>{t&&t.forEach((t=>{(t!==e||t.allowRecurse)&&d.add(t)}))};if("clear"===r)h.forEach(f);else if("length"===s&&n.isArray(t))h.forEach(((t,e)=>{("length"===e||e>=u)&&f(t)}));else switch(void 0!==s&&f(h.get(s)),r){case"add":n.isArray(t)?n.isIntegerKey(s)&&f(h.get("length")):(f(h.get(o)),n.isMap(t)&&f(h.get(a)));break;case"delete":n.isArray(t)||(f(h.get(o)),n.isMap(t)&&f(h.get(a)));break;case"set":n.isMap(t)&&f(h.get(o))}d.forEach((e=>{e.options.onTrigger&&e.options.onTrigger({effect:e,target:t,key:s,type:r,newValue:u,oldValue:l,oldTarget:c}),e.options.scheduler?e.options.scheduler(e):e()}))}var y=n.makeMap("__proto__,__v_isRef,__isVue"),b=new Set(Object.getOwnPropertyNames(Symbol).map((t=>Symbol[t])).filter(n.isSymbol)),_=w(),E=w(!1,!0),x=w(!0),A=w(!0,!0),D={};function w(t=!1,e=!1){return function(i,r,o){if("__v_isReactive"===r)return!t;if("__v_isReadonly"===r)return t;if("__v_raw"===r&&o===(t?e?at:ot:e?rt:it).get(i))return i;const a=n.isArray(i);if(!t&&a&&n.hasOwn(D,r))return Reflect.get(D,r,o);const s=Reflect.get(i,r,o);if(n.isSymbol(r)?b.has(r):y(r))return s;if(t||m(i,"get",r),e)return s;if(gt(s)){return!a||!n.isIntegerKey(r)?s.value:s}return n.isObject(s)?t?ut(s):st(s):s}}["includes","indexOf","lastIndexOf"].forEach((t=>{const e=Array.prototype[t];D[t]=function(...t){const n=ft(this);for(let t=0,e=this.length;t<e;t++)m(n,"get",t+"");const i=e.apply(n,t);return-1===i||!1===i?e.apply(n,t.map(ft)):i}})),["push","pop","shift","unshift","splice"].forEach((t=>{const e=Array.prototype[t];D[t]=function(...t){d();const n=e.apply(this,t);return p(),n}}));var k=C(),T=C(!0);function C(t=!1){return function(e,i,r,o){let a=e[i];if(!t&&(r=ft(r),a=ft(a),!n.isArray(e)&&gt(a)&&!gt(r)))return a.value=r,!0;const s=n.isArray(e)&&n.isIntegerKey(i)?Number(i)<e.length:n.hasOwn(e,i),u=Reflect.set(e,i,r,o);return e===ft(o)&&(s?n.hasChanged(r,a)&&v(e,"set",i,r,a):v(e,"add",i,r)),u}}var S={get:_,set:k,deleteProperty:function(t,e){const i=n.hasOwn(t,e),r=t[e],o=Reflect.deleteProperty(t,e);return o&&i&&v(t,"delete",e,void 0,r),o},has:function(t,e){const i=Reflect.has(t,e);return n.isSymbol(e)&&b.has(e)||m(t,"has",e),i},ownKeys:function(t){return m(t,"iterate",n.isArray(t)?"length":o),Reflect.ownKeys(t)}},I={get:x,set:(t,e)=>(console.warn(`Set operation on key "${String(e)}" failed: target is readonly.`,t),!0),deleteProperty:(t,e)=>(console.warn(`Delete operation on key "${String(e)}" failed: target is readonly.`,t),!0)},O=n.extend({},S,{get:E,set:T}),R=n.extend({},I,{get:A}),M=t=>n.isObject(t)?st(t):t,L=t=>n.isObject(t)?ut(t):t,P=t=>t,F=t=>Reflect.getPrototypeOf(t);function B(t,e,n=!1,i=!1){const r=ft(t=t.__v_raw),o=ft(e);e!==o&&!n&&m(r,"get",e),!n&&m(r,"get",o);const{has:a}=F(r),s=i?P:n?L:M;return a.call(r,e)?s(t.get(e)):a.call(r,o)?s(t.get(o)):void(t!==r&&t.get(e))}function N(t,e=!1){const n=this.__v_raw,i=ft(n),r=ft(t);return t!==r&&!e&&m(i,"has",t),!e&&m(i,"has",r),t===r?n.has(t):n.has(t)||n.has(r)}function j(t,e=!1){return t=t.__v_raw,!e&&m(ft(t),"iterate",o),Reflect.get(t,"size",t)}function V(t){t=ft(t);const e=ft(this);return F(e).has.call(e,t)||(e.add(t),v(e,"add",t,t)),this}function z(t,e){e=ft(e);const i=ft(this),{has:r,get:o}=F(i);let a=r.call(i,t);a?nt(i,r,t):(t=ft(t),a=r.call(i,t));const s=o.call(i,t);return i.set(t,e),a?n.hasChanged(e,s)&&v(i,"set",t,e,s):v(i,"add",t,e),this}function U(t){const e=ft(this),{has:n,get:i}=F(e);let r=n.call(e,t);r?nt(e,n,t):(t=ft(t),r=n.call(e,t));const o=i?i.call(e,t):void 0,a=e.delete(t);return r&&v(e,"delete",t,void 0,o),a}function G(){const t=ft(this),e=0!==t.size,i=n.isMap(t)?new Map(t):new Set(t),r=t.clear();return e&&v(t,"clear",void 0,void 0,i),r}function W(t,e){return function(n,i){const r=this,a=r.__v_raw,s=ft(a),u=e?P:t?L:M;return!t&&m(s,"iterate",o),a.forEach(((t,e)=>n.call(i,u(t),u(e),r)))}}function H(t,e,i){return function(...r){const s=this.__v_raw,u=ft(s),l=n.isMap(u),c="entries"===t||t===Symbol.iterator&&l,h="keys"===t&&l,d=s[t](...r),f=i?P:e?L:M;return!e&&m(u,"iterate",h?a:o),{next(){const{value:t,done:e}=d.next();return e?{value:t,done:e}:{value:c?[f(t[0]),f(t[1])]:f(t),done:e}},[Symbol.iterator](){return this}}}}function q(t){return function(...e){{const i=e[0]?`on key "${e[0]}" `:"";console.warn(`${n.capitalize(t)} operation ${i}failed: target is readonly.`,ft(this))}return"delete"!==t&&this}}var $={get(t){return B(this,t)},get size(){return j(this)},has:N,add:V,set:z,delete:U,clear:G,forEach:W(!1,!1)},Y={get(t){return B(this,t,!1,!0)},get size(){return j(this)},has:N,add:V,set:z,delete:U,clear:G,forEach:W(!1,!0)},X={get(t){return B(this,t,!0)},get size(){return j(this,!0)},has(t){return N.call(this,t,!0)},add:q("add"),set:q("set"),delete:q("delete"),clear:q("clear"),forEach:W(!0,!1)},K={get(t){return B(this,t,!0,!0)},get size(){return j(this,!0)},has(t){return N.call(this,t,!0)},add:q("add"),set:q("set"),delete:q("delete"),clear:q("clear"),forEach:W(!0,!0)};function Z(t,e){const i=e?t?K:Y:t?X:$;return(e,r,o)=>"__v_isReactive"===r?!t:"__v_isReadonly"===r?t:"__v_raw"===r?e:Reflect.get(n.hasOwn(i,r)&&r in e?i:e,r,o)}["keys","values","entries",Symbol.iterator].forEach((t=>{$[t]=H(t,!1,!1),X[t]=H(t,!0,!1),Y[t]=H(t,!1,!0),K[t]=H(t,!0,!0)}));var J={get:Z(!1,!1)},Q={get:Z(!1,!0)},tt={get:Z(!0,!1)},et={get:Z(!0,!0)};function nt(t,e,i){const r=ft(i);if(r!==i&&e.call(t,r)){const e=n.toRawType(t);console.warn(`Reactive ${e} contains both the raw and reactive versions of the same object${"Map"===e?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var it=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap;function st(t){return t&&t.__v_isReadonly?t:lt(t,!1,S,J,it)}function ut(t){return lt(t,!0,I,tt,ot)}function lt(t,e,i,r,o){if(!n.isObject(t))return console.warn(`value cannot be made reactive: ${String(t)}`),t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const a=o.get(t);if(a)return a;const s=(u=t).__v_skip||!Object.isExtensible(u)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(n.toRawType(u));var u;if(0===s)return t;const l=new Proxy(t,2===s?r:i);return o.set(t,l),l}function ct(t){return ht(t)?ct(t.__v_raw):!(!t||!t.__v_isReactive)}function ht(t){return!(!t||!t.__v_isReadonly)}function dt(t){return ct(t)||ht(t)}function ft(t){return t&&ft(t.__v_raw)||t}var pt=t=>n.isObject(t)?st(t):t;function gt(t){return Boolean(t&&!0===t.__v_isRef)}function mt(t,e=!1){return gt(t)?t:new class{constructor(t,e=!1){this._rawValue=t,this._shallow=e,this.__v_isRef=!0,this._value=e?t:pt(t)}get value(){return m(ft(this),"get","value"),this._value}set value(t){n.hasChanged(ft(t),this._rawValue)&&(this._rawValue=t,this._value=this._shallow?t:pt(t),v(ft(this),"set","value",t))}}(t,e)}function vt(t){return gt(t)?t.value:t}var yt={get:(t,e,n)=>vt(Reflect.get(t,e,n)),set:(t,e,n,i)=>{const r=t[e];return gt(r)&&!gt(n)?(r.value=n,!0):Reflect.set(t,e,n,i)}};function bt(t,e){return gt(t[e])?t[e]:new class{constructor(t,e){this._object=t,this._key=e,this.__v_isRef=!0}get value(){return this._object[this._key]}set value(t){this._object[this._key]=t}}(t,e)}t.ITERATE_KEY=o,t.computed=function(t){let e,i;return n.isFunction(t)?(e=t,i=()=>{console.warn("Write operation failed: computed value is readonly")}):(e=t.get,i=t.set),new class{constructor(t,e,n){this._setter=e,this._dirty=!0,this.__v_isRef=!0,this.effect=s(t,{lazy:!0,scheduler:()=>{this._dirty||(this._dirty=!0,v(ft(this),"set","value"))}}),this.__v_isReadonly=n}get value(){const t=ft(this);return t._dirty&&(t._value=this.effect(),t._dirty=!1),m(t,"get","value"),t._value}set value(t){this._setter(t)}}(e,i,n.isFunction(t)||!t.set)},t.customRef=function(t){return new class{constructor(t){this.__v_isRef=!0;const{get:e,set:n}=t((()=>m(this,"get","value")),(()=>v(this,"set","value")));this._get=e,this._set=n}get value(){return this._get()}set value(t){this._set(t)}}(t)},t.effect=s,t.enableTracking=f,t.isProxy=dt,t.isReactive=ct,t.isReadonly=ht,t.isRef=gt,t.markRaw=function(t){return n.def(t,"__v_skip",!0),t},t.pauseTracking=d,t.proxyRefs=function(t){return ct(t)?t:new Proxy(t,yt)},t.reactive=st,t.readonly=ut,t.ref=function(t){return mt(t)},t.resetTracking=p,t.shallowReactive=function(t){return lt(t,!1,O,Q,rt)},t.shallowReadonly=function(t){return lt(t,!0,R,et,at)},t.shallowRef=function(t){return mt(t,!0)},t.stop=function(t){t.active&&(l(t),t.options.onStop&&t.options.onStop(),t.active=!1)},t.toRaw=ft,t.toRef=bt,t.toRefs=function(t){dt(t)||console.warn("toRefs() expects a reactive object but received a plain one.");const e=n.isArray(t)?new Array(t.length):{};for(const n in t)e[n]=bt(t,n);return e},t.track=m,t.trigger=v,t.triggerRef=function(t){v(ft(t),"set","value",t.value)},t.unref=vt})),v=f(((t,e)=>{e.exports=m()})),y=!1,b=!1,_=[];function E(t){!function(t){_.includes(t)||_.push(t);b||y||(y=!0,queueMicrotask(x))}(t)}function x(){y=!1,b=!0;for(let t=0;t<_.length;t++)_[t]();_.length=0,b=!1}var A=!0;function D(t){r=t}var w=[],k=[],T=[];function C(t,e){t._x_attributeCleanups&&Object.entries(t._x_attributeCleanups).forEach((([n,i])=>{(void 0===e||e.includes(n))&&(i.forEach((t=>t())),delete t._x_attributeCleanups[n])}))}var S=new MutationObserver(N),I=!1;function O(){S.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),I=!0}function R(){(M=M.concat(S.takeRecords())).length&&!L&&(L=!0,queueMicrotask((()=>{N(M),M.length=0,L=!1}))),S.disconnect(),I=!1}var M=[],L=!1;function P(t){if(!I)return t();R();let e=t();return O(),e}var F=!1,B=[];function N(t){if(F)return void(B=B.concat(t));let e=[],n=[],i=new Map,r=new Map;for(let o=0;o<t.length;o++)if(!t[o].target._x_ignoreMutationObserver&&("childList"===t[o].type&&(t[o].addedNodes.forEach((t=>1===t.nodeType&&e.push(t))),t[o].removedNodes.forEach((t=>1===t.nodeType&&n.push(t)))),"attributes"===t[o].type)){let e=t[o].target,n=t[o].attributeName,a=t[o].oldValue,s=()=>{i.has(e)||i.set(e,[]),i.get(e).push({name:n,value:e.getAttribute(n)})},u=()=>{r.has(e)||r.set(e,[]),r.get(e).push(n)};e.hasAttribute(n)&&null===a?s():e.hasAttribute(n)?(u(),s()):u()}r.forEach(((t,e)=>{C(e,t)})),i.forEach(((t,e)=>{w.forEach((n=>n(e,t)))}));for(let t of n)e.includes(t)||k.forEach((e=>e(t)));e.forEach((t=>{t._x_ignoreSelf=!0,t._x_ignore=!0}));for(let t of e)n.includes(t)||t.isConnected&&(delete t._x_ignoreSelf,delete t._x_ignore,T.forEach((e=>e(t))),t._x_ignore=!0,t._x_ignoreSelf=!0);e.forEach((t=>{delete t._x_ignoreSelf,delete t._x_ignore})),e=null,n=null,i=null,r=null}function j(t,e,n){return t._x_dataStack=[e,...z(n||t)],()=>{t._x_dataStack=t._x_dataStack.filter((t=>t!==e))}}function V(t,e){let n=t._x_dataStack[0];Object.entries(e).forEach((([t,e])=>{n[t]=e}))}function z(t){return t._x_dataStack?t._x_dataStack:"function"==typeof ShadowRoot&&t instanceof ShadowRoot?z(t.host):t.parentNode?z(t.parentNode):[]}function U(t){let e=new Proxy({},{ownKeys:()=>Array.from(new Set(t.flatMap((t=>Object.keys(t))))),has:(e,n)=>t.some((t=>t.hasOwnProperty(n))),get:(n,i)=>(t.find((t=>{if(t.hasOwnProperty(i)){let n=Object.getOwnPropertyDescriptor(t,i);if(n.get&&n.get._x_alreadyBound||n.set&&n.set._x_alreadyBound)return!0;if((n.get||n.set)&&n.enumerable){let r=n.get,o=n.set,a=n;r=r&&r.bind(e),o=o&&o.bind(e),r&&(r._x_alreadyBound=!0),o&&(o._x_alreadyBound=!0),Object.defineProperty(t,i,{...a,get:r,set:o})}return!0}return!1}))||{})[i],set:(e,n,i)=>{let r=t.find((t=>t.hasOwnProperty(n)));return r?r[n]=i:t[t.length-1][n]=i,!0}});return e}function G(t){let e=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach((([r,{value:o,enumerable:a}])=>{if(!1===a||void 0===o)return;let s=""===i?r:`${i}.${r}`;var u;"object"==typeof o&&null!==o&&o._x_interceptor?n[r]=o.initialize(t,s,r):"object"!=typeof(u=o)||Array.isArray(u)||null===u||o===n||o instanceof Element||e(o,s)}))};return e(t)}function W(t,e=(()=>{})){let n={initialValue:void 0,_x_interceptor:!0,initialize(e,n,i){return t(this.initialValue,(()=>function(t,e){return e.split(".").reduce(((t,e)=>t[e]),t)}(e,n)),(t=>H(e,n,t)),n,i)}};return e(n),t=>{if("object"==typeof t&&null!==t&&t._x_interceptor){let e=n.initialize.bind(n);n.initialize=(i,r,o)=>{let a=t.initialize(i,r,o);return n.initialValue=a,e(i,r,o)}}else n.initialValue=t;return n}}function H(t,e,n){if("string"==typeof e&&(e=e.split(".")),1!==e.length){if(0===e.length)throw error;return t[e[0]]||(t[e[0]]={}),H(t[e[0]],e.slice(1),n)}t[e[0]]=n}var q={};function $(t,e){q[t]=e}function Y(t,e){return Object.entries(q).forEach((([n,i])=>{Object.defineProperty(t,`$${n}`,{get:()=>i(e,{Alpine:te,interceptor:W}),enumerable:!1})})),t}function X(t,e,n,...i){try{return n(...i)}catch(n){K(n,t,e)}}function K(t,e,n){Object.assign(t,{el:e,expression:n}),console.warn(`Alpine Expression Error: ${t.message}\n\n${n?'Expression: "'+n+'"\n\n':""}`,e),setTimeout((()=>{throw t}),0)}function Z(t,e,n={}){let i;return J(t,e)((t=>i=t),n),i}function J(...t){return Q(...t)}var Q=tt;function tt(t,e){let n={};Y(n,t);let i=[n,...z(t)];if("function"==typeof e)return function(t,e){return(n=(()=>{}),{scope:i={},params:r=[]}={})=>{nt(n,e.apply(U([i,...t]),r))}}(i,e);let r=function(t,e,n){let i=function(t,e){if(et[t])return et[t];let n=Object.getPrototypeOf((async function(){})).constructor,i=/^[\n\s]*if.*\(.*\)/.test(t)||/^(let|const)\s/.test(t)?`(() => { ${t} })()`:t;let r=(()=>{try{return new n(["__self","scope"],`with (scope) { __self.result = ${i} }; __self.finished = true; return __self.result;`)}catch(n){return K(n,e,t),Promise.resolve()}})();return et[t]=r,r}(e,n);return(r=(()=>{}),{scope:o={},params:a=[]}={})=>{i.result=void 0,i.finished=!1;let s=U([o,...t]);if("function"==typeof i){let t=i(i,s).catch((t=>K(t,n,e)));i.finished?(nt(r,i.result,s,a,n),i.result=void 0):t.then((t=>{nt(r,t,s,a,n)})).catch((t=>K(t,n,e))).finally((()=>i.result=void 0))}}}(i,e,t);return X.bind(null,t,e,r)}var et={};function nt(t,e,n,i,r){if("function"==typeof e){let o=e.apply(n,i);o instanceof Promise?o.then((e=>nt(t,e,n,i))).catch((t=>K(t,r,e))):t(o)}else t(e)}var it="x-";function rt(t=""){return it+t}var ot={};function at(t,e){ot[t]=e}function st(t,e,n){let i={},a=Array.from(e).map(dt(((t,e)=>i[t]=e))).filter(gt).map(function(t,e){return({name:n,value:i})=>{let r=n.match(mt()),o=n.match(/:([a-zA-Z0-9\-:]+)/),a=n.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],s=e||t[n]||n;return{type:r?r[1]:null,value:o?o[1]:null,modifiers:a.map((t=>t.replace(".",""))),expression:i,original:s}}}(i,n)).sort(bt);return a.map((e=>function(t,e){let n=()=>{},i=ot[e.type]||n,a=[],s=t=>a.push(t),[u,l]=function(t){let e=()=>{};return[n=>{let i=r(n);t._x_effects||(t._x_effects=new Set,t._x_runEffects=()=>{t._x_effects.forEach((t=>t()))}),t._x_effects.add(i),e=()=>{void 0!==i&&(t._x_effects.delete(i),o(i))}},()=>{e()}]}(t);a.push(l);let c={Alpine:te,effect:u,cleanup:s,evaluateLater:J.bind(J,t),evaluate:Z.bind(Z,t)},h=()=>a.forEach((t=>t()));!function(t,e,n){t._x_attributeCleanups||(t._x_attributeCleanups={}),t._x_attributeCleanups[e]||(t._x_attributeCleanups[e]=[]),t._x_attributeCleanups[e].push(n)}(t,e.original,h);let d=()=>{t._x_ignore||t._x_ignoreSelf||(i.inline&&i.inline(t,e,c),i=i.bind(i,t,e,c),ut?lt.get(ct).push(i):i())};return d.runCleanups=h,d}(t,e)))}var ut=!1,lt=new Map,ct=Symbol();var ht=(t,e)=>({name:n,value:i})=>(n.startsWith(t)&&(n=n.replace(t,e)),{name:n,value:i});function dt(t=(()=>{})){return({name:e,value:n})=>{let{name:i,value:r}=ft.reduce(((t,e)=>e(t)),{name:e,value:n});return i!==e&&t(i,e),{name:i,value:r}}}var ft=[];function pt(t){ft.push(t)}function gt({name:t}){return mt().test(t)}var mt=()=>new RegExp(`^${it}([^:^.]+)\\b`);var vt="DEFAULT",yt=["ignore","ref","data","id","bind","init","for","model","transition","show","if",vt,"teleport","element"];function bt(t,e){let n=-1===yt.indexOf(t.type)?vt:t.type,i=-1===yt.indexOf(e.type)?vt:e.type;return yt.indexOf(n)-yt.indexOf(i)}function _t(t,e,n={}){t.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}var Et=[],xt=!1;function At(t){Et.push(t),queueMicrotask((()=>{xt||setTimeout((()=>{Dt()}))}))}function Dt(){for(xt=!1;Et.length;)Et.shift()()}function wt(t,e){if("function"==typeof ShadowRoot&&t instanceof ShadowRoot)return void Array.from(t.children).forEach((t=>wt(t,e)));let n=!1;if(e(t,(()=>n=!0)),n)return;let i=t.firstElementChild;for(;i;)wt(i,e),i=i.nextElementSibling}function kt(t,...e){console.warn(`Alpine Warning: ${t}`,...e)}var Tt=[],Ct=[];function St(){return Tt.map((t=>t()))}function It(){return Tt.concat(Ct).map((t=>t()))}function Ot(t){Tt.push(t)}function Rt(t){Ct.push(t)}function Mt(t,e=!1){return Lt(t,(t=>{if((e?It():St()).some((e=>t.matches(e))))return!0}))}function Lt(t,e){if(t){if(e(t))return t;if(t._x_teleportBack&&(t=t._x_teleportBack),t.parentElement)return Lt(t.parentElement,e)}}function Pt(t,e=wt){!function(t){ut=!0;let e=Symbol();ct=e,lt.set(e,[]);let n=()=>{for(;lt.get(e).length;)lt.get(e).shift()();lt.delete(e)};t(n),ut=!1,n()}((()=>{e(t,((t,e)=>{st(t,t.attributes).forEach((t=>t())),t._x_ignore&&e()}))}))}function Ft(t,e){return Array.isArray(e)?Bt(t,e.join(" ")):"object"==typeof e&&null!==e?function(t,e){let n=t=>t.split(" ").filter(Boolean),i=Object.entries(e).flatMap((([t,e])=>!!e&&n(t))).filter(Boolean),r=Object.entries(e).flatMap((([t,e])=>!e&&n(t))).filter(Boolean),o=[],a=[];return r.forEach((e=>{t.classList.contains(e)&&(t.classList.remove(e),a.push(e))})),i.forEach((e=>{t.classList.contains(e)||(t.classList.add(e),o.push(e))})),()=>{a.forEach((e=>t.classList.add(e))),o.forEach((e=>t.classList.remove(e)))}}(t,e):"function"==typeof e?Ft(t,e()):Bt(t,e)}function Bt(t,e){return e=!0===e?e="":e||"",n=e.split(" ").filter((e=>!t.classList.contains(e))).filter(Boolean),t.classList.add(...n),()=>{t.classList.remove(...n)};var n}function Nt(t,e){return"object"==typeof e&&null!==e?function(t,e){let n={};return Object.entries(e).forEach((([e,i])=>{n[e]=t.style[e],t.style.setProperty(e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),i)})),setTimeout((()=>{0===t.style.length&&t.removeAttribute("style")})),()=>{Nt(t,n)}}(t,e):function(t,e){let n=t.getAttribute("style",e);return t.setAttribute("style",e),()=>{t.setAttribute("style",n||"")}}(t,e)}function jt(t,e=(()=>{})){let n=!1;return function(){n?e.apply(this,arguments):(n=!0,t.apply(this,arguments))}}function Vt(t,e,n={}){t._x_transition||(t._x_transition={enter:{during:n,start:n,end:n},leave:{during:n,start:n,end:n},in(n=(()=>{}),i=(()=>{})){Ut(t,e,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,i)},out(n=(()=>{}),i=(()=>{})){Ut(t,e,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,i)}})}function zt(t){let e=t.parentNode;if(e)return e._x_hidePromise?e:zt(e)}function Ut(t,e,{during:n,start:i,end:r}={},o=(()=>{}),a=(()=>{})){if(t._x_transitioning&&t._x_transitioning.cancel(),0===Object.keys(n).length&&0===Object.keys(i).length&&0===Object.keys(r).length)return o(),void a();let s,u,l;!function(t,e){let n,i,r,o=jt((()=>{P((()=>{n=!0,i||e.before(),r||(e.end(),Dt()),e.after(),t.isConnected&&e.cleanup(),delete t._x_transitioning}))}));t._x_transitioning={beforeCancels:[],beforeCancel(t){this.beforeCancels.push(t)},cancel:jt((function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()})),finish:o},P((()=>{e.start(),e.during()})),xt=!0,requestAnimationFrame((()=>{if(n)return;let o=1e3*Number(getComputedStyle(t).transitionDuration.replace(/,.*/,"").replace("s","")),a=1e3*Number(getComputedStyle(t).transitionDelay.replace(/,.*/,"").replace("s",""));0===o&&(o=1e3*Number(getComputedStyle(t).animationDuration.replace("s",""))),P((()=>{e.before()})),i=!0,requestAnimationFrame((()=>{n||(P((()=>{e.end()})),Dt(),setTimeout(t._x_transitioning.finish,o+a),r=!0)}))}))}(t,{start(){s=e(t,i)},during(){u=e(t,n)},before:o,end(){s(),l=e(t,r)},after:a,cleanup(){u(),l()}})}function Gt(t,e,n){if(-1===t.indexOf(e))return n;const i=t[t.indexOf(e)+1];if(!i)return n;if("scale"===e&&isNaN(i))return n;if("duration"===e){let t=i.match(/([0-9]+)ms/);if(t)return t[1]}return"origin"===e&&["top","right","left","center","bottom"].includes(t[t.indexOf(e)+2])?[i,t[t.indexOf(e)+2]].join(" "):i}at("transition",((t,{value:e,modifiers:n,expression:i},{evaluate:r})=>{"function"==typeof i&&(i=r(i)),i?function(t,e,n){Vt(t,Ft,""),{enter:e=>{t._x_transition.enter.during=e},"enter-start":e=>{t._x_transition.enter.start=e},"enter-end":e=>{t._x_transition.enter.end=e},leave:e=>{t._x_transition.leave.during=e},"leave-start":e=>{t._x_transition.leave.start=e},"leave-end":e=>{t._x_transition.leave.end=e}}[n](e)}(t,i,e):function(t,e,n){Vt(t,Nt);let i=!e.includes("in")&&!e.includes("out")&&!n,r=i||e.includes("in")||["enter"].includes(n),o=i||e.includes("out")||["leave"].includes(n);e.includes("in")&&!i&&(e=e.filter(((t,n)=>n<e.indexOf("out"))));e.includes("out")&&!i&&(e=e.filter(((t,n)=>n>e.indexOf("out"))));let a=!e.includes("opacity")&&!e.includes("scale"),s=a||e.includes("opacity"),u=a||e.includes("scale"),l=s?0:1,c=u?Gt(e,"scale",95)/100:1,h=Gt(e,"delay",0),d=Gt(e,"origin","center"),f="opacity, transform",p=Gt(e,"duration",150)/1e3,g=Gt(e,"duration",75)/1e3,m="cubic-bezier(0.4, 0.0, 0.2, 1)";r&&(t._x_transition.enter.during={transformOrigin:d,transitionDelay:h,transitionProperty:f,transitionDuration:`${p}s`,transitionTimingFunction:m},t._x_transition.enter.start={opacity:l,transform:`scale(${c})`},t._x_transition.enter.end={opacity:1,transform:"scale(1)"});o&&(t._x_transition.leave.during={transformOrigin:d,transitionDelay:h,transitionProperty:f,transitionDuration:`${g}s`,transitionTimingFunction:m},t._x_transition.leave.start={opacity:1,transform:"scale(1)"},t._x_transition.leave.end={opacity:l,transform:`scale(${c})`})}(t,n,e)})),window.Element.prototype._x_toggleAndCascadeWithTransitions=function(t,e,n,i){let r=()=>{"visible"===document.visibilityState?requestAnimationFrame(n):setTimeout(n)};e?t._x_transition&&(t._x_transition.enter||t._x_transition.leave)?t._x_transition.enter&&(Object.entries(t._x_transition.enter.during).length||Object.entries(t._x_transition.enter.start).length||Object.entries(t._x_transition.enter.end).length)?t._x_transition.in(n):r():t._x_transition?t._x_transition.in(n):r():(t._x_hidePromise=t._x_transition?new Promise(((e,n)=>{t._x_transition.out((()=>{}),(()=>e(i))),t._x_transitioning.beforeCancel((()=>n({isFromCancelledTransition:!0})))})):Promise.resolve(i),queueMicrotask((()=>{let e=zt(t);e?(e._x_hideChildren||(e._x_hideChildren=[]),e._x_hideChildren.push(t)):queueMicrotask((()=>{let e=t=>{let n=Promise.all([t._x_hidePromise,...(t._x_hideChildren||[]).map(e)]).then((([t])=>t()));return delete t._x_hidePromise,delete t._x_hideChildren,n};e(t).catch((t=>{if(!t.isFromCancelledTransition)throw t}))}))})))};var Wt=!1;function Ht(t,e=(()=>{})){return(...n)=>Wt?e(...n):t(...n)}function qt(t,e){var n;return function(){var i=this,r=arguments,o=function(){n=null,t.apply(i,r)};clearTimeout(n),n=setTimeout(o,e)}}function $t(t,e){let n;return function(){let i=this,r=arguments;n||(t.apply(i,r),n=!0,setTimeout((()=>n=!1),e))}}var Yt={},Xt=!1;var Kt={};var Zt,Jt,Qt={get reactive(){return i},get release(){return o},get effect(){return r},get raw(){return a},version:"3.7.1",flushAndStopDeferringMutations:function(){F=!1,N(B),B=[]},disableEffectScheduling:function(t){A=!1,t(),A=!0},setReactivityEngine:function(t){i=t.reactive,o=t.release,r=e=>t.effect(e,{scheduler:t=>{A?E(t):t()}}),a=t.raw},closestDataStack:z,skipDuringClone:Ht,addRootSelector:Ot,addInitSelector:Rt,addScopeToNode:j,deferMutations:function(){F=!0},mapAttributes:pt,evaluateLater:J,setEvaluator:function(t){Q=t},mergeProxies:U,closestRoot:Mt,interceptor:W,transition:Ut,setStyles:Nt,mutateDom:P,directive:at,throttle:$t,debounce:qt,evaluate:Z,initTree:Pt,nextTick:At,prefixed:rt,prefix:function(t){it=t},plugin:function(t){t(te)},magic:$,store:function(t,e){if(Xt||(Yt=i(Yt),Xt=!0),void 0===e)return Yt[t];Yt[t]=e,"object"==typeof e&&null!==e&&e.hasOwnProperty("init")&&"function"==typeof e.init&&Yt[t].init(),G(Yt[t])},start:function(){document.body||kt("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),_t(document,"alpine:init"),_t(document,"alpine:initializing"),O(),function(t){T.push(t)}((t=>Pt(t,wt))),function(t){k.push(t)}((t=>function(t){wt(t,(t=>C(t)))}(t))),function(t){w.push(t)}(((t,e)=>{st(t,e).forEach((t=>t()))})),Array.from(document.querySelectorAll(It())).filter((t=>!Mt(t.parentElement,!0))).forEach((t=>{Pt(t)})),_t(document,"alpine:initialized")},clone:function(t,e){e._x_dataStack||(e._x_dataStack=t._x_dataStack),Wt=!0,function(t){let e=r;D(((t,n)=>{let i=e(t);return o(i),()=>{}})),t(),D(e)}((()=>{!function(t){let e=!1,n=(t,n)=>{wt(t,((t,i)=>{if(e&&function(t){return St().some((e=>t.matches(e)))}(t))return i();e=!0,n(t,i)}))};Pt(t,n)}(e)})),Wt=!1},data:function(t,e){Kt[t]=e}},te=Qt,ee=(Zt=v(),((t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of h(e))c.call(t,i)||"default"===i||u(t,i,{get:()=>e[i],enumerable:!(n=d(e,i))||n.enumerable});return t})((Jt=u(null!=Zt?s(l(Zt)):{},"default",Zt&&Zt.__esModule&&"default"in Zt?{get:()=>Zt.default,enumerable:!0}:{value:Zt,enumerable:!0}),u(Jt,"__esModule",{value:!0})),Zt));$("nextTick",(()=>At)),$("dispatch",(t=>_t.bind(_t,t))),$("watch",(t=>(e,n)=>{let i,o=J(t,e),a=!0;r((()=>o((t=>{JSON.stringify(t),a?i=t:queueMicrotask((()=>{n(t,i),i=t})),a=!1}))))})),$("store",(function(){return Yt})),$("data",(t=>U(z(t)))),$("root",(t=>Mt(t))),$("refs",(t=>(t._x_refs_proxy||(t._x_refs_proxy=U(function(t){let e=[],n=t;for(;n;)n._x_refs&&e.push(n._x_refs),n=n.parentNode;return e}(t))),t._x_refs_proxy)));var ne={};function ie(t){return ne[t]||(ne[t]=0),++ne[t]}$("id",(t=>(e,n=null)=>{let i=function(t,e){return Lt(t,(t=>{if(t._x_ids&&t._x_ids[e])return!0}))}(t,e),r=i?i._x_ids[e]:ie(e);return new re(n?`${e}-${r}-${n}`:`${e}-${r}`)}));var re=class{constructor(t){this.id=t}toString(){return this.id}};$("el",(t=>t)),at("teleport",((t,{expression:e},{cleanup:n})=>{"template"!==t.tagName.toLowerCase()&&kt("x-teleport can only be used on a <template> tag",t);let i=document.querySelector(e);i||kt(`Cannot find x-teleport element for selector: "${e}"`);let r=t.content.cloneNode(!0).firstElementChild;t._x_teleport=r,r._x_teleportBack=t,t._x_forwardEvents&&t._x_forwardEvents.forEach((e=>{r.addEventListener(e,(e=>{e.stopPropagation(),t.dispatchEvent(new e.constructor(e.type,e))}))})),j(r,{},t),P((()=>{i.appendChild(r),Pt(r),r._x_ignore=!0})),n((()=>r.remove()))}));var oe=()=>{};function ae(t,e,n,r=[]){switch(t._x_bindings||(t._x_bindings=i({})),t._x_bindings[e]=n,e=r.includes("camel")?e.toLowerCase().replace(/-(\w)/g,((t,e)=>e.toUpperCase())):e){case"value":!function(t,e){if("radio"===t.type)void 0===t.attributes.value&&(t.value=e),window.fromModel&&(t.checked=se(t.value,e));else if("checkbox"===t.type)Number.isInteger(e)?t.value=e:Number.isInteger(e)||Array.isArray(e)||"boolean"==typeof e||[null,void 0].includes(e)?Array.isArray(e)?t.checked=e.some((e=>se(e,t.value))):t.checked=!!e:t.value=String(e);else if("SELECT"===t.tagName)!function(t,e){const n=[].concat(e).map((t=>t+""));Array.from(t.options).forEach((t=>{t.selected=n.includes(t.value)}))}(t,e);else{if(t.value===e)return;t.value=e}}(t,n);break;case"style":!function(t,e){t._x_undoAddedStyles&&t._x_undoAddedStyles();t._x_undoAddedStyles=Nt(t,e)}(t,n);break;case"class":!function(t,e){t._x_undoAddedClasses&&t._x_undoAddedClasses();t._x_undoAddedClasses=Ft(t,e)}(t,n);break;default:!function(t,e,n){[null,void 0,!1].includes(n)&&function(t){return!["aria-pressed","aria-checked","aria-expanded"].includes(t)}(e)?t.removeAttribute(e):(["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(e)&&(n=e),function(t,e,n){t.getAttribute(e)!=n&&t.setAttribute(e,n)}(t,e,n))}(t,e,n)}}function se(t,e){return t==e}function ue(t,e,n,i){let r=t,o=t=>i(t),a={},s=(t,e)=>n=>e(t,n);if(n.includes("dot")&&(e=e.replace(/-/g,".")),n.includes("camel")&&(e=function(t){return t.toLowerCase().replace(/-(\w)/g,((t,e)=>e.toUpperCase()))}(e)),n.includes("passive")&&(a.passive=!0),n.includes("capture")&&(a.capture=!0),n.includes("window")&&(r=window),n.includes("document")&&(r=document),n.includes("prevent")&&(o=s(o,((t,e)=>{e.preventDefault(),t(e)}))),n.includes("stop")&&(o=s(o,((t,e)=>{e.stopPropagation(),t(e)}))),n.includes("self")&&(o=s(o,((e,n)=>{n.target===t&&e(n)}))),(n.includes("away")||n.includes("outside"))&&(r=document,o=s(o,((e,n)=>{t.contains(n.target)||t.offsetWidth<1&&t.offsetHeight<1||!1!==t._x_isShown&&e(n)}))),o=s(o,((t,i)=>{(function(t){return["keydown","keyup"].includes(t)})(e)&&function(t,e){let n=e.filter((t=>!["window","document","prevent","stop","once"].includes(t)));if(n.includes("debounce")){let t=n.indexOf("debounce");n.splice(t,le((n[t+1]||"invalid-wait").split("ms")[0])?2:1)}if(0===n.length)return!1;if(1===n.length&&ce(t.key).includes(n[0]))return!1;const i=["ctrl","shift","alt","meta","cmd","super"].filter((t=>n.includes(t)));if(n=n.filter((t=>!i.includes(t))),i.length>0){if(i.filter((e=>("cmd"!==e&&"super"!==e||(e="meta"),t[`${e}Key`]))).length===i.length&&ce(t.key).includes(n[0]))return!1}return!0}(i,n)||t(i)})),n.includes("debounce")){let t=n[n.indexOf("debounce")+1]||"invalid-wait",e=le(t.split("ms")[0])?Number(t.split("ms")[0]):250;o=qt(o,e)}if(n.includes("throttle")){let t=n[n.indexOf("throttle")+1]||"invalid-wait",e=le(t.split("ms")[0])?Number(t.split("ms")[0]):250;o=$t(o,e)}return n.includes("once")&&(o=s(o,((t,n)=>{t(n),r.removeEventListener(e,o,a)}))),r.addEventListener(e,o,a),()=>{r.removeEventListener(e,o,a)}}function le(t){return!Array.isArray(t)&&!isNaN(t)}function ce(t){if(!t)return[];t=t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase();let e={ctrl:"control",slash:"/",space:"-",spacebar:"-",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"="};return e[t]=t,Object.keys(e).map((n=>{if(e[n]===t)return n})).filter((t=>t))}function he(t){let e=t?parseFloat(t):null;return n=e,Array.isArray(n)||isNaN(n)?t:e;var n}function de(t,e,n,i){let r={};if(/^\[.*\]$/.test(t.item)&&Array.isArray(e)){t.item.replace("[","").replace("]","").split(",").map((t=>t.trim())).forEach(((t,n)=>{r[t]=e[n]}))}else if(/^\{.*\}$/.test(t.item)&&!Array.isArray(e)&&"object"==typeof e){t.item.replace("{","").replace("}","").split(",").map((t=>t.trim())).forEach((t=>{r[t]=e[t]}))}else r[t.item]=e;return t.index&&(r[t.index]=n),t.collection&&(r[t.collection]=i),r}function fe(){}oe.inline=(t,{modifiers:e},{cleanup:n})=>{e.includes("self")?t._x_ignoreSelf=!0:t._x_ignore=!0,n((()=>{e.includes("self")?delete t._x_ignoreSelf:delete t._x_ignore}))},at("ignore",oe),at("effect",((t,{expression:e},{effect:n})=>n(J(t,e)))),at("model",((t,{modifiers:e,expression:n},{effect:i,cleanup:r})=>{let o=J(t,n),a=J(t,`${n} = rightSideOfExpression($event, ${n})`);var s="select"===t.tagName.toLowerCase()||["checkbox","radio"].includes(t.type)||e.includes("lazy")?"change":"input";let u=function(t,e,n){"radio"===t.type&&P((()=>{t.hasAttribute("name")||t.setAttribute("name",n)}));return(n,i)=>P((()=>{if(n instanceof CustomEvent&&void 0!==n.detail)return n.detail||n.target.value;if("checkbox"===t.type){if(Array.isArray(i)){let t=e.includes("number")?he(n.target.value):n.target.value;return n.target.checked?i.concat([t]):i.filter((e=>!(e==t)))}return n.target.checked}if("select"===t.tagName.toLowerCase()&&t.multiple)return e.includes("number")?Array.from(n.target.selectedOptions).map((t=>he(t.value||t.text))):Array.from(n.target.selectedOptions).map((t=>t.value||t.text));{let t=n.target.value;return e.includes("number")?he(t):e.includes("trim")?t.trim():t}}))}(t,e,n),l=ue(t,s,e,(t=>{a((()=>{}),{scope:{$event:t,rightSideOfExpression:u}})}));r((()=>l()));let c=J(t,`${n} = __placeholder`);t._x_model={get(){let t;return o((e=>t=e)),t},set(t){c((()=>{}),{scope:{__placeholder:t}})}},t._x_forceModelUpdate=()=>{o((e=>{void 0===e&&n.match(/\./)&&(e=""),window.fromModel=!0,P((()=>ae(t,"value",e))),delete window.fromModel}))},i((()=>{e.includes("unintrusive")&&document.activeElement.isSameNode(t)||t._x_forceModelUpdate()}))})),at("cloak",(t=>queueMicrotask((()=>P((()=>t.removeAttribute(rt("cloak")))))))),Rt((()=>`[${rt("init")}]`)),at("init",Ht(((t,{expression:e})=>"string"==typeof e?!!e.trim()&&Z(t,e,{}):Z(t,e,{})))),at("text",((t,{expression:e},{effect:n,evaluateLater:i})=>{let r=i(e);n((()=>{r((e=>{P((()=>{t.textContent=e}))}))}))})),at("html",((t,{expression:e},{effect:n,evaluateLater:i})=>{let r=i(e);n((()=>{r((e=>{t.innerHTML=e}))}))})),pt(ht(":",rt("bind:"))),at("bind",((t,{value:e,modifiers:n,expression:i,original:r},{effect:o})=>{if(!e)return function(t,e,n,i){let r=J(t,e),o=[];i((()=>{for(;o.length;)o.pop()();r((e=>{let i=Object.entries(e).map((([t,e])=>({name:t,value:e}))),r=function(t){return Array.from(t).map(dt()).filter((t=>!gt(t)))}(i);i=i.map((t=>r.find((e=>e.name===t.name))?{name:`x-bind:${t.name}`,value:`"${t.value}"`}:t)),st(t,i,n).map((t=>{o.push(t.runCleanups),t()}))}))}))}(t,i,r,o);if("key"===e)return function(t,e){t._x_keyExpression=e}(t,i);let a=J(t,i);o((()=>a((r=>{void 0===r&&i.match(/\./)&&(r=""),P((()=>ae(t,e,r,n)))}))))})),Ot((()=>`[${rt("data")}]`)),at("data",Ht(((t,{expression:e},{cleanup:n})=>{e=""===e?"{}":e;let r={};Y(r,t);let o={};var a,s;a=o,s=r,Object.entries(Kt).forEach((([t,e])=>{Object.defineProperty(a,t,{get:()=>(...t)=>e.bind(s)(...t),enumerable:!1})}));let u=Z(t,e,{scope:o});void 0===u&&(u={}),Y(u,t);let l=i(u);G(l);let c=j(t,l);l.init&&Z(t,l.init),n((()=>{c(),l.destroy&&Z(t,l.destroy)}))}))),at("show",((t,{modifiers:e,expression:n},{effect:i})=>{let r,o=J(t,n),a=()=>P((()=>{t.style.display="none",t._x_isShown=!1})),s=()=>P((()=>{1===t.style.length&&"none"===t.style.display?t.removeAttribute("style"):t.style.removeProperty("display"),t._x_isShown=!0})),u=()=>setTimeout(s),l=jt((t=>t?s():a()),(e=>{"function"==typeof t._x_toggleAndCascadeWithTransitions?t._x_toggleAndCascadeWithTransitions(t,e,s,a):e?u():a()})),c=!0;i((()=>o((t=>{(c||t!==r)&&(e.includes("immediate")&&(t?u():a()),l(t),r=t,c=!1)}))))})),at("for",((t,{expression:e},{effect:n,cleanup:r})=>{let o=function(t){let e=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,n=/^\s*\(|\)\s*$/g,i=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,r=t.match(i);if(!r)return;let o={};o.items=r[2].trim();let a=r[1].replace(n,"").trim(),s=a.match(e);s?(o.item=a.replace(e,"").trim(),o.index=s[1].trim(),s[2]&&(o.collection=s[2].trim())):o.item=a;return o}(e),a=J(t,o.items),s=J(t,t._x_keyExpression||"index");t._x_prevKeys=[],t._x_lookup={},n((()=>function(t,e,n,r){let o=t=>"object"==typeof t&&!Array.isArray(t),a=t;n((n=>{var s;s=n,!Array.isArray(s)&&!isNaN(s)&&n>=0&&(n=Array.from(Array(n).keys(),(t=>t+1))),void 0===n&&(n=[]);let u=t._x_lookup,l=t._x_prevKeys,c=[],h=[];if(o(n))n=Object.entries(n).map((([t,i])=>{let o=de(e,i,t,n);r((t=>h.push(t)),{scope:{index:t,...o}}),c.push(o)}));else for(let t=0;t<n.length;t++){let i=de(e,n[t],t,n);r((t=>h.push(t)),{scope:{index:t,...i}}),c.push(i)}let d=[],f=[],p=[],g=[];for(let t=0;t<l.length;t++){let e=l[t];-1===h.indexOf(e)&&p.push(e)}l=l.filter((t=>!p.includes(t)));let m="template";for(let t=0;t<h.length;t++){let e=h[t],n=l.indexOf(e);if(-1===n)l.splice(t,0,e),d.push([m,t]);else if(n!==t){let e=l.splice(t,1)[0],i=l.splice(n-1,1)[0];l.splice(t,0,i),l.splice(n,0,e),f.push([e,i])}else g.push(e);m=e}for(let t=0;t<p.length;t++){let e=p[t];u[e].remove(),u[e]=null,delete u[e]}for(let t=0;t<f.length;t++){let[e,n]=f[t],i=u[e],r=u[n],o=document.createElement("div");P((()=>{r.after(o),i.after(r),r._x_currentIfEl&&r.after(r._x_currentIfEl),o.before(i),i._x_currentIfEl&&i.after(i._x_currentIfEl),o.remove()})),V(r,c[h.indexOf(n)])}for(let t=0;t<d.length;t++){let[e,n]=d[t],r="template"===e?a:u[e];r._x_currentIfEl&&(r=r._x_currentIfEl);let o=c[n],s=h[n],l=document.importNode(a.content,!0).firstElementChild;j(l,i(o),a),P((()=>{r.after(l),Pt(l)})),"object"==typeof s&&kt("x-for key cannot be an object, it must be a string or an integer",a),u[s]=l}for(let t=0;t<g.length;t++)V(u[g[t]],c[h.indexOf(g[t])]);a._x_prevKeys=h}))}(t,o,a,s))),r((()=>{Object.values(t._x_lookup).forEach((t=>t.remove())),delete t._x_prevKeys,delete t._x_lookup}))})),fe.inline=(t,{expression:e},{cleanup:n})=>{let i=Mt(t);i._x_refs||(i._x_refs={}),i._x_refs[e]=t,n((()=>delete i._x_refs[e]))},at("ref",fe),at("if",((t,{expression:e},{effect:n,cleanup:i})=>{let r=J(t,e);n((()=>r((e=>{e?(()=>{if(t._x_currentIfEl)return t._x_currentIfEl;let e=t.content.cloneNode(!0).firstElementChild;j(e,{},t),P((()=>{t.after(e),Pt(e)})),t._x_currentIfEl=e,t._x_undoIf=()=>{e.remove(),delete t._x_currentIfEl}})():t._x_undoIf&&(t._x_undoIf(),delete t._x_undoIf)})))),i((()=>t._x_undoIf&&t._x_undoIf()))})),at("id",((t,{expression:e},{evaluate:n})=>{n(e).forEach((e=>function(t,e){t._x_ids||(t._x_ids={}),t._x_ids[e]||(t._x_ids[e]=ie(e))}(t,e)))})),pt(ht("@",rt("on:"))),at("on",Ht(((t,{value:e,modifiers:n,expression:i},{cleanup:r})=>{let o=i?J(t,i):()=>{};"template"===t.tagName.toLowerCase()&&(t._x_forwardEvents||(t._x_forwardEvents=[]),t._x_forwardEvents.includes(e)||t._x_forwardEvents.push(e));let a=ue(t,e,n,(t=>{o((()=>{}),{scope:{$event:t},params:[t]})}));r((()=>a()))}))),te.setEvaluator(tt),te.setReactivityEngine({reactive:ee.reactive,effect:ee.effect,release:ee.stop,raw:ee.toRaw});var pe=te;const ge="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function me(t,e,n){const i=n||(t=>Array.prototype.slice.call(t));let r=!1,o=[];return function(...n){o=i(n),r||(r=!0,ge.call(window,(()=>{r=!1,t.apply(e,o)})))}}const ve=t=>"start"===t?"left":"end"===t?"right":"center",ye=(t,e,n)=>"start"===t?e:"end"===t?n:(e+n)/2;function be(){}const _e=function(){let t=0;return function(){return t++}}();function Ee(t){return null==t}function xe(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function Ae(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const De=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function we(t,e){return De(t)?t:e}function ke(t,e){return void 0===t?e:t}const Te=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Ce(t,e,n){if(t&&"function"==typeof t.call)return t.apply(n,e)}function Se(t,e,n,i){let r,o,a;if(xe(t))if(o=t.length,i)for(r=o-1;r>=0;r--)e.call(n,t[r],r);else for(r=0;r<o;r++)e.call(n,t[r],r);else if(Ae(t))for(a=Object.keys(t),o=a.length,r=0;r<o;r++)e.call(n,t[a[r]],a[r])}function Ie(t,e){let n,i,r,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,i=t.length;n<i;++n)if(r=t[n],o=e[n],r.datasetIndex!==o.datasetIndex||r.index!==o.index)return!1;return!0}function Oe(t){if(xe(t))return t.map(Oe);if(Ae(t)){const e=Object.create(null),n=Object.keys(t),i=n.length;let r=0;for(;r<i;++r)e[n[r]]=Oe(t[n[r]]);return e}return t}function Re(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function Me(t,e,n,i){if(!Re(t))return;const r=e[t],o=n[t];Ae(r)&&Ae(o)?Le(r,o,i):e[t]=Oe(o)}function Le(t,e,n){const i=xe(e)?e:[e],r=i.length;if(!Ae(t))return t;const o=(n=n||{}).merger||Me;for(let a=0;a<r;++a){if(!Ae(e=i[a]))continue;const r=Object.keys(e);for(let i=0,a=r.length;i<a;++i)o(r[i],t,e,n)}return t}function Pe(t,e){return Le(t,e,{merger:Fe})}function Fe(t,e,n){if(!Re(t))return;const i=e[t],r=n[t];Ae(i)&&Ae(r)?Pe(i,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Oe(r))}function Be(t,e){const n=t.indexOf(".",e);return-1===n?t.length:n}function Ne(t,e){if(""===e)return t;let n=0,i=Be(e,n);for(;t&&i>n;)t=t[e.substr(n,i-n)],n=i+1,i=Be(e,n);return t}function je(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ve=t=>void 0!==t,ze=t=>"function"==typeof t,Ue=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0},Ge=Math.PI,We=2*Ge,He=We+Ge,qe=Number.POSITIVE_INFINITY,$e=Ge/180,Ye=Ge/2,Xe=Ge/4,Ke=2*Ge/3,Ze=Math.log10,Je=Math.sign;function Qe(t){const e=Math.round(t);t=en(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(Ze(t))),i=t/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function tn(t){return!isNaN(parseFloat(t))&&isFinite(t)}function en(t,e,n){return Math.abs(t-e)<n}function nn(t,e,n){let i,r,o;for(i=0,r=t.length;i<r;i++)o=t[i][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function rn(t){return t*(Ge/180)}function on(t){return t*(180/Ge)}function an(t){if(!De(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function sn(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function un(t,e){return(t-e+He)%We-Ge}function ln(t){return(t%We+We)%We}function cn(t,e,n,i){const r=ln(t),o=ln(e),a=ln(n),s=ln(o-r),u=ln(a-r),l=ln(r-o),c=ln(r-a);return r===o||r===a||i&&o===a||s>u&&l<c}function hn(t,e,n){return Math.max(e,Math.min(n,t))}function dn(t,e,n,i=1e-6){return t>=Math.min(e,n)-i&&t<=Math.max(e,n)+i}const fn=t=>0===t||1===t,pn=(t,e,n)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*We/n),gn=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*We/n)+1,mn={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Ye),easeOutSine:t=>Math.sin(t*Ye),easeInOutSine:t=>-.5*(Math.cos(Ge*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>fn(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>fn(t)?t:pn(t,.075,.3),easeOutElastic:t=>fn(t)?t:gn(t,.075,.3),easeInOutElastic(t){const e=.1125;return fn(t)?t:t<.5?.5*pn(2*t,e,.45):.5+.5*gn(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-mn.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:t=>t<.5?.5*mn.easeInBounce(2*t):.5*mn.easeOutBounce(2*t-1)+.5},vn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},yn="0123456789ABCDEF",bn=t=>yn[15&t],_n=t=>yn[(240&t)>>4]+yn[15&t],En=t=>(240&t)>>4==(15&t);function xn(t){var e=function(t){return En(t.r)&&En(t.g)&&En(t.b)&&En(t.a)}(t)?bn:_n;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function An(t){return t+.5|0}const Dn=(t,e,n)=>Math.max(Math.min(t,n),e);function wn(t){return Dn(An(2.55*t),0,255)}function kn(t){return Dn(An(255*t),0,255)}function Tn(t){return Dn(An(t/2.55)/100,0,1)}function Cn(t){return Dn(An(100*t),0,100)}const Sn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const In=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function On(t,e,n){const i=e*Math.min(n,1-n),r=(e,r=(e+t/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[r(0),r(8),r(4)]}function Rn(t,e,n){const i=(i,r=(i+t/60)%6)=>n-n*e*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Mn(t,e,n){const i=On(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function Ln(t){const e=t.r/255,n=t.g/255,i=t.b/255,r=Math.max(e,n,i),o=Math.min(e,n,i),a=(r+o)/2;let s,u,l;return r!==o&&(l=r-o,u=a>.5?l/(2-r-o):l/(r+o),s=r===e?(n-i)/l+(n<i?6:0):r===n?(i-e)/l+2:(e-n)/l+4,s=60*s+.5),[0|s,u||0,a]}function Pn(t,e,n,i){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,i)).map(kn)}function Fn(t,e,n){return Pn(On,t,e,n)}function Bn(t){return(t%360+360)%360}function Nn(t){const e=In.exec(t);let n,i=255;if(!e)return;e[5]!==n&&(i=e[6]?wn(+e[5]):kn(+e[5]));const r=Bn(+e[2]),o=+e[3]/100,a=+e[4]/100;return n="hwb"===e[1]?function(t,e,n){return Pn(Mn,t,e,n)}(r,o,a):"hsv"===e[1]?function(t,e,n){return Pn(Rn,t,e,n)}(r,o,a):Fn(r,o,a),{r:n[0],g:n[1],b:n[2],a:i}}const jn={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Vn={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let zn;function Un(t){zn||(zn=function(){const t={},e=Object.keys(Vn),n=Object.keys(jn);let i,r,o,a,s;for(i=0;i<e.length;i++){for(a=s=e[i],r=0;r<n.length;r++)o=n[r],s=s.replace(o,jn[o]);o=parseInt(Vn[a],16),t[s]=[o>>16&255,o>>8&255,255&o]}return t}(),zn.transparent=[0,0,0,0]);const e=zn[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function Gn(t,e,n){if(t){let i=Ln(t);i[e]=Math.max(0,Math.min(i[e]+i[e]*n,0===e?360:1)),i=Fn(i),t.r=i[0],t.g=i[1],t.b=i[2]}}function Wn(t,e){return t?Object.assign(e||{},t):t}function Hn(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=kn(t[3]))):(e=Wn(t,{r:0,g:0,b:0,a:1})).a=kn(e.a),e}function qn(t){return"r"===t.charAt(0)?function(t){const e=Sn.exec(t);let n,i,r,o=255;if(e){if(e[7]!==n){const t=+e[7];o=255&(e[8]?wn(t):255*t)}return n=+e[1],i=+e[3],r=+e[5],n=255&(e[2]?wn(n):n),i=255&(e[4]?wn(i):i),r=255&(e[6]?wn(r):r),{r:n,g:i,b:r,a:o}}}(t):Nn(t)}class $n{constructor(t){if(t instanceof $n)return t;const e=typeof t;let n;var i,r,o;"object"===e?n=Hn(t):"string"===e&&(o=(i=t).length,"#"===i[0]&&(4===o||5===o?r={r:255&17*vn[i[1]],g:255&17*vn[i[2]],b:255&17*vn[i[3]],a:5===o?17*vn[i[4]]:255}:7!==o&&9!==o||(r={r:vn[i[1]]<<4|vn[i[2]],g:vn[i[3]]<<4|vn[i[4]],b:vn[i[5]]<<4|vn[i[6]],a:9===o?vn[i[7]]<<4|vn[i[8]]:255})),n=r||Un(t)||qn(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Wn(this._rgb);return t&&(t.a=Tn(t.a)),t}set rgb(t){this._rgb=Hn(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Tn(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?xn(this._rgb):this._rgb}hslString(){return this._valid?function(t){if(!t)return;const e=Ln(t),n=e[0],i=Cn(e[1]),r=Cn(e[2]);return t.a<255?`hsla(${n}, ${i}%, ${r}%, ${Tn(t.a)})`:`hsl(${n}, ${i}%, ${r}%)`}(this._rgb):this._rgb}mix(t,e){const n=this;if(t){const i=n.rgb,r=t.rgb;let o;const a=e===o?.5:e,s=2*a-1,u=i.a-r.a,l=((s*u==-1?s:(s+u)/(1+s*u))+1)/2;o=1-l,i.r=255&l*i.r+o*r.r+.5,i.g=255&l*i.g+o*r.g+.5,i.b=255&l*i.b+o*r.b+.5,i.a=a*i.a+(1-a)*r.a,n.rgb=i}return n}clone(){return new $n(this.rgb)}alpha(t){return this._rgb.a=kn(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=An(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Gn(this._rgb,2,t),this}darken(t){return Gn(this._rgb,2,-t),this}saturate(t){return Gn(this._rgb,1,t),this}desaturate(t){return Gn(this._rgb,1,-t),this}rotate(t){return function(t,e){var n=Ln(t);n[0]=Bn(n[0]+e),n=Fn(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}function Yn(t){return new $n(t)}const Xn=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Kn(t){return Xn(t)?t:Yn(t)}function Zn(t){return Xn(t)?t:Yn(t).saturate(.5).darken(.1).hexString()}const Jn=Object.create(null),Qn=Object.create(null);function ti(t,e){if(!e)return t;const n=e.split(".");for(let e=0,i=n.length;e<i;++e){const i=n[e];t=t[i]||(t[i]=Object.create(null))}return t}function ei(t,e,n){return"string"==typeof e?Le(ti(t,e),n):Le(ti(t,""),e)}var ni=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>Zn(e.backgroundColor),this.hoverBorderColor=(t,e)=>Zn(e.borderColor),this.hoverColor=(t,e)=>Zn(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.describe(t)}set(t,e){return ei(this,t,e)}get(t){return ti(this,t)}describe(t,e){return ei(Qn,t,e)}override(t,e){return ei(Jn,t,e)}route(t,e,n,i){const r=ti(this,t),o=ti(this,n),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[i];return Ae(t)?Object.assign({},e,t):ke(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function ii(t,e,n,i,r){let o=e[r];return o||(o=e[r]=t.measureText(r).width,n.push(r)),o>i&&(i=o),i}function ri(t,e,n,i){let r=(i=i||{}).data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(r=i.data={},o=i.garbageCollect=[],i.font=e),t.save(),t.font=e;let a=0;const s=n.length;let u,l,c,h,d;for(u=0;u<s;u++)if(h=n[u],null!=h&&!0!==xe(h))a=ii(t,r,o,a,h);else if(xe(h))for(l=0,c=h.length;l<c;l++)d=h[l],null==d||xe(d)||(a=ii(t,r,o,a,d));t.restore();const f=o.length/2;if(f>n.length){for(u=0;u<f;u++)delete r[o[u]];o.splice(0,f)}return a}function oi(t,e,n){const i=t.currentDevicePixelRatio,r=0!==n?Math.max(n/2,.5):0;return Math.round((e-r)*i)/i+r}function ai(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function si(t,e,n,i){let r,o,a,s,u;const l=e.pointStyle,c=e.rotation,h=e.radius;let d=(c||0)*$e;if(l&&"object"==typeof l&&(r=l.toString(),"[object HTMLImageElement]"===r||"[object HTMLCanvasElement]"===r))return t.save(),t.translate(n,i),t.rotate(d),t.drawImage(l,-l.width/2,-l.height/2,l.width,l.height),void t.restore();if(!(isNaN(h)||h<=0)){switch(t.beginPath(),l){default:t.arc(n,i,h,0,We),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(d)*h,i-Math.cos(d)*h),d+=Ke,t.lineTo(n+Math.sin(d)*h,i-Math.cos(d)*h),d+=Ke,t.lineTo(n+Math.sin(d)*h,i-Math.cos(d)*h),t.closePath();break;case"rectRounded":u=.516*h,s=h-u,o=Math.cos(d+Xe)*s,a=Math.sin(d+Xe)*s,t.arc(n-o,i-a,u,d-Ge,d-Ye),t.arc(n+a,i-o,u,d-Ye,d),t.arc(n+o,i+a,u,d,d+Ye),t.arc(n-a,i+o,u,d+Ye,d+Ge),t.closePath();break;case"rect":if(!c){s=Math.SQRT1_2*h,t.rect(n-s,i-s,2*s,2*s);break}d+=Xe;case"rectRot":o=Math.cos(d)*h,a=Math.sin(d)*h,t.moveTo(n-o,i-a),t.lineTo(n+a,i-o),t.lineTo(n+o,i+a),t.lineTo(n-a,i+o),t.closePath();break;case"crossRot":d+=Xe;case"cross":o=Math.cos(d)*h,a=Math.sin(d)*h,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a),t.moveTo(n+a,i-o),t.lineTo(n-a,i+o);break;case"star":o=Math.cos(d)*h,a=Math.sin(d)*h,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a),t.moveTo(n+a,i-o),t.lineTo(n-a,i+o),d+=Xe,o=Math.cos(d)*h,a=Math.sin(d)*h,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a),t.moveTo(n+a,i-o),t.lineTo(n-a,i+o);break;case"line":o=Math.cos(d)*h,a=Math.sin(d)*h,t.moveTo(n-o,i-a),t.lineTo(n+o,i+a);break;case"dash":t.moveTo(n,i),t.lineTo(n+Math.cos(d)*h,i+Math.sin(d)*h)}t.fill(),e.borderWidth>0&&t.stroke()}}function ui(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function li(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function ci(t){t.restore()}function hi(t,e,n,i,r){if(!e)return t.lineTo(n.x,n.y);if("middle"===r){const i=(e.x+n.x)/2;t.lineTo(i,e.y),t.lineTo(i,n.y)}else"after"===r!=!!i?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function di(t,e,n,i){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function fi(t,e,n,i,r,o={}){const a=xe(e)?e:[e],s=o.strokeWidth>0&&""!==o.strokeColor;let u,l;for(t.save(),t.font=r.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);Ee(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),u=0;u<a.length;++u)l=a[u],s&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),Ee(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(l,n,i,o.maxWidth)),t.fillText(l,n,i,o.maxWidth),pi(t,n,i,l,o),i+=r.lineHeight;t.restore()}function pi(t,e,n,i,r){if(r.strikethrough||r.underline){const o=t.measureText(i),a=e-o.actualBoundingBoxLeft,s=e+o.actualBoundingBoxRight,u=n-o.actualBoundingBoxAscent,l=n+o.actualBoundingBoxDescent,c=r.strikethrough?(u+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(a,c),t.lineTo(s,c),t.stroke()}}function gi(t,e){const{x:n,y:i,w:r,h:o,radius:a}=e;t.arc(n+a.topLeft,i+a.topLeft,a.topLeft,-Ye,Ge,!0),t.lineTo(n,i+o-a.bottomLeft),t.arc(n+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,Ge,Ye,!0),t.lineTo(n+r-a.bottomRight,i+o),t.arc(n+r-a.bottomRight,i+o-a.bottomRight,a.bottomRight,Ye,0,!0),t.lineTo(n+r,i+a.topRight),t.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-Ye,!0),t.lineTo(n+a.topLeft,i)}const mi=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),vi=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function yi(t,e){const n=(""+t).match(mi);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}function bi(t,e){const n={},i=Ae(e),r=i?Object.keys(e):e,o=Ae(t)?i?n=>ke(t[n],t[e[n]]):e=>t[e]:()=>t;for(const t of r)n[t]=+o(t)||0;return n}function _i(t){return bi(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ei(t){return bi(t,["topLeft","topRight","bottomLeft","bottomRight"])}function xi(t){const e=_i(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ai(t,e){t=t||{},e=e||ni.font;let n=ke(t.size,e.size);"string"==typeof n&&(n=parseInt(n,10));let i=ke(t.style,e.style);i&&!(""+i).match(vi)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const r={family:ke(t.family,e.family),lineHeight:yi(ke(t.lineHeight,e.lineHeight),n),size:n,style:i,weight:ke(t.weight,e.weight),string:""};return r.string=function(t){return!t||Ee(t.size)||Ee(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(r),r}function Di(t,e,n,i){let r,o,a,s=!0;for(r=0,o=t.length;r<o;++r)if(a=t[r],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),s=!1),void 0!==n&&xe(a)&&(a=a[n%a.length],s=!1),void 0!==a))return i&&!s&&(i.cacheable=!1),a}function wi(t,e){return Object.assign(Object.create(t),e)}function ki(t,e,n){n=n||(n=>t[n]<e);let i,r=t.length-1,o=0;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const Ti=(t,e,n)=>ki(t,n,(i=>t[i][e]<n)),Ci=(t,e,n)=>ki(t,n,(i=>t[i][e]>=n));const Si=["push","pop","shift","splice","unshift"];function Ii(t,e){const n=t._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(e);-1!==r&&i.splice(r,1),i.length>0||(Si.forEach((e=>{delete t[e]})),delete t._chartjs)}function Oi(t){const e=new Set;let n,i;for(n=0,i=t.length;n<i;++n)e.add(t[n]);return e.size===i?t:Array.from(e)}function Ri(t,e=[""],n=t,i,r=(()=>t[0])){Ve(i)||(i=Gi("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:n,_fallback:i,_getTarget:r,override:r=>Ri([r,...t],e,n,i)};return new Proxy(o,{deleteProperty:(e,n)=>(delete e[n],delete e._keys,delete t[0][n],!0),get:(n,i)=>Bi(n,i,(()=>function(t,e,n,i){let r;for(const o of e)if(r=Gi(Pi(o,t),n),Ve(r))return Fi(t,r)?zi(n,i,t,r):r}(i,e,t,n))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>Wi(t).includes(e),ownKeys:t=>Wi(t),set(t,e,n){const i=t._storage||(t._storage=r());return t[e]=i[e]=n,delete t._keys,!0}})}function Mi(t,e,n,i){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Li(t,i),setContext:e=>Mi(t,e,n,i),override:r=>Mi(t.override(r),e,n,i)};return new Proxy(r,{deleteProperty:(e,n)=>(delete e[n],delete t[n],!0),get:(t,e,n)=>Bi(t,e,(()=>function(t,e,n){const{_proxy:i,_context:r,_subProxy:o,_descriptors:a}=t;let s=i[e];ze(s)&&a.isScriptable(e)&&(s=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:a,_stack:s}=n;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t),e=e(o,a||i),s.delete(t),Fi(t,e)&&(e=zi(r._scopes,r,t,e));return e}(e,s,t,n));xe(s)&&s.length&&(s=function(t,e,n,i){const{_proxy:r,_context:o,_subProxy:a,_descriptors:s}=n;if(Ve(o.index)&&i(t))e=e[o.index%e.length];else if(Ae(e[0])){const n=e,i=r._scopes.filter((t=>t!==n));e=[];for(const u of n){const n=zi(i,r,t,u);e.push(Mi(n,o,a&&a[t],s))}}return e}(e,s,t,a.isIndexable));Fi(e,s)&&(s=Mi(s,r,o&&o[e],a));return s}(t,e,n))),getOwnPropertyDescriptor:(e,n)=>e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,n)=>Reflect.has(t,n),ownKeys:()=>Reflect.ownKeys(t),set:(e,n,i)=>(t[n]=i,delete e[n],!0)})}function Li(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:i=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:i,isScriptable:ze(n)?n:()=>n,isIndexable:ze(i)?i:()=>i}}const Pi=(t,e)=>t?t+je(e):e,Fi=(t,e)=>Ae(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Bi(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const i=n();return t[e]=i,i}function Ni(t,e,n){return ze(t)?t(e,n):t}const ji=(t,e)=>!0===t?e:"string"==typeof t?Ne(e,t):void 0;function Vi(t,e,n,i){for(const r of e){const e=ji(n,r);if(e){t.add(e);const r=Ni(e._fallback,n,e);if(Ve(r)&&r!==n&&r!==i)return r}else if(!1===e&&Ve(i)&&n!==i)return null}return!1}function zi(t,e,n,i){const r=e._rootScopes,o=Ni(e._fallback,n,i),a=[...t,...r],s=new Set;s.add(i);let u=Ui(s,a,n,o||n);return null!==u&&((!Ve(o)||o===n||(u=Ui(s,a,o,u),null!==u))&&Ri(Array.from(s),[""],r,o,(()=>function(t,e,n){const i=t._getTarget();e in i||(i[e]={});const r=i[e];if(xe(r)&&Ae(n))return n;return r}(e,n,i))))}function Ui(t,e,n,i){for(;n;)n=Vi(t,e,n,i);return n}function Gi(t,e){for(const n of e){if(!n)continue;const e=n[t];if(Ve(e))return e}}function Wi(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const n of t)for(const t of Object.keys(n).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const Hi=Number.EPSILON||1e-14,qi=(t,e)=>e<t.length&&!t[e].skip&&t[e],$i=t=>"x"===t?"y":"x";function Yi(t,e,n,i){const r=t.skip?e:t,o=e,a=n.skip?e:n,s=sn(o,r),u=sn(a,o);let l=s/(s+u),c=u/(s+u);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const h=i*l,d=i*c;return{previous:{x:o.x-h*(a.x-r.x),y:o.y-h*(a.y-r.y)},next:{x:o.x+d*(a.x-r.x),y:o.y+d*(a.y-r.y)}}}function Xi(t,e="x"){const n=$i(e),i=t.length,r=Array(i).fill(0),o=Array(i);let a,s,u,l=qi(t,0);for(a=0;a<i;++a)if(s=u,u=l,l=qi(t,a+1),u){if(l){const t=l[e]-u[e];r[a]=0!==t?(l[n]-u[n])/t:0}o[a]=s?l?Je(r[a-1])!==Je(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}!function(t,e,n){const i=t.length;let r,o,a,s,u,l=qi(t,0);for(let c=0;c<i-1;++c)u=l,l=qi(t,c+1),u&&l&&(en(e[c],0,Hi)?n[c]=n[c+1]=0:(r=n[c]/e[c],o=n[c+1]/e[c],s=Math.pow(r,2)+Math.pow(o,2),s<=9||(a=3/Math.sqrt(s),n[c]=r*a*e[c],n[c+1]=o*a*e[c])))}(t,r,o),function(t,e,n="x"){const i=$i(n),r=t.length;let o,a,s,u=qi(t,0);for(let l=0;l<r;++l){if(a=s,s=u,u=qi(t,l+1),!s)continue;const r=s[n],c=s[i];a&&(o=(r-a[n])/3,s[`cp1${n}`]=r-o,s[`cp1${i}`]=c-o*e[l]),u&&(o=(u[n]-r)/3,s[`cp2${n}`]=r+o,s[`cp2${i}`]=c+o*e[l])}}(t,o,e)}function Ki(t,e,n){return Math.max(Math.min(t,n),e)}function Zi(t,e,n,i,r){let o,a,s,u;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)Xi(t,r);else{let n=i?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)s=t[o],u=Yi(n,s,t[Math.min(o+1,a-(i?0:1))%a],e.tension),s.cp1x=u.previous.x,s.cp1y=u.previous.y,s.cp2x=u.next.x,s.cp2y=u.next.y,n=s}e.capBezierPoints&&function(t,e){let n,i,r,o,a,s=ui(t[0],e);for(n=0,i=t.length;n<i;++n)a=o,o=s,s=n<i-1&&ui(t[n+1],e),o&&(r=t[n],a&&(r.cp1x=Ki(r.cp1x,e.left,e.right),r.cp1y=Ki(r.cp1y,e.top,e.bottom)),s&&(r.cp2x=Ki(r.cp2x,e.left,e.right),r.cp2y=Ki(r.cp2y,e.top,e.bottom)))}(t,n)}function Ji(){return"undefined"!=typeof window&&"undefined"!=typeof document}function Qi(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function tr(t,e,n){let i;return"string"==typeof t?(i=parseInt(t,10),-1!==t.indexOf("%")&&(i=i/100*e.parentNode[n])):i=t,i}const er=t=>window.getComputedStyle(t,null);const nr=["top","right","bottom","left"];function ir(t,e,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const o=nr[r];i[o]=parseFloat(t[e+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function rr(t,e){const{canvas:n,currentDevicePixelRatio:i}=e,r=er(n),o="border-box"===r.boxSizing,a=ir(r,"padding"),s=ir(r,"border","width"),{x:u,y:l,box:c}=function(t,e){const n=t.native||t,i=n.touches,r=i&&i.length?i[0]:n,{offsetX:o,offsetY:a}=r;let s,u,l=!1;if(((t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot))(o,a,n.target))s=o,u=a;else{const t=e.getBoundingClientRect();s=r.clientX-t.left,u=r.clientY-t.top,l=!0}return{x:s,y:u,box:l}}(t,n),h=a.left+(c&&s.left),d=a.top+(c&&s.top);let{width:f,height:p}=e;return o&&(f-=a.width+s.width,p-=a.height+s.height),{x:Math.round((u-h)/f*n.width/i),y:Math.round((l-d)/p*n.height/i)}}const or=t=>Math.round(10*t)/10;function ar(t,e,n,i){const r=er(t),o=ir(r,"margin"),a=tr(r.maxWidth,t,"clientWidth")||qe,s=tr(r.maxHeight,t,"clientHeight")||qe,u=function(t,e,n){let i,r;if(void 0===e||void 0===n){const o=Qi(t);if(o){const t=o.getBoundingClientRect(),a=er(o),s=ir(a,"border","width"),u=ir(a,"padding");e=t.width-u.width-s.width,n=t.height-u.height-s.height,i=tr(a.maxWidth,o,"clientWidth"),r=tr(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:i||qe,maxHeight:r||qe}}(t,e,n);let{width:l,height:c}=u;if("content-box"===r.boxSizing){const t=ir(r,"border","width"),e=ir(r,"padding");l-=e.width+t.width,c-=e.height+t.height}return l=Math.max(0,l-o.width),c=Math.max(0,i?Math.floor(l/i):c-o.height),l=or(Math.min(l,a,u.maxWidth)),c=or(Math.min(c,s,u.maxHeight)),l&&!c&&(c=or(l/2)),{width:l,height:c}}function sr(t,e,n){const i=e||1,r=Math.floor(t.height*i),o=Math.floor(t.width*i);t.height=r/i,t.width=o/i;const a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==i||a.height!==r||a.width!==o)&&(t.currentDevicePixelRatio=i,a.height=r,a.width=o,t.ctx.setTransform(i,0,0,i,0,0),!0)}const ur=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function lr(t,e){const n=function(t,e){return er(t).getPropertyValue(e)}(t,e),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function cr(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function hr(t,e,n,i){return{x:t.x+n*(e.x-t.x),y:"middle"===i?n<.5?t.y:e.y:"after"===i?n<1?t.y:e.y:n>0?e.y:t.y}}function dr(t,e,n,i){const r={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=cr(t,r,n),s=cr(r,o,n),u=cr(o,e,n),l=cr(a,s,n),c=cr(s,u,n);return cr(l,c,n)}const fr=new Map;function pr(t,e,n){return function(t,e){e=e||{};const n=t+JSON.stringify(e);let i=fr.get(n);return i||(i=new Intl.NumberFormat(t,e),fr.set(n,i)),i}(e,n).format(t)}function gr(t,e,n){return t?function(t,e){return{x:n=>t+t+e-n,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,n):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function mr(t,e){let n,i;"ltr"!==e&&"rtl"!==e||(n=t.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=i)}function vr(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function yr(t){return"angle"===t?{between:cn,compare:un,normalize:ln}:{between:dn,compare:(t,e)=>t-e,normalize:t=>t}}function br({start:t,end:e,count:n,loop:i,style:r}){return{start:t%n,end:e%n,loop:i&&(e-t+1)%n==0,style:r}}function _r(t,e,n){if(!n)return[t];const{property:i,start:r,end:o}=n,a=e.length,{compare:s,between:u,normalize:l}=yr(i),{start:c,end:h,loop:d,style:f}=function(t,e,n){const{property:i,start:r,end:o}=n,{between:a,normalize:s}=yr(i),u=e.length;let l,c,{start:h,end:d,loop:f}=t;if(f){for(h+=u,d+=u,l=0,c=u;l<c&&a(s(e[h%u][i]),r,o);++l)h--,d--;h%=u,d%=u}return d<h&&(d+=u),{start:h,end:d,loop:f,style:t.style}}(t,e,n),p=[];let g,m,v,y=!1,b=null;const _=()=>y||u(r,v,g)&&0!==s(r,v),E=()=>!y||0===s(o,g)||u(o,v,g);for(let t=c,n=c;t<=h;++t)m=e[t%a],m.skip||(g=l(m[i]),g!==v&&(y=u(g,r,o),null===b&&_()&&(b=0===s(g,r)?t:n),null!==b&&E()&&(p.push(br({start:b,end:t,loop:d,count:a,style:f})),b=null),n=t,v=g));return null!==b&&p.push(br({start:b,end:h,loop:d,count:a,style:f})),p}function Er(t,e){const n=[],i=t.segments;for(let r=0;r<i.length;r++){const o=_r(i[r],t.points,e);o.length&&n.push(...o)}return n}function xr(t,e,n,i){return i&&i.setContext&&n?function(t,e,n,i){const r=t._chart.getContext(),o=Ar(t.options),{_datasetIndex:a,options:{spanGaps:s}}=t,u=n.length,l=[];let c=o,h=e[0].start,d=h;function f(t,e,i,r){const o=s?-1:1;if(t!==e){for(t+=u;n[t%u].skip;)t-=o;for(;n[e%u].skip;)e+=o;t%u!=e%u&&(l.push({start:t%u,end:e%u,loop:i,style:r}),c=r,h=e%u)}}for(const t of e){h=s?h:t.start;let e,o=n[h%u];for(d=h+1;d<=t.end;d++){const s=n[d%u];e=Ar(i.setContext(wi(r,{type:"segment",p0:o,p1:s,p0DataIndex:(d-1)%u,p1DataIndex:d%u,datasetIndex:a}))),Dr(e,c)&&f(h,d-1,t.loop,c),o=s,c=e}h<d-1&&f(h,d-1,t.loop,c)}return l}(t,e,n,i):e}function Ar(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Dr(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var wr=new
  /*!
   * Chart.js v3.6.2
   * https://www.chartjs.org
   * (c) 2021 Chart.js Contributors
   * Released under the MIT License
   */
  class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,n,i){const r=e.listeners[i],o=e.duration;r.forEach((i=>i({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=ge.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((n,i)=>{if(!n.running||!n.items.length)return;const r=n.items;let o,a=r.length-1,s=!1;for(;a>=0;--a)o=r[a],o._active?(o._total>n.duration&&(n.duration=o._total),o.tick(t),s=!0):(r[a]=r[r.length-1],r.pop());s&&(i.draw(),this._notify(i,n,t,"progress")),r.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),e+=r.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};const kr="transparent",Tr={boolean:(t,e,n)=>n>.5?e:t,color(t,e,n){const i=Kn(t||kr),r=i.valid&&Kn(e||kr);return r&&r.valid?r.mix(i,n).hexString():e},number:(t,e,n)=>t+(e-t)*n};class Cr{constructor(t,e,n,i){const r=e[n];i=Di([t.to,i,r,t.from]);const o=Di([t.from,r,i]);this._active=!0,this._fn=t.fn||Tr[t.type||typeof o],this._easing=mn[t.easing]||mn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=n,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const i=this._target[this._prop],r=n-this._start,o=this._duration-r;this._start=n,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=Di([t.to,e,i,t.from]),this._from=Di([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,i=this._prop,r=this._from,o=this._loop,a=this._to;let s;if(this._active=r!==a&&(o||e<n),!this._active)return this._target[i]=a,void this._notify(!0);e<0?this._target[i]=r:(s=e/n%2,s=o&&s>1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[i]=this._fn(r,a,s))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,n)=>{t.push({res:e,rej:n})}))}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let t=0;t<n.length;t++)n[t][e]()}}ni.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Sr=Object.keys(ni.animation);ni.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),ni.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),ni.describe("animations",{_fallback:"animation"}),ni.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class Ir{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!Ae(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((n=>{const i=t[n];if(!Ae(i))return;const r={};for(const t of Sr)r[t]=i[t];(xe(i.properties)&&i.properties||[n]).forEach((t=>{t!==n&&e.has(t)||e.set(t,r)}))}))}_animateOptions(t,e){const n=e.options,i=function(t,e){if(!e)return;let n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!i)return[];const r=this._createAnimations(i,n);return n.$shared&&function(t,e){const n=[],i=Object.keys(e);for(let e=0;e<i.length;e++){const r=t[i[e]];r&&r.active()&&n.push(r.wait())}return Promise.all(n)}(t.options.$animations,n).then((()=>{t.options=n}),(()=>{})),r}_createAnimations(t,e){const n=this._properties,i=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let s;for(s=o.length-1;s>=0;--s){const u=o[s];if("$"===u.charAt(0))continue;if("options"===u){i.push(...this._animateOptions(t,e));continue}const l=e[u];let c=r[u];const h=n.get(u);if(c){if(h&&c.active()){c.update(h,l,a);continue}c.cancel()}h&&h.duration?(r[u]=c=new Cr(h,t,u,l),i.push(c)):t[u]=l}return i}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const n=this._createAnimations(t,e);return n.length?(wr.add(this._chart,n),!0):void 0}}function Or(t,e){const n=t&&t.options||{},i=n.reverse,r=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:i?o:r,end:i?r:o}}function Rr(t,e){const n=[],i=t._getSortedDatasetMetas(e);let r,o;for(r=0,o=i.length;r<o;++r)n.push(i[r].index);return n}function Mr(t,e,n,i={}){const r=t.keys,o="single"===i.mode;let a,s,u,l;if(null!==e){for(a=0,s=r.length;a<s;++a){if(u=+r[a],u===n){if(i.all)continue;break}l=t.values[u],De(l)&&(o||0===e||Je(e)===Je(l))&&(e+=l)}return e}}function Lr(t,e){const n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function Pr(t,e,n){const i=t[e]||(t[e]={});return i[n]||(i[n]={})}function Fr(t,e,n,i){for(const r of e.getMatchingVisibleMetas(i).reverse()){const e=t[r.index];if(n&&e>0||!n&&e<0)return r.index}return null}function Br(t,e){const{chart:n,_cachedMeta:i}=t,r=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:s}=i,u=o.axis,l=a.axis,c=function(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}(o,a,i),h=e.length;let d;for(let t=0;t<h;++t){const n=e[t],{[u]:o,[l]:h}=n;d=(n._stacks||(n._stacks={}))[l]=Pr(r,c,o),d[s]=h,d._top=Fr(d,a,!0,i.type),d._bottom=Fr(d,a,!1,i.type)}}function Nr(t,e){const n=t.scales;return Object.keys(n).filter((t=>n[t].axis===e)).shift()}function jr(t,e){const n=t.controller.index,i=t.vScale&&t.vScale.axis;if(i){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[i]||void 0===e[i][n])return;delete e[i][n]}}}const Vr=t=>"reset"===t||"none"===t,zr=(t,e)=>e?t:Object.assign({},t);class Ur{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Lr(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&jr(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),i=(t,e,n,i)=>"x"===t?e:"r"===t?i:n,r=e.xAxisID=ke(n.xAxisID,Nr(t,"x")),o=e.yAxisID=ke(n.yAxisID,Nr(t,"y")),a=e.rAxisID=ke(n.rAxisID,Nr(t,"r")),s=e.indexAxis,u=e.iAxisID=i(s,r,o,a),l=e.vAxisID=i(s,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(u),e.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ii(this._data,this),t._stacked&&jr(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(Ae(e))this._data=function(t){const e=Object.keys(t),n=new Array(e.length);let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i],n[i]={x:o,y:t[o]};return n}(e);else if(n!==e){if(n){Ii(n,this);const t=this._cachedMeta;jr(t),t._parsed=[]}e&&Object.isExtensible(e)&&(r=this,(i=e)._chartjs?i._chartjs.listeners.push(r):(Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[r]}}),Si.forEach((t=>{const e="_onData"+je(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...t){const r=n.apply(this,t);return i._chartjs.listeners.forEach((n=>{"function"==typeof n[e]&&n[e](...t)})),r}})})))),this._syncList=[],this._data=e}var i,r}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,n=this.getDataset();let i=!1;this._dataCheck();const r=e._stacked;e._stacked=Lr(e.vScale,e),e.stack!==n.stack&&(i=!0,jr(e),e.stack=n.stack),this._resyncElements(t),(i||r!==e._stacked)&&Br(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:i}=this,{iScale:r,_stacked:o}=n,a=r.axis;let s,u,l,c=0===t&&e===i.length||n._sorted,h=t>0&&n._parsed[t-1];if(!1===this._parsing)n._parsed=i,n._sorted=!0,l=i;else{l=xe(i[t])?this.parseArrayData(n,i,t,e):Ae(i[t])?this.parseObjectData(n,i,t,e):this.parsePrimitiveData(n,i,t,e);const r=()=>null===u[a]||h&&u[a]<h[a];for(s=0;s<e;++s)n._parsed[s+t]=u=l[s],c&&(r()&&(c=!1),h=u);n._sorted=c}o&&Br(this,l)}parsePrimitiveData(t,e,n,i){const{iScale:r,vScale:o}=t,a=r.axis,s=o.axis,u=r.getLabels(),l=r===o,c=new Array(i);let h,d,f;for(h=0,d=i;h<d;++h)f=h+n,c[h]={[a]:l||r.parse(u[f],f),[s]:o.parse(e[f],f)};return c}parseArrayData(t,e,n,i){const{xScale:r,yScale:o}=t,a=new Array(i);let s,u,l,c;for(s=0,u=i;s<u;++s)l=s+n,c=e[l],a[s]={x:r.parse(c[0],l),y:o.parse(c[1],l)};return a}parseObjectData(t,e,n,i){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,u=new Array(i);let l,c,h,d;for(l=0,c=i;l<c;++l)h=l+n,d=e[h],u[l]={x:r.parse(Ne(d,a),h),y:o.parse(Ne(d,s),h)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,n){const i=this.chart,r=this._cachedMeta,o=e[t.axis];return Mr({keys:Rr(i,!0),values:e._stacks[t.axis]},o,r.index,{mode:n})}updateRangeFromParsed(t,e,n,i){const r=n[e.axis];let o=null===r?NaN:r;const a=i&&n._stacks[e.axis];i&&a&&(i.values=a,o=Mr(i,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const n=this._cachedMeta,i=n._parsed,r=n._sorted&&t===n.iScale,o=i.length,a=this._getOtherScale(t),s=((t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:Rr(n,!0),values:null})(e,n,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:l,max:c}=function(t){const{min:e,max:n,minDefined:i,maxDefined:r}=t.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}(a);let h,d;function f(){d=i[h];const e=d[a.axis];return!De(d[t.axis])||l>e||c<e}for(h=0;h<o&&(f()||(this.updateRangeFromParsed(u,t,d,s),!r));++h);if(r)for(h=o-1;h>=0;--h)if(!f()){this.updateRangeFromParsed(u,t,d,s);break}return u}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let i,r,o;for(i=0,r=e.length;i<r;++i)o=e[i][t.axis],De(o)&&n.push(o);return n}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,n=e.iScale,i=e.vScale,r=this.getParsed(t);return{label:n?""+n.getLabelForValue(r[n.axis]):"",value:i?""+i.getLabelForValue(r[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,n,i,r;return Ae(t)?(e=t.top,n=t.right,i=t.bottom,r=t.left):e=n=i=r=t,{top:e,right:n,bottom:i,left:r,disabled:!1===t}}(ke(this.options.clip,function(t,e,n){if(!1===n)return!1;const i=Or(t,n),r=Or(e,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,n=this._cachedMeta,i=n.data||[],r=e.chartArea,o=[],a=this._drawStart||0,s=this._drawCount||i.length-a;let u;for(n.dataset&&n.dataset.draw(t,r,a,s),u=a;u<a+s;++u){const e=i[u];e.hidden||(e.active?o.push(e):e.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,e,n){const i=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];r=e.$context||(e.$context=function(t,e,n){return wi(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),r.parsed=this.getParsed(t),r.raw=i.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=function(t,e){return wi(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),r.dataset=i,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=n,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",n){const i="active"===e,r=this._cachedDataOpts,o=t+"-"+e,a=r[o],s=this.enableOptionSharing&&Ve(n);if(a)return zr(a,s);const u=this.chart.config,l=u.datasetElementScopeKeys(this._type,t),c=i?[`${t}Hover`,"hover",t,""]:[t,""],h=u.getOptionScopes(this.getDataset(),l),d=Object.keys(ni.elements[t]),f=u.resolveNamedOptions(h,d,(()=>this.getContext(n,i)),c);return f.$shared&&(f.$shared=s,r[o]=Object.freeze(zr(f,s))),f}_resolveAnimations(t,e,n){const i=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let s;if(!1!==i.options.animation){const i=this.chart.config,r=i.datasetAnimationScopeKeys(this._type,e),o=i.getOptionScopes(this.getDataset(),r);s=i.createResolver(o,this.getContext(t,n,e))}const u=new Ir(i,s&&s.animations);return s&&s._cacheable&&(r[o]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Vr(t)||this.chart._animationsDisabled}updateElement(t,e,n,i){Vr(i)?Object.assign(t,n):this._resolveAnimations(e,i).update(t,n)}updateSharedOptions(t,e,n){t&&!Vr(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,i){t.active=i;const r=this.getStyle(e,i);this._resolveAnimations(e,n,i).update(t,{options:!i&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,n=this._cachedMeta.data;for(const[t,e,n]of this._syncList)this[t](e,n);this._syncList=[];const i=n.length,r=e.length,o=Math.min(r,i);o&&this.parse(0,o),r>i?this._insertElements(i,r-i,t):r<i&&this._removeElements(r,i-r)}_insertElements(t,e,n=!0){const i=this._cachedMeta,r=i.data,o=t+e;let a;const s=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(s(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&s(i._parsed),this.parse(t,e),n&&this.updateElements(r,t,e,"reset")}updateElements(t,e,n,i){}_removeElements(t,e){const n=this._cachedMeta;if(this._parsing){const i=n._parsed.splice(t,e);n._stacked&&jr(n,i)}n.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,n,i]=t;this[e](n,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Gr(t){const e=t.iScale,n=function(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let i=[];for(let e=0,r=n.length;e<r;e++)i=i.concat(n[e].controller.getAllParsedValues(t));t._cache.$bar=Oi(i.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let i,r,o,a,s=e._length;const u=()=>{32767!==o&&-32768!==o&&(Ve(a)&&(s=Math.min(s,Math.abs(o-a)||s)),a=o)};for(i=0,r=n.length;i<r;++i)o=e.getPixelForValue(n[i]),u();for(a=void 0,i=0,r=e.ticks.length;i<r;++i)o=e.getPixelForTick(i),u();return s}function Wr(t,e,n,i){return xe(t)?function(t,e,n,i){const r=n.parse(t[0],i),o=n.parse(t[1],i),a=Math.min(r,o),s=Math.max(r,o);let u=a,l=s;Math.abs(a)>Math.abs(s)&&(u=s,l=a),e[n.axis]=l,e._custom={barStart:u,barEnd:l,start:r,end:o,min:a,max:s}}(t,e,n,i):e[n.axis]=n.parse(t,i),e}function Hr(t,e,n,i){const r=t.iScale,o=t.vScale,a=r.getLabels(),s=r===o,u=[];let l,c,h,d;for(l=n,c=n+i;l<c;++l)d=e[l],h={},h[r.axis]=s||r.parse(a[l],l),u.push(Wr(d,h,o,l));return u}function qr(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function $r(t,e,n,i){let r=e.borderSkipped;const o={};if(!r)return void(t.borderSkipped=o);const{start:a,end:s,reverse:u,top:l,bottom:c}=function(t){let e,n,i,r,o;return t.horizontal?(e=t.base>t.x,n="left",i="right"):(e=t.base<t.y,n="bottom",i="top"),e?(r="end",o="start"):(r="start",o="end"),{start:n,end:i,reverse:e,top:r,bottom:o}}(t);"middle"===r&&n&&(t.enableBorderRadius=!0,(n._top||0)===i?r=l:(n._bottom||0)===i?r=c:(o[Yr(c,a,s,u)]=!0,r=l)),o[Yr(r,a,s,u)]=!0,t.borderSkipped=o}function Yr(t,e,n,i){var r,o,a;return i?(a=n,t=Xr(t=(r=t)===(o=e)?a:r===a?o:r,n,e)):t=Xr(t,e,n),t}function Xr(t,e,n){return"start"===t?e:"end"===t?n:t}function Kr(t,{inflateAmount:e},n){t.inflateAmount="auto"===e?1===n?.33:0:e}Ur.defaults={},Ur.prototype.datasetElementType=null,Ur.prototype.dataElementType=null;class Zr extends Ur{parsePrimitiveData(t,e,n,i){return Hr(t,e,n,i)}parseArrayData(t,e,n,i){return Hr(t,e,n,i)}parseObjectData(t,e,n,i){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:s="y"}=this._parsing,u="x"===r.axis?a:s,l="x"===o.axis?a:s,c=[];let h,d,f,p;for(h=n,d=n+i;h<d;++h)p=e[h],f={},f[r.axis]=r.parse(Ne(p,u),h),c.push(Wr(Ne(p,l),f,o,h));return c}updateRangeFromParsed(t,e,n,i){super.updateRangeFromParsed(t,e,n,i);const r=n._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:n,vScale:i}=e,r=this.getParsed(t),o=r._custom,a=qr(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(r[i.axis]);return{label:""+n.getLabelForValue(r[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,n,i){const r="reset"===i,{index:o,_cachedMeta:{vScale:a}}=this,s=a.getBasePixel(),u=a.isHorizontal(),l=this._getRuler(),c=this.resolveDataElementOptions(e,i),h=this.getSharedOptions(c),d=this.includeOptions(i,h);this.updateSharedOptions(h,i,c);for(let c=e;c<e+n;c++){const e=this.getParsed(c),n=r||Ee(e[a.axis])?{base:s,head:s}:this._calculateBarValuePixels(c),f=this._calculateBarIndexPixels(c,l),p=(e._stacks||{})[a.axis],g={horizontal:u,base:n.base,enableBorderRadius:!p||qr(e._custom)||o===p._top||o===p._bottom,x:u?n.head:f.center,y:u?f.center:n.head,height:u?f.size:Math.abs(n.size),width:u?Math.abs(n.size):f.size};d&&(g.options=h||this.resolveDataElementOptions(c,t[c].active?"active":i));const m=g.options||t[c].options;$r(g,m,p,o),Kr(g,m,l.ratio),this.updateElement(t[c],c,g,i)}}_getStacks(t,e){const n=this._cachedMeta.iScale,i=n.getMatchingVisibleMetas(this._type),r=n.options.stacked,o=i.length,a=[];let s,u;for(s=0;s<o;++s)if(u=i[s],u.controller.options.grouped){if(void 0!==e){const t=u.controller.getParsed(e)[u.controller._cachedMeta.vScale.axis];if(Ee(t)||isNaN(t))continue}if((!1===r||-1===a.indexOf(u.stack)||void 0===r&&void 0===u.stack)&&a.push(u.stack),u.index===t)break}return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const i=this._getStacks(t,n),r=void 0!==e?i.indexOf(e):-1;return-1===r?i.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,i=[];let r,o;for(r=0,o=e.data.length;r<o;++r)i.push(n.getPixelForValue(this.getParsed(r)[n.axis],r));const a=t.barThickness;return{min:a||Gr(e),pixels:i,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:n},options:{base:i,minBarLength:r}}=this,o=i||0,a=this.getParsed(t),s=a._custom,u=qr(s);let l,c,h=a[e.axis],d=0,f=n?this.applyStack(e,a,n):h;f!==h&&(d=f-h,f=h),u&&(h=s.barStart,f=s.barEnd-s.barStart,0!==h&&Je(h)!==Je(s.barEnd)&&(d=0),d+=h);const p=Ee(i)||u?d:i;let g=e.getPixelForValue(p);if(l=this.chart.getDataVisibility(t)?e.getPixelForValue(d+f):g,c=l-g,Math.abs(c)<r&&(c=function(t,e,n){return 0!==t?Je(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(c,e,o)*r,h===o&&(g-=c/2),l=g+c),g===e.getPixelForValue(o)){const t=Je(c)*e.getLineWidthForValue(o)/2;g+=t,c-=t}return{size:c,base:g,head:l,center:l+c/2}}_calculateBarIndexPixels(t,e){const n=e.scale,i=this.options,r=i.skipNull,o=ke(i.maxBarThickness,1/0);let a,s;if(e.grouped){const n=r?this._getStackCount(t):e.stackCount,u="flex"===i.barThickness?function(t,e,n,i){const r=e.pixels,o=r[t];let a=t>0?r[t-1]:null,s=t<r.length-1?r[t+1]:null;const u=n.categoryPercentage;null===a&&(a=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-a);const l=o-(o-Math.min(a,s))/2*u;return{chunk:Math.abs(s-a)/2*u/i,ratio:n.barPercentage,start:l}}(t,e,i,n):function(t,e,n,i){const r=n.barThickness;let o,a;return Ee(r)?(o=e.min*n.categoryPercentage,a=n.barPercentage):(o=r*i,a=1),{chunk:o/i,ratio:a,start:e.pixels[t]-o/2}}(t,e,i,n),l=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=u.start+u.chunk*l+u.chunk/2,s=Math.min(o,u.chunk*u.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),s=Math.min(o,e.min*e.ratio);return{base:a-s/2,head:a+s/2,center:a,size:s}}draw(){const t=this._cachedMeta,e=t.vScale,n=t.data,i=n.length;let r=0;for(;r<i;++r)null!==this.getParsed(r)[e.axis]&&n[r].draw(this._ctx)}}Zr.id="bar",Zr.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Zr.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Jr extends Ur{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,n,i){const r=super.parsePrimitiveData(t,e,n,i);for(let t=0;t<r.length;t++)r[t]._custom=this.resolveDataElementOptions(t+n).radius;return r}parseArrayData(t,e,n,i){const r=super.parseArrayData(t,e,n,i);for(let t=0;t<r.length;t++){const i=e[n+t];r[t]._custom=ke(i[2],this.resolveDataElementOptions(t+n).radius)}return r}parseObjectData(t,e,n,i){const r=super.parseObjectData(t,e,n,i);for(let t=0;t<r.length;t++){const i=e[n+t];r[t]._custom=ke(i&&i.r&&+i.r,this.resolveDataElementOptions(t+n).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:n,yScale:i}=e,r=this.getParsed(t),o=n.getLabelForValue(r.x),a=i.getLabelForValue(r.y),s=r._custom;return{label:e.label,value:"("+o+", "+a+(s?", "+s:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:o,vScale:a}=this._cachedMeta,s=this.resolveDataElementOptions(e,i),u=this.getSharedOptions(s),l=this.includeOptions(i,u),c=o.axis,h=a.axis;for(let s=e;s<e+n;s++){const e=t[s],n=!r&&this.getParsed(s),u={},d=u[c]=r?o.getPixelForDecimal(.5):o.getPixelForValue(n[c]),f=u[h]=r?a.getBasePixel():a.getPixelForValue(n[h]);u.skip=isNaN(d)||isNaN(f),l&&(u.options=this.resolveDataElementOptions(s,e.active?"active":i),r&&(u.options.radius=0)),this.updateElement(e,s,u,i)}this.updateSharedOptions(u,i,s)}resolveDataElementOptions(t,e){const n=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const r=i.radius;return"active"!==e&&(i.radius=0),i.radius+=ke(n&&n._custom,r),i}}Jr.id="bubble",Jr.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Jr.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class Qr extends Ur{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const n=this.getDataset().data,i=this._cachedMeta;if(!1===this._parsing)i._parsed=n;else{let r,o,a=t=>+n[t];if(Ae(n[t])){const{key:t="value"}=this._parsing;a=e=>+Ne(n[e],t)}for(r=t,o=t+e;r<o;++r)i._parsed[r]=a(r)}}_getRotation(){return rn(this.options.rotation-90)}_getCircumference(){return rn(this.options.circumference)}_getRotationExtents(){let t=We,e=-We;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)){const i=this.chart.getDatasetMeta(n).controller,r=i._getRotation(),o=i._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:n}=e,i=this._cachedMeta,r=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-o)/2,0),s=Math.min((u=this.options.cutout,l=a,"string"==typeof u&&u.endsWith("%")?parseFloat(u)/100:u/l),1);var u,l;const c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=function(t,e,n){let i=1,r=1,o=0,a=0;if(e<We){const s=t,u=s+e,l=Math.cos(s),c=Math.sin(s),h=Math.cos(u),d=Math.sin(u),f=(t,e,i)=>cn(t,s,u,!0)?1:Math.max(e,e*n,i,i*n),p=(t,e,i)=>cn(t,s,u,!0)?-1:Math.min(e,e*n,i,i*n),g=f(0,l,h),m=f(Ye,c,d),v=p(Ge,l,h),y=p(Ge+Ye,c,d);i=(g-v)/2,r=(m-y)/2,o=-(g+v)/2,a=-(m+y)/2}return{ratioX:i,ratioY:r,offsetX:o,offsetY:a}}(d,h,s),v=(n.width-o)/f,y=(n.height-o)/p,b=Math.max(Math.min(v,y)/2,0),_=Te(this.options.radius,b),E=(_-Math.max(_*s,0))/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=m*_,i.total=this.calculateTotal(),this.outerRadius=_-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const n=this.options,i=this._cachedMeta,r=this._getCircumference();return e&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||null===i._parsed[t]||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*r/We)}updateElements(t,e,n,i){const r="reset"===i,o=this.chart,a=o.chartArea,s=o.options.animation,u=(a.left+a.right)/2,l=(a.top+a.bottom)/2,c=r&&s.animateScale,h=c?0:this.innerRadius,d=c?0:this.outerRadius,f=this.resolveDataElementOptions(e,i),p=this.getSharedOptions(f),g=this.includeOptions(i,p);let m,v=this._getRotation();for(m=0;m<e;++m)v+=this._circumference(m,r);for(m=e;m<e+n;++m){const e=this._circumference(m,r),n=t[m],o={x:u+this.offsetX,y:l+this.offsetY,startAngle:v,endAngle:v+e,circumference:e,outerRadius:d,innerRadius:h};g&&(o.options=p||this.resolveDataElementOptions(m,n.active?"active":i)),v+=e,this.updateElement(n,m,o,i)}this.updateSharedOptions(p,i,f)}calculateTotal(){const t=this._cachedMeta,e=t.data;let n,i=0;for(n=0;n<e.length;n++){const r=t._parsed[n];null===r||isNaN(r)||!this.chart.getDataVisibility(n)||e[n].hidden||(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?We*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=pr(e._parsed[t],n.options.locale);return{label:i[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const n=this.chart;let i,r,o,a,s;if(!t)for(i=0,r=n.data.datasets.length;i<r;++i)if(n.isDatasetVisible(i)){o=n.getDatasetMeta(i),t=o.data,a=o.controller;break}if(!t)return 0;for(i=0,r=t.length;i<r;++i)s=a.resolveDataElementOptions(i),"inner"!==s.borderAlign&&(e=Math.max(e,s.borderWidth||0,s.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let n=0,i=t.length;n<i;++n){const t=this.resolveDataElementOptions(n);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}_getRingWeight(t){return Math.max(ke(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Qr.id="doughnut",Qr.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},Qr.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},Qr.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const n=": "+t.formattedValue;return xe(e)?(e=e.slice(),e[0]+=n):e+=n,e}}}}};class to extends Ur{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:i=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:s}=function(t,e,n){const i=e.length;let r=0,o=i;if(t._sorted){const{iScale:a,_parsed:s}=t,u=a.axis,{min:l,max:c,minDefined:h,maxDefined:d}=a.getUserBounds();h&&(r=hn(Math.min(Ti(s,a.axis,l).lo,n?i:Ti(e,u,a.getPixelForValue(l)).lo),0,i-1)),o=d?hn(Math.max(Ti(s,a.axis,c).hi+1,n?0:Ti(e,u,a.getPixelForValue(c)).hi+1),r,i)-r:i-r}return{start:r,count:o}}(e,i,o);this._drawStart=a,this._drawCount=s,function(t){const{xScale:e,yScale:n,_scaleRanges:i}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!i)return t._scaleRanges=r,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),o}(e)&&(a=0,s=i.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!r._decimated,n.points=i;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(n,void 0,{animated:!o,options:u},t),this.updateElements(i,a,s,t)}updateElements(t,e,n,i){const r="reset"===i,{iScale:o,vScale:a,_stacked:s,_dataset:u}=this._cachedMeta,l=this.resolveDataElementOptions(e,i),c=this.getSharedOptions(l),h=this.includeOptions(i,c),d=o.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=tn(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||"none"===i;let y=e>0&&this.getParsed(e-1);for(let l=e;l<e+n;++l){const e=t[l],n=this.getParsed(l),p=v?e:{},b=Ee(n[f]),_=p[d]=o.getPixelForValue(n[d],l),E=p[f]=r||b?a.getBasePixel():a.getPixelForValue(s?this.applyStack(a,n,s):n[f],l);p.skip=isNaN(_)||isNaN(E)||b,p.stop=l>0&&n[d]-y[d]>m,g&&(p.parsed=n,p.raw=u.data[l]),h&&(p.options=c||this.resolveDataElementOptions(l,e.active?"active":i)),v||this.updateElement(e,l,p,i),y=n}this.updateSharedOptions(c,i,l)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return n;const r=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}to.id="line",to.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},to.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class eo extends Ur{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,i=n.data.labels||[],r=pr(e._parsed[t].r,n.options.locale);return{label:i[t]||"",value:r}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(i/2,0),o=(r-Math.max(n.cutoutPercentage?r/100*n.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,n,i){const r="reset"===i,o=this.chart,a=this.getDataset(),s=o.options.animation,u=this._cachedMeta.rScale,l=u.xCenter,c=u.yCenter,h=u.getIndexAngle(0)-.5*Ge;let d,f=h;const p=360/this.countVisibleElements();for(d=0;d<e;++d)f+=this._computeAngle(d,i,p);for(d=e;d<e+n;d++){const e=t[d];let n=f,g=f+this._computeAngle(d,i,p),m=o.getDataVisibility(d)?u.getDistanceFromCenterForValue(a.data[d]):0;f=g,r&&(s.animateScale&&(m=0),s.animateRotate&&(n=g=h));const v={x:l,y:c,innerRadius:0,outerRadius:m,startAngle:n,endAngle:g,options:this.resolveDataElementOptions(d,e.active?"active":i)};this.updateElement(e,d,v,i)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let n=0;return e.data.forEach(((e,i)=>{!isNaN(t.data[i])&&this.chart.getDataVisibility(i)&&n++})),n}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?rn(this.resolveDataElementOptions(t,e).angle||n):0}}eo.id="polarArea",eo.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},eo.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n}}=t.legend.options;return e.labels.map(((e,i)=>{const r=t.getDatasetMeta(0).controller.getStyle(i);return{text:e,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(i),index:i}}))}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class no extends Qr{}no.id="pie",no.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class io extends Ur{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}update(t){const e=this._cachedMeta,n=e.dataset,i=e.data||[],r=e.iScale.getLabels();if(n.points=i,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===i.length,options:e};this.updateElement(n,void 0,o,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,n,i){const r=this.getDataset(),o=this._cachedMeta.rScale,a="reset"===i;for(let s=e;s<e+n;s++){const e=t[s],n=this.resolveDataElementOptions(s,e.active?"active":i),u=o.getPointPositionForValue(s,r.data[s]),l=a?o.xCenter:u.x,c=a?o.yCenter:u.y,h={x:l,y:c,angle:u.angle,skip:isNaN(l)||isNaN(c),options:n};this.updateElement(e,s,h,i)}}}io.id="radar",io.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},io.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class ro extends to{}ro.id="scatter",ro.defaults={showLine:!1,fill:!1},ro.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var oo=Object.freeze({__proto__:null,BarController:Zr,BubbleController:Jr,DoughnutController:Qr,LineController:to,PolarAreaController:eo,PieController:no,RadarController:io,ScatterController:ro});function ao(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class so{constructor(t){this.options=t||{}}formats(){return ao()}parse(t,e){return ao()}format(t,e){return ao()}add(t,e,n){return ao()}diff(t,e,n){return ao()}startOf(t,e,n){return ao()}endOf(t,e){return ao()}}so.override=function(t){Object.assign(so.prototype,t)};var uo={_date:so};function lo(t,e){return"native"in t?{x:t.x,y:t.y}:rr(t,e)}function co(t,e,n,i){const{controller:r,data:o,_sorted:a}=t,s=r._cachedMeta.iScale;if(s&&e===s.axis&&a&&o.length){const t=s._reversePixels?Ci:Ti;if(!i)return t(o,e,n);if(r._sharedOptions){const i=o[0],r="function"==typeof i.getRange&&i.getRange(e);if(r){const i=t(o,e,n-r),a=t(o,e,n+r);return{lo:i.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function ho(t,e,n,i,r){const o=t.getSortedVisibleDatasetMetas(),a=n[e];for(let t=0,n=o.length;t<n;++t){const{index:n,data:s}=o[t],{lo:u,hi:l}=co(o[t],e,a,r);for(let t=u;t<=l;++t){const e=s[t];e.skip||i(e,n,t)}}}function fo(t,e,n,i){const r=[];if(!ui(e,t.chartArea,t._minPadding))return r;return ho(t,n,e,(function(t,n,o){t.inRange(e.x,e.y,i)&&r.push({element:t,datasetIndex:n,index:o})}),!0),r}function po(t,e,n,i,r){const o=function(t){const e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,i){const r=e?Math.abs(t.x-i.x):0,o=n?Math.abs(t.y-i.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}(n);let a=Number.POSITIVE_INFINITY,s=[];if(!ui(e,t.chartArea,t._minPadding))return s;return ho(t,n,e,(function(n,u,l){if(i&&!n.inRange(e.x,e.y,r))return;const c=n.getCenterPoint(r);if(!ui(c,t.chartArea,t._minPadding)&&!n.inRange(e.x,e.y,r))return;const h=o(e,c);h<a?(s=[{element:n,datasetIndex:u,index:l}],a=h):h===a&&s.push({element:n,datasetIndex:u,index:l})})),s}function go(t,e,n,i){const r=lo(e,t),o=[],a=n.axis,s="x"===a?"inXRange":"inYRange";let u=!1;return function(t,e){const n=t.getSortedVisibleDatasetMetas();let i,r,o;for(let t=0,a=n.length;t<a;++t){({index:i,data:r}=n[t]);for(let t=0,n=r.length;t<n;++t)o=r[t],o.skip||e(o,i,t)}}(t,((t,e,n)=>{t[s](r[a],i)&&o.push({element:t,datasetIndex:e,index:n}),t.inRange(r.x,r.y,i)&&(u=!0)})),n.intersect&&!u?[]:o}var mo={modes:{index(t,e,n,i){const r=lo(e,t),o=n.axis||"x",a=n.intersect?fo(t,r,o,i):po(t,r,o,!1,i),s=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,n=t.data[e];n&&!n.skip&&s.push({element:n,datasetIndex:t.index,index:e})})),s):[]},dataset(t,e,n,i){const r=lo(e,t),o=n.axis||"xy";let a=n.intersect?fo(t,r,o,i):po(t,r,o,!1,i);if(a.length>0){const e=a[0].datasetIndex,n=t.getDatasetMeta(e).data;a=[];for(let t=0;t<n.length;++t)a.push({element:n[t],datasetIndex:e,index:t})}return a},point:(t,e,n,i)=>fo(t,lo(e,t),n.axis||"xy",i),nearest:(t,e,n,i)=>po(t,lo(e,t),n.axis||"xy",n.intersect,i),x:(t,e,n,i)=>go(t,e,{axis:"x",intersect:n.intersect},i),y:(t,e,n,i)=>go(t,e,{axis:"y",intersect:n.intersect},i)}};const vo=["left","top","right","bottom"];function yo(t,e){return t.filter((t=>t.pos===e))}function bo(t,e){return t.filter((t=>-1===vo.indexOf(t.pos)&&t.box.axis===e))}function _o(t,e){return t.sort(((t,n)=>{const i=e?n:t,r=e?t:n;return i.weight===r.weight?i.index-r.index:i.weight-r.weight}))}function Eo(t,e){const n=function(t){const e={};for(const n of t){const{stack:t,pos:i,stackWeight:r}=n;if(!t||!vo.includes(i))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return e}(t),{vBoxMaxWidth:i,hBoxMaxHeight:r}=e;let o,a,s;for(o=0,a=t.length;o<a;++o){s=t[o];const{fullSize:a}=s.box,u=n[s.stack],l=u&&s.stackWeight/u.weight;s.horizontal?(s.width=l?l*i:a&&e.availableWidth,s.height=r):(s.width=i,s.height=l?l*r:a&&e.availableHeight)}return n}function xo(t,e,n,i){return Math.max(t[n],e[n])+Math.max(t[i],e[i])}function Ao(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Do(t,e,n,i){const{pos:r,box:o}=n,a=t.maxPadding;if(!Ae(r)){n.size&&(t[r]-=n.size);const e=i[n.stack]||{size:0,count:1};e.size=Math.max(e.size,n.horizontal?o.height:o.width),n.size=e.size/e.count,t[r]+=n.size}o.getPadding&&Ao(a,o.getPadding());const s=Math.max(0,e.outerWidth-xo(a,t,"left","right")),u=Math.max(0,e.outerHeight-xo(a,t,"top","bottom")),l=s!==t.w,c=u!==t.h;return t.w=s,t.h=u,n.horizontal?{same:l,other:c}:{same:c,other:l}}function wo(t,e){const n=e.maxPadding;function i(t){const i={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{i[t]=Math.max(e[t],n[t])})),i}return i(t?["left","right"]:["top","bottom"])}function ko(t,e,n,i){const r=[];let o,a,s,u,l,c;for(o=0,a=t.length,l=0;o<a;++o){s=t[o],u=s.box,u.update(s.width||e.w,s.height||e.h,wo(s.horizontal,e));const{same:a,other:h}=Do(e,n,s,i);l|=a&&r.length,c=c||h,u.fullSize||r.push(s)}return l&&ko(r,e,n,i)||c}function To(t,e,n,i,r){t.top=n,t.left=e,t.right=e+i,t.bottom=n+r,t.width=i,t.height=r}function Co(t,e,n,i){const r=n.padding;let{x:o,y:a}=e;for(const s of t){const t=s.box,u=i[s.stack]||{count:1,placed:0,weight:1},l=s.stackWeight/u.weight||1;if(s.horizontal){const i=e.w*l,o=u.size||t.height;Ve(u.start)&&(a=u.start),t.fullSize?To(t,r.left,a,n.outerWidth-r.right-r.left,o):To(t,e.left+u.placed,a,i,o),u.start=a,u.placed+=i,a=t.bottom}else{const i=e.h*l,a=u.size||t.width;Ve(u.start)&&(o=u.start),t.fullSize?To(t,o,r.top,a,n.outerHeight-r.bottom-r.top):To(t,o,e.top+u.placed,a,i),u.start=o,u.placed+=i,o=t.right}}e.x=o,e.y=a}ni.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var So={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,i){if(!t)return;const r=xi(t.options.layout.padding),o=Math.max(e-r.width,0),a=Math.max(n-r.height,0),s=function(t){const e=function(t){const e=[];let n,i,r,o,a,s;for(n=0,i=(t||[]).length;n<i;++n)r=t[n],({position:o,options:{stack:a,stackWeight:s=1}}=r),e.push({index:n,box:r,pos:o,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&o+a,stackWeight:s});return e}(t),n=_o(e.filter((t=>t.box.fullSize)),!0),i=_o(yo(e,"left"),!0),r=_o(yo(e,"right")),o=_o(yo(e,"top"),!0),a=_o(yo(e,"bottom")),s=bo(e,"x"),u=bo(e,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:r.concat(u).concat(a).concat(s),chartArea:yo(e,"chartArea"),vertical:i.concat(r).concat(u),horizontal:o.concat(a).concat(s)}}(t.boxes),u=s.vertical,l=s.horizontal;Se(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=u.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},r);Ao(d,xi(i));const f=Object.assign({maxPadding:d,w:o,h:a,x:r.left,y:r.top},r),p=Eo(u.concat(l),h);ko(s.fullSize,f,h,p),ko(u,f,h,p),ko(l,f,h,p)&&ko(u,f,h,p),function(t){const e=t.maxPadding;function n(n){const i=Math.max(e[n]-t[n],0);return t[n]+=i,i}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(f),Co(s.leftAndTop,f,h,p),f.x+=f.w,f.y+=f.h,Co(s.rightAndBottom,f,h,p),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Se(s.chartArea,(e=>{const n=e.box;Object.assign(n,t.chartArea),n.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class Io{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,i){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):n)}}isAttached(t){return!0}updateConfig(t){}}class Oo extends Io{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ro={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Mo=t=>null===t||""===t;const Lo=!!ur&&{passive:!0};function Po(t,e,n){t.canvas.removeEventListener(e,n,Lo)}function Fo(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function Bo(t,e,n){const i=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Fo(n.addedNodes,i),e=e&&!Fo(n.removedNodes,i);e&&n()}));return r.observe(document,{childList:!0,subtree:!0}),r}function No(t,e,n){const i=t.canvas,r=new MutationObserver((t=>{let e=!1;for(const n of t)e=e||Fo(n.removedNodes,i),e=e&&!Fo(n.addedNodes,i);e&&n()}));return r.observe(document,{childList:!0,subtree:!0}),r}const jo=new Map;let Vo=0;function zo(){const t=window.devicePixelRatio;t!==Vo&&(Vo=t,jo.forEach(((e,n)=>{n.currentDevicePixelRatio!==t&&e()})))}function Uo(t,e,n){const i=t.canvas,r=i&&Qi(i);if(!r)return;const o=me(((t,e)=>{const i=r.clientWidth;n(t,e),i<r.clientWidth&&n()}),window),a=new ResizeObserver((t=>{const e=t[0],n=e.contentRect.width,i=e.contentRect.height;0===n&&0===i||o(n,i)}));return a.observe(r),function(t,e){jo.size||window.addEventListener("resize",zo),jo.set(t,e)}(t,o),a}function Go(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){jo.delete(t),jo.size||window.removeEventListener("resize",zo)}(t)}function Wo(t,e,n){const i=t.canvas,r=me((e=>{null!==t.ctx&&n(function(t,e){const n=Ro[t.type]||t.type,{x:i,y:r}=rr(t,e);return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==r?r:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,n){t.addEventListener(e,n,Lo)}(i,e,r),r}class Ho extends Io{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){const n=t.style,i=t.getAttribute("height"),r=t.getAttribute("width");if(t.$chartjs={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Mo(r)){const e=lr(t,"width");void 0!==e&&(t.width=e)}if(Mo(i))if(""===t.style.height)t.height=t.width/(e||2);else{const e=lr(t,"height");void 0!==e&&(t.height=e)}}(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const n=e.$chartjs.initial;["height","width"].forEach((t=>{const i=n[t];Ee(i)?e.removeAttribute(t):e.setAttribute(t,i)}));const i=n.style||{};return Object.keys(i).forEach((t=>{e.style[t]=i[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,n){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),r={attach:Bo,detach:No,resize:Uo}[e]||Wo;i[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),i=n[e];if(!i)return;({attach:Go,detach:Go,resize:Go}[e]||Po)(t,e,i),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,i){return ar(t,e,n,i)}isAttached(t){const e=Qi(t);return!(!e||!e.isConnected)}}class qo{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return tn(this.x)&&tn(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const i={};return t.forEach((t=>{i[t]=n[t]&&n[t].active()?n[t]._to:this[t]})),i}}qo.defaults={},qo.defaultRoutes=void 0;const $o={values:t=>xe(t)?t:""+t,numeric(t,e,n){if(0===t)return"0";const i=this.chart.options.locale;let r,o=t;if(n.length>1){const e=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(e<1e-4||e>1e15)&&(r="scientific"),o=function(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t));return n}(t,n)}const a=Ze(Math.abs(o)),s=Math.max(Math.min(-1*Math.floor(a),20),0),u={notation:r,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(u,this.options.ticks.format),pr(t,i,u)},logarithmic(t,e,n){if(0===t)return"0";const i=t/Math.pow(10,Math.floor(Ze(t)));return 1===i||2===i||5===i?$o.numeric.call(this,t,e,n):""}};var Yo={formatters:$o};function Xo(t,e){const n=t.options.ticks,i=n.maxTicksLimit||function(t){const e=t.options.offset,n=t._tickSize(),i=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(i,r))}(t),r=n.major.enabled?function(t){const e=[];let n,i;for(n=0,i=t.length;n<i;n++)t[n].major&&e.push(n);return e}(e):[],o=r.length,a=r[0],s=r[o-1],u=[];if(o>i)return function(t,e,n,i){let r,o=0,a=n[0];for(i=Math.ceil(i),r=0;r<t.length;r++)r===a&&(e.push(t[r]),o++,a=n[o*i])}(e,u,r,o/i),u;const l=function(t,e,n){const i=function(t){const e=t.length;let n,i;if(e<2)return!1;for(i=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==i)return!1;return i}(t),r=e.length/n;if(!i)return Math.max(r,1);const o=function(t){const e=[],n=Math.sqrt(t);let i;for(i=1;i<n;i++)t%i==0&&(e.push(i),e.push(t/i));return n===(0|n)&&e.push(n),e.sort(((t,e)=>t-e)).pop(),e}(i);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>r)return e}return Math.max(r,1)}(r,e,i);if(o>0){let t,n;const i=o>1?Math.round((s-a)/(o-1)):null;for(Ko(e,u,l,Ee(i)?0:a-i,a),t=0,n=o-1;t<n;t++)Ko(e,u,l,r[t],r[t+1]);return Ko(e,u,l,s,Ee(i)?e.length:s+i),u}return Ko(e,u,l),u}function Ko(t,e,n,i,r){const o=ke(i,0),a=Math.min(ke(r,t.length),t.length);let s,u,l,c=0;for(n=Math.ceil(n),r&&(s=r-i,n=s/Math.floor(s/n)),l=o;l<0;)c++,l=Math.round(o+c*n);for(u=Math.max(o,0);u<a;u++)u===l&&(e.push(t[u]),c++,l=Math.round(o+c*n))}ni.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Yo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),ni.route("scale.ticks","color","","color"),ni.route("scale.grid","color","","borderColor"),ni.route("scale.grid","borderColor","","borderColor"),ni.route("scale.title","color","","color"),ni.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),ni.describe("scales",{_fallback:"scale"}),ni.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Zo=(t,e,n)=>"top"===e||"left"===e?t[e]+n:t[e]-n;function Jo(t,e){const n=[],i=t.length/e,r=t.length;let o=0;for(;o<r;o+=i)n.push(t[Math.floor(o)]);return n}function Qo(t,e,n){const i=t.ticks.length,r=Math.min(e,i-1),o=t._startPixel,a=t._endPixel,s=1e-6;let u,l=t.getPixelForTick(r);if(!(n&&(u=1===i?Math.max(l-o,a-l):0===e?(t.getPixelForTick(1)-l)/2:(l-t.getPixelForTick(r-1))/2,l+=r<e?u:-u,l<o-s||l>a+s)))return l}function ta(t){return t.drawTicks?t.tickLength:0}function ea(t,e){if(!t.display)return 0;const n=Ai(t.font,e),i=xi(t.padding);return(xe(t.text)?t.text.length:1)*n.lineHeight+i.height}function na(t,e,n){let i=ve(t);return(n&&"right"!==e||!n&&"right"===e)&&(i=(t=>"left"===t?"right":"right"===t?"left":t)(i)),i}class ia extends qo{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:n,_suggestedMax:i}=this;return t=we(t,Number.POSITIVE_INFINITY),e=we(e,Number.NEGATIVE_INFINITY),n=we(n,Number.POSITIVE_INFINITY),i=we(i,Number.NEGATIVE_INFINITY),{min:we(t,n),max:we(e,i),minDefined:De(t),maxDefined:De(e)}}getMinMax(t){let e,{min:n,max:i,minDefined:r,maxDefined:o}=this.getUserBounds();if(r&&o)return{min:n,max:i};const a=this.getMatchingVisibleMetas();for(let s=0,u=a.length;s<u;++s)e=a[s].controller.getMinMax(this,t),r||(n=Math.min(n,e.min)),o||(i=Math.max(i,e.max));return n=o&&n>i?i:n,i=r&&n>i?n:i,{min:we(n,we(i,n)),max:we(i,we(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ce(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:i,grace:r,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=function(t,e,n){const{min:i,max:r}=t,o=Te(e,(r-i)/2),a=(t,e)=>n&&0===t?0:t+e;return{min:a(i,-Math.abs(o)),max:a(r,o)}}(this,r,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const s=a<this.ticks.length;this._convertTicksToLabels(s?Jo(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=Xo(this,this.ticks),this._labelSizes=null),s&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,n=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,n=!n),this._startPixel=t,this._endPixel=e,this._reversePixels=n,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ce(this.options.afterUpdate,[this])}beforeSetDimensions(){Ce(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Ce(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ce(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ce(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let n,i,r;for(n=0,i=t.length;n<i;n++)r=t[n],r.label=Ce(e.callback,[r.value,n,t],this)}afterTickToLabelConversion(){Ce(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ce(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,n=this.ticks.length,i=e.minRotation||0,r=e.maxRotation;let o,a,s,u=i;if(!this._isVisible()||!e.display||i>=r||n<=1||!this.isHorizontal())return void(this.labelRotation=i);const l=this._getLabelSizes(),c=l.widest.width,h=l.highest.height,d=hn(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/n:d/(n-1),c+6>o&&(o=d/(n-(t.offset?.5:1)),a=this.maxHeight-ta(t.grid)-e.padding-ea(t.title,this.chart.options.font),s=Math.sqrt(c*c+h*h),u=on(Math.min(Math.asin(hn((l.highest.height+6)/o,-1,1)),Math.asin(hn(a/s,-1,1))-Math.asin(hn(h/s,-1,1)))),u=Math.max(i,Math.min(r,u))),this.labelRotation=u}afterCalculateLabelRotation(){Ce(this.options.afterCalculateLabelRotation,[this])}beforeFit(){Ce(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:i,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=ea(i,e.options.font);if(a?(t.width=this.maxWidth,t.height=ta(r)+o):(t.height=this.maxHeight,t.width=ta(r)+o),n.display&&this.ticks.length){const{first:e,last:i,widest:r,highest:o}=this._getLabelSizes(),s=2*n.padding,u=rn(this.labelRotation),l=Math.cos(u),c=Math.sin(u);if(a){const e=n.mirror?0:c*r.width+l*o.height;t.height=Math.min(this.maxHeight,t.height+e+s)}else{const e=n.mirror?0:l*r.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+s)}this._calculatePadding(e,i,c,l)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,n,i){const{ticks:{align:r,padding:o},position:a}=this.options,s=0!==this.labelRotation,u="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,h=0;s?u?(c=i*t.width,h=n*e.height):(c=n*t.height,h=i*e.width):"start"===r?h=e.width:"end"===r?c=t.width:(c=t.width/2,h=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((h-l+o)*this.width/(this.width-l),0)}else{let n=e.height/2,i=t.height/2;"start"===r?(n=0,i=t.height):"end"===r&&(n=e.height,i=0),this.paddingTop=n+o,this.paddingBottom=i+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ce(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,n;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,n=t.length;e<n;e++)Ee(t[e].label)&&(t.splice(e,1),n--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let n=this.ticks;e<n.length&&(n=Jo(n,e)),this._labelSizes=t=this._computeLabelSizes(n,n.length)}return t}_computeLabelSizes(t,e){const{ctx:n,_longestTextCache:i}=this,r=[],o=[];let a,s,u,l,c,h,d,f,p,g,m,v=0,y=0;for(a=0;a<e;++a){if(l=t[a].label,c=this._resolveTickFontOptions(a),n.font=h=c.string,d=i[h]=i[h]||{data:{},gc:[]},f=c.lineHeight,p=g=0,Ee(l)||xe(l)){if(xe(l))for(s=0,u=l.length;s<u;++s)m=l[s],Ee(m)||xe(m)||(p=ii(n,d.data,d.gc,p,m),g+=f)}else p=ii(n,d.data,d.gc,p,l),g=f;r.push(p),o.push(g),v=Math.max(p,v),y=Math.max(g,y)}!function(t,e){Se(t,(t=>{const n=t.gc,i=n.length/2;let r;if(i>e){for(r=0;r<i;++r)delete t.data[n[r]];n.splice(0,i)}}))}(i,e);const b=r.indexOf(v),_=o.indexOf(y),E=t=>({width:r[t]||0,height:o[t]||0});return{first:E(0),last:E(e-1),widest:E(b),highest:E(_),widths:r,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return hn(this._alignToPixels?oi(this.chart,e,0):e,-32768,32767)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const n=e[t];return n.$context||(n.$context=function(t,e,n){return wi(t,{tick:n,index:e,type:"tick"})}(this.getContext(),t,n))}return this.$context||(this.$context=wi(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=rn(this.labelRotation),n=Math.abs(Math.cos(e)),i=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,s=r?r.highest.height+o:0;return this.isHorizontal()?s*n>a*i?a/n:s/i:s*i<a*n?s/n:a/i}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,n=this.chart,i=this.options,{grid:r,position:o}=i,a=r.offset,s=this.isHorizontal(),u=this.ticks.length+(a?1:0),l=ta(r),c=[],h=r.setContext(this.getContext()),d=h.drawBorder?h.borderWidth:0,f=d/2,p=function(t){return oi(n,t,d)};let g,m,v,y,b,_,E,x,A,D,w,k;if("top"===o)g=p(this.bottom),_=this.bottom-l,x=g-f,D=p(t.top)+f,k=t.bottom;else if("bottom"===o)g=p(this.top),D=t.top,k=p(t.bottom)-f,_=g+f,x=this.top+l;else if("left"===o)g=p(this.right),b=this.right-l,E=g-f,A=p(t.left)+f,w=t.right;else if("right"===o)g=p(this.left),A=t.left,w=p(t.right)-f,b=g+f,E=this.left+l;else if("x"===e){if("center"===o)g=p((t.top+t.bottom)/2+.5);else if(Ae(o)){const t=Object.keys(o)[0],e=o[t];g=p(this.chart.scales[t].getPixelForValue(e))}D=t.top,k=t.bottom,_=g+f,x=_+l}else if("y"===e){if("center"===o)g=p((t.left+t.right)/2);else if(Ae(o)){const t=Object.keys(o)[0],e=o[t];g=p(this.chart.scales[t].getPixelForValue(e))}b=g-f,E=b-l,A=t.left,w=t.right}const T=ke(i.ticks.maxTicksLimit,u),C=Math.max(1,Math.ceil(u/T));for(m=0;m<u;m+=C){const t=r.setContext(this.getContext(m)),e=t.lineWidth,i=t.color,o=r.borderDash||[],u=t.borderDashOffset,l=t.tickWidth,h=t.tickColor,d=t.tickBorderDash||[],f=t.tickBorderDashOffset;v=Qo(this,m,a),void 0!==v&&(y=oi(n,v,e),s?b=E=A=w=y:_=x=D=k=y,c.push({tx1:b,ty1:_,tx2:E,ty2:x,x1:A,y1:D,x2:w,y2:k,width:e,color:i,borderDash:o,borderDashOffset:u,tickWidth:l,tickColor:h,tickBorderDash:d,tickBorderDashOffset:f}))}return this._ticksLength=u,this._borderValue=g,c}_computeLabelItems(t){const e=this.axis,n=this.options,{position:i,ticks:r}=n,o=this.isHorizontal(),a=this.ticks,{align:s,crossAlign:u,padding:l,mirror:c}=r,h=ta(n.grid),d=h+l,f=c?-l:d,p=-rn(this.labelRotation),g=[];let m,v,y,b,_,E,x,A,D,w,k,T,C="middle";if("top"===i)E=this.bottom-f,x=this._getXAxisLabelAlignment();else if("bottom"===i)E=this.top+f,x=this._getXAxisLabelAlignment();else if("left"===i){const t=this._getYAxisLabelAlignment(h);x=t.textAlign,_=t.x}else if("right"===i){const t=this._getYAxisLabelAlignment(h);x=t.textAlign,_=t.x}else if("x"===e){if("center"===i)E=(t.top+t.bottom)/2+d;else if(Ae(i)){const t=Object.keys(i)[0],e=i[t];E=this.chart.scales[t].getPixelForValue(e)+d}x=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===i)_=(t.left+t.right)/2-d;else if(Ae(i)){const t=Object.keys(i)[0],e=i[t];_=this.chart.scales[t].getPixelForValue(e)}x=this._getYAxisLabelAlignment(h).textAlign}"y"===e&&("start"===s?C="top":"end"===s&&(C="bottom"));const S=this._getLabelSizes();for(m=0,v=a.length;m<v;++m){y=a[m],b=y.label;const t=r.setContext(this.getContext(m));A=this.getPixelForTick(m)+r.labelOffset,D=this._resolveTickFontOptions(m),w=D.lineHeight,k=xe(b)?b.length:1;const e=k/2,n=t.color,s=t.textStrokeColor,l=t.textStrokeWidth;let h;if(o?(_=A,T="top"===i?"near"===u||0!==p?-k*w+w/2:"center"===u?-S.highest.height/2-e*w+w:-S.highest.height+w/2:"near"===u||0!==p?w/2:"center"===u?S.highest.height/2-e*w:S.highest.height-k*w,c&&(T*=-1)):(E=A,T=(1-k)*w/2),t.showLabelBackdrop){const e=xi(t.backdropPadding),n=S.heights[m],i=S.widths[m];let r=E+T-e.top,o=_-e.left;switch(C){case"middle":r-=n/2;break;case"bottom":r-=n}switch(x){case"center":o-=i/2;break;case"right":o-=i}h={left:o,top:r,width:i+e.width,height:n+e.height,color:t.backdropColor}}g.push({rotation:p,label:b,font:D,color:n,strokeColor:s,strokeWidth:l,textOffset:T,textAlign:x,textBaseline:C,translation:[_,E],backdrop:h})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-rn(this.labelRotation))return"top"===t?"left":"right";let n="center";return"start"===e.align?n="left":"end"===e.align&&(n="right"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:i,padding:r}}=this.options,o=t+r,a=this._getLabelSizes().widest.width;let s,u;return"left"===e?i?(u=this.right+r,"near"===n?s="left":"center"===n?(s="center",u+=a/2):(s="right",u+=a)):(u=this.right-o,"near"===n?s="right":"center"===n?(s="center",u-=a/2):(s="left",u=this.left)):"right"===e?i?(u=this.left+r,"near"===n?s="right":"center"===n?(s="center",u-=a/2):(s="left",u-=a)):(u=this.left+o,"near"===n?s="left":"center"===n?(s="center",u+=a/2):(s="right",u=this.right)):s="right",{textAlign:s,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:i,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,i,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex((e=>e.value===t));if(n>=0){return e.setContext(this.getContext(n)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,n=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(t,e,i)=>{i.width&&i.color&&(n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset,n.beginPath(),n.moveTo(t.x,t.y),n.lineTo(e.x,e.y),n.stroke(),n.restore())};if(e.display)for(r=0,o=i.length;r<o;++r){const t=i[r];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:n}}=this,i=n.setContext(this.getContext()),r=n.drawBorder?i.borderWidth:0;if(!r)return;const o=n.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let s,u,l,c;this.isHorizontal()?(s=oi(t,this.left,r)-r/2,u=oi(t,this.right,o)+o/2,l=c=a):(l=oi(t,this.top,r)-r/2,c=oi(t,this.bottom,o)+o/2,s=u=a),e.save(),e.lineWidth=i.borderWidth,e.strokeStyle=i.borderColor,e.beginPath(),e.moveTo(s,l),e.lineTo(u,c),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,n=this._computeLabelArea();n&&li(e,n);const i=this._labelItems||(this._labelItems=this._computeLabelItems(t));let r,o;for(r=0,o=i.length;r<o;++r){const t=i[r],n=t.font,o=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),fi(e,o,0,t.textOffset,n,t)}n&&ci(e)}drawTitle(){const{ctx:t,options:{position:e,title:n,reverse:i}}=this;if(!n.display)return;const r=Ai(n.font),o=xi(n.padding),a=n.align;let s=r.lineHeight/2;"bottom"===e||"center"===e||Ae(e)?(s+=o.bottom,xe(n.text)&&(s+=r.lineHeight*(n.text.length-1))):s+=o.top;const{titleX:u,titleY:l,maxWidth:c,rotation:h}=function(t,e,n,i){const{top:r,left:o,bottom:a,right:s,chart:u}=t,{chartArea:l,scales:c}=u;let h,d,f,p=0;const g=a-r,m=s-o;if(t.isHorizontal()){if(d=ye(i,o,s),Ae(n)){const t=Object.keys(n)[0],i=n[t];f=c[t].getPixelForValue(i)+g-e}else f="center"===n?(l.bottom+l.top)/2+g-e:Zo(t,n,e);h=s-o}else{if(Ae(n)){const t=Object.keys(n)[0],i=n[t];d=c[t].getPixelForValue(i)-m+e}else d="center"===n?(l.left+l.right)/2-m+e:Zo(t,n,e);f=ye(i,a,r),p="left"===n?-Ye:Ye}return{titleX:d,titleY:f,maxWidth:h,rotation:p}}(this,s,e,a);fi(t,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:h,textAlign:na(a,e,i),textBaseline:"middle",translation:[u,l]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,n=ke(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===ia.prototype.draw?[{z:n,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:n+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",i=[];let r,o;for(r=0,o=e.length;r<o;++r){const o=e[r];o[n]!==this.id||t&&o.type!==t||i.push(o)}return i}_resolveTickFontOptions(t){return Ai(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ra{constructor(t,e,n){this.type=t,this.scope=e,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let n;(function(t){return"id"in t&&"defaults"in t})(e)&&(n=this.register(e));const i=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in i||(i[r]=t,function(t,e,n){const i=Le(Object.create(null),[n?ni.get(n):{},ni.get(e),t.defaults]);ni.set(e,i),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((n=>{const i=n.split("."),r=i.pop(),o=[t].concat(i).join("."),a=e[n].split("."),s=a.pop(),u=a.join(".");ni.route(o,r,u,s)}))}(e,t.defaultRoutes);t.descriptors&&ni.describe(e,t.descriptors)}(t,o,n),this.override&&ni.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,n=t.id,i=this.scope;n in e&&delete e[n],i&&n in ni[i]&&(delete ni[i][n],this.override&&delete Jn[n])}}var oa=new class{constructor(){this.controllers=new ra(Ur,"datasets",!0),this.elements=new ra(qo,"elements"),this.plugins=new ra(Object,"plugins"),this.scales=new ra(ia,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,n){[...e].forEach((e=>{const i=n||this._getRegistryForType(e);n||i.isForType(e)||i===this.plugins&&e.id?this._exec(t,i,e):Se(e,(e=>{const i=n||this._getRegistryForType(e);this._exec(t,i,e)}))}))}_exec(t,e,n){const i=je(t);Ce(n["before"+i],[],n),e[t](n),Ce(n["after"+i],[],n)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}_get(t,e,n){const i=e.get(t);if(void 0===i)throw new Error('"'+t+'" is not a registered '+n+".");return i}};class aa{constructor(){this._init=[]}notify(t,e,n,i){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(r,t,e,n);return"destroy"===e&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,n,i){i=i||{};for(const r of t){const t=r.plugin;if(!1===Ce(t[n],[e,i,r.options],t)&&i.cancelable)return!1}return!0}invalidate(){Ee(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const n=t&&t.config,i=ke(n.options&&n.options.plugins,{}),r=function(t){const e=[],n=Object.keys(oa.plugins.items);for(let t=0;t<n.length;t++)e.push(oa.getPlugin(n[t]));const i=t.plugins||[];for(let t=0;t<i.length;t++){const n=i[t];-1===e.indexOf(n)&&e.push(n)}return e}(n);return!1!==i||e?function(t,e,n,i){const r=[],o=t.getContext();for(let a=0;a<e.length;a++){const s=e[a],u=sa(n[s.id],i);null!==u&&r.push({plugin:s,options:ua(t.config,s,u,o)})}return r}(t,r,i,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],n=this._cache,i=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(i(e,n),t,"stop"),this._notify(i(n,e),t,"start")}}function sa(t,e){return e||!1!==t?!0===t?{}:t:null}function ua(t,e,n,i){const r=t.pluginScopeKeys(e),o=t.getOptionScopes(n,r);return t.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function la(t,e){const n=ni.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function ca(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||t.charAt(0).toLowerCase();var n}function ha(t){const e=t.options||(t.options={});e.plugins=ke(e.plugins,{}),e.scales=function(t,e){const n=Jn[t.type]||{scales:{}},i=e.scales||{},r=la(t.type,e),o=Object.create(null),a=Object.create(null);return Object.keys(i).forEach((t=>{const e=i[t];if(!Ae(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const s=ca(t,e),u=function(t,e){return t===e?"_index_":"_value_"}(s,r),l=n.scales||{};o[s]=o[s]||t,a[t]=Pe(Object.create(null),[{axis:s},e,l[s],l[u]])})),t.data.datasets.forEach((n=>{const r=n.type||t.type,s=n.indexAxis||la(r,e),u=(Jn[r]||{}).scales||{};Object.keys(u).forEach((t=>{const e=function(t,e){let n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,s),r=n[e+"AxisID"]||o[e]||e;a[r]=a[r]||Object.create(null),Pe(a[r],[{axis:e},i[r],u[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];Pe(e,[ni.scales[e.type],ni.scale])})),a}(t,e)}function da(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const fa=new Map,pa=new Set;function ga(t,e){let n=fa.get(t);return n||(n=e(),fa.set(t,n),pa.add(n)),n}const ma=(t,e,n)=>{const i=Ne(e,n);void 0!==i&&t.add(i)};class va{constructor(t){this._config=function(t){return(t=t||{}).data=da(t.data),ha(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=da(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),ha(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ga(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return ga(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return ga(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return ga(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const n=this._scopeCache;let i=n.get(t);return i&&!e||(i=new Map,n.set(t,i)),i}getOptionScopes(t,e,n){const{options:i,type:r}=this,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;const s=new Set;e.forEach((e=>{t&&(s.add(t),e.forEach((e=>ma(s,t,e)))),e.forEach((t=>ma(s,i,t))),e.forEach((t=>ma(s,Jn[r]||{},t))),e.forEach((t=>ma(s,ni,t))),e.forEach((t=>ma(s,Qn,t)))}));const u=Array.from(s);return 0===u.length&&u.push(Object.create(null)),pa.has(e)&&o.set(e,u),u}chartOptionScopes(){const{options:t,type:e}=this;return[t,Jn[e]||{},ni.datasets[e]||{},{type:e},ni,Qn]}resolveNamedOptions(t,e,n,i=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=ya(this._resolverCache,t,i);let s=o;if(function(t,e){const{isScriptable:n,isIndexable:i}=Li(t);for(const r of e){const e=n(r),o=i(r),a=(o||e)&&t[r];if(e&&(ze(a)||ba(a))||o&&xe(a))return!0}return!1}(o,e)){r.$shared=!1;s=Mi(o,n=ze(n)?n():n,this.createResolver(t,n,a))}for(const t of e)r[t]=s[t];return r}createResolver(t,e,n=[""],i){const{resolver:r}=ya(this._resolverCache,t,n);return Ae(e)?Mi(r,e,void 0,i):r}}function ya(t,e,n){let i=t.get(e);i||(i=new Map,t.set(e,i));const r=n.join();let o=i.get(r);if(!o){o={resolver:Ri(e,n),subPrefixes:n.filter((t=>!t.toLowerCase().includes("hover")))},i.set(r,o)}return o}const ba=t=>Ae(t)&&Object.getOwnPropertyNames(t).reduce(((e,n)=>e||ze(t[n])),!1);const _a=["top","bottom","left","right","chartArea"];function Ea(t,e){return"top"===t||"bottom"===t||-1===_a.indexOf(t)&&"x"===e}function xa(t,e){return function(n,i){return n[t]===i[t]?n[e]-i[e]:n[t]-i[t]}}function Aa(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Ce(n&&n.onComplete,[t],e)}function Da(t){const e=t.chart,n=e.options.animation;Ce(n&&n.onProgress,[t],e)}function wa(t){return Ji()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ka={},Ta=t=>{const e=wa(t);return Object.values(ka).filter((t=>t.canvas===e)).pop()};function Ca(t,e,n){const i=Object.keys(t);for(const r of i){const i=+r;if(i>=e){const o=t[r];delete t[r],(n>0||i>e)&&(t[i+n]=o)}}}class Sa{constructor(t,e){const n=this.config=new va(e),i=wa(t),r=Ta(i);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas can be reused.");const o=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||function(t){return!Ji()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Oo:Ho}(i)),this.platform.updateConfig(n);const a=this.platform.acquireContext(i,o.aspectRatio),s=a&&a.canvas,u=s&&s.height,l=s&&s.width;this.id=_e(),this.ctx=a,this.canvas=s,this.width=l,this.height=u,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new aa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=function(t,e){let n;return function(...i){return e?(clearTimeout(n),n=setTimeout(t,e,i)):t.apply(this,i),e}}((t=>this.update(t)),o.resizeDelay||0),this._dataChanges=[],ka[this.id]=this,a&&s?(wr.listen(this,"complete",Aa),wr.listen(this,"progress",Da),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:i,_aspectRatio:r}=this;return Ee(t)?e&&r?r:i?n/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():sr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ai(this.canvas,this.ctx),this}stop(){return wr.stop(this),this}resize(t,e){wr.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,i=this.canvas,r=n.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,e,r),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,sr(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Ce(n.onResize,[this,o],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){Se(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,i=Object.keys(n).reduce(((t,e)=>(t[e]=!1,t)),{});let r=[];e&&(r=r.concat(Object.keys(e).map((t=>{const n=e[t],i=ca(t,n),r="r"===i,o="x"===i;return{options:n,dposition:r?"chartArea":o?"bottom":"left",dtype:r?"radialLinear":o?"category":"linear"}})))),Se(r,(e=>{const r=e.options,o=r.id,a=ca(o,r),s=ke(r.type,e.dtype);void 0!==r.position&&Ea(r.position,a)===Ea(e.dposition)||(r.position=e.dposition),i[o]=!0;let u=null;if(o in n&&n[o].type===s)u=n[o];else{u=new(oa.getScale(s))({id:o,type:s,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(r,t)})),Se(i,((t,e)=>{t||delete n[e]})),Se(n,(t=>{So.configure(this,t,t.options),So.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort(((t,e)=>t.index-e.index)),n>e){for(let t=e;t<n;++t)this._destroyDatasetMeta(t);t.splice(e,n-e)}this._sortedMetasets=t.slice(0).sort(xa("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,n)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(n)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,i;for(this._removeUnreferencedMetasets(),n=0,i=e.length;n<i;n++){const i=e[n];let r=this.getDatasetMeta(n);const o=i.type||this.config.type;if(r.type&&r.type!==o&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=o,r.indexAxis=i.indexAxis||la(o,this.options),r.order=i.order||0,r.index=n,r.label=""+i.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{const e=oa.getController(o),{datasetElementType:i,dataElementType:a}=ni.datasets[o];Object.assign(e.prototype,{dataElementType:oa.getElement(a),datasetElementType:i&&oa.getElement(i)}),r.controller=new e(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){Se(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),n=!i&&-1===r.indexOf(e);e.buildOrUpdateElements(n),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=n.layout.autoPadding?o:0,this._updateLayout(o),i||Se(r,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(xa("z","_idx")),this._lastEvent&&this._eventHandler(this._lastEvent,!0),this.render()}_updateScales(){Se(this.scales,(t=>{So.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);Ue(e,n)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:i,count:r}of e){Ca(t,i,"_removeElements"===n?-r:r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),i=n(0);for(let t=1;t<e;t++)if(!Ue(i,n(t)))return;return Array.from(i).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;So.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],Se(this.boxes,(t=>{n&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,n=this.data.datasets.length;e<n;++e)this._updateDataset(e,ze(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const n=this.getDatasetMeta(t),i={meta:n,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",i)&&(n.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(wr.has(this)?this.attached&&!wr.running(this)&&wr.start(this):(this.draw(),Aa({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,n=[];let i,r;for(i=0,r=e.length;i<r;++i){const r=e[i];t&&!r.visible||n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,i=!n.disabled,r=this.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(i&&li(e,{left:!1===n.left?0:r.left-n.left,right:!1===n.right?this.width:r.right+n.right,top:!1===n.top?0:r.top-n.top,bottom:!1===n.bottom?this.height:r.bottom+n.bottom}),t.controller.draw(),i&&ci(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}getElementsAtEventForMode(t,e,n,i){const r=mo.modes[e];return"function"==typeof r?r(this,t,n,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let i=n.filter((t=>t&&t._dataset===e)).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(i)),i}getContext(){return this.$context||(this.$context=wi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return"boolean"==typeof n.hidden?!n.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const i=n?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,i);Ve(e)?(r.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),o.update(r,{visible:n}),this.update((e=>e.datasetIndex===t?i:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),wr.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ai(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete ka[this.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(t,e,n)=>{t.offsetX=e,t.offsetY=n,this._eventHandler(t)};Se(this.options.events,(t=>n(t,i)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(n,i)=>{e.addEventListener(this,n,i),t[n]=i},i=(n,i)=>{t[n]&&(e.removeEventListener(this,n,i),delete t[n])},r=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),n("resize",r),n("detach",o)};o=()=>{this.attached=!1,i("resize",r),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){Se(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},Se(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const i=n?"set":"remove";let r,o,a,s;for("dataset"===e&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+i+"DatasetHoverStyle"]()),a=0,s=t.length;a<s;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],n=t.map((({datasetIndex:t,index:e})=>{const n=this.getDatasetMeta(t);if(!n)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:n.data[e],index:e}}));!Ie(n,e)&&(this._active=n,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}_updateHoverStyles(t,e,n){const i=this.options.hover,r=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=r(e,t),a=n?t:r(t,e);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0},i=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",n,i))return;const r=this._handleEvent(t,e);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,i),(r||n.changed)&&this.render(),this}_handleEvent(t,e){const{_active:n=[],options:i}=this,r=i.hover,o=e;let a=[],s=!1,u=null;return"mouseout"!==t.type&&(a=this.getElementsAtEventForMode(t,r.mode,r,o),u="click"===t.type?this._lastEvent:t),this._lastEvent=null,ui(t,this.chartArea,this._minPadding)&&(Ce(i.onHover,[t,a,this],this),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||Ce(i.onClick,[t,a,this],this)),s=!Ie(a,n),(s||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=u,s}}const Ia=()=>Se(Sa.instances,(t=>t._plugins.invalidate())),Oa=!0;function Ra(t,e,n){const{startAngle:i,pixelMargin:r,x:o,y:a,outerRadius:s,innerRadius:u}=e;let l=r/s;t.beginPath(),t.arc(o,a,s,i-l,n+l),u>r?(l=r/u,t.arc(o,a,u,n+l,i-l,!0)):t.arc(o,a,r,n+Ye,i-Ye),t.closePath(),t.clip()}function Ma(t,e,n,i){const r=bi(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(n-e)/2,a=Math.min(o,i*e/2),s=t=>{const e=(n-Math.min(o,t))*i/2;return hn(t,0,Math.min(o,e))};return{outerStart:s(r.outerStart),outerEnd:s(r.outerEnd),innerStart:hn(r.innerStart,0,a),innerEnd:hn(r.innerEnd,0,a)}}function La(t,e,n,i){return{x:n+t*Math.cos(e),y:i+t*Math.sin(e)}}function Pa(t,e,n,i,r){const{x:o,y:a,startAngle:s,pixelMargin:u,innerRadius:l}=e,c=Math.max(e.outerRadius+i+n-u,0),h=l>0?l+i+n+u:0;let d=0;const f=r-s;if(i){const t=((l>0?l-i:0)+(c>0?c-i:0))/2;d=(f-(0!==t?f*t/(t+i):f))/2}const p=(f-Math.max(.001,f*c-n/Ge)/c)/2,g=s+p+d,m=r-p-d,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:_}=Ma(e,h,c,m-g),E=c-v,x=c-y,A=g+v/E,D=m-y/x,w=h+b,k=h+_,T=g+b/w,C=m-_/k;if(t.beginPath(),t.arc(o,a,c,A,D),y>0){const e=La(x,D,o,a);t.arc(e.x,e.y,y,D,m+Ye)}const S=La(k,m,o,a);if(t.lineTo(S.x,S.y),_>0){const e=La(k,C,o,a);t.arc(e.x,e.y,_,m+Ye,C+Math.PI)}if(t.arc(o,a,h,m-_/h,g+b/h,!0),b>0){const e=La(w,T,o,a);t.arc(e.x,e.y,b,T+Math.PI,g-Ye)}const I=La(E,g,o,a);if(t.lineTo(I.x,I.y),v>0){const e=La(E,A,o,a);t.arc(e.x,e.y,v,g-Ye,A)}t.closePath()}function Fa(t,e,n,i,r){const{options:o}=e,a="inner"===o.borderAlign;o.borderWidth&&(a?(t.lineWidth=2*o.borderWidth,t.lineJoin="round"):(t.lineWidth=o.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,n){const{x:i,y:r,startAngle:o,pixelMargin:a,fullCircles:s}=e,u=Math.max(e.outerRadius-a,0),l=e.innerRadius+a;let c;for(n&&Ra(t,e,o+We),t.beginPath(),t.arc(i,r,l,o+We,o,!0),c=0;c<s;++c)t.stroke();for(t.beginPath(),t.arc(i,r,u,o,o+We),c=0;c<s;++c)t.stroke()}(t,e,a),a&&Ra(t,e,r),Pa(t,e,n,i,r),t.stroke())}Object.defineProperties(Sa,{defaults:{enumerable:Oa,value:ni},instances:{enumerable:Oa,value:ka},overrides:{enumerable:Oa,value:Jn},registry:{enumerable:Oa,value:oa},version:{enumerable:Oa,value:"3.6.2"},getChart:{enumerable:Oa,value:Ta},register:{enumerable:Oa,value:(...t)=>{oa.add(...t),Ia()}},unregister:{enumerable:Oa,value:(...t)=>{oa.remove(...t),Ia()}}});class Ba extends qo{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.getProps(["x","y"],n),{angle:r,distance:o}=function(t,e){const n=e.x-t.x,i=e.y-t.y,r=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*Ge&&(o+=We),{angle:o,distance:r}}(i,{x:t,y:e}),{startAngle:a,endAngle:s,innerRadius:u,outerRadius:l,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),h=this.options.spacing/2,d=ke(c,s-a)>=We||cn(r,a,s),f=dn(o,u+h,l+h);return d&&f}getCenterPoint(t){const{x:e,y:n,startAngle:i,endAngle:r,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:s,spacing:u}=this.options,l=(i+r)/2,c=(o+a+u+s)/2;return{x:e+Math.cos(l)*c,y:n+Math.sin(l)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:n}=this,i=(e.offset||0)/2,r=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=n>We?Math.floor(n/We):0,0===n||this.innerRadius<0||this.outerRadius<0)return;t.save();let o=0;if(i){o=i/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*o,Math.sin(e)*o),this.circumference>=Ge&&(o=i)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=function(t,e,n,i){const{fullCircles:r,startAngle:o,circumference:a}=e;let s=e.endAngle;if(r){Pa(t,e,n,i,o+We);for(let e=0;e<r;++e)t.fill();isNaN(a)||(s=o+a%We,a%We==0&&(s+=We))}return Pa(t,e,n,i,s),t.fill(),s}(t,this,o,r);Fa(t,this,o,r,a),t.restore()}}function Na(t,e,n=e){t.lineCap=ke(n.borderCapStyle,e.borderCapStyle),t.setLineDash(ke(n.borderDash,e.borderDash)),t.lineDashOffset=ke(n.borderDashOffset,e.borderDashOffset),t.lineJoin=ke(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=ke(n.borderWidth,e.borderWidth),t.strokeStyle=ke(n.borderColor,e.borderColor)}function ja(t,e,n){t.lineTo(n.x,n.y)}function Va(t,e,n={}){const i=t.length,{start:r=0,end:o=i-1}=n,{start:a,end:s}=e,u=Math.max(r,a),l=Math.min(o,s),c=r<a&&o<a||r>s&&o>s;return{count:i,start:u,loop:e.loop,ilen:l<u&&!c?i+l-u:l-u}}function za(t,e,n,i){const{points:r,options:o}=e,{count:a,start:s,loop:u,ilen:l}=Va(r,n,i),c=function(t){return t.stepped?hi:t.tension||"monotone"===t.cubicInterpolationMode?di:ja}(o);let h,d,f,{move:p=!0,reverse:g}=i||{};for(h=0;h<=l;++h)d=r[(s+(g?l-h:h))%a],d.skip||(p?(t.moveTo(d.x,d.y),p=!1):c(t,f,d,g,o.stepped),f=d);return u&&(d=r[(s+(g?l:0))%a],c(t,f,d,g,o.stepped)),!!u}function Ua(t,e,n,i){const r=e.points,{count:o,start:a,ilen:s}=Va(r,n,i),{move:u=!0,reverse:l}=i||{};let c,h,d,f,p,g,m=0,v=0;const y=t=>(a+(l?s-t:t))%o,b=()=>{f!==p&&(t.lineTo(m,p),t.lineTo(m,f),t.lineTo(m,g))};for(u&&(h=r[y(0)],t.moveTo(h.x,h.y)),c=0;c<=s;++c){if(h=r[y(c)],h.skip)continue;const e=h.x,n=h.y,i=0|e;i===d?(n<f?f=n:n>p&&(p=n),m=(v*m+e)/++v):(b(),t.lineTo(e,n),d=i,v=0,f=p=n),g=n}b()}function Ga(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||n)?Ua:za}Ba.id="arc",Ba.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},Ba.defaultRoutes={backgroundColor:"backgroundColor"};const Wa="function"==typeof Path2D;function Ha(t,e,n,i){Wa&&!e.options.segment?function(t,e,n,i){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,i)&&r.closePath()),Na(t,e.options),t.stroke(r)}(t,e,n,i):function(t,e,n,i){const{segments:r,options:o}=e,a=Ga(e);for(const s of r)Na(t,o,s.style),t.beginPath(),a(t,e,s,{start:n,end:n+i-1})&&t.closePath(),t.stroke()}(t,e,n,i)}class qa extends qo{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const n=this.options;if((n.tension||"monotone"===n.cubicInterpolationMode)&&!n.stepped&&!this._pointsUpdated){const i=n.spanGaps?this._loop:this._fullLoop;Zi(this._points,n,t,i,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=function(t,e){const n=t.points,i=t.options.spanGaps,r=n.length;if(!r)return[];const o=!!t._loop,{start:a,end:s}=function(t,e,n,i){let r=0,o=e-1;if(n&&!i)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(o+=r);o>r&&t[o%e].skip;)o--;return o%=e,{start:r,end:o}}(n,r,o,i);return xr(t,!0===i?[{start:a,end:s,loop:o}]:function(t,e,n,i){const r=t.length,o=[];let a,s=e,u=t[e];for(a=e+1;a<=n;++a){const n=t[a%r];n.skip||n.stop?u.skip||(i=!1,o.push({start:e%r,end:(a-1)%r,loop:i}),e=s=n.stop?a:null):(s=a,u.skip&&(e=a)),u=n}return null!==s&&o.push({start:e%r,end:s%r,loop:i}),o}(n,a,s<a?s+r:s,!!t._fullLoop&&0===a&&s===r-1),n,e)}(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,i=t[e],r=this.points,o=Er(this,{property:e,start:i,end:i});if(!o.length)return;const a=[],s=function(t){return t.stepped?hr:t.tension||"monotone"===t.cubicInterpolationMode?dr:cr}(n);let u,l;for(u=0,l=o.length;u<l;++u){const{start:l,end:c}=o[u],h=r[l],d=r[c];if(h===d){a.push(h);continue}const f=s(h,d,Math.abs((i-h[e])/(d[e]-h[e])),n.stepped);f[e]=t[e],a.push(f)}return 1===a.length?a[0]:a}pathSegment(t,e,n){return Ga(this)(t,this,e,n)}path(t,e,n){const i=this.segments,r=Ga(this);let o=this._loop;e=e||0,n=n||this.points.length-e;for(const a of i)o&=r(t,this,a,{start:e,end:e+n-1});return!!o}draw(t,e,n,i){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Ha(t,this,n,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function $a(t,e,n,i){const r=t.options,{[n]:o}=t.getProps([n],i);return Math.abs(e-o)<r.radius+r.hitRadius}qa.id="line",qa.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},qa.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},qa.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class Ya extends qo{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,n){const i=this.options,{x:r,y:o}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(e-o,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(t,e){return $a(this,t,"x",e)}inYRange(t,e){return $a(this,t,"y",e)}getCenterPoint(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const n=this.options;this.skip||n.radius<.1||!ui(this,e,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,si(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Xa(t,e){const{x:n,y:i,base:r,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let s,u,l,c,h;return t.horizontal?(h=a/2,s=Math.min(n,r),u=Math.max(n,r),l=i-h,c=i+h):(h=o/2,s=n-h,u=n+h,l=Math.min(i,r),c=Math.max(i,r)),{left:s,top:l,right:u,bottom:c}}function Ka(t,e,n,i){return t?0:hn(e,n,i)}function Za(t){const e=Xa(t),n=e.right-e.left,i=e.bottom-e.top,r=function(t,e,n){const i=t.options.borderWidth,r=t.borderSkipped,o=_i(i);return{t:Ka(r.top,o.top,0,n),r:Ka(r.right,o.right,0,e),b:Ka(r.bottom,o.bottom,0,n),l:Ka(r.left,o.left,0,e)}}(t,n/2,i/2),o=function(t,e,n){const{enableBorderRadius:i}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,o=Ei(r),a=Math.min(e,n),s=t.borderSkipped,u=i||Ae(r);return{topLeft:Ka(!u||s.top||s.left,o.topLeft,0,a),topRight:Ka(!u||s.top||s.right,o.topRight,0,a),bottomLeft:Ka(!u||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:Ka(!u||s.bottom||s.right,o.bottomRight,0,a)}}(t,n/2,i/2);return{outer:{x:e.left,y:e.top,w:n,h:i,radius:o},inner:{x:e.left+r.l,y:e.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,o.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(r.b,r.r))}}}}function Ja(t,e,n,i){const r=null===e,o=null===n,a=t&&!(r&&o)&&Xa(t,i);return a&&(r||dn(e,a.left,a.right))&&(o||dn(n,a.top,a.bottom))}function Qa(t,e){t.rect(e.x,e.y,e.w,e.h)}function ts(t,e,n={}){const i=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-i,a=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+i,y:t.y+r,w:t.w+o,h:t.h+a,radius:t.radius}}Ya.id="point",Ya.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Ya.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class es extends qo{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:n,backgroundColor:i}}=this,{inner:r,outer:o}=Za(this),a=(s=o.radius).topLeft||s.topRight||s.bottomLeft||s.bottomRight?gi:Qa;var s;t.save(),o.w===r.w&&o.h===r.h||(t.beginPath(),a(t,ts(o,e,r)),t.clip(),a(t,ts(r,-e,o)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,ts(r,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,n){return Ja(this,t,e,n)}inXRange(t,e){return Ja(this,t,null,e)}inYRange(t,e){return Ja(this,null,t,e)}getCenterPoint(t){const{x:e,y:n,base:i,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+i)/2:e,y:r?n:(n+i)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}es.id="bar",es.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},es.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var ns=Object.freeze({__proto__:null,ArcElement:Ba,LineElement:qa,PointElement:Ya,BarElement:es});function is(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function rs(t){t.data.datasets.forEach((t=>{is(t)}))}var os={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,n)=>{if(!n.enabled)return void rs(t);const i=t.width;t.data.datasets.forEach(((e,r)=>{const{_data:o,indexAxis:a}=e,s=t.getDatasetMeta(r),u=o||e.data;if("y"===Di([a,t.options.indexAxis]))return;if("line"!==s.type)return;const l=t.scales[s.xAxisID];if("linear"!==l.type&&"time"!==l.type)return;if(t.options.parsing)return;let{start:c,count:h}=function(t,e){const n=e.length;let i,r=0;const{iScale:o}=t,{min:a,max:s,minDefined:u,maxDefined:l}=o.getUserBounds();return u&&(r=hn(Ti(e,o.axis,a).lo,0,n-1)),i=l?hn(Ti(e,o.axis,s).hi+1,r,n)-r:n-r,{start:r,count:i}}(s,u);if(h<=(n.threshold||4*i))return void is(e);let d;switch(Ee(o)&&(e._data=u,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":d=function(t,e,n,i,r){const o=r.samples||i;if(o>=n)return t.slice(e,e+n);const a=[],s=(n-2)/(o-2);let u=0;const l=e+n-1;let c,h,d,f,p,g=e;for(a[u++]=t[g],c=0;c<o-2;c++){let i,r=0,o=0;const l=Math.floor((c+1)*s)+1+e,m=Math.min(Math.floor((c+2)*s)+1,n)+e,v=m-l;for(i=l;i<m;i++)r+=t[i].x,o+=t[i].y;r/=v,o/=v;const y=Math.floor(c*s)+1+e,b=Math.min(Math.floor((c+1)*s)+1,n)+e,{x:_,y:E}=t[g];for(d=f=-1,i=y;i<b;i++)f=.5*Math.abs((_-r)*(t[i].y-E)-(_-t[i].x)*(o-E)),f>d&&(d=f,h=t[i],p=i);a[u++]=h,g=p}return a[u++]=t[l],a}(u,c,h,i,n);break;case"min-max":d=function(t,e,n,i){let r,o,a,s,u,l,c,h,d,f,p=0,g=0;const m=[],v=e+n-1,y=t[e].x,b=t[v].x-y;for(r=e;r<e+n;++r){o=t[r],a=(o.x-y)/b*i,s=o.y;const e=0|a;if(e===u)s<d?(d=s,l=r):s>f&&(f=s,c=r),p=(g*p+o.x)/++g;else{const n=r-1;if(!Ee(l)&&!Ee(c)){const e=Math.min(l,c),i=Math.max(l,c);e!==h&&e!==n&&m.push({...t[e],x:p}),i!==h&&i!==n&&m.push({...t[i],x:p})}r>0&&n!==h&&m.push(t[n]),m.push(o),u=e,g=0,d=f=s,l=c=h=r}}return m}(u,c,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}e._decimated=d}))},destroy(t){rs(t)}};function as(t,e,n){const i=function(t){const e=t.options,n=e.fill;let i=ke(n&&n.target,n);return void 0===i&&(i=!!e.backgroundColor),!1!==i&&null!==i&&(!0===i?"origin":i)}(t);if(Ae(i))return!isNaN(i.value)&&i;let r=parseFloat(i);return De(r)&&Math.floor(r)===r?("-"!==i[0]&&"+"!==i[0]||(r=e+r),!(r===e||r<0||r>=n)&&r):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}class ss{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,n){const{x:i,y:r,radius:o}=this;return e=e||{start:0,end:We},t.arc(i,r,o,e.end,e.start,!0),!n.bounds}interpolate(t){const{x:e,y:n,radius:i}=this,r=t.angle;return{x:e+Math.cos(r)*i,y:n+Math.sin(r)*i,angle:r}}}function us(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:n}=t,i=e.options,r=e.getLabels().length,o=[],a=i.reverse?e.max:e.min,s=i.reverse?e.min:e.max;let u,l,c;if(c="start"===n?a:"end"===n?s:Ae(n)?n.value:e.getBaseValue(),i.grid.circular)return l=e.getPointPositionForValue(0,a),new ss({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(c)});for(u=0;u<r;++u)o.push(e.getPointPositionForValue(u,c));return o}(t):function(t){const{scale:e={},fill:n}=t;let i,r=null;return"start"===n?r=e.bottom:"end"===n?r=e.top:Ae(n)?r=e.getPixelForValue(n.value):e.getBasePixel&&(r=e.getBasePixel()),De(r)?(i=e.isHorizontal(),{x:i?r:null,y:i?null:r}):null}(t)}function ls(t,e,n){for(;e>t;e--){const t=n[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function cs(t,e,n){const i=[];for(let r=0;r<n.length;r++){const o=n[r],{first:a,last:s,point:u}=hs(o,e,"x");if(!(!u||a&&s))if(a)i.unshift(u);else if(t.push(u),!s)break}t.push(...i)}function hs(t,e,n){const i=t.interpolate(e,n);if(!i)return{};const r=i[n],o=t.segments,a=t.points;let s=!1,u=!1;for(let t=0;t<o.length;t++){const e=o[t],i=a[e.start][n],l=a[e.end][n];if(dn(r,i,l)){s=r===i,u=r===l;break}}return{first:s,last:u,point:i}}function ds(t){const{chart:e,fill:n,line:i}=t;if(De(n))return function(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return function(t){const{scale:e,index:n,line:i}=t,r=[],o=i.segments,a=i.points,s=function(t,e){const n=[],i=t.getMatchingVisibleMetas("line");for(let t=0;t<i.length;t++){const r=i[t];if(r.index===e)break;r.hidden||n.unshift(r.dataset)}return n}(e,n);s.push(fs({x:null,y:e.bottom},i));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)cs(r,a[t],s)}return new qa({points:r,options:{}})}(t);if("shape"===n)return!0;const r=us(t);return r instanceof ss?r:fs(r,i)}function fs(t,e){let n=[],i=!1;return xe(t)?(i=!0,n=t):n=function(t,e){const{x:n=null,y:i=null}=t||{},r=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=ls(t,e,r);const a=r[t],s=r[e];null!==i?(o.push({x:a.x,y:i}),o.push({x:s.x,y:i})):null!==n&&(o.push({x:n,y:a.y}),o.push({x:n,y:s.y}))})),o}(t,e),n.length?new qa({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function ps(t,e,n){let i=t[e].fill;const r=[e];let o;if(!n)return i;for(;!1!==i&&-1===r.indexOf(i);){if(!De(i))return i;if(o=t[i],!o)return!1;if(o.visible)return i;r.push(i),i=o.fill}return!1}function gs(t,e,n){t.beginPath(),e.path(t),t.lineTo(e.last().x,n),t.lineTo(e.first().x,n),t.closePath(),t.clip()}function ms(t,e,n,i){if(i)return;let r=e[t],o=n[t];return"angle"===t&&(r=ln(r),o=ln(o)),{property:t,start:r,end:o}}function vs(t,e,n,i){return t&&e?i(t[n],e[n]):t?t[n]:e?e[n]:0}function ys(t,e,n){const{top:i,bottom:r}=e.chart.chartArea,{property:o,start:a,end:s}=n||{};"x"===o&&(t.beginPath(),t.rect(a,i,s-a,r-i),t.clip())}function bs(t,e,n,i){const r=e.interpolate(n,i);r&&t.lineTo(r.x,r.y)}function _s(t,e){const{line:n,target:i,property:r,color:o,scale:a}=e,s=function(t,e,n){const i=t.segments,r=t.points,o=e.points,a=[];for(const t of i){let{start:i,end:s}=t;s=ls(i,s,r);const u=ms(n,r[i],r[s],t.loop);if(!e.segments){a.push({source:t,target:u,start:r[i],end:r[s]});continue}const l=Er(e,u);for(const e of l){const i=ms(n,o[e.start],o[e.end],e.loop),s=_r(t,r,i);for(const t of s)a.push({source:t,target:e,start:{[n]:vs(u,i,"start",Math.max)},end:{[n]:vs(u,i,"end",Math.min)}})}}return a}(n,i,r);for(const{source:e,target:u,start:l,end:c}of s){const{style:{backgroundColor:s=o}={}}=e,h=!0!==i;t.save(),t.fillStyle=s,ys(t,a,h&&ms(r,l,c)),t.beginPath();const d=!!n.pathSegment(t,e);let f;if(h){d?t.closePath():bs(t,i,c,r);const e=!!i.pathSegment(t,u,{move:d,reverse:!0});f=d&&e,f||bs(t,i,l,r)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function Es(t,e,n){const i=ds(e),{line:r,scale:o,axis:a}=e,s=r.options,u=s.fill,l=s.backgroundColor,{above:c=l,below:h=l}=u||{};i&&r.points.length&&(li(t,n),function(t,e){const{line:n,target:i,above:r,below:o,area:a,scale:s}=e,u=n._loop?"angle":e.axis;t.save(),"x"===u&&o!==r&&(gs(t,i,a.top),_s(t,{line:n,target:i,color:r,scale:s,property:u}),t.restore(),t.save(),gs(t,i,a.bottom)),_s(t,{line:n,target:i,color:o,scale:s,property:u}),t.restore()}(t,{line:r,target:i,above:c,below:h,area:n,scale:o,axis:a}),ci(t))}var xs={id:"filler",afterDatasetsUpdate(t,e,n){const i=(t.data.datasets||[]).length,r=[];let o,a,s,u;for(a=0;a<i;++a)o=t.getDatasetMeta(a),s=o.dataset,u=null,s&&s.options&&s instanceof qa&&(u={visible:t.isDatasetVisible(a),index:a,fill:as(s,a,i),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:s}),o.$filler=u,r.push(u);for(a=0;a<i;++a)u=r[a],u&&!1!==u.fill&&(u.fill=ps(r,a,n.propagate))},beforeDraw(t,e,n){const i="beforeDraw"===n.drawTime,r=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=r.length-1;e>=0;--e){const n=r[e].$filler;n&&(n.line.updateControlPoints(o,n.axis),i&&Es(t.ctx,n,o))}},beforeDatasetsDraw(t,e,n){if("beforeDatasetsDraw"!==n.drawTime)return;const i=t.getSortedVisibleDatasetMetas();for(let e=i.length-1;e>=0;--e){const n=i[e].$filler;n&&Es(t.ctx,n,t.chartArea)}},beforeDatasetDraw(t,e,n){const i=e.meta.$filler;i&&!1!==i.fill&&"beforeDatasetDraw"===n.drawTime&&Es(t.ctx,i,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const As=(t,e)=>{let{boxHeight:n=e,boxWidth:i=e}=t;return t.usePointStyle&&(n=Math.min(n,e),i=Math.min(i,e)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(e,n)}};class Ds extends qo{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=Ce(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,n)=>t.sort(e,n,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const n=t.labels,i=Ai(n.font),r=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:s}=As(n,r);let u,l;e.font=i.string,this.isHorizontal()?(u=this.maxWidth,l=this._fitRows(o,r,a,s)+10):(l=this.maxHeight,u=this._fitCols(o,r,a,s)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(l,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,i){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],u=this.lineWidths=[0],l=i+a;let c=t;r.textAlign="left",r.textBaseline="middle";let h=-1,d=-l;return this.legendItems.forEach(((t,f)=>{const p=n+e/2+r.measureText(t.text).width;(0===f||u[u.length-1]+p+2*a>o)&&(c+=l,u[u.length-(f>0?0:1)]=0,d+=l,h++),s[f]={left:0,top:d,row:h,width:p,height:i},u[u.length-1]+=p+a})),c}_fitCols(t,e,n,i){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,s=this.legendHitBoxes=[],u=this.columnSizes=[],l=o-t;let c=a,h=0,d=0,f=0,p=0;return this.legendItems.forEach(((t,o)=>{const g=n+e/2+r.measureText(t.text).width;o>0&&d+i+2*a>l&&(c+=h+a,u.push({width:h,height:d}),f+=h+a,p++,h=d=0),s[o]={left:f,top:d,col:p,width:g,height:i},h=Math.max(h,g),d+=i+a})),c+=h,u.push({width:h,height:d}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:i},rtl:r}}=this,o=gr(r,this.left,this.width);if(this.isHorizontal()){let r=0,a=ye(n,this.left+i,this.right-this.lineWidths[r]);for(const s of e)r!==s.row&&(r=s.row,a=ye(n,this.left+i,this.right-this.lineWidths[r])),s.top+=this.top+t+i,s.left=o.leftForLtr(o.x(a),s.width),a+=s.width+i}else{let r=0,a=ye(n,this.top+t+i,this.bottom-this.columnSizes[r].height);for(const s of e)s.col!==r&&(r=s.col,a=ye(n,this.top+t+i,this.bottom-this.columnSizes[r].height)),s.top=a,s.left+=this.left+i,s.left=o.leftForLtr(o.x(s.left),s.width),a+=s.height+i}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;li(t,this),this._draw(),ci(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:i}=this,{align:r,labels:o}=t,a=ni.color,s=gr(t.rtl,this.left,this.width),u=Ai(o.font),{color:l,padding:c}=o,h=u.size,d=h/2;let f;this.drawTitle(),i.textAlign=s.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=u.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=As(o,h),v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:ye(r,this.left+c,this.right-n[0]),y:this.top+c+y,line:0}:{x:this.left+c,y:ye(r,this.top+y+c,this.bottom-e[0].height),line:0},mr(this.ctx,t.textDirection);const b=m+c;this.legendItems.forEach(((_,E)=>{i.strokeStyle=_.fontColor||l,i.fillStyle=_.fontColor||l;const x=i.measureText(_.text).width,A=s.textAlign(_.textAlign||(_.textAlign=o.textAlign)),D=p+d+x;let w=f.x,k=f.y;s.setWidth(this.width),v?E>0&&w+D+c>this.right&&(k=f.y+=b,f.line++,w=f.x=ye(r,this.left+c,this.right-n[f.line])):E>0&&k+b>this.bottom&&(w=f.x=w+e[f.line].width+c,f.line++,k=f.y=ye(r,this.top+y+c,this.bottom-e[f.line].height));!function(t,e,n){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;i.save();const r=ke(n.lineWidth,1);if(i.fillStyle=ke(n.fillStyle,a),i.lineCap=ke(n.lineCap,"butt"),i.lineDashOffset=ke(n.lineDashOffset,0),i.lineJoin=ke(n.lineJoin,"miter"),i.lineWidth=r,i.strokeStyle=ke(n.strokeStyle,a),i.setLineDash(ke(n.lineDash,[])),o.usePointStyle){const o={radius:p*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},a=s.xPlus(t,p/2);si(i,o,a,e+d)}else{const o=e+Math.max((h-g)/2,0),a=s.leftForLtr(t,p),u=Ei(n.borderRadius);i.beginPath(),Object.values(u).some((t=>0!==t))?gi(i,{x:a,y:o,w:p,h:g,radius:u}):i.rect(a,o,p,g),i.fill(),0!==r&&i.stroke()}i.restore()}(s.x(w),k,_),w=((t,e,n,i)=>t===(i?"left":"right")?n:"center"===t?(e+n)/2:e)(A,w+p+d,v?w+D:this.right,t.rtl),function(t,e,n){fi(i,n.text,t,e+m/2,u,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})}(s.x(w),k,_),v?f.x+=D+c:f.y+=b})),vr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=Ai(e.font),i=xi(e.padding);if(!e.display)return;const r=gr(t.rtl,this.left,this.width),o=this.ctx,a=e.position,s=n.size/2,u=i.top+s;let l,c=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),l=this.top+u,c=ye(t.align,c,this.right-h);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);l=u+ye(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const d=ye(a,c,c+h);o.textAlign=r.textAlign(ve(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=n.string,fi(o,e.text,d,l,n)}_computeTitleHeight(){const t=this.options.title,e=Ai(t.font),n=xi(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,i,r;if(dn(t,this.left,this.right)&&dn(e,this.top,this.bottom))for(r=this.legendHitBoxes,n=0;n<r.length;++n)if(i=r[n],dn(t,i.left,i.left+i.width)&&dn(e,i.top,i.top+i.height))return this.legendItems[n];return null}handleEvent(t){const e=this.options;if(!function(t,e){if("mousemove"===t&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const n=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){const i=this._hoveredItem,r=((t,e)=>null!==t&&null!==e&&t.datasetIndex===e.datasetIndex&&t.index===e.index)(i,n);i&&!r&&Ce(e.onLeave,[t,i,this],this),this._hoveredItem=n,n&&!r&&Ce(e.onHover,[t,n,this],this)}else n&&Ce(e.onClick,[t,n,this],this)}}var ws={id:"legend",_element:Ds,start(t,e,n){const i=t.legend=new Ds({ctx:t.ctx,options:n,chart:t});So.configure(t,i,n),So.addBox(t,i)},stop(t){So.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const i=t.legend;So.configure(t,i,n),i.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const i=e.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),e.hidden=!0):(r.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:o}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(n?0:void 0),s=xi(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:a.borderColor,pointStyle:i||a.pointStyle,rotation:a.rotation,textAlign:r||a.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class ks extends qo{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const n=this.options;if(this.left=0,this.top=0,!n.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const i=xe(n.text)?n.text.length:1;this._padding=xi(n.padding);const r=i*Ai(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:n,bottom:i,right:r,options:o}=this,a=o.align;let s,u,l,c=0;return this.isHorizontal()?(u=ye(a,n,r),l=e+t,s=r-n):("left"===o.position?(u=n+t,l=ye(a,i,e),c=-.5*Ge):(u=r-t,l=ye(a,e,i),c=.5*Ge),s=i-e),{titleX:u,titleY:l,maxWidth:s,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=Ai(e.font),i=n.lineHeight/2+this._padding.top,{titleX:r,titleY:o,maxWidth:a,rotation:s}=this._drawArgs(i);fi(t,e.text,0,0,n,{color:e.color,maxWidth:a,rotation:s,textAlign:ve(e.align),textBaseline:"middle",translation:[r,o]})}}var Ts={id:"title",_element:ks,start(t,e,n){!function(t,e){const n=new ks({ctx:t.ctx,options:e,chart:t});So.configure(t,n,e),So.addBox(t,n),t.titleBlock=n}(t,n)},stop(t){const e=t.titleBlock;So.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const i=t.titleBlock;So.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Cs=new WeakMap;var Ss={id:"subtitle",start(t,e,n){const i=new ks({ctx:t.ctx,options:n,chart:t});So.configure(t,i,n),So.addBox(t,i),Cs.set(t,i)},stop(t){So.removeBox(t,Cs.get(t)),Cs.delete(t)},beforeUpdate(t,e,n){const i=Cs.get(t);So.configure(t,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Is={average(t){if(!t.length)return!1;let e,n,i=0,r=0,o=0;for(e=0,n=t.length;e<n;++e){const n=t[e].element;if(n&&n.hasValue()){const t=n.tooltipPosition();i+=t.x,r+=t.y,++o}}return{x:i/o,y:r/o}},nearest(t,e){if(!t.length)return!1;let n,i,r,o=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(n=0,i=t.length;n<i;++n){const i=t[n].element;if(i&&i.hasValue()){const t=sn(e,i.getCenterPoint());t<s&&(s=t,r=i)}}if(r){const t=r.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function Os(t,e){return e&&(xe(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Rs(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Ms(t,e){const{element:n,datasetIndex:i,index:r}=e,o=t.getDatasetMeta(i).controller,{label:a,value:s}=o.getLabelAndValue(r);return{chart:t,label:a,parsed:o.getParsed(r),raw:t.data.datasets[i].data[r],formattedValue:s,dataset:o.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Ls(t,e){const n=t._chart.ctx,{body:i,footer:r,title:o}=t,{boxWidth:a,boxHeight:s}=e,u=Ai(e.bodyFont),l=Ai(e.titleFont),c=Ai(e.footerFont),h=o.length,d=r.length,f=i.length,p=xi(e.padding);let g=p.height,m=0,v=i.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(v+=t.beforeBody.length+t.afterBody.length,h&&(g+=h*l.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),v){g+=f*(e.displayColors?Math.max(s,u.lineHeight):u.lineHeight)+(v-f)*u.lineHeight+(v-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*c.lineHeight+(d-1)*e.footerSpacing);let y=0;const b=function(t){m=Math.max(m,n.measureText(t).width+y)};return n.save(),n.font=l.string,Se(t.title,b),n.font=u.string,Se(t.beforeBody.concat(t.afterBody),b),y=e.displayColors?a+2+e.boxPadding:0,Se(i,(t=>{Se(t.before,b),Se(t.lines,b),Se(t.after,b)})),y=0,n.font=c.string,Se(t.footer,b),n.restore(),m+=p.width,{width:m,height:g}}function Ps(t,e,n,i){const{x:r,width:o}=n,{width:a,chartArea:{left:s,right:u}}=t;let l="center";return"center"===i?l=r<=(s+u)/2?"left":"right":r<=o/2?l="left":r>=a-o/2&&(l="right"),function(t,e,n,i){const{x:r,width:o}=i,a=n.caretSize+n.caretPadding;return"left"===t&&r+o+a>e.width||"right"===t&&r-o-a<0||void 0}(l,t,e,n)&&(l="center"),l}function Fs(t,e,n){const i=e.yAlign||function(t,e){const{y:n,height:i}=e;return n<i/2?"top":n>t.height-i/2?"bottom":"center"}(t,n);return{xAlign:e.xAlign||Ps(t,e,n,i),yAlign:i}}function Bs(t,e,n,i){const{caretSize:r,caretPadding:o,cornerRadius:a}=t,{xAlign:s,yAlign:u}=n,l=r+o,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:f}=Ei(a);let p=function(t,e){let{x:n,width:i}=t;return"right"===e?n-=i:"center"===e&&(n-=i/2),n}(e,s);const g=function(t,e,n){let{y:i,height:r}=t;return"top"===e?i+=n:i-="bottom"===e?r+n:r/2,i}(e,u,l);return"center"===u?"left"===s?p+=l:"right"===s&&(p-=l):"left"===s?p-=Math.max(c,d)+r:"right"===s&&(p+=Math.max(h,f)+r),{x:hn(p,0,i.width-e.width),y:hn(g,0,i.height-e.height)}}function Ns(t,e,n){const i=xi(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-i.right:t.x+i.left}function js(t){return Os([],Rs(t))}function Vs(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}class zs extends qo{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this._chart,n=this.options.setContext(this.getContext()),i=n.enabled&&e.options.animation&&n.animations,r=new Ir(this._chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=(t=this._chart.getContext(),e=this,n=this._tooltipItems,wi(t,{tooltip:e,tooltipItems:n,type:"tooltip"})));var t,e,n}getTitle(t,e){const{callbacks:n}=e,i=n.beforeTitle.apply(this,[t]),r=n.title.apply(this,[t]),o=n.afterTitle.apply(this,[t]);let a=[];return a=Os(a,Rs(i)),a=Os(a,Rs(r)),a=Os(a,Rs(o)),a}getBeforeBody(t,e){return js(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:n}=e,i=[];return Se(t,(t=>{const e={before:[],lines:[],after:[]},r=Vs(n,t);Os(e.before,Rs(r.beforeLabel.call(this,t))),Os(e.lines,r.label.call(this,t)),Os(e.after,Rs(r.afterLabel.call(this,t))),i.push(e)})),i}getAfterBody(t,e){return js(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:n}=e,i=n.beforeFooter.apply(this,[t]),r=n.footer.apply(this,[t]),o=n.afterFooter.apply(this,[t]);let a=[];return a=Os(a,Rs(i)),a=Os(a,Rs(r)),a=Os(a,Rs(o)),a}_createItems(t){const e=this._active,n=this._chart.data,i=[],r=[],o=[];let a,s,u=[];for(a=0,s=e.length;a<s;++a)u.push(Ms(this._chart,e[a]));return t.filter&&(u=u.filter(((e,i,r)=>t.filter(e,i,r,n)))),t.itemSort&&(u=u.sort(((e,i)=>t.itemSort(e,i,n)))),Se(u,(e=>{const n=Vs(t.callbacks,e);i.push(n.labelColor.call(this,e)),r.push(n.labelPointStyle.call(this,e)),o.push(n.labelTextColor.call(this,e))})),this.labelColors=i,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=u,u}update(t,e){const n=this.options.setContext(this.getContext()),i=this._active;let r,o=[];if(i.length){const t=Is[n.position].call(this,i,this._eventPosition);o=this._createItems(n),this.title=this.getTitle(o,n),this.beforeBody=this.getBeforeBody(o,n),this.body=this.getBody(o,n),this.afterBody=this.getAfterBody(o,n),this.footer=this.getFooter(o,n);const e=this._size=Ls(this,n),a=Object.assign({},t,e),s=Fs(this._chart,n,a),u=Bs(n,a,s,this._chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,r={opacity:1,x:u.x,y:u.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(r={opacity:0});this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&n.external&&n.external.call(this,{chart:this._chart,tooltip:this,replay:e})}drawCaret(t,e,n,i){const r=this.getCaretPosition(t,n,i);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,n){const{xAlign:i,yAlign:r}=this,{caretSize:o,cornerRadius:a}=n,{topLeft:s,topRight:u,bottomLeft:l,bottomRight:c}=Ei(a),{x:h,y:d}=t,{width:f,height:p}=e;let g,m,v,y,b,_;return"center"===r?(b=d+p/2,"left"===i?(g=h,m=g-o,y=b+o,_=b-o):(g=h+f,m=g+o,y=b-o,_=b+o),v=g):(m="left"===i?h+Math.max(s,l)+o:"right"===i?h+f-Math.max(u,c)-o:this.caretX,"top"===r?(y=d,b=y-o,g=m-o,v=m+o):(y=d+p,b=y+o,g=m+o,v=m-o),_=y),{x1:g,x2:m,x3:v,y1:y,y2:b,y3:_}}drawTitle(t,e,n){const i=this.title,r=i.length;let o,a,s;if(r){const u=gr(n.rtl,this.x,this.width);for(t.x=Ns(this,n.titleAlign,n),e.textAlign=u.textAlign(n.titleAlign),e.textBaseline="middle",o=Ai(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=o.string,s=0;s<r;++s)e.fillText(i[s],u.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,s+1===r&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,e,n,i,r){const o=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:s,boxWidth:u,boxPadding:l}=r,c=Ai(r.bodyFont),h=Ns(this,"left",r),d=i.x(h),f=s<c.lineHeight?(c.lineHeight-s)/2:0,p=e.y+f;if(r.usePointStyle){const e={radius:Math.min(u,s)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},n=i.leftForLtr(d,u)+u/2,l=p+s/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,si(t,e,n,l),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,si(t,e,n,l)}else{t.lineWidth=o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=i.leftForLtr(d,u-l),n=i.leftForLtr(i.xPlus(d,1),u-l-2),a=Ei(o.borderRadius);Object.values(a).some((t=>0!==t))?(t.beginPath(),t.fillStyle=r.multiKeyBackground,gi(t,{x:e,y:p,w:u,h:s,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),gi(t,{x:n,y:p+1,w:u-2,h:s-2,radius:a}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(e,p,u,s),t.strokeRect(e,p,u,s),t.fillStyle=o.backgroundColor,t.fillRect(n,p+1,u-2,s-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:i}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:s,boxWidth:u,boxPadding:l}=n,c=Ai(n.bodyFont);let h=c.lineHeight,d=0;const f=gr(n.rtl,this.x,this.width),p=function(n){e.fillText(n,f.x(t.x+d),t.y+h/2),t.y+=h+r},g=f.textAlign(o);let m,v,y,b,_,E,x;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Ns(this,g,n),e.fillStyle=n.bodyColor,Se(this.beforeBody,p),d=a&&"right"!==g?"center"===o?u/2+l:u+2+l:0,b=0,E=i.length;b<E;++b){for(m=i[b],v=this.labelTextColors[b],e.fillStyle=v,Se(m.before,p),y=m.lines,a&&y.length&&(this._drawColorBox(e,t,b,f,n),h=Math.max(c.lineHeight,s)),_=0,x=y.length;_<x;++_)p(y[_]),h=c.lineHeight;Se(m.after,p)}d=0,h=c.lineHeight,Se(this.afterBody,p),t.y-=r}drawFooter(t,e,n){const i=this.footer,r=i.length;let o,a;if(r){const s=gr(n.rtl,this.x,this.width);for(t.x=Ns(this,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=s.textAlign(n.footerAlign),e.textBaseline="middle",o=Ai(n.footerFont),e.fillStyle=n.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(i[a],s.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+n.footerSpacing}}drawBackground(t,e,n,i){const{xAlign:r,yAlign:o}=this,{x:a,y:s}=t,{width:u,height:l}=n,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:f}=Ei(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(a+c,s),"top"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+u-h,s),e.quadraticCurveTo(a+u,s,a+u,s+h),"center"===o&&"right"===r&&this.drawCaret(t,e,n,i),e.lineTo(a+u,s+l-f),e.quadraticCurveTo(a+u,s+l,a+u-f,s+l),"bottom"===o&&this.drawCaret(t,e,n,i),e.lineTo(a+d,s+l),e.quadraticCurveTo(a,s+l,a,s+l-d),"center"===o&&"left"===r&&this.drawCaret(t,e,n,i),e.lineTo(a,s+c),e.quadraticCurveTo(a,s,a+c,s),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this._chart,n=this.$animations,i=n&&n.x,r=n&&n.y;if(i||r){const n=Is[t.position].call(this,this._active,this._eventPosition);if(!n)return;const o=this._size=Ls(this,t),a=Object.assign({},n,this._size),s=Fs(e,t,a),u=Bs(t,a,s,e);i._to===u.x&&r._to===u.y||(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=o.width,this.height=o.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,u))}}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},r={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const o=xi(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(r,t,i,e),mr(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),vr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,i=t.map((({datasetIndex:t,index:e})=>{const n=this._chart.getDatasetMeta(t);if(!n)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:n.data[e],index:e}})),r=!Ie(n,i),o=this._positionChanged(i,e);(r||o)&&(this._active=i,this._eventPosition=e,this.update(!0))}handleEvent(t,e){const n=this.options,i=this._active||[];let r=!1,o=[];"mouseout"!==t.type&&(o=this._chart.getElementsAtEventForMode(t,n.mode,n,e),n.reverse&&o.reverse());const a=this._positionChanged(o,t);return r=e||!Ie(o,i)||a,r&&(this._active=o,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_positionChanged(t,e){const{caretX:n,caretY:i,options:r}=this,o=Is[r.position].call(this,t,e);return!1!==o&&(n!==o.x||i!==o.y)}}zs.positioners=Is;var Us={id:"tooltip",_element:zs,positioners:Is,afterInit(t,e,n){n&&(t.tooltip=new zs({_chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip,n={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",n)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n))},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:be,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,i=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return n[e.dataIndex]}return""},afterTitle:be,beforeBody:be,beforeLabel:be,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Ee(n)||(e+=n),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:be,afterBody:be,beforeFooter:be,footer:be,afterFooter:be}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Gs=Object.freeze({__proto__:null,Decimation:os,Filler:xs,Legend:ws,SubTitle:Ss,Title:Ts,Tooltip:Us});function Ws(t,e,n,i){const r=t.indexOf(e);if(-1===r)return((t,e,n,i)=>("string"==typeof e?(n=t.push(e)-1,i.unshift({index:n,label:e})):isNaN(e)&&(n=null),n))(t,e,n,i);return r!==t.lastIndexOf(e)?n:r}class Hs extends ia{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:n,label:i}of e)t[n]===i&&t.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(Ee(t))return null;const n=this.getLabels();return((t,e)=>null===t?null:hn(Math.round(t),0,e))(e=isFinite(e)&&n[e]===t?e:Ws(n,t,ke(e,t),this._addedLabels),n.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:n,max:i}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(n=0),e||(i=this.getLabels().length-1)),this.min=n,this.max=i}buildTicks(){const t=this.min,e=this.max,n=this.options.offset,i=[];let r=this.getLabels();r=0===t&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let n=t;n<=e;n++)i.push({value:n});return i}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function qs(t,e){const n=[],{bounds:i,step:r,min:o,max:a,precision:s,count:u,maxTicks:l,maxDigits:c,includeBounds:h}=t,d=r||1,f=l-1,{min:p,max:g}=e,m=!Ee(o),v=!Ee(a),y=!Ee(u),b=(g-p)/(c+1);let _,E,x,A,D=Qe((g-p)/f/d)*d;if(D<1e-14&&!m&&!v)return[{value:p},{value:g}];A=Math.ceil(g/D)-Math.floor(p/D),A>f&&(D=Qe(A*D/f/d)*d),Ee(s)||(_=Math.pow(10,s),D=Math.ceil(D*_)/_),"ticks"===i?(E=Math.floor(p/D)*D,x=Math.ceil(g/D)*D):(E=p,x=g),m&&v&&r&&function(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}((a-o)/r,D/1e3)?(A=Math.round(Math.min((a-o)/D,l)),D=(a-o)/A,E=o,x=a):y?(E=m?o:E,x=v?a:x,A=u-1,D=(x-E)/A):(A=(x-E)/D,A=en(A,Math.round(A),D/1e3)?Math.round(A):Math.ceil(A));const w=Math.max(an(D),an(E));_=Math.pow(10,Ee(s)?w:s),E=Math.round(E*_)/_,x=Math.round(x*_)/_;let k=0;for(m&&(h&&E!==o?(n.push({value:o}),E<o&&k++,en(Math.round((E+k*D)*_)/_,o,$s(o,b,t))&&k++):E<o&&k++);k<A;++k)n.push({value:Math.round((E+k*D)*_)/_});return v&&h&&x!==a?n.length&&en(n[n.length-1].value,a,$s(a,b,t))?n[n.length-1].value=a:n.push({value:a}):v&&x!==a||n.push({value:x}),n}function $s(t,e,{horizontal:n,minRotation:i}){const r=rn(i),o=(n?Math.sin(r):Math.cos(r))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}Hs.id="category",Hs.defaults={ticks:{callback:Hs.prototype.getLabelForValue}};class Ys extends ia{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return Ee(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this;const o=t=>i=e?i:t,a=t=>r=n?r:t;if(t){const t=Je(i),e=Je(r);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(i===r){let e=1;(r>=Number.MAX_SAFE_INTEGER||i<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*r)),a(r+e),t||o(i-e)}this.min=i,this.max=r}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:n,stepSize:i}=t;return i?(e=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),n=n||11),n&&(e=Math.min(n,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const i=qs({maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&nn(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const i=(n-e)/Math.max(t.length-1,1)/2;e-=i,n+=i}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return pr(t,this.chart.options.locale,this.options.ticks.format)}}class Xs extends Ys{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=De(t)?t:0,this.max=De(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=rn(this.options.ticks.minRotation),i=(t?Math.sin(n):Math.cos(n))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/i))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Ks(t){return 1===t/Math.pow(10,Math.floor(Ze(t)))}Xs.id="linear",Xs.defaults={ticks:{callback:Yo.formatters.numeric}};class Zs extends ia{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Ys.prototype.parse.apply(this,[t,e]);if(0!==n)return De(n)&&n>0?n:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=De(t)?Math.max(0,t):null,this.max=De(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,i=this.max;const r=e=>n=t?n:e,o=t=>i=e?i:t,a=(t,e)=>Math.pow(10,Math.floor(Ze(t))+e);n===i&&(n<=0?(r(1),o(10)):(r(a(n,-1)),o(a(i,1)))),n<=0&&r(a(i,-1)),i<=0&&o(a(n,1)),this._zero&&this.min!==this._suggestedMin&&n===a(this.min,0)&&r(a(n,-1)),this.min=n,this.max=i}buildTicks(){const t=this.options,e=function(t,e){const n=Math.floor(Ze(e.max)),i=Math.ceil(e.max/Math.pow(10,n)),r=[];let o=we(t.min,Math.pow(10,Math.floor(Ze(e.min)))),a=Math.floor(Ze(o)),s=Math.floor(o/Math.pow(10,a)),u=a<0?Math.pow(10,Math.abs(a)):1;do{r.push({value:o,major:Ks(o)}),++s,10===s&&(s=1,++a,u=a>=0?1:u),o=Math.round(s*Math.pow(10,a)*u)/u}while(a<n||a===n&&s<i);const l=we(t.max,o);return r.push({value:l,major:Ks(o)}),r}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&nn(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":pr(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ze(t),this._valueRange=Ze(this.max)-Ze(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ze(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function Js(t){const e=t.ticks;if(e.display&&t.display){const t=xi(e.backdropPadding);return ke(e.font&&e.font.size,ni.font.size)+t.height}return 0}function Qs(t,e,n,i,r){return t===i||t===r?{start:e-n/2,end:e+n/2}:t<i||t>r?{start:e-n,end:e}:{start:e,end:e+n}}function tu(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},n={},i=[],r=[],o=t.getLabels().length;for(let l=0;l<o;l++){const o=t.options.pointLabels.setContext(t.getPointLabelContext(l));r[l]=o.padding;const c=t.getPointPosition(l,t.drawingArea+r[l]),h=Ai(o.font),d=(a=t.ctx,s=h,u=xe(u=t._pointLabels[l])?u:[u],{w:ri(a,s.string,u),h:u.length*s.lineHeight});i[l]=d;const f=t.getIndexAngle(l),p=on(f),g=Qs(p,c.x,d.w,0,180),m=Qs(p,c.y,d.h,90,270);g.start<e.l&&(e.l=g.start,n.l=f),g.end>e.r&&(e.r=g.end,n.r=f),m.start<e.t&&(e.t=m.start,n.t=f),m.end>e.b&&(e.b=m.end,n.b=f)}var a,s,u;t._setReductions(t.drawingArea,e,n),t._pointLabelItems=function(t,e,n){const i=[],r=t.getLabels().length,o=t.options,a=Js(o),s=t.getDistanceFromCenterForValue(o.ticks.reverse?t.min:t.max);for(let o=0;o<r;o++){const r=0===o?a/2:0,u=t.getPointPosition(o,s+r+n[o]),l=on(t.getIndexAngle(o)),c=e[o],h=iu(u.y,c.h,l),d=eu(l),f=nu(u.x,c.w,d);i.push({x:u.x,y:h,textAlign:d,left:f,top:h,right:f+c.w,bottom:h+c.h})}return i}(t,i,r)}function eu(t){return 0===t||180===t?"center":t<180?"left":"right"}function nu(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function iu(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function ru(t,e,n,i){const{ctx:r}=t;if(n)r.arc(t.xCenter,t.yCenter,e,0,We);else{let n=t.getPointPosition(0,e);r.moveTo(n.x,n.y);for(let o=1;o<i;o++)n=t.getPointPosition(o,e),r.lineTo(n.x,n.y)}}function ou(t){return tn(t)?t:0}Zs.id="logarithmic",Zs.defaults={ticks:{callback:Yo.formatters.logarithmic,major:{enabled:!0}}};class au extends Ys{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){this.width=this.maxWidth,this.height=this.maxHeight,this.paddingTop=Js(this.options)/2,this.xCenter=Math.floor(this.width/2),this.yCenter=Math.floor((this.height-this.paddingTop)/2),this.drawingArea=Math.min(this.height-this.paddingTop,this.width)/2}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=De(t)&&!isNaN(t)?t:0,this.max=De(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Js(this.options))}generateTickLabels(t){Ys.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const n=Ce(this.options.pointLabels.callback,[t,e],this);return n||0===n?n:""}))}fit(){const t=this.options;t.display&&t.pointLabels.display?tu(this):this.setCenterPoint(0,0,0,0)}_setReductions(t,e,n){let i=e.l/Math.sin(n.l),r=Math.max(e.r-this.width,0)/Math.sin(n.r),o=-e.t/Math.cos(n.t),a=-Math.max(e.b-(this.height-this.paddingTop),0)/Math.cos(n.b);i=ou(i),r=ou(r),o=ou(o),a=ou(a),this.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(i+r)/2),Math.floor(t-(o+a)/2))),this.setCenterPoint(i,r,o,a)}setCenterPoint(t,e,n,i){const r=this.width-e-this.drawingArea,o=t+this.drawingArea,a=n+this.drawingArea,s=this.height-this.paddingTop-i-this.drawingArea;this.xCenter=Math.floor((o+r)/2+this.left),this.yCenter=Math.floor((a+s)/2+this.top+this.paddingTop)}getIndexAngle(t){return ln(t*(We/this.getLabels().length)+rn(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(Ee(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(Ee(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const n=e[t];return function(t,e,n){return wi(t,{label:n,index:e,type:"pointLabel"})}(this.getContext(),t,n)}}getPointPosition(t,e){const n=this.getIndexAngle(t)-Ye;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:n,right:i,bottom:r}=this._pointLabelItems[t];return{left:e,top:n,right:i,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const n=this.ctx;n.save(),n.beginPath(),ru(this,this.getDistanceFromCenterForValue(this._endValue),e,this.getLabels().length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:n,grid:i}=e,r=this.getLabels().length;let o,a,s;if(e.pointLabels.display&&function(t,e){const{ctx:n,options:{pointLabels:i}}=t;for(let r=e-1;r>=0;r--){const e=i.setContext(t.getPointLabelContext(r)),o=Ai(e.font),{x:a,y:s,textAlign:u,left:l,top:c,right:h,bottom:d}=t._pointLabelItems[r],{backdropColor:f}=e;if(!Ee(f)){const t=xi(e.backdropPadding);n.fillStyle=f,n.fillRect(l-t.left,c-t.top,h-l+t.width,d-c+t.height)}fi(n,t._pointLabels[r],a,s+o.lineHeight/2,o,{color:e.color,textAlign:u,textBaseline:"middle"})}}(this,r),i.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);!function(t,e,n,i){const r=t.ctx,o=e.circular,{color:a,lineWidth:s}=e;!o&&!i||!a||!s||n<0||(r.save(),r.strokeStyle=a,r.lineWidth=s,r.setLineDash(e.borderDash),r.lineDashOffset=e.borderDashOffset,r.beginPath(),ru(t,n,o,i),r.closePath(),r.stroke(),r.restore())}(this,i.setContext(this.getContext(e-1)),a,r)}})),n.display){for(t.save(),o=this.getLabels().length-1;o>=0;o--){const i=n.setContext(this.getPointLabelContext(o)),{color:r,lineWidth:u}=i;u&&r&&(t.lineWidth=u,t.strokeStyle=r,t.setLineDash(i.borderDash),t.lineDashOffset=i.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),s=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(s.x,s.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const i=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((i,a)=>{if(0===a&&!e.reverse)return;const s=n.setContext(this.getContext(a)),u=Ai(s.font);if(r=this.getDistanceFromCenterForValue(this.ticks[a].value),s.showLabelBackdrop){t.font=u.string,o=t.measureText(i.label).width,t.fillStyle=s.backdropColor;const e=xi(s.backdropPadding);t.fillRect(-o/2-e.left,-r-u.size/2-e.top,o+e.width,u.size+e.height)}fi(t,i.label,0,-r,u,{color:s.color})})),t.restore()}drawTitle(){}}au.id="radialLinear",au.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Yo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5}},au.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},au.descriptors={angleLines:{_fallback:"grid"}};const su={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},uu=Object.keys(su);function lu(t,e){return t-e}function cu(t,e){if(Ee(e))return null;const n=t._adapter,{parser:i,round:r,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof i&&(a=i(a)),De(a)||(a="string"==typeof i?n.parse(a,i):n.parse(a)),null===a?null:(r&&(a="week"!==r||!tn(o)&&!0!==o?n.startOf(a,r):n.startOf(a,"isoWeek",o)),+a)}function hu(t,e,n,i){const r=uu.length;for(let o=uu.indexOf(t);o<r-1;++o){const t=su[uu[o]],r=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((n-e)/(r*t.size))<=i)return uu[o]}return uu[r-1]}function du(t,e,n){if(n){if(n.length){const{lo:i,hi:r}=ki(n,e);t[n[i]>=e?n[i]:n[r]]=!0}}else t[e]=!0}function fu(t,e,n){const i=[],r={},o=e.length;let a,s;for(a=0;a<o;++a)s=e[a],r[s]=a,i.push({value:s,major:!1});return 0!==o&&n?function(t,e,n,i){const r=t._adapter,o=+r.startOf(e[0].value,i),a=e[e.length-1].value;let s,u;for(s=o;s<=a;s=+r.add(s,1,i))u=n[s],u>=0&&(e[u].major=!0);return e}(t,i,r,n):i}class pu extends ia{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const n=t.time||(t.time={}),i=this._adapter=new uo._date(t.adapters.date);Pe(n.displayFormats,i.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:cu(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,n=t.time.unit||"day";let{min:i,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function s(t){o||isNaN(t.min)||(i=Math.min(i,t.min)),a||isNaN(t.max)||(r=Math.max(r,t.max))}o&&a||(s(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||s(this.getMinMax(!1))),i=De(i)&&!isNaN(i)?i:+e.startOf(Date.now(),n),r=De(r)&&!isNaN(r)?r:+e.endOf(Date.now(),n)+1,this.min=Math.min(i,r-1),this.max=Math.max(i+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}buildTicks(){const t=this.options,e=t.time,n=t.ticks,i="labels"===n.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const r=this.min,o=function(t,e,n){let i=0,r=t.length;for(;i<r&&t[i]<e;)i++;for(;r>i&&t[r-1]>n;)r--;return i>0||r<t.length?t.slice(i,r):t}(i,r,this.max);return this._unit=e.unit||(n.autoSkip?hu(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):function(t,e,n,i,r){for(let o=uu.length-1;o>=uu.indexOf(n);o--){const n=uu[o];if(su[n].common&&t._adapter.diff(r,i,n)>=e-1)return n}return uu[n?uu.indexOf(n):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=n.major.enabled&&"year"!==this._unit?function(t){for(let e=uu.indexOf(t)+1,n=uu.length;e<n;++e)if(su[uu[e]].common)return uu[e]}(this._unit):void 0,this.initOffsets(i),t.reverse&&o.reverse(),fu(this,o,this._majorUnit)}initOffsets(t){let e,n,i=0,r=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),i=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,n=this.getDecimalForValue(t[t.length-1]),r=1===t.length?n:(n-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;i=hn(i,0,o),r=hn(r,0,o),this._offsets={start:i,end:r,factor:1/(i+1+r)}}_generate(){const t=this._adapter,e=this.min,n=this.max,i=this.options,r=i.time,o=r.unit||hu(r.minUnit,e,n,this._getLabelCapacity(e)),a=ke(r.stepSize,1),s="week"===o&&r.isoWeekday,u=tn(s)||!0===s,l={};let c,h,d=e;if(u&&(d=+t.startOf(d,"isoWeek",s)),d=+t.startOf(d,u?"day":o),t.diff(n,e,o)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+o);const f="data"===i.ticks.source&&this.getDataTimestamps();for(c=d,h=0;c<n;c=+t.add(c,a,o),h++)du(l,c,f);return c!==n&&"ticks"!==i.bounds&&1!==h||du(l,c,f),Object.keys(l).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}_tickFormatFunction(t,e,n,i){const r=this.options,o=r.time.displayFormats,a=this._unit,s=this._majorUnit,u=a&&o[a],l=s&&o[s],c=n[e],h=s&&l&&c&&c.major,d=this._adapter.format(t,i||(h?l:u)),f=r.ticks.callback;return f?Ce(f,[d,e,n],this):d}generateTickLabels(t){let e,n,i;for(e=0,n=t.length;e<n;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+n)*e.factor)}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,n=this.ctx.measureText(t).width,i=rn(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:n*r+a*o,h:n*o+a*r}}_getLabelCapacity(t){const e=this.options.time,n=e.displayFormats,i=n[e.unit]||n.millisecond,r=this._tickFormatFunction(t,0,fu(this,[t],this._majorUnit),i),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,n=this._cache.data||[];if(n.length)return n;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(t=0,e=i.length;t<e;++t)n=n.concat(i[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const t=this._cache.labels||[];let e,n;if(t.length)return t;const i=this.getLabels();for(e=0,n=i.length;e<n;++e)t.push(cu(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Oi(t.sort(lu))}}function gu(t,e,n){let i,r,o,a,s=0,u=t.length-1;n?(e>=t[s].pos&&e<=t[u].pos&&({lo:s,hi:u}=Ti(t,"pos",e)),({pos:i,time:o}=t[s]),({pos:r,time:a}=t[u])):(e>=t[s].time&&e<=t[u].time&&({lo:s,hi:u}=Ti(t,"time",e)),({time:i,pos:o}=t[s]),({time:r,pos:a}=t[u]));const l=r-i;return l?o+(a-o)*(e-i)/l:o}pu.id="time",pu.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class mu extends pu{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=gu(e,this.min),this._tableRange=gu(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,i=[],r=[];let o,a,s,u,l;for(o=0,a=t.length;o<a;++o)u=t[o],u>=e&&u<=n&&i.push(u);if(i.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(o=0,a=i.length;o<a;++o)l=i[o+1],s=i[o-1],u=i[o],Math.round((l+s)/2)!==u&&r.push({time:u,pos:o/(a-1)});return r}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return t=e.length&&n.length?this.normalize(e.concat(n)):e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(gu(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return gu(this._table,n*this._tableRange+this._minPos,!0)}}mu.id="timeseries",mu.defaults=pu.defaults;const vu=[oo,ns,Gs,Object.freeze({__proto__:null,CategoryScale:Hs,LinearScale:Xs,LogarithmicScale:Zs,RadialLinearScale:au,TimeScale:pu,TimeSeriesScale:mu})];Sa.register(...vu);const yu=Sa;var bu=n(757),_u=n.n(bu),Eu=["query","success","failure"];function xu(){return xu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=Au(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},xu.apply(this,arguments)}function Au(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Ru(t)););return t}function Du(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(t,"prototype",{value:Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),writable:!1}),e&&Ou(t,e)}function wu(t){var e=Iu();return function(){var n,i=Ru(t);if(e){var r=Ru(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return ku(this,n)}}function ku(t,e){if(e&&("object"===$u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Tu(t)}function Tu(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Cu(t){var e="function"==typeof Map?new Map:void 0;return Cu=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return Su(t,arguments,Ru(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Ou(n,t)},Cu(t)}function Su(t,e,n){return Su=Iu()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&Ou(r,n.prototype),r},Su.apply(null,arguments)}function Iu(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Ou(t,e){return Ou=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},Ou(t,e)}function Ru(t){return Ru=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ru(t)}function Mu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lu(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Pu(t,e,n){return e&&Lu(t.prototype,e),n&&Lu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Fu(t,e,n,i,r,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(i,r)}function Bu(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function a(t){Fu(o,i,r,a,s,"next",t)}function s(t){Fu(o,i,r,a,s,"throw",t)}a(void 0)}))}}function Nu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var i,r,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(i=n.next()).done)&&(o.push(i.value),!e||o.length!==e);a=!0);}catch(t){s=!0,r=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return o}(t,e)||Hu(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ju(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Vu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function zu(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Vu(Object(n),!0).forEach((function(e){Uu(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vu(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Uu(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gu(t){return function(t){if(Array.isArray(t))return qu(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Hu(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wu(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Hu(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Hu(t,e){if(t){if("string"==typeof t)return qu(t,e);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)?qu(t,e):void 0}}function qu(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function $u(t){return $u="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},$u(t)}var Yu=Object.create,Xu=Object.defineProperty,Ku=Object.getPrototypeOf,Zu=Object.prototype.hasOwnProperty,Ju=Object.getOwnPropertyNames,Qu=Object.getOwnPropertyDescriptor,tl=function(t,e){return function(){return e||t((e={exports:{}}).exports,e),e.exports}},el=function(t){return function(t,e,n){if(e&&"object"===$u(e)||"function"==typeof e){var i,r=Wu(Ju(e));try{var o=function(){var r=i.value;Zu.call(t,r)||"default"===r||Xu(t,r,{get:function(){return e[r]},enumerable:!(n=Qu(e,r))||n.enumerable})};for(r.s();!(i=r.n()).done;)o()}catch(t){r.e(t)}finally{r.f()}}return t}(function(t){return Xu(t,"__esModule",{value:!0})}(Xu(null!=t?Yu(Ku(t)):{},"default",t&&t.__esModule&&"default"in t?{get:function(){return t.default},enumerable:!0}:{value:t,enumerable:!0})),t)},nl=tl((function(t,e){var i,r;i=t,r=function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-:/.()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d\d/,i=/\d\d?/,r=/\d*[^\s\d-_:/()]+/,o={},a=function(t){return(t=+t)+(t>68?1900:2e3)},s=function(t){return function(e){this[t]=+e}},u=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],l=function(t){var e=o[t];return e&&(e.indexOf?e:e.s.concat(e.f))},c=function(t,e){var n,i=o.meridiem;if(i){for(var r=1;r<=24;r+=1)if(t.indexOf(i(r,0,e))>-1){n=r>12;break}}else n=t===(e?"pm":"PM");return n},h={A:[r,function(t){this.afternoon=c(t,!1)}],a:[r,function(t){this.afternoon=c(t,!0)}],S:[/\d/,function(t){this.milliseconds=100*+t}],SS:[n,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[i,s("seconds")],ss:[i,s("seconds")],m:[i,s("minutes")],mm:[i,s("minutes")],H:[i,s("hours")],h:[i,s("hours")],HH:[i,s("hours")],hh:[i,s("hours")],D:[i,s("day")],DD:[n,s("day")],Do:[r,function(t){var e=o.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var i=1;i<=31;i+=1)e(i).replace(/\[|\]/g,"")===t&&(this.day=i)}],M:[i,s("month")],MM:[n,s("month")],MMM:[r,function(t){var e=l("months"),n=(l("monthsShort")||e.map((function(t){return t.substr(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[r,function(t){var e=l("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,s("year")],YY:[n,function(t){this.year=a(t)}],YYYY:[/\d{4}/,s("year")],Z:u,ZZ:u};return function(n,i,r){r.p.customParseFormat=!0,n&&n.parseTwoDigitYear&&(a=n.parseTwoDigitYear);var s=i.prototype,u=s.parse;s.parse=function(n){var i=n.date,a=n.utc,s=n.args;this.$u=a;var l=s[1];if("string"==typeof l){var c=!0===s[2],d=!0===s[3],f=c||d,p=s[2];d&&(p=s[2]),o=this.$locale(),!c&&p&&(o=r.Ls[p]),this.$d=function(n,i,r){try{if(["x","X"].indexOf(i)>-1)return new Date(("X"===i?1e3:1)*n);var a=function(n){var i,r;i=n,r=o&&o.formats;for(var a=(n=i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,i){var o=i&&i.toUpperCase();return n||r[i]||t[i]||r[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),s=a.length,u=0;u<s;u+=1){var l=a[u],c=h[l],d=c&&c[0],f=c&&c[1];a[u]=f?{regex:d,parser:f}:l.replace(/^\[|\]$/g,"")}return function(t){for(var e={},n=0,i=0;n<s;n+=1){var r=a[n];if("string"==typeof r)i+=r.length;else{var o=r.regex,u=r.parser,l=t.substr(i),c=o.exec(l)[0];u.call(e,c),t=t.replace(c,"")}}return function(t){var e=t.afternoon;if(void 0!==e){var n=t.hours;e?n<12&&(t.hours+=12):12===n&&(t.hours=0),delete t.afternoon}}(e),e}}(i)(n),s=a.year,u=a.month,l=a.day,c=a.hours,d=a.minutes,f=a.seconds,p=a.milliseconds,g=a.zone,m=new Date,v=l||(s||u?1:m.getDate()),y=s||m.getFullYear(),b=0;s&&!u||(b=u>0?u-1:m.getMonth());var _=c||0,E=d||0,x=f||0,A=p||0;return g?new Date(Date.UTC(y,b,v,_,E,x,A+60*g.offset*1e3)):r?new Date(Date.UTC(y,b,v,_,E,x,A)):new Date(y,b,v,_,E,x,A)}catch(t){return new Date("")}}(i,l,a),this.init(),p&&!0!==p&&(this.$L=this.locale(p).$L),f&&i!=this.format(l)&&(this.$d=new Date("")),o={}}else if(l instanceof Array)for(var g=l.length,m=1;m<=g;m+=1){s[1]=l[m-1];var v=r.apply(this,s);if(v.isValid()){this.$d=v.$d,this.$L=v.$L,this.init();break}m===g&&(this.$d=new Date(""))}else u.call(this,n)}}},"object"==$u(t)&&void 0!==e?e.exports=r():"function"==typeof define&&n.amdO?define(r):(i="undefined"!=typeof globalThis?globalThis:i||self).dayjs_plugin_customParseFormat=r()})),il=tl((function(t,e){var i,r;i=t,r=function(){return function(t,e,n){var i=e.prototype,r=function(t){return t&&(t.indexOf?t:t.s)},o=function(t,e,n,i,o){var a=t.name?t:t.$locale(),s=r(a[e]),u=r(a[n]),l=s||u.map((function(t){return t.substr(0,i)}));if(!o)return l;var c=a.weekStart;return l.map((function(t,e){return l[(e+(c||0))%7]}))},a=function(){return n.Ls[n.locale()]},s=function(t,e){return t.formats[e]||t.formats[e.toUpperCase()].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))},u=function(){var t=this;return{months:function(e){return e?e.format("MMMM"):o(t,"months")},monthsShort:function(e){return e?e.format("MMM"):o(t,"monthsShort","months",3)},firstDayOfWeek:function(){return t.$locale().weekStart||0},weekdays:function(e){return e?e.format("dddd"):o(t,"weekdays")},weekdaysMin:function(e){return e?e.format("dd"):o(t,"weekdaysMin","weekdays",2)},weekdaysShort:function(e){return e?e.format("ddd"):o(t,"weekdaysShort","weekdays",3)},longDateFormat:function(e){return s(t.$locale(),e)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return u.bind(this)()},n.localeData=function(){var t=a();return{firstDayOfWeek:function(){return t.weekStart||0},weekdays:function(){return n.weekdays()},weekdaysShort:function(){return n.weekdaysShort()},weekdaysMin:function(){return n.weekdaysMin()},months:function(){return n.months()},monthsShort:function(){return n.monthsShort()},longDateFormat:function(e){return s(t,e)},meridiem:t.meridiem,ordinal:t.ordinal}},n.months=function(){return o(a(),"months")},n.monthsShort=function(){return o(a(),"monthsShort","months",3)},n.weekdays=function(t){return o(a(),"weekdays",null,null,t)},n.weekdaysShort=function(t){return o(a(),"weekdaysShort","weekdays",3,t)},n.weekdaysMin=function(t){return o(a(),"weekdaysMin","weekdays",2,t)}}},"object"==$u(t)&&void 0!==e?e.exports=r():"function"==typeof define&&n.amdO?define(r):(i="undefined"!=typeof globalThis?globalThis:i||self).dayjs_plugin_localeData=r()})),rl=tl((function(t,e){var i,r;i=t,r=function(){var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(n,i,r){var o,a=function(t,n,i){void 0===i&&(i={});var r=new Date(t);return function(t,n){void 0===n&&(n={});var i=n.timeZoneName||"short",r=t+"|"+i,o=e[r];return o||(o=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:i}),e[r]=o),o}(n,i).formatToParts(r)},s=function(e,n){for(var i=a(e,n),o=[],s=0;s<i.length;s+=1){var u=i[s],l=u.type,c=u.value,h=t[l];h>=0&&(o[h]=parseInt(c,10))}var d=o[3],f=24===d?0:d,p=o[0]+"-"+o[1]+"-"+o[2]+" "+f+":"+o[4]+":"+o[5]+":000",g=+e;return(r.utc(p).valueOf()-(g-=g%1e3))/6e4},u=i.prototype;u.tz=function(t,e){void 0===t&&(t=o);var n=this.utcOffset(),i=this.toDate(),a=i.toLocaleString("en-US",{timeZone:t}),s=Math.round((i-new Date(a))/1e3/60),u=r(a).$set("millisecond",this.$ms).utcOffset(15*-Math.round(i.getTimezoneOffset()/15)-s,!0);if(e){var l=u.utcOffset();u=u.add(n-l,"minute")}return u.$x.$timezone=t,u},u.offsetName=function(t){var e=this.$x.$timezone||r.tz.guess(),n=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return"timezonename"===t.type.toLowerCase()}));return n&&n.value};var l=u.startOf;u.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return l.call(this,t,e);var n=r(this.format("YYYY-MM-DD HH:mm:ss:SSS"));return l.call(n,t,e).tz(this.$x.$timezone,!0)},r.tz=function(t,e,n){var i=n&&e,a=n||e||o,u=s(+r(),a);if("string"!=typeof t)return r(t).tz(a);var l=function(t,e,n){var i=t-60*e*1e3,r=s(i,n);if(e===r)return[i,e];var o=s(i-=60*(r-e)*1e3,n);return r===o?[i,r]:[t-60*Math.min(r,o)*1e3,Math.max(r,o)]}(r.utc(t,i).valueOf(),u,a),c=l[0],h=l[1],d=r(c).utcOffset(h);return d.$x.$timezone=a,d},r.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},r.tz.setDefault=function(t){o=t}}},"object"==$u(t)&&void 0!==e?e.exports=r():"function"==typeof define&&n.amdO?define(r):(i="undefined"!=typeof globalThis?globalThis:i||self).dayjs_plugin_timezone=r()})),ol=tl((function(t,e){var i,r;i=t,r=function(){var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(i,r,o){var a=r.prototype;o.utc=function(t){var e={date:t,utc:!0,args:arguments};return new r(e)},a.utc=function(e){var n=o(this.toDate(),{locale:this.$L,utc:!0});return e?n.add(this.utcOffset(),t):n},a.local=function(){return o(this.toDate(),{locale:this.$L,utc:!1})};var s=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),s.call(this,t)};var u=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else u.call(this)};var l=a.utcOffset;a.utcOffset=function(i,r){var o=this.$utils().u;if(o(i))return this.$u?0:o(this.$offset)?l.call(this):this.$offset;if("string"==typeof i&&null===(i=function(t){void 0===t&&(t="");var i=t.match(e);if(!i)return null;var r=(""+i[0]).match(n)||["-",0,0],o=r[0],a=60*+r[1]+ +r[2];return 0===a?0:"+"===o?a:-a}(i)))return this;var a=Math.abs(i)<=16?60*i:i,s=this;if(r)return s.$offset=a,s.$u=0===i,s;if(0!==i){var u=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(s=this.local().add(a+u,t)).$offset=a,s.$x.$localOffset=u}else s=this.utc();return s};var c=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return c.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||(new Date).getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var h=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?o(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():h.call(this)};var d=a.diff;a.diff=function(t,e,n){if(t&&this.$u===t.$u)return d.call(this,t,e,n);var i=this.local(),r=o(t).local();return d.call(i,r,e,n)}}},"object"==$u(t)&&void 0!==e?e.exports=r():"function"==typeof define&&n.amdO?define(r):(i="undefined"!=typeof globalThis?globalThis:i||self).dayjs_plugin_utc=r()})),al=tl((function(t,e){(function(){}).call(t),function(){null==window.Set&&(window.Set=function(){function t(){this.clear()}return t.prototype.clear=function(){return this.values=[]},t.prototype.has=function(t){return-1!==this.values.indexOf(t)},t.prototype.add=function(t){return this.has(t)||this.values.push(t),this},t.prototype.delete=function(t){var e;return-1!==(e=this.values.indexOf(t))&&(this.values.splice(e,1),!0)},t.prototype.forEach=function(){var t;return(t=this.values).forEach.apply(t,arguments)},t}())}.call(t),function(t){function n(){}function i(t){if("object"!=$u(this))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(t,this)}function r(t,e){for(;3===t._state;)t=t._value;return 0===t._state?void t._deferreds.push(e):(t._handled=!0,void h((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var i;try{i=n(t._value)}catch(t){return void a(e.promise,t)}o(e.promise,i)}else(1===t._state?o:a)(e.promise,t._value)})))}function o(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==$u(e)||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l(function(t,e){return function(){t.apply(e,arguments)}}(n,e),t)}t._state=1,t._value=e,s(t)}catch(e){a(t,e)}}function a(t,e){t._state=2,t._value=e,s(t)}function s(t){2===t._state&&0===t._deferreds.length&&setTimeout((function(){t._handled||d(t._value)}),1);for(var e=0,n=t._deferreds.length;n>e;e++)r(t,t._deferreds[e]);t._deferreds=null}function u(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function l(t,e){var n=!1;try{t((function(t){n||(n=!0,o(e,t))}),(function(t){n||(n=!0,a(e,t))}))}catch(t){if(n)return;n=!0,a(e,t)}}var c=setTimeout,h="function"==typeof setImmediate&&setImmediate||function(t){c(t,1)},d=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};i.prototype.catch=function(t){return this.then(null,t)},i.prototype.then=function(t,e){var o=new i(n);return r(this,new u(t,e,o)),o},i.all=function(t){var e=Array.prototype.slice.call(t);return new i((function(t,n){function i(o,a){try{if(a&&("object"==$u(a)||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(t){i(o,t)}),n)}e[o]=a,0==--r&&t(e)}catch(t){n(t)}}if(0===e.length)return t([]);for(var r=e.length,o=0;o<e.length;o++)i(o,e[o])}))},i.resolve=function(t){return t&&"object"==$u(t)&&t.constructor===i?t:new i((function(e){e(t)}))},i.reject=function(t){return new i((function(e,n){n(t)}))},i.race=function(t){return new i((function(e,n){for(var i=0,r=t.length;r>i;i++)t[i].then(e,n)}))},i._setImmediateFn=function(t){h=t},i._setUnhandledRejectionFn=function(t){d=t},void 0!==e&&e.exports?e.exports=i:t.Promise||(t.Promise=i)}(t),function(){var t,e,n,i="object"==$u(window.customElements),r="function"==typeof document.registerElement;i||r||("undefined"==typeof WeakMap&&(t=Object.defineProperty,e=Date.now()%1e9,(n=function(){this.name="__st"+(1e9*Math.random()>>>0)+e+++"__"}).prototype={set:function(e,n){var i=e[this.name];return i&&i[0]===e?i[1]=n:t(e,this.name,{value:[e,n],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},delete:function(t){var e=t[this.name];return!(!e||e[0]!==t||(e[0]=e[1]=void 0,0))},has:function(t){var e=t[this.name];return!!e&&e[0]===t}},window.WeakMap=n),function(t){function e(){g=!1;var t=m;m=[],t.sort((function(t,e){return t.uid_-e.uid_}));var n=!1;t.forEach((function(t){var e=t.takeRecords();(function(t){t.nodes_.forEach((function(e){var n=c.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))})(t),e.length&&(t.callback_(e,t),n=!0)})),n&&e()}function n(t,e){for(var n=t;n;n=n.parentNode){var i=c.get(n);if(i)for(var r=0;r<i.length;r++){var o=i[r],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}function i(t){this.callback_=t,this.nodes_=[],this.records_=[],this.uid_=++v}function r(t,e){this.type=t,this.target=e,this.addedNodes=[],this.removedNodes=[],this.previousSibling=null,this.nextSibling=null,this.attributeName=null,this.attributeNamespace=null,this.oldValue=null}function o(t,e){return f=new r(t,e)}function a(t){return p||(p=function(t){var e=new r(t.type,t.target);return e.addedNodes=t.addedNodes.slice(),e.removedNodes=t.removedNodes.slice(),e.previousSibling=t.previousSibling,e.nextSibling=t.nextSibling,e.attributeName=t.attributeName,e.attributeNamespace=t.attributeNamespace,e.oldValue=t.oldValue,e}(f),p.oldValue=t,p)}function s(t,e){return t===e?t:p&&function(t){return t===p||t===f}(t)?p:null}function u(t,e,n){this.observer=t,this.target=e,this.options=n,this.transientObservedNodes=[]}if(!t.JsMutationObserver){var l,c=new WeakMap;if(/Trident|Edge/.test(navigator.userAgent))l=setTimeout;else if(window.setImmediate)l=window.setImmediate;else{var h=[],d=String(Math.random());window.addEventListener("message",(function(t){if(t.data===d){var e=h;h=[],e.forEach((function(t){t()}))}})),l=function(t){h.push(t),window.postMessage(d,"*")}}var f,p,g=!1,m=[],v=0;i.prototype={observe:function(t,e){if(t=function(t){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(t)||t}(t),!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n=c.get(t);n||c.set(t,n=[]);for(var i,r=0;r<n.length;r++)if(n[r].observer===this){(i=n[r]).removeListeners(),i.options=e;break}i||(i=new u(this,t,e),n.push(i),this.nodes_.push(t)),i.addListeners()},disconnect:function(){this.nodes_.forEach((function(t){for(var e=c.get(t),n=0;n<e.length;n++){var i=e[n];if(i.observer===this){i.removeListeners(),e.splice(n,1);break}}}),this),this.records_=[]},takeRecords:function(){var t=this.records_;return this.records_=[],t}},u.prototype={enqueue:function(t){var n=this.observer.records_,i=n.length;if(n.length>0){var r=s(n[i-1],t);if(r)return void(n[i-1]=r)}else!function(t){m.push(t),g||(g=!0,l(e))}(this.observer);n[i]=t},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(t){var e=this.options;e.attributes&&t.addEventListener("DOMAttrModified",this,!0),e.characterData&&t.addEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.addEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(t){var e=this.options;e.attributes&&t.removeEventListener("DOMAttrModified",this,!0),e.characterData&&t.removeEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.removeEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(t){if(t!==this.target){this.addListeners_(t),this.transientObservedNodes.push(t);var e=c.get(t);e||c.set(t,e=[]),e.push(this)}},removeTransientObservers:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=c.get(t),n=0;n<e.length;n++)if(e[n]===this){e.splice(n,1);break}}),this)},handleEvent:function(t){switch(t.stopImmediatePropagation(),t.type){case"DOMAttrModified":var e=t.attrName,i=t.relatedNode.namespaceURI,r=t.target;(u=new o("attributes",r)).attributeName=e,u.attributeNamespace=i;var s=t.attrChange===MutationEvent.ADDITION?null:t.prevValue;n(r,(function(t){return!t.attributes||t.attributeFilter&&t.attributeFilter.length&&-1===t.attributeFilter.indexOf(e)&&-1===t.attributeFilter.indexOf(i)?void 0:t.attributeOldValue?a(s):u}));break;case"DOMCharacterDataModified":var u=o("characterData",r=t.target);s=t.prevValue;n(r,(function(t){return t.characterData?t.characterDataOldValue?a(s):u:void 0}));break;case"DOMNodeRemoved":this.addTransientObserver(t.target);case"DOMNodeInserted":var l,c,h=t.target;"DOMNodeInserted"===t.type?(l=[h],c=[]):(l=[],c=[h]);var d=h.previousSibling,g=h.nextSibling;(u=o("childList",t.target.parentNode)).addedNodes=l,u.removedNodes=c,u.previousSibling=d,u.nextSibling=g,n(t.relatedNode,(function(t){return t.childList?u:void 0}))}f=p=void 0}},t.JsMutationObserver=i,t.MutationObserver||(t.MutationObserver=i,i._isPolyfilled=!0)}}(self),function(){if(!window.performance||!window.performance.now){var t=Date.now();window.performance={now:function(){return Date.now()-t}}}var e;window.requestAnimationFrame||(window.requestAnimationFrame=(e=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)?function(t){return e((function(){t(performance.now())}))}:function(t){return window.setTimeout(t,1e3/60)}),window.cancelAnimationFrame||(window.cancelAnimationFrame=window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||function(t){clearTimeout(t)});var n=function(){var t=document.createEvent("Event");return t.initEvent("foo",!0,!0),t.preventDefault(),t.defaultPrevented}();if(!n){var i=Event.prototype.preventDefault;Event.prototype.preventDefault=function(){this.cancelable&&(i.call(this),Object.defineProperty(this,"defaultPrevented",{get:function(){return!0},configurable:!0}))}}var r=/Trident/.test(navigator.userAgent);if((!window.CustomEvent||r&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(t,e){e=e||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,Boolean(e.bubbles),Boolean(e.cancelable),e.detail),n},window.CustomEvent.prototype=window.Event.prototype),!window.Event||r&&"function"!=typeof window.Event){var o=window.Event;window.Event=function(t,e){e=e||{};var n=document.createEvent("Event");return n.initEvent(t,Boolean(e.bubbles),Boolean(e.cancelable)),n},window.Event.prototype=o.prototype}}(window.WebComponents),window.CustomElements=window.CustomElements||{flags:{}},function(t){var e=t.flags,n=[];t.addModule=function(t){n.push(t)},t.initializeModules=function(){n.forEach((function(e){e(t)}))},t.hasNative=Boolean(document.registerElement),t.isIE=/Trident/.test(navigator.userAgent),t.useNative=!e.register&&t.hasNative&&!window.ShadowDOMPolyfill&&(!window.HTMLImports||window.HTMLImports.useNative)}(window.CustomElements),window.CustomElements.addModule((function(t){function e(t,e){n(t,(function(t){return!!e(t)||void i(t,e)})),i(t,e)}function n(t,e,i){var r=t.firstElementChild;if(!r)for(r=t.firstChild;r&&r.nodeType!==Node.ELEMENT_NODE;)r=r.nextSibling;for(;r;)!0!==e(r,i)&&n(r,e,i),r=r.nextElementSibling;return null}function i(t,n){for(var i=t.shadowRoot;i;)e(i,n),i=i.olderShadowRoot}function r(t,e,n){if(t=window.wrap(t),!(n.indexOf(t)>=0)){n.push(t);for(var i,a=t.querySelectorAll("link[rel="+o+"]"),s=0,u=a.length;u>s&&(i=a[s]);s++)i.import&&r(i.import,e,n);e(t)}}var o=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";t.forDocumentTree=function(t,e){r(t,e,[])},t.forSubtree=e})),window.CustomElements.addModule((function(t){function e(t,e){return n(t,e)||i(t,e)}function n(e,n){return!!t.upgrade(e,n)||void(n&&a(e))}function i(t,e){p(t,(function(t){return!!n(t,e)||void 0}))}function r(t){y.push(t),v||(v=!0,setTimeout(o))}function o(){v=!1;for(var t,e=y,n=0,i=e.length;i>n&&(t=e[n]);n++)t();y=[]}function a(t){m?r((function(){s(t)})):s(t)}function s(t){t.__upgraded__&&!t.__attached&&(t.__attached=!0,t.attachedCallback&&t.attachedCallback())}function u(t){m?r((function(){l(t)})):l(t)}function l(t){t.__upgraded__&&t.__attached&&(t.__attached=!1,t.detachedCallback&&t.detachedCallback())}function c(t,n){if(f.dom){var i=n[0];if(i&&"childList"===i.type&&i.addedNodes&&i.addedNodes){for(var r=i.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var o=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";o=o.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",n.length,o||"")}var a=function(t){for(var e=t,n=window.wrap(document);e;){if(e==n)return!0;e=e.parentNode||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host}}(t);n.forEach((function(t){"childList"===t.type&&(b(t.addedNodes,(function(t){t.localName&&e(t,a)})),b(t.removedNodes,(function(t){t.localName&&function(t){u(t),p(t,(function(t){u(t)}))}(t)})))})),f.dom&&console.groupEnd()}function h(t){if(!t.__observer){var e=new MutationObserver(c.bind(this,t));e.observe(t,{childList:!0,subtree:!0}),t.__observer=e}}function d(t){t=window.wrap(t),f.dom&&console.group("upgradeDocument: ",t.baseURI.split("/").pop()),e(t,t===window.wrap(document)),h(t),f.dom&&console.groupEnd()}var f=t.flags,p=t.forSubtree,g=t.forDocumentTree,m=window.MutationObserver._isPolyfilled&&f["throttle-attached"];t.hasPolyfillMutations=m,t.hasThrottledAttached=m;var v=!1,y=[],b=Array.prototype.forEach.call.bind(Array.prototype.forEach),_=Element.prototype.createShadowRoot;_&&(Element.prototype.createShadowRoot=function(){var t=_.call(this);return window.CustomElements.watchShadow(this),t}),t.watchShadow=function(t){if(t.shadowRoot&&!t.shadowRoot.__watched){f.dom&&console.log("watching shadow-root for: ",t.localName);for(var e=t.shadowRoot;e;)h(e),e=e.olderShadowRoot}},t.upgradeDocumentTree=function(t){g(t,d)},t.upgradeDocument=d,t.upgradeSubtree=i,t.upgradeAll=e,t.attached=a,t.takeRecords=function(t){for((t=window.wrap(t))||(t=window.wrap(document));t.parentNode;)t=t.parentNode;var e=t.__observer;e&&(c(t,e.takeRecords()),o())}})),window.CustomElements.addModule((function(t){function e(e,r,o){return i.upgrade&&console.group("upgrade:",e.localName),r.is&&e.setAttribute("is",r.is),n(e,r),e.__upgraded__=!0,(a=e).createdCallback&&a.createdCallback(),o&&t.attached(e),t.upgradeSubtree(e,o),i.upgrade&&console.groupEnd(),e;var a}function n(t,e){Object.__proto__||function(t,e,n){for(var i={},r=e;r!==n&&r!==HTMLElement.prototype;){for(var o,a=Object.getOwnPropertyNames(r),s=0;o=a[s];s++)i[o]||(Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o)),i[o]=1);r=Object.getPrototypeOf(r)}}(t,e.prototype,e.native),t.__proto__=e.prototype}var i=t.flags;t.upgrade=function(n,i){if("template"===n.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(n),!n.__upgraded__&&n.nodeType===Node.ELEMENT_NODE){var r=n.getAttribute("is"),o=t.getRegisteredDefinition(n.localName)||t.getRegisteredDefinition(r);if(o&&(r&&o.tag==n.localName||!r&&!o.extends))return e(n,o,i)}},t.upgradeWithDefinition=e,t.implementPrototype=n})),window.CustomElements.addModule((function(t){function e(t,e,n){t=t.toLowerCase();var i=this.getAttribute(t);n.apply(this,arguments);var r=this.getAttribute(t);this.attributeChangedCallback&&r!==i&&this.attributeChangedCallback(t,i,r)}function n(t){var e=i(t);return e?n(e.extends).concat([e]):[]}function i(t){return t?f[t.toLowerCase()]:void 0}function r(t,e){t&&(t=t.toLowerCase()),e&&(e=e.toLowerCase());var n,o=i(e||t);if(o){if(t==o.tag&&e==o.is)return new o.ctor;if(!e&&!o.is)return new o.ctor}return e?((n=r(t)).setAttribute("is",e),n):(n=g(t),t.indexOf("-")>=0&&c(n,HTMLElement),n)}function o(t,e){var n=t[e];t[e]=function(){var t=n.apply(this,arguments);return u(t),t}}var a,s=(t.isIE,t.upgradeDocumentTree),u=t.upgradeAll,l=t.upgradeWithDefinition,c=t.implementPrototype,h=t.useNative,d=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],f={},p="http://www.w3.org/1999/xhtml",g=document.createElement.bind(document),m=document.createElementNS.bind(document);a=Object.__proto__||h?function(t,e){return t instanceof e}:function(t,e){if(t instanceof e)return!0;for(var n=t;n;){if(n===e.prototype)return!0;n=n.__proto__}return!1},o(Node.prototype,"cloneNode"),o(document,"importNode"),document.registerElement=function(r,o){var a,u=o||{};if(!r)throw new Error("document.registerElement: first argument `name` must not be empty");if(r.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(r)+"'.");if(function(t){for(var e=0;e<d.length;e++)if(t===d[e])return!0}(r))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(r)+"'. The type name is invalid.");if(i(r))throw new Error("DuplicateDefinitionError: a type with name '"+String(r)+"' is already registered");return u.prototype||(u.prototype=Object.create(HTMLElement.prototype)),u.__name=r.toLowerCase(),u.extends&&(u.extends=u.extends.toLowerCase()),u.lifecycle=u.lifecycle||{},u.ancestry=n(u.extends),function(t){for(var e,n=t.extends,i=0;e=t.ancestry[i];i++)n=e.is&&e.tag;t.tag=n||t.__name,n&&(t.is=t.__name)}(u),function(t){if(!Object.__proto__){var e=HTMLElement.prototype;if(t.is){var n=document.createElement(t.tag);e=Object.getPrototypeOf(n)}for(var i,r=t.prototype,o=!1;r;)r==e&&(o=!0),(i=Object.getPrototypeOf(r))&&(r.__proto__=i),r=i;o||console.warn(t.tag+" prototype not found in prototype chain for "+t.is),t.native=e}}(u),function(t){if(!t.setAttribute._polyfilled){var n=t.setAttribute;t.setAttribute=function(t,i){e.call(this,t,i,n)};var i=t.removeAttribute;t.removeAttribute=function(t){e.call(this,t,null,i)},t.setAttribute._polyfilled=!0}}(u.prototype),function(t,e){f[t]=e}(u.__name,u),u.ctor=(a=u,function(){return function(t){return l(g(t.tag),t)}(a)}),u.ctor.prototype=u.prototype,u.prototype.constructor=u.ctor,t.ready&&s(document),u.ctor},document.createElement=r,document.createElementNS=function(t,e,n){return t===p?r(e,n):m(t,e)},t.registry=f,t.instanceof=a,t.reservedTagList=d,t.getRegisteredDefinition=i,document.register=document.registerElement})),function(t){function e(){o(window.wrap(document)),window.CustomElements.ready=!0,(window.requestAnimationFrame||function(t){setTimeout(t,16)})((function(){setTimeout((function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))}))}))}var n=t.useNative,i=t.initializeModules;if(t.isIE,n){var r=function(){};t.watchShadow=r,t.upgrade=r,t.upgradeAll=r,t.upgradeDocumentTree=r,t.upgradeSubtree=r,t.takeRecords=r,t.instanceof=function(t,e){return t instanceof e}}else i();var o=t.upgradeDocumentTree,a=t.upgradeDocument;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(t){return t}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(t){t.import&&a(wrap(t.import))}),"complete"===document.readyState||t.flags.eager)e();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var s=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(s,e)}else e()}(window.CustomElements))}.call(t),function(){}.call(t),function(){(function(){(function(){this.Trix={VERSION:"1.3.1",ZERO_WIDTH_SPACE:"\ufeff",NON_BREAKING_SPACE:" ",OBJECT_REPLACEMENT_CHARACTER:"￼",browser:{composesExistingText:/Android.*Chrome/.test(navigator.userAgent),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:function(){var t,e,n;if("undefined"==typeof InputEvent)return!1;for(t=0,e=(n=["data","getTargetRanges","inputType"]).length;e>t;t++)if(!(n[t]in InputEvent.prototype))return!1;return!0}()},config:{}}}).call(this)}).call(this);var t=this.Trix;(function(){(function(){t.BasicObject=function(){function t(){}var e,n,i;return t.proxyMethod=function(t){var i,r,o,a,s;return o=n(t),i=o.name,a=o.toMethod,s=o.toProperty,r=o.optional,this.prototype[i]=function(){var t,n;return t=null!=a?r?"function"==typeof this[a]?this[a]():void 0:this[a]():null!=s?this[s]:void 0,r?null!=(n=null!=t?t[i]:void 0)?e.call(n,t,arguments):void 0:(n=t[i],e.call(n,t,arguments))}},n=function(t){var e,n;if(!(n=t.match(i)))throw new Error("can't parse @proxyMethod expression: "+t);return e={name:n[4]},null!=n[2]?e.toMethod=n[1]:e.toProperty=n[1],null!=n[3]&&(e.optional=!0),e},e=Function.prototype.apply,i=/^(.+?)(\(\))?(\?)?\.(.+?)$/,t}()}).call(this),function(){var e={}.hasOwnProperty;t.Object=function(n){function i(){this.id=++r}var r;return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(i,n),r=0,i.fromJSONString=function(t){return this.fromJSON(JSON.parse(t))},i.prototype.hasSameConstructorAs=function(t){return this.constructor===(null!=t?t.constructor:void 0)},i.prototype.isEqualTo=function(t){return this===t},i.prototype.inspect=function(){var t,e,n;return t=function(){var t,i,r;for(e in r=[],i=null!=(t=this.contentsForInspection())?t:{})n=i[e],r.push(e+"="+n);return r}.call(this),"#<"+this.constructor.name+":"+this.id+(t.length?" "+t.join(", "):"")+">"},i.prototype.contentsForInspection=function(){},i.prototype.toJSONString=function(){return JSON.stringify(this)},i.prototype.toUTF16String=function(){return t.UTF16String.box(this)},i.prototype.getCacheKey=function(){return this.id.toString()},i}(t.BasicObject)}.call(this),function(){t.extend=function(t){var e,n;for(e in t)n=t[e],this[e]=n;return this}}.call(this),function(){t.extend({defer:function(t){return setTimeout(t,1)}})}.call(this),function(){var e,n;t.extend({normalizeSpaces:function(e){return e.replace(RegExp(""+t.ZERO_WIDTH_SPACE,"g"),"").replace(RegExp(""+t.NON_BREAKING_SPACE,"g")," ")},normalizeNewlines:function(t){return t.replace(/\r\n/g,"\n")},breakableWhitespacePattern:RegExp("[^\\S"+t.NON_BREAKING_SPACE+"]"),squishBreakableWhitespace:function(e){return e.replace(RegExp(""+t.breakableWhitespacePattern.source,"g")," ").replace(/\ {2,}/g," ")},summarizeStringChange:function(e,i){var r,o,a,s;return e=t.UTF16String.box(e),(i=t.UTF16String.box(i)).length<e.length?(s=(o=n(e,i))[0],r=o[1]):(r=(a=n(i,e))[0],s=a[1]),{added:r,removed:s}}}),n=function(n,i){var r,o,a,s,u;return n.isEqualTo(i)?["",""]:(a=(s=(o=e(n,i)).utf16String.length)?(u=o.offset,r=n.codepoints.slice(0,u).concat(n.codepoints.slice(u+s)),e(i,t.UTF16String.fromCodepoints(r))):e(i,n),[o.utf16String.toString(),a.utf16String.toString()])},e=function(t,e){var n,i,r;for(n=0,i=t.length,r=e.length;i>n&&t.charAt(n).isEqualTo(e.charAt(n));)n++;for(;i>n+1&&t.charAt(i-1).isEqualTo(e.charAt(r-1));)i--,r--;return{utf16String:t.slice(n,i),offset:n}}}.call(this),function(){t.extend({copyObject:function(t){var e,n,i;for(e in null==t&&(t={}),n={},t)i=t[e],n[e]=i;return n},objectsAreEqual:function(t,e){var n;if(null==t&&(t={}),null==e&&(e={}),Object.keys(t).length!==Object.keys(e).length)return!1;for(n in t)if(t[n]!==e[n])return!1;return!0}})}.call(this),function(){var e=[].slice;t.extend({arraysAreEqual:function(t,e){var n,i,r;if(null==t&&(t=[]),null==e&&(e=[]),t.length!==e.length)return!1;for(i=n=0,r=t.length;r>n;i=++n)if(t[i]!==e[i])return!1;return!0},arrayStartsWith:function(e,n){return null==e&&(e=[]),null==n&&(n=[]),t.arraysAreEqual(e.slice(0,n.length),n)},spliceArray:function(){var t,n,i;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],(i=n.slice(0)).splice.apply(i,t),i},summarizeArrayChange:function(t,e){var n,i,r,o,a,s,u,l,c,h,d;for(null==t&&(t=[]),null==e&&(e=[]),n=[],h=[],r=new Set,o=0,u=t.length;u>o;o++)d=t[o],r.add(d);for(i=new Set,a=0,l=e.length;l>a;a++)d=e[a],i.add(d),r.has(d)||n.push(d);for(s=0,c=t.length;c>s;s++)d=t[s],i.has(d)||h.push(d);return{added:n,removed:h}}})}.call(this),function(){var e,n,i,r;e=null,n=null,r=null,i=null,t.extend({getAllAttributeNames:function(){return null!=e?e:e=t.getTextAttributeNames().concat(t.getBlockAttributeNames())},getBlockConfig:function(e){return t.config.blockAttributes[e]},getBlockAttributeNames:function(){return null!=n?n:n=Object.keys(t.config.blockAttributes)},getTextConfig:function(e){return t.config.textAttributes[e]},getTextAttributeNames:function(){return null!=r?r:r=Object.keys(t.config.textAttributes)},getListAttributeNames:function(){var e,n;return null!=i?i:i=function(){var i,r;for(e in r=[],i=t.config.blockAttributes)null!=(n=i[e].listAttribute)&&r.push(n);return r}()}})}.call(this),function(){var e,n,i,r,o,a=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=document.documentElement,n=null!=(i=null!=(r=null!=(o=e.matchesSelector)?o:e.webkitMatchesSelector)?r:e.msMatchesSelector)?i:e.mozMatchesSelector,t.extend({handleEvent:function(n,i){var r,o,a,s,u,l,c,h,d,f,p;return u=(c=null!=i?i:{}).onElement,s=c.matchingSelector,p=c.withCallback,a=c.inPhase,l=c.preventDefault,d=c.times,r=null!=u?u:e,h=s,p,f="capturing"===a,(o=function(e){var n;return null!=d&&0==--d&&o.destroy(),null!=(n=t.findClosestElementFromNode(e.target,{matchingSelector:h}))&&(null!=p&&p.call(n,e,n),l)?e.preventDefault():void 0}).destroy=function(){return r.removeEventListener(n,o,f)},r.addEventListener(n,o,f),o},handleEventOnce:function(e,n){return null==n&&(n={}),n.times=1,t.handleEvent(e,n)},triggerEvent:function(n,i){var r,o,a,s,u,l,c;return l=(c=null!=i?i:{}).onElement,o=c.bubbles,a=c.cancelable,r=c.attributes,s=null!=l?l:e,o=!1!==o,a=!1!==a,(u=document.createEvent("Events")).initEvent(n,o,a),null!=r&&t.extend.call(u,r),s.dispatchEvent(u)},elementMatchesSelector:function(t,e){return 1===(null!=t?t.nodeType:void 0)?n.call(t,e):void 0},findClosestElementFromNode:function(e,n){var i,r,o;for(i=(r=null!=n?n:{}).matchingSelector,o=r.untilNode;null!=e&&e.nodeType!==Node.ELEMENT_NODE;)e=e.parentNode;if(null!=e){if(null==i)return e;if(e.closest&&null==o)return e.closest(i);for(;e&&e!==o;){if(t.elementMatchesSelector(e,i))return e;e=e.parentNode}}},findInnerElement:function(t){for(;null!=t?t.firstElementChild:void 0;)t=t.firstElementChild;return t},innerElementIsActive:function(e){return document.activeElement!==e&&t.elementContainsNode(e,document.activeElement)},elementContainsNode:function(t,e){if(t&&e)for(;e;){if(e===t)return!0;e=e.parentNode}},findNodeFromContainerAndOffset:function(t,e){var n;if(t)return t.nodeType===Node.TEXT_NODE?t:0===e?null!=(n=t.firstChild)?n:t:t.childNodes.item(e-1)},findElementFromContainerAndOffset:function(e,n){var i;return i=t.findNodeFromContainerAndOffset(e,n),t.findClosestElementFromNode(i)},findChildIndexOfNode:function(t){var e;if(null!=t?t.parentNode:void 0){for(e=0;t=t.previousSibling;)e++;return e}},removeNode:function(t){var e;return null!=t&&null!=(e=t.parentNode)?e.removeChild(t):void 0},walkTree:function(t,e){var n,i,r,o,a;return i=(r=null!=e?e:{}).onlyNodesOfType,o=r.usingFilter,n=r.expandEntityReferences,a=function(){switch(i){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}}(),document.createTreeWalker(t,a,null!=o?o:null,!0===n)},tagName:function(t){var e;return null!=t&&null!=(e=t.tagName)?e.toLowerCase():void 0},makeElement:function(t,e){var n,i,r,o,a,s,u,l,c,h,d,f,p,g;if(null==e&&(e={}),"object"==$u(t)?t=(e=t).tagName:e={attributes:e},r=document.createElement(t),null!=e.editable&&(null==e.attributes&&(e.attributes={}),e.attributes.contenteditable=e.editable),e.attributes)for(s in c=e.attributes)g=c[s],r.setAttribute(s,g);if(e.style)for(s in h=e.style)g=h[s],r.style[s]=g;if(e.data)for(s in d=e.data)g=d[s],r.dataset[s]=g;if(e.className)for(o=0,u=(f=e.className.split(" ")).length;u>o;o++)i=f[o],r.classList.add(i);if(e.textContent&&(r.textContent=e.textContent),e.childNodes)for(a=0,l=(p=[].concat(e.childNodes)).length;l>a;a++)n=p[a],r.appendChild(n);return r},getBlockTagNames:function(){var e,n;return null!=t.blockTagNames?t.blockTagNames:t.blockTagNames=function(){var i,r;for(e in r=[],i=t.config.blockAttributes)(n=i[e].tagName)&&r.push(n);return r}()},nodeIsBlockContainer:function(e){return t.nodeIsBlockStartComment(null!=e?e.firstChild:void 0)},nodeProbablyIsBlockContainer:function(e){var n,i;return n=t.tagName(e),a.call(t.getBlockTagNames(),n)>=0&&(i=t.tagName(e.firstChild),a.call(t.getBlockTagNames(),i)<0)},nodeIsBlockStart:function(e,n){return(null!=n?n:{strict:!0}).strict?t.nodeIsBlockStartComment(e):t.nodeIsBlockStartComment(e)||!t.nodeIsBlockStartComment(e.firstChild)&&t.nodeProbablyIsBlockContainer(e)},nodeIsBlockStartComment:function(e){return t.nodeIsCommentNode(e)&&"block"===(null!=e?e.data:void 0)},nodeIsCommentNode:function(t){return(null!=t?t.nodeType:void 0)===Node.COMMENT_NODE},nodeIsCursorTarget:function(e,n){var i;return i=(null!=n?n:{}).name,e?t.nodeIsTextNode(e)?e.data===t.ZERO_WIDTH_SPACE?!i||e.parentNode.dataset.trixCursorTarget===i:void 0:t.nodeIsCursorTarget(e.firstChild):void 0},nodeIsAttachmentElement:function(e){return t.elementMatchesSelector(e,t.AttachmentView.attachmentSelector)},nodeIsEmptyTextNode:function(e){return t.nodeIsTextNode(e)&&""===(null!=e?e.data:void 0)},nodeIsTextNode:function(t){return(null!=t?t.nodeType:void 0)===Node.TEXT_NODE}})}.call(this),function(){var e,n,i,r,o;e=t.copyObject,r=t.objectsAreEqual,t.extend({normalizeRange:i=function(t){var e;if(null!=t)return Array.isArray(t)||(t=[t,t]),[n(t[0]),n(null!=(e=t[1])?e:t[0])]},rangeIsCollapsed:function(t){var e,n,r;if(null!=t)return r=(n=i(t))[0],e=n[1],o(r,e)},rangesAreEqual:function(t,e){var n,r,a,s,u,l;if(null!=t&&null!=e)return r=(a=i(t))[0],n=a[1],l=(s=i(e))[0],u=s[1],o(r,l)&&o(n,u)}}),n=function(t){return"number"==typeof t?t:e(t)},o=function(t,e){return"number"==typeof t?t===e:r(t,e)}}.call(this),function(){var e,n,i,r,o,a,s,u;t.registerElement=function(t,e){var n,i;return null==e&&(e={}),t=t.toLowerCase(),e=s(e),(n=(i=a(e)).defaultCSS)&&(delete i.defaultCSS,r(n,t)),o(t,i)},r=function(t,e){return i(e).textContent=t.replace(/%t/g,e)},i=function(t){var n,i;return(n=document.createElement("style")).setAttribute("type","text/css"),n.setAttribute("data-tag-name",t.toLowerCase()),(i=e())&&n.setAttribute("nonce",i),document.head.insertBefore(n,document.head.firstChild),n},e=function(){var t;return(t=n("trix-csp-nonce")||n("csp-nonce"))?t.getAttribute("content"):void 0},n=function(t){return document.head.querySelector("meta[name="+t+"]")},a=function(t){var e,n,i;for(e in n={},t)i=t[e],n[e]="function"==typeof i?{value:i}:i;return n},u=function(t){var e,n,i,r,o;for(e={},n=0,r=(o=["initialize","connect","disconnect"]).length;r>n;n++)e[i=o[n]]=t[i],delete t[i];return e},s=window.customElements?function(t){var e,n,i,r,o;return o=u(t),i=o.initialize,e=o.connect,n=o.disconnect,i&&(r=e,e=function(){return this.initialized||(this.initialized=!0,i.call(this)),null!=r?r.call(this):void 0}),e&&(t.connectedCallback=e),n&&(t.disconnectedCallback=n),t}:function(t){var e,n,i,r;return i=(r=u(t)).initialize,e=r.connect,n=r.disconnect,i&&(t.createdCallback=i),e&&(t.attachedCallback=e),n&&(t.detachedCallback=n),t},o=window.customElements?function(t,e){var n;return n=function(){return"object"==("undefined"==typeof Reflect?"undefined":$u(Reflect))?Reflect.construct(HTMLElement,[],n):HTMLElement.apply(this)},Object.setPrototypeOf(n.prototype,HTMLElement.prototype),Object.setPrototypeOf(n,HTMLElement),Object.defineProperties(n.prototype,e),window.customElements.define(t,n),n}:function(t,e){var n,i;return i=Object.create(HTMLElement.prototype,e),n=document.registerElement(t,{prototype:i}),Object.defineProperty(i,"constructor",{value:n}),n}}.call(this),function(){var e,n;t.extend({getDOMSelection:function(){var t;return(t=window.getSelection()).rangeCount>0?t:void 0},getDOMRange:function(){var n,i;return(n=null!=(i=t.getDOMSelection())?i.getRangeAt(0):void 0)&&!e(n)?n:void 0},setDOMRange:function(e){var n;return(n=window.getSelection()).removeAllRanges(),n.addRange(e),t.selectionChangeObserver.update()}}),e=function(t){return n(t.startContainer)||n(t.endContainer)},n=function(t){return!Object.getPrototypeOf(t)}}.call(this),function(){var e;e={"application/x-trix-feature-detection":"test"},t.extend({dataTransferIsPlainText:function(t){var e,n,i;return i=t.getData("text/plain"),n=t.getData("text/html"),i&&n?(e=(new DOMParser).parseFromString(n,"text/html").body).textContent===i?!e.querySelector("*"):void 0:null!=i?i.length:void 0},dataTransferIsWritable:function(t){var n,i;if(null!=(null!=t?t.setData:void 0)){for(n in e)if(i=e[n],!function(){try{return t.setData(n,i),t.getData(n)===i}catch(t){}}())return;return!0}},keyEventIsKeyboardCommand:/Mac|^iP/.test(navigator.platform)?function(t){return t.metaKey}:function(t){return t.ctrlKey}})}.call(this),function(){var e,n,i,r;t.extend({RTL_PATTERN:/[\u05BE\u05C0\u05C3\u05D0-\u05EA\u05F0-\u05F4\u061B\u061F\u0621-\u063A\u0640-\u064A\u066D\u0671-\u06B7\u06BA-\u06BE\u06C0-\u06CE\u06D0-\u06D5\u06E5\u06E6\u200F\u202B\u202E\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE72\uFE74\uFE76-\uFEFC]/,getDirection:(n=t.makeElement("input",{dir:"auto",name:"x",dirName:"x.dir"}),(e=t.makeElement("form")).appendChild(n),i=function(){try{return new FormData(e).has(n.dirName)}catch(t){}}(),r=function(){try{return n.matches(":dir(ltr),:dir(rtl)")}catch(t){}}(),i?function(t){return n.value=t,new FormData(e).get(n.dirName)}:r?function(t){return n.value=t,n.matches(":dir(rtl)")?"rtl":"ltr"}:function(e){var n;return n=e.trim().charAt(0),t.RTL_PATTERN.test(n)?"rtl":"ltr"})})}.call(this),function(){}.call(this),function(){var e,n={}.hasOwnProperty;e=t.arraysAreEqual,t.Hash=function(i){function r(t){null==t&&(t={}),this.values=a(t),r.__super__.constructor.apply(this,arguments)}var o,a,s,u,l;return function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(r,i),r.fromCommonAttributesOfObjects=function(t){var e,n,i,r,a,s;if(null==t&&(t=[]),!t.length)return new this;for(i=(e=o(t[0])).getKeys(),n=0,r=(s=t.slice(1)).length;r>n;n++)a=s[n],i=e.getKeysCommonToHash(o(a)),e=e.slice(i);return e},r.box=function(t){return o(t)},r.prototype.add=function(t,e){return this.merge(u(t,e))},r.prototype.remove=function(e){return new t.Hash(a(this.values,e))},r.prototype.get=function(t){return this.values[t]},r.prototype.has=function(t){return t in this.values},r.prototype.merge=function(e){return new t.Hash(s(this.values,l(e)))},r.prototype.slice=function(e){var n,i,r,o;for(o={},n=0,r=e.length;r>n;n++)i=e[n],this.has(i)&&(o[i]=this.values[i]);return new t.Hash(o)},r.prototype.getKeys=function(){return Object.keys(this.values)},r.prototype.getKeysCommonToHash=function(t){var e,n,i,r,a;for(t=o(t),a=[],e=0,i=(r=this.getKeys()).length;i>e;e++)n=r[e],this.values[n]===t.values[n]&&a.push(n);return a},r.prototype.isEqualTo=function(t){return e(this.toArray(),o(t).toArray())},r.prototype.isEmpty=function(){return 0===this.getKeys().length},r.prototype.toArray=function(){var t,e,n;return(null!=this.array?this.array:this.array=function(){var i;for(t in e=[],i=this.values)n=i[t],e.push(t,n);return e}.call(this)).slice(0)},r.prototype.toObject=function(){return a(this.values)},r.prototype.toJSON=function(){return this.toObject()},r.prototype.contentsForInspection=function(){return{values:JSON.stringify(this.values)}},u=function(t,e){var n;return(n={})[t]=e,n},s=function(t,e){var n,i,r;for(n in i=a(t),e)r=e[n],i[n]=r;return i},a=function(t,e){var n,i,r,o,a;for(o={},n=0,r=(a=Object.keys(t).sort()).length;r>n;n++)(i=a[n])!==e&&(o[i]=t[i]);return o},o=function(e){return e instanceof t.Hash?e:new t.Hash(e)},l=function(e){return e instanceof t.Hash?e.values:e},r}(t.Object)}.call(this),function(){t.ObjectGroup=function(){function t(t,e){var n,i;this.objects=null!=t?t:[],i=e.depth,(n=e.asTree)&&(this.depth=i,this.objects=this.constructor.groupObjects(this.objects,{asTree:n,depth:this.depth+1}))}return t.groupObjects=function(t,e){var n,i,r,o,a,s,u,l,c;for(null==t&&(t=[]),r=(c=null!=e?e:{}).depth,(n=c.asTree)&&null==r&&(r=0),l=[],a=0,s=t.length;s>a;a++){if(u=t[a],o){if(("function"==typeof u.canBeGrouped?u.canBeGrouped(r):void 0)&&("function"==typeof(i=o[o.length-1]).canBeGroupedWith?i.canBeGroupedWith(u,r):void 0)){o.push(u);continue}l.push(new this(o,{depth:r,asTree:n})),o=null}("function"==typeof u.canBeGrouped?u.canBeGrouped(r):void 0)?o=[u]:l.push(u)}return o&&l.push(new this(o,{depth:r,asTree:n})),l},t.prototype.getObjects=function(){return this.objects},t.prototype.getDepth=function(){return this.depth},t.prototype.getCacheKey=function(){var t,e,n,i,r;for(e=["objectGroup"],t=0,n=(r=this.getObjects()).length;n>t;t++)i=r[t],e.push(i.getCacheKey());return e.join("/")},t}()}.call(this),function(){var e={}.hasOwnProperty;t.ObjectMap=function(t){function n(t){var e,n,i,r,o;for(null==t&&(t=[]),this.objects={},i=0,r=t.length;r>i;i++)o=t[i],n=JSON.stringify(o),null==(e=this.objects)[n]&&(e[n]=o)}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(n,t),n.prototype.find=function(t){var e;return e=JSON.stringify(t),this.objects[e]},n}(t.BasicObject)}.call(this),function(){t.ElementStore=function(){function t(t){this.reset(t)}var e;return t.prototype.add=function(t){var n;return n=e(t),this.elements[n]=t},t.prototype.remove=function(t){var n,i;return n=e(t),(i=this.elements[n])?(delete this.elements[n],i):void 0},t.prototype.reset=function(t){var e,n,i;for(null==t&&(t=[]),this.elements={},n=0,i=t.length;i>n;n++)e=t[n],this.add(e);return t},e=function(t){return t.dataset.trixStoreKey},t}()}.call(this),function(){}.call(this),function(){var e={}.hasOwnProperty;t.Operation=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(n,t),n.prototype.isPerforming=function(){return!0===this.performing},n.prototype.hasPerformed=function(){return!0===this.performed},n.prototype.hasSucceeded=function(){return this.performed&&this.succeeded},n.prototype.hasFailed=function(){return this.performed&&!this.succeeded},n.prototype.getPromise=function(){return null!=this.promise?this.promise:this.promise=new Promise((t=this,function(e,n){return t.performing=!0,t.perform((function(i,r){return t.succeeded=i,t.performing=!1,t.performed=!0,t.succeeded?e(r):n(r)}))}));var t},n.prototype.perform=function(t){return t(!1)},n.prototype.release=function(){var t;return null!=(t=this.promise)&&"function"==typeof t.cancel&&t.cancel(),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null},n.proxyMethod("getPromise().then"),n.proxyMethod("getPromise().catch"),n}(t.BasicObject)}.call(this),function(){var e,n,i,r,o,a={}.hasOwnProperty;t.UTF16String=function(t){function e(t,e){this.ucs2String=t,this.codepoints=e,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}return function(t,e){function n(){this.constructor=t}for(var i in e)a.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(e,t),e.box=function(t){return null==t&&(t=""),t instanceof this?t:this.fromUCS2String(null!=t?t.toString():void 0)},e.fromUCS2String=function(t){return new this(t,r(t))},e.fromCodepoints=function(t){return new this(o(t),t)},e.prototype.offsetToUCS2Offset=function(t){return o(this.codepoints.slice(0,Math.max(0,t))).length},e.prototype.offsetFromUCS2Offset=function(t){return r(this.ucs2String.slice(0,Math.max(0,t))).length},e.prototype.slice=function(){var t;return this.constructor.fromCodepoints((t=this.codepoints).slice.apply(t,arguments))},e.prototype.charAt=function(t){return this.slice(t,t+1)},e.prototype.isEqualTo=function(t){return this.constructor.box(t).ucs2String===this.ucs2String},e.prototype.toJSON=function(){return this.ucs2String},e.prototype.getCacheKey=function(){return this.ucs2String},e.prototype.toString=function(){return this.ucs2String},e}(t.BasicObject),e=1===("function"==typeof Array.from?Array.from("👼").length:void 0),n=null!=("function"==typeof" ".codePointAt?" ".codePointAt(0):void 0),i=" 👼"===("function"==typeof String.fromCodePoint?String.fromCodePoint(32,128124):void 0),r=e&&n?function(t){return Array.from(t).map((function(t){return t.codePointAt(0)}))}:function(t){var e,n,i,r,o;for(r=[],e=0,i=t.length;i>e;)(o=t.charCodeAt(e++))>=55296&&56319>=o&&i>e&&(56320==(64512&(n=t.charCodeAt(e++)))?o=((1023&o)<<10)+(1023&n)+65536:e--),r.push(o);return r},o=i?function(t){return String.fromCodePoint.apply(String,t)}:function(t){var e,n;return function(){var i,r,o;for(o=[],i=0,r=t.length;r>i;i++)n=t[i],e="",n>65535&&(n-=65536,e+=String.fromCharCode(n>>>10&1023|55296),n=56320|1023&n),o.push(e+String.fromCharCode(n));return o}().join("")}}.call(this),function(){}.call(this),function(){}.call(this),function(){t.config.lang={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption…",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL…",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"}}.call(this),function(){t.config.css={attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"}}.call(this),function(){var e;t.config.blockAttributes=e={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test:function(n){return t.tagName(n.parentNode)===e[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test:function(n){return t.tagName(n.parentNode)===e[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}}}.call(this),function(){var e,n;e=t.config.lang,n=[e.bytes,e.KB,e.MB,e.GB,e.TB,e.PB],t.config.fileSize={prefix:"IEC",precision:2,formatter:function(t){var i,r;switch(t){case 0:return"0 "+e.bytes;case 1:return"1 "+e.byte;default:return i=function(){switch(this.prefix){case"SI":return 1e3;case"IEC":return 1024}}.call(this),r=Math.floor(Math.log(t)/Math.log(i)),(t/Math.pow(i,r)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"")+" "+n[r]}}}}.call(this),function(){t.config.textAttributes={bold:{tagName:"strong",inheritable:!0,parser:function(t){var e;return"bold"===(e=window.getComputedStyle(t)).fontWeight||e.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:function(t){return"italic"===window.getComputedStyle(t).fontStyle}},href:{groupTagName:"a",parser:function(e){var n,i;return i="a:not("+t.AttachmentView.attachmentSelector+")",(n=t.findClosestElementFromNode(e,{matchingSelector:i}))?n.getAttribute("href"):void 0}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}}}.call(this),function(){var e,n,i;i=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable","data-trix-placeholder","tabindex"],n="data-trix-serialized-attributes",e=new RegExp("\x3c!--block--\x3e","g"),t.extend({serializers:{"application/json":function(e){var n;if(e instanceof t.Document)n=e;else{if(!(e instanceof HTMLElement))throw new Error("unserializable object");n=t.Document.fromHTML(e.innerHTML)}return n.toSerializableDocument().toJSONString()},"text/html":function(r){var o,a,s,u,l,c,h,d,f,p,g,m,v,y,b,_,E;if(r instanceof t.Document)u=t.DocumentView.render(r);else{if(!(r instanceof HTMLElement))throw new Error("unserializable object");u=r.cloneNode(!0)}for(l=0,f=(y=u.querySelectorAll("[data-trix-serialize=false]")).length;f>l;l++)s=y[l],t.removeNode(s);for(c=0,p=i.length;p>c;c++)for(o=i[c],h=0,g=(b=u.querySelectorAll("["+o+"]")).length;g>h;h++)(s=b[h]).removeAttribute(o);for(d=0,m=(_=u.querySelectorAll("[data-trix-serialized-attributes]")).length;m>d;d++){s=_[d];try{for(v in a=JSON.parse(s.getAttribute(n)),s.removeAttribute(n),a)E=a[v],s.setAttribute(v,E)}catch(t){}}return u.innerHTML.replace(e,"")}},deserializers:{"application/json":function(e){return t.Document.fromJSONString(e)},"text/html":function(e){return t.Document.fromHTML(e)}},serializeToContentType:function(e,n){var i;if(i=t.serializers[n])return i(e);throw new Error("unknown content type: "+n)},deserializeFromContentType:function(e,n){var i;if(i=t.deserializers[n])return i(e);throw new Error("unknown content type: "+n)}})}.call(this),function(){var e;e=t.config.lang,t.config.toolbar={getDefaultHTML:function(){return'<div class="trix-button-row">\n  <span class="trix-button-group trix-button-group--text-tools" data-trix-button-group="text-tools">\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-bold" data-trix-attribute="bold" data-trix-key="b" title="'+e.bold+'" tabindex="-1">'+e.bold+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-italic" data-trix-attribute="italic" data-trix-key="i" title="'+e.italic+'" tabindex="-1">'+e.italic+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-strike" data-trix-attribute="strike" title="'+e.strike+'" tabindex="-1">'+e.strike+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-link" data-trix-attribute="href" data-trix-action="link" data-trix-key="k" title="'+e.link+'" tabindex="-1">'+e.link+'</button>\n  </span>\n\n  <span class="trix-button-group trix-button-group--block-tools" data-trix-button-group="block-tools">\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-heading-1" data-trix-attribute="heading1" title="'+e.heading1+'" tabindex="-1">'+e.heading1+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-quote" data-trix-attribute="quote" title="'+e.quote+'" tabindex="-1">'+e.quote+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-code" data-trix-attribute="code" title="'+e.code+'" tabindex="-1">'+e.code+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-bullet-list" data-trix-attribute="bullet" title="'+e.bullets+'" tabindex="-1">'+e.bullets+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-number-list" data-trix-attribute="number" title="'+e.numbers+'" tabindex="-1">'+e.numbers+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-decrease-nesting-level" data-trix-action="decreaseNestingLevel" title="'+e.outdent+'" tabindex="-1">'+e.outdent+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-increase-nesting-level" data-trix-action="increaseNestingLevel" title="'+e.indent+'" tabindex="-1">'+e.indent+'</button>\n  </span>\n\n  <span class="trix-button-group trix-button-group--file-tools" data-trix-button-group="file-tools">\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-attach" data-trix-action="attachFiles" title="'+e.attachFiles+'" tabindex="-1">'+e.attachFiles+'</button>\n  </span>\n\n  <span class="trix-button-group-spacer"></span>\n\n  <span class="trix-button-group trix-button-group--history-tools" data-trix-button-group="history-tools">\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-undo" data-trix-action="undo" data-trix-key="z" title="'+e.undo+'" tabindex="-1">'+e.undo+'</button>\n    <button type="button" class="trix-button trix-button--icon trix-button--icon-redo" data-trix-action="redo" data-trix-key="shift+z" title="'+e.redo+'" tabindex="-1">'+e.redo+'</button>\n  </span>\n</div>\n\n<div class="trix-dialogs" data-trix-dialogs>\n  <div class="trix-dialog trix-dialog--link" data-trix-dialog="href" data-trix-dialog-attribute="href">\n    <div class="trix-dialog__link-fields">\n      <input type="url" name="href" class="trix-input trix-input--dialog" placeholder="'+e.urlPlaceholder+'" aria-label="'+e.url+'" required data-trix-input>\n      <div class="trix-button-group">\n        <input type="button" class="trix-button trix-button--dialog" value="'+e.link+'" data-trix-method="setAttribute">\n        <input type="button" class="trix-button trix-button--dialog" value="'+e.unlink+'" data-trix-method="removeAttribute">\n      </div>\n    </div>\n  </div>\n</div>'}}}.call(this),function(){t.config.undoInterval=5e3}.call(this),function(){t.config.attachments={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}}}.call(this),function(){t.config.keyNames={8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"}}.call(this),function(){t.config.input={level2Enabled:!0,getLevel:function(){return this.level2Enabled&&t.browser.supportsInputEvents?2:0},pickFiles:function(e){var n;return(n=t.makeElement("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId})).addEventListener("change",(function(){return e(n.files),t.removeNode(n)})),t.removeNode(document.getElementById(this.fileInputId)),document.body.appendChild(n),n.click()},fileInputId:"trix-file-input-"+Date.now().toString(16)}}.call(this),function(){}.call(this),function(){t.registerElement("trix-toolbar",{defaultCSS:"%t {\n  display: block;\n}\n\n%t {\n  white-space: nowrap;\n}\n\n%t [data-trix-dialog] {\n  display: none;\n}\n\n%t [data-trix-dialog][data-trix-active] {\n  display: block;\n}\n\n%t [data-trix-dialog] [data-trix-validate]:invalid {\n  background-color: #ffdddd;\n}",initialize:function(){return""===this.innerHTML?this.innerHTML=t.config.toolbar.getDefaultHTML():void 0}})}.call(this),function(){var e={}.hasOwnProperty,n=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};t.ObjectView=function(i){function r(t,e){this.object=t,this.options=null!=e?e:{},this.childViews=[],this.rootView=this}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(r,i),r.prototype.getNodes=function(){var t,e,n,i,r;for(null==this.nodes&&(this.nodes=this.createNodes()),r=[],t=0,e=(i=this.nodes).length;e>t;t++)n=i[t],r.push(n.cloneNode(!0));return r},r.prototype.invalidate=function(){var t;return this.nodes=null,this.childViews=[],null!=(t=this.parentView)?t.invalidate():void 0},r.prototype.invalidateViewForObject=function(t){var e;return null!=(e=this.findViewForObject(t))?e.invalidate():void 0},r.prototype.findOrCreateCachedChildView=function(t,e){var n;return(n=this.getCachedViewForObject(e))?this.recordChildView(n):(n=this.createChildView.apply(this,arguments),this.cacheViewForObject(n,e)),n},r.prototype.createChildView=function(e,n,i){var r;return null==i&&(i={}),n instanceof t.ObjectGroup&&(i.viewClass=e,e=t.ObjectGroupView),r=new e(n,i),this.recordChildView(r)},r.prototype.recordChildView=function(t){return t.parentView=this,t.rootView=this.rootView,this.childViews.push(t),t},r.prototype.getAllChildViews=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.childViews).length;n>e;e++)t=i[e],r.push(t),r=r.concat(t.getAllChildViews());return r},r.prototype.findElement=function(){return this.findElementForObject(this.object)},r.prototype.findElementForObject=function(t){var e;return(e=null!=t?t.id:void 0)?this.rootView.element.querySelector("[data-trix-id='"+e+"']"):void 0},r.prototype.findViewForObject=function(t){var e,n,i,r;for(e=0,n=(i=this.getAllChildViews()).length;n>e;e++)if((r=i[e]).object===t)return r},r.prototype.getViewCache=function(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?null!=this.viewCache?this.viewCache:this.viewCache={}:void 0},r.prototype.isViewCachingEnabled=function(){return!1!==this.shouldCacheViews},r.prototype.enableViewCaching=function(){return this.shouldCacheViews=!0},r.prototype.disableViewCaching=function(){return this.shouldCacheViews=!1},r.prototype.getCachedViewForObject=function(t){var e;return null!=(e=this.getViewCache())?e[t.getCacheKey()]:void 0},r.prototype.cacheViewForObject=function(t,e){var n;return null!=(n=this.getViewCache())?n[e.getCacheKey()]=t:void 0},r.prototype.garbageCollectCachedViews=function(){var t,e,i,r,o,a;if(t=this.getViewCache()){for(e in a=this.getAllChildViews().concat(this),i=function(){var t,e,n;for(n=[],t=0,e=a.length;e>t;t++)o=a[t],n.push(o.object.getCacheKey());return n}(),r=[],t)n.call(i,e)<0&&r.push(delete t[e]);return r}},r}(t.BasicObject)}.call(this),function(){var e={}.hasOwnProperty;t.ObjectGroupView=function(t){function n(){n.__super__.constructor.apply(this,arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(n,t),n.prototype.getChildViews=function(){var t,e,n,i;if(!this.childViews.length)for(t=0,e=(i=this.objectGroup.getObjects()).length;e>t;t++)n=i[t],this.findOrCreateCachedChildView(this.viewClass,n,this.options);return this.childViews},n.prototype.createNodes=function(){var t,e,n,i,r,o,a,s;for(t=this.createContainerElement(),e=0,i=(a=this.getChildViews()).length;i>e;e++)for(n=0,r=(s=a[e].getNodes()).length;r>n;n++)o=s[n],t.appendChild(o);return[t]},n.prototype.createContainerElement=function(t){return null==t&&(t=this.objectGroup.getDepth()),this.getChildViews()[0].createContainerElement(t)},n}(t.ObjectView)}.call(this),function(){var e={}.hasOwnProperty;t.Controller=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(n,t),n}(t.BasicObject)}.call(this),function(){var e,n,i,r,o,a,s={}.hasOwnProperty,u=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=t.findClosestElementFromNode,i=t.nodeIsEmptyTextNode,n=t.nodeIsBlockStartComment,r=t.normalizeSpaces,o=t.summarizeStringChange,a=t.tagName,t.MutationObserver=function(t){function l(t){this.element=t,this.didMutate=function(t,e){return function(){return t.apply(e,arguments)}}(this.didMutate,this),this.observer=new window.MutationObserver(this.didMutate),this.start()}var c,h,d;return function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(l,t),"["+(h="data-trix-mutable")+"]",d={attributes:!0,childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},l.prototype.start=function(){return this.reset(),this.observer.observe(this.element,d)},l.prototype.stop=function(){return this.observer.disconnect()},l.prototype.didMutate=function(t){var e,n;return(e=this.mutations).push.apply(e,this.findSignificantMutations(t)),this.mutations.length?(null!=(n=this.delegate)&&"function"==typeof n.elementDidMutate&&n.elementDidMutate(this.getMutationSummary()),this.reset()):void 0},l.prototype.reset=function(){return this.mutations=[]},l.prototype.findSignificantMutations=function(t){var e,n,i,r;for(r=[],e=0,n=t.length;n>e;e++)i=t[e],this.mutationIsSignificant(i)&&r.push(i);return r},l.prototype.mutationIsSignificant=function(t){var e,n,i,r;if(this.nodeIsMutable(t.target))return!1;for(e=0,n=(r=this.nodesModifiedByMutation(t)).length;n>e;e++)if(i=r[e],this.nodeIsSignificant(i))return!0;return!1},l.prototype.nodeIsSignificant=function(t){return t!==this.element&&!this.nodeIsMutable(t)&&!i(t)},l.prototype.nodeIsMutable=function(t){return e(t,{matchingSelector:"[data-trix-mutable]"})},l.prototype.nodesModifiedByMutation=function(t){var e;switch(e=[],t.type){case"attributes":t.attributeName!==h&&e.push(t.target);break;case"characterData":e.push(t.target.parentNode),e.push(t.target);break;case"childList":e.push.apply(e,t.addedNodes),e.push.apply(e,t.removedNodes)}return e},l.prototype.getMutationSummary=function(){return this.getTextMutationSummary()},l.prototype.getTextMutationSummary=function(){var t,e,n,i,r,o,a,s,l,c,h;for(n=(s=this.getTextChangesFromCharacterData()).additions,r=s.deletions,o=0,a=(l=(h=this.getTextChangesFromChildList()).additions).length;a>o;o++)e=l[o],u.call(n,e)<0&&n.push(e);return r.push.apply(r,h.deletions),c={},(t=n.join(""))&&(c.textAdded=t),(i=r.join(""))&&(c.textDeleted=i),c},l.prototype.getMutationsByType=function(t){var e,n,i,r,o;for(o=[],e=0,n=(r=this.mutations).length;n>e;e++)(i=r[e]).type===t&&o.push(i);return o},l.prototype.getTextChangesFromChildList=function(){var t,e,i,o,a,s,u,l,h,d;for(t=[],u=[],e=0,o=(s=this.getMutationsByType("childList")).length;o>e;e++)a=s[e],t.push.apply(t,a.addedNodes),u.push.apply(u,a.removedNodes);return 0===t.length&&1===u.length&&n(u[0])?(h=[],d=["\n"]):(h=c(t),d=c(u)),{additions:function(){var t,e,n;for(n=[],i=t=0,e=h.length;e>t;i=++t)(l=h[i])!==d[i]&&n.push(r(l));return n}(),deletions:function(){var t,e,n;for(n=[],i=t=0,e=d.length;e>t;i=++t)(l=d[i])!==h[i]&&n.push(r(l));return n}()}},l.prototype.getTextChangesFromCharacterData=function(){var t,e,n,i,a,s,u,l;return(e=this.getMutationsByType("characterData")).length&&(l=e[0],n=e[e.length-1],a=r(l.oldValue),i=r(n.target.data),t=(s=o(a,i)).added,u=s.removed),{additions:t?[t]:[],deletions:u?[u]:[]}},c=function(t){var e,n,i,r;for(null==t&&(t=[]),r=[],e=0,n=t.length;n>e;e++)switch((i=t[e]).nodeType){case Node.TEXT_NODE:r.push(i.data);break;case Node.ELEMENT_NODE:"br"===a(i)?r.push("\n"):r.push.apply(r,c(i.childNodes))}return r},l}(t.BasicObject)}.call(this),function(){var e={}.hasOwnProperty;t.FileVerificationOperation=function(t){function n(t){this.file=t}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(n,t),n.prototype.perform=function(t){var e,n;return(e=new FileReader).onerror=function(){return t(!1)},e.onload=(n=this,function(){e.onerror=null;try{e.abort()}catch(t){}return t(!0,n.file)}),e.readAsArrayBuffer(this.file)},n}(t.Operation)}.call(this),function(){var e,n,i={}.hasOwnProperty;e=t.handleEvent,n=t.innerElementIsActive,t.InputController=function(r){function o(n){var i;for(i in this.element=n,this.mutationObserver=new t.MutationObserver(this.element),this.mutationObserver.delegate=this,this.events)e(i,{onElement:this.element,withCallback:this.handlerFor(i)})}return function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(o,r),o.prototype.events={},o.prototype.elementDidMutate=function(){},o.prototype.editorWillSyncDocumentView=function(){return this.mutationObserver.stop()},o.prototype.editorDidSyncDocumentView=function(){return this.mutationObserver.start()},o.prototype.requestRender=function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidRequestRender?t.inputControllerDidRequestRender():void 0},o.prototype.requestReparse=function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidRequestReparse&&t.inputControllerDidRequestReparse(),this.requestRender()},o.prototype.attachFiles=function(e){var n,i,r;return i=function(){var i,r,o;for(o=[],i=0,r=e.length;r>i;i++)n=e[i],o.push(new t.FileVerificationOperation(n));return o}(),Promise.all(i).then((r=this,function(t){return r.handleInput((function(){var e,n;return null!=(e=this.delegate)&&e.inputControllerWillAttachFiles(),null!=(n=this.responder)&&n.insertFiles(t),this.requestRender()}))}))},o.prototype.handlerFor=function(t){return e=this,function(i){return i.defaultPrevented?void 0:e.handleInput((function(){return n(this.element)?void 0:(this.eventName=t,this.events[t].call(this,i))}))};var e},o.prototype.handleInput=function(t){var e,n;try{return null!=(e=this.delegate)&&e.inputControllerWillHandleInput(),t.call(this)}finally{null!=(n=this.delegate)&&n.inputControllerDidHandleInput()}},o.prototype.createLinkHTML=function(t,e){var n;return(n=document.createElement("a")).href=t,n.textContent=null!=e?e:t,n.outerHTML},o}(t.BasicObject)}.call(this),function(){var e,n,i,r,o,a,s,u,l,c,h,d,f=function(t,e){function n(){this.constructor=t}for(var i in e)p.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},p={}.hasOwnProperty,g=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};l=t.makeElement,c=t.objectsAreEqual,t.tagName,n=t.browser,s=t.keyEventIsKeyboardCommand,r=t.dataTransferIsWritable,i=t.dataTransferIsPlainText,u=t.config.keyNames,t.Level0InputController=function(n){function a(){a.__super__.constructor.apply(this,arguments),this.resetInputSummary()}var p;return f(a,n),p=0,a.prototype.setInputSummary=function(t){var e,n;for(e in null==t&&(t={}),this.inputSummary.eventName=this.eventName,t)n=t[e],this.inputSummary[e]=n;return this.inputSummary},a.prototype.resetInputSummary=function(){return this.inputSummary={}},a.prototype.reset=function(){return this.resetInputSummary(),t.selectionChangeObserver.reset()},a.prototype.elementDidMutate=function(t){var e;return this.isComposing()?null!=(e=this.delegate)&&"function"==typeof e.inputControllerDidAllowUnhandledInput?e.inputControllerDidAllowUnhandledInput():void 0:this.handleInput((function(){return this.mutationIsSignificant(t)&&(this.mutationIsExpected(t)?this.requestRender():this.requestReparse()),this.reset()}))},a.prototype.mutationIsExpected=function(t){var e,n,i,r,o,a,s,u,l;return a=t.textAdded,s=t.textDeleted,!!this.inputSummary.preferDocument||(e=null!=a?a===this.inputSummary.textAdded:!this.inputSummary.textAdded,n=null!=s?this.inputSummary.didDelete:!this.inputSummary.didDelete,l="\n"===s&&!n,!!(((u=("\n"===a||" \n"===a)&&!e)&&!l||l&&!u)&&(r=this.getSelectedRange())&&(i=u?a.replace(/\n$/,"").length||-1:(null!=a?a.length:void 0)||1,null!=(o=this.responder)?o.positionIsBlockBreak(r[1]+i):void 0))||e&&n)},a.prototype.mutationIsSignificant=function(t){var e,n,i;return i=Object.keys(t).length>0,e=""===(null!=(n=this.compositionInput)?n.getEndData():void 0),i||!e},a.prototype.events={keydown:function(e){var n,i,r,o,a,l,c,h,d;if(this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0,o=u[e.keyCode]){for(i=this.keys,r=0,l=(h=["ctrl","alt","shift","meta"]).length;l>r;r++)e[(c=h[r])+"Key"]&&("ctrl"===c&&(c="control"),i=null!=i?i[c]:void 0);null!=(null!=i?i[o]:void 0)&&(this.setInputSummary({keyName:o}),t.selectionChangeObserver.reset(),i[o].call(this,e))}return s(e)&&(n=String.fromCharCode(e.keyCode).toLowerCase())&&((a=function(){var t,n,i,r;for(r=[],t=0,n=(i=["alt","shift"]).length;n>t;t++)e[(c=i[t])+"Key"]&&r.push(c);return r}()).push(n),null!=(d=this.delegate)?d.inputControllerDidReceiveKeyboardCommand(a):void 0)?e.preventDefault():void 0},keypress:function(t){var e,n,i;if(null==this.inputSummary.eventName&&!t.metaKey&&(!t.ctrlKey||t.altKey))return(i=d(t))?(null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.insertString(i),this.setInputSummary({textAdded:i,didDelete:this.selectionIsExpanded()})):void 0},textInput:function(t){var e,n,i,r;return e=t.data,(r=this.inputSummary.textAdded)&&r!==e&&r.toUpperCase()===e?(n=this.getSelectedRange(),this.setSelectedRange([n[0],n[1]+r.length]),null!=(i=this.responder)&&i.insertString(e),this.setInputSummary({textAdded:e}),this.setSelectedRange(n)):void 0},dragenter:function(t){return t.preventDefault()},dragstart:function(t){var e;return t.target,this.serializeSelectionToDataTransfer(t.dataTransfer),this.draggedRange=this.getSelectedRange(),null!=(e=this.delegate)&&"function"==typeof e.inputControllerDidStartDrag?e.inputControllerDidStartDrag():void 0},dragover:function(t){var e,n;return!this.draggedRange&&!this.canAcceptDataTransfer(t.dataTransfer)||(t.preventDefault(),e={x:t.clientX,y:t.clientY},c(e,this.draggingPoint))?void 0:(this.draggingPoint=e,null!=(n=this.delegate)&&"function"==typeof n.inputControllerDidReceiveDragOverPoint?n.inputControllerDidReceiveDragOverPoint(this.draggingPoint):void 0)},dragend:function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidCancelDrag&&t.inputControllerDidCancelDrag(),this.draggedRange=null,this.draggingPoint=null},drop:function(e){var n,i,r,o,a,s,u,l,c;return e.preventDefault(),r=null!=(a=e.dataTransfer)?a.files:void 0,o={x:e.clientX,y:e.clientY},null!=(s=this.responder)&&s.setLocationRangeFromPointRange(o),(null!=r?r.length:void 0)?this.attachFiles(r):this.draggedRange?(null!=(u=this.delegate)&&u.inputControllerWillMoveText(),null!=(l=this.responder)&&l.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()):(i=e.dataTransfer.getData("application/x-trix-document"))&&(n=t.Document.fromJSONString(i),null!=(c=this.responder)&&c.insertDocument(n),this.requestRender()),this.draggedRange=null,this.draggingPoint=null},cut:function(t){var e,n;return(null!=(e=this.responder)?e.selectionIsExpanded():void 0)&&(this.serializeSelectionToDataTransfer(t.clipboardData)&&t.preventDefault(),null!=(n=this.delegate)&&n.inputControllerWillCutText(),this.deleteInDirection("backward"),t.defaultPrevented)?this.requestRender():void 0},copy:function(t){var e;return(null!=(e=this.responder)?e.selectionIsExpanded():void 0)&&this.serializeSelectionToDataTransfer(t.clipboardData)?t.preventDefault():void 0},paste:function(e){var n,r,a,s,u,l,c,d,f,m,v,y,b,_,E,x,A,D,w,k,T,C,S,I;return n=null!=(d=e.clipboardData)?d:e.testClipboardData,c={clipboard:n},null==n||h(e)?void this.getPastedHTMLUsingHiddenElement((I=this,function(t){var e,n,i;return c.type="text/html",c.html=t,null!=(e=I.delegate)&&e.inputControllerWillPaste(c),null!=(n=I.responder)&&n.insertHTML(c.html),I.requestRender(),null!=(i=I.delegate)?i.inputControllerDidPaste(c):void 0})):((s=n.getData("URL"))?(c.type="text/html",S=(l=n.getData("public.url-name"))?t.squishBreakableWhitespace(l).trim():s,c.html=this.createLinkHTML(s,S),null!=(f=this.delegate)&&f.inputControllerWillPaste(c),this.setInputSummary({textAdded:S,didDelete:this.selectionIsExpanded()}),null!=(E=this.responder)&&E.insertHTML(c.html),this.requestRender(),null!=(x=this.delegate)&&x.inputControllerDidPaste(c)):i(n)?(c.type="text/plain",c.string=n.getData("text/plain"),null!=(A=this.delegate)&&A.inputControllerWillPaste(c),this.setInputSummary({textAdded:c.string,didDelete:this.selectionIsExpanded()}),null!=(D=this.responder)&&D.insertString(c.string),this.requestRender(),null!=(w=this.delegate)&&w.inputControllerDidPaste(c)):(u=n.getData("text/html"))?(c.type="text/html",c.html=u,null!=(k=this.delegate)&&k.inputControllerWillPaste(c),null!=(T=this.responder)&&T.insertHTML(c.html),this.requestRender(),null!=(C=this.delegate)&&C.inputControllerDidPaste(c)):g.call(n.types,"Files")>=0&&(a=null!=(m=n.items)&&null!=(v=m[0])&&"function"==typeof v.getAsFile?v.getAsFile():void 0)&&(!a.name&&(r=o(a))&&(a.name="pasted-file-"+ ++p+"."+r),c.type="File",c.file=a,null!=(y=this.delegate)&&y.inputControllerWillAttachFiles(),null!=(b=this.responder)&&b.insertFile(c.file),this.requestRender(),null!=(_=this.delegate)&&_.inputControllerDidPaste(c)),e.preventDefault())},compositionstart:function(t){return this.getCompositionInput().start(t.data)},compositionupdate:function(t){return this.getCompositionInput().update(t.data)},compositionend:function(t){return this.getCompositionInput().end(t.data)},beforeinput:function(){return this.inputSummary.didInput=!0},input:function(t){return this.inputSummary.didInput=!0,t.stopPropagation()}},a.prototype.keys={backspace:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",t)},delete:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",t)},return:function(){var t,e;return this.setInputSummary({preferDocument:!0}),null!=(t=this.delegate)&&t.inputControllerWillPerformTyping(),null!=(e=this.responder)?e.insertLineBreak():void 0},tab:function(t){var e,n;return(null!=(e=this.responder)?e.canIncreaseNestingLevel():void 0)?(null!=(n=this.responder)&&n.increaseNestingLevel(),this.requestRender(),t.preventDefault()):void 0},left:function(t){var e;return this.selectionIsInCursorTarget()?(t.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("backward"):void 0):void 0},right:function(t){var e;return this.selectionIsInCursorTarget()?(t.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("forward"):void 0):void 0},control:{d:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",t)},h:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",t)},o:function(t){var e,n;return t.preventDefault(),null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.insertString("\n",{updatePosition:!1}),this.requestRender()}},shift:{return:function(t){var e,n;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.insertString("\n"),this.requestRender(),t.preventDefault()},tab:function(t){var e,n;return(null!=(e=this.responder)?e.canDecreaseNestingLevel():void 0)?(null!=(n=this.responder)&&n.decreaseNestingLevel(),this.requestRender(),t.preventDefault()):void 0},left:function(t){return this.selectionIsInCursorTarget()?(t.preventDefault(),this.expandSelectionInDirection("backward")):void 0},right:function(t){return this.selectionIsInCursorTarget()?(t.preventDefault(),this.expandSelectionInDirection("forward")):void 0}},alt:{backspace:function(){var t;return this.setInputSummary({preferDocument:!1}),null!=(t=this.delegate)?t.inputControllerWillPerformTyping():void 0}},meta:{backspace:function(){var t;return this.setInputSummary({preferDocument:!1}),null!=(t=this.delegate)?t.inputControllerWillPerformTyping():void 0}}},a.prototype.getCompositionInput=function(){return this.isComposing()?this.compositionInput:this.compositionInput=new e(this)},a.prototype.isComposing=function(){return null!=this.compositionInput&&!this.compositionInput.isEnded()},a.prototype.deleteInDirection=function(t,e){var n;return!1!==(null!=(n=this.responder)?n.deleteInDirection(t):void 0)?this.setInputSummary({didDelete:!0}):e?(e.preventDefault(),this.requestRender()):void 0},a.prototype.serializeSelectionToDataTransfer=function(e){var n,i;if(r(e))return n=null!=(i=this.responder)?i.getSelectedDocument().toSerializableDocument():void 0,e.setData("application/x-trix-document",JSON.stringify(n)),e.setData("text/html",t.DocumentView.render(n).innerHTML),e.setData("text/plain",n.toString().replace(/\n$/,"")),!0},a.prototype.canAcceptDataTransfer=function(t){var e,n,i,r,o;for(o={},e=0,n=(r=null!=(i=null!=t?t.types:void 0)?i:[]).length;n>e;e++)o[r[e]]=!0;return o.Files||o["application/x-trix-document"]||o["text/html"]||o["text/plain"]},a.prototype.getPastedHTMLUsingHiddenElement=function(e){var n,i,r,o;return i=this.getSelectedRange(),r={position:"absolute",left:window.pageXOffset+"px",top:window.pageYOffset+"px",opacity:0},n=l({style:r,tagName:"div",editable:!0}),document.body.appendChild(n),n.focus(),requestAnimationFrame((o=this,function(){var r;return r=n.innerHTML,t.removeNode(n),o.setSelectedRange(i),e(r)}))},a.proxyMethod("responder?.getSelectedRange"),a.proxyMethod("responder?.setSelectedRange"),a.proxyMethod("responder?.expandSelectionInDirection"),a.proxyMethod("responder?.selectionIsInCursorTarget"),a.proxyMethod("responder?.selectionIsExpanded"),a}(t.InputController),o=function(t){var e,n;return null!=(e=t.type)&&null!=(n=e.match(/\/(\w+)$/))?n[1]:void 0},a=null!=("function"==typeof" ".codePointAt?" ".codePointAt(0):void 0),d=function(e){var n;return e.key&&a&&e.key.codePointAt(0)===e.keyCode?e.key:(null===e.which?n=e.keyCode:0!==e.which&&0!==e.charCode&&(n=e.charCode),null!=n&&"escape"!==u[n]?t.UTF16String.fromCodepoints([n]).toString():void 0)},h=function(t){var e,n,i,r,o,a,s,u,l;if(s=t.clipboardData){if(g.call(s.types,"text/html")>=0){for(i=0,a=(u=s.types).length;a>i;i++)if(l=u[i],e=/^CorePasteboardFlavorType/.test(l),n=/^dyn\./.test(l)&&s.getData(l),e||n)return!0;return!1}return r=g.call(s.types,"com.apple.webarchive")>=0,o=g.call(s.types,"com.apple.flat-rtfd")>=0,r||o}},e=function(t){function e(t){var e;this.inputController=t,e=this.inputController,this.responder=e.responder,this.delegate=e.delegate,this.inputSummary=e.inputSummary,this.data={}}return f(e,t),e.prototype.start=function(t){var e,n;return this.data.start=t,this.isSignificant()?("keypress"===this.inputSummary.eventName&&this.inputSummary.textAdded&&null!=(e=this.responder)&&e.deleteInDirection("left"),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=null!=(n=this.responder)?n.getSelectedRange():void 0):void 0},e.prototype.update=function(t){var e;return this.data.update=t,this.isSignificant()&&(e=this.selectPlaceholder())?(this.forgetPlaceholder(),this.range=e):void 0},e.prototype.end=function(t){var e,n,i,r;return this.data.end=t,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.setSelectedRange(this.range),null!=(i=this.responder)&&i.insertString(this.data.end),null!=(r=this.responder)?r.setSelectedRange(this.range[0]+this.data.end.length):void 0):null!=this.data.start||null!=this.data.update?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset()},e.prototype.getEndData=function(){return this.data.end},e.prototype.isEnded=function(){return null!=this.getEndData()},e.prototype.isSignificant=function(){return!n.composesExistingText||this.inputSummary.didInput},e.prototype.canApplyToDocument=function(){var t,e;return 0===(null!=(t=this.data.start)?t.length:void 0)&&(null!=(e=this.data.end)?e.length:void 0)>0&&null!=this.range},e.proxyMethod("inputController.setInputSummary"),e.proxyMethod("inputController.requestRender"),e.proxyMethod("inputController.requestReparse"),e.proxyMethod("responder?.selectionIsExpanded"),e.proxyMethod("responder?.insertPlaceholder"),e.proxyMethod("responder?.selectPlaceholder"),e.proxyMethod("responder?.forgetPlaceholder"),e}(t.BasicObject)}.call(this),function(){var e,n,i,r=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty,a=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=t.dataTransferIsPlainText,n=t.keyEventIsKeyboardCommand,i=t.objectsAreEqual,t.Level2InputController=function(s){function u(){return this.render=r(this.render,this),u.__super__.constructor.apply(this,arguments)}var l,c,h,d,f,p;return function(t,e){function n(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(u,s),u.prototype.elementDidMutate=function(){var t;return this.scheduledRender?this.composing&&null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidAllowUnhandledInput?t.inputControllerDidAllowUnhandledInput():void 0:this.reparse()},u.prototype.scheduleRender=function(){return null!=this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)},u.prototype.render=function(){var t;return cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||null!=(t=this.delegate)&&t.render(),"function"==typeof this.afterRender&&this.afterRender(),this.afterRender=null},u.prototype.reparse=function(){var t;return null!=(t=this.delegate)?t.reparse():void 0},u.prototype.events={keydown:function(t){var e,i,r,o;if(n(t)){if(e=c(t),null!=(o=this.delegate)?o.inputControllerDidReceiveKeyboardCommand(e):void 0)return t.preventDefault()}else if(r=t.key,t.altKey&&(r+="+Alt"),t.shiftKey&&(r+="+Shift"),i=this.keys[r])return this.withEvent(t,i)},paste:function(t){var e,n,i,r,o,a,s,u,l;return h(t)?(t.preventDefault(),this.attachFiles(t.clipboardData.files)):d(t)?(t.preventDefault(),n={type:"text/plain",string:t.clipboardData.getData("text/plain")},null!=(i=this.delegate)&&i.inputControllerWillPaste(n),null!=(r=this.responder)&&r.insertString(n.string),this.render(),null!=(o=this.delegate)?o.inputControllerDidPaste(n):void 0):(e=null!=(a=t.clipboardData)?a.getData("URL"):void 0)?(t.preventDefault(),n={type:"text/html",html:this.createLinkHTML(e)},null!=(s=this.delegate)&&s.inputControllerWillPaste(n),null!=(u=this.responder)&&u.insertHTML(n.html),this.render(),null!=(l=this.delegate)?l.inputControllerDidPaste(n):void 0):void 0},beforeinput:function(t){var e;return(e=this.inputTypes[t.inputType])?(this.withEvent(t,e),this.scheduleRender()):void 0},input:function(){return t.selectionChangeObserver.reset()},dragstart:function(t){var e,n;return(null!=(e=this.responder)?e.selectionContainsAttachments():void 0)?(t.dataTransfer.setData("application/x-trix-dragging",!0),this.dragging={range:null!=(n=this.responder)?n.getSelectedRange():void 0,point:f(t)}):void 0},dragenter:function(t){return l(t)?t.preventDefault():void 0},dragover:function(t){var e,n;if(this.dragging){if(t.preventDefault(),e=f(t),!i(e,this.dragging.point))return this.dragging.point=e,null!=(n=this.responder)?n.setLocationRangeFromPointRange(e):void 0}else if(l(t))return t.preventDefault()},drop:function(t){var e,n,i,r;return this.dragging?(t.preventDefault(),null!=(n=this.delegate)&&n.inputControllerWillMoveText(),null!=(i=this.responder)&&i.moveTextFromRange(this.dragging.range),this.dragging=null,this.scheduleRender()):l(t)?(t.preventDefault(),e=f(t),null!=(r=this.responder)&&r.setLocationRangeFromPointRange(e),this.attachFiles(t.dataTransfer.files)):void 0},dragend:function(){var t;return this.dragging?(null!=(t=this.responder)&&t.setSelectedRange(this.dragging.range),this.dragging=null):void 0},compositionend:function(){return this.composing?(this.composing=!1,this.scheduleRender()):void 0}},u.prototype.keys={ArrowLeft:function(){var t,e;return(null!=(t=this.responder)?t.shouldManageMovingCursorInDirection("backward"):void 0)?(this.event.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("backward"):void 0):void 0},ArrowRight:function(){var t,e;return(null!=(t=this.responder)?t.shouldManageMovingCursorInDirection("forward"):void 0)?(this.event.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("forward"):void 0):void 0},Backspace:function(){var t,e,n;return(null!=(t=this.responder)?t.shouldManageDeletingInDirection("backward"):void 0)?(this.event.preventDefault(),null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.deleteInDirection("backward"),this.render()):void 0},Tab:function(){var t,e;return(null!=(t=this.responder)?t.canIncreaseNestingLevel():void 0)?(this.event.preventDefault(),null!=(e=this.responder)&&e.increaseNestingLevel(),this.render()):void 0},"Tab+Shift":function(){var t,e;return(null!=(t=this.responder)?t.canDecreaseNestingLevel():void 0)?(this.event.preventDefault(),null!=(e=this.responder)&&e.decreaseNestingLevel(),this.render()):void 0}},u.prototype.inputTypes={deleteByComposition:function(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteByCut:function(){return this.deleteInDirection("backward")},deleteByDrag:function(){return this.event.preventDefault(),this.withTargetDOMRange((function(){var t;return this.deleteByDragRange=null!=(t=this.responder)?t.getSelectedRange():void 0}))},deleteCompositionText:function(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteContent:function(){return this.deleteInDirection("backward")},deleteContentBackward:function(){return this.deleteInDirection("backward")},deleteContentForward:function(){return this.deleteInDirection("forward")},deleteEntireSoftLine:function(){return this.deleteInDirection("forward")},deleteHardLineBackward:function(){return this.deleteInDirection("backward")},deleteHardLineForward:function(){return this.deleteInDirection("forward")},deleteSoftLineBackward:function(){return this.deleteInDirection("backward")},deleteSoftLineForward:function(){return this.deleteInDirection("forward")},deleteWordBackward:function(){return this.deleteInDirection("backward")},deleteWordForward:function(){return this.deleteInDirection("forward")},formatBackColor:function(){return this.activateAttributeIfSupported("backgroundColor",this.event.data)},formatBold:function(){return this.toggleAttributeIfSupported("bold")},formatFontColor:function(){return this.activateAttributeIfSupported("color",this.event.data)},formatFontName:function(){return this.activateAttributeIfSupported("font",this.event.data)},formatIndent:function(){var t;return(null!=(t=this.responder)?t.canIncreaseNestingLevel():void 0)?this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.increaseNestingLevel():void 0})):void 0},formatItalic:function(){return this.toggleAttributeIfSupported("italic")},formatJustifyCenter:function(){return this.toggleAttributeIfSupported("justifyCenter")},formatJustifyFull:function(){return this.toggleAttributeIfSupported("justifyFull")},formatJustifyLeft:function(){return this.toggleAttributeIfSupported("justifyLeft")},formatJustifyRight:function(){return this.toggleAttributeIfSupported("justifyRight")},formatOutdent:function(){var t;return(null!=(t=this.responder)?t.canDecreaseNestingLevel():void 0)?this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.decreaseNestingLevel():void 0})):void 0},formatRemove:function(){return this.withTargetDOMRange((function(){var t,e,n,i;for(t in i=[],null!=(e=this.responder)?e.getCurrentAttributes():void 0)i.push(null!=(n=this.responder)?n.removeCurrentAttribute(t):void 0);return i}))},formatSetBlockTextDirection:function(){return this.activateAttributeIfSupported("blockDir",this.event.data)},formatSetInlineTextDirection:function(){return this.activateAttributeIfSupported("textDir",this.event.data)},formatStrikeThrough:function(){return this.toggleAttributeIfSupported("strike")},formatSubscript:function(){return this.toggleAttributeIfSupported("sub")},formatSuperscript:function(){return this.toggleAttributeIfSupported("sup")},formatUnderline:function(){return this.toggleAttributeIfSupported("underline")},historyRedo:function(){var t;return null!=(t=this.delegate)?t.inputControllerWillPerformRedo():void 0},historyUndo:function(){var t;return null!=(t=this.delegate)?t.inputControllerWillPerformUndo():void 0},insertCompositionText:function(){return this.composing=!0,this.insertString(this.event.data)},insertFromComposition:function(){return this.composing=!1,this.insertString(this.event.data)},insertFromDrop:function(){var t,e;return(t=this.deleteByDragRange)?(this.deleteByDragRange=null,null!=(e=this.delegate)&&e.inputControllerWillMoveText(),this.withTargetDOMRange((function(){var e;return null!=(e=this.responder)?e.moveTextFromRange(t):void 0}))):void 0},insertFromPaste:function(){var n,i,r,o,a,s,u,l,c,h,d,f;return n=this.event.dataTransfer,a={dataTransfer:n},(i=n.getData("URL"))?(this.event.preventDefault(),a.type="text/html",d=(o=n.getData("public.url-name"))?t.squishBreakableWhitespace(o).trim():i,a.html=this.createLinkHTML(i,d),null!=(s=this.delegate)&&s.inputControllerWillPaste(a),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertHTML(a.html):void 0})),this.afterRender=(f=this,function(){var t;return null!=(t=f.delegate)?t.inputControllerDidPaste(a):void 0})):e(n)?(a.type="text/plain",a.string=n.getData("text/plain"),null!=(u=this.delegate)&&u.inputControllerWillPaste(a),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertString(a.string):void 0})),this.afterRender=function(t){return function(){var e;return null!=(e=t.delegate)?e.inputControllerDidPaste(a):void 0}}(this)):(r=n.getData("text/html"))?(this.event.preventDefault(),a.type="text/html",a.html=r,null!=(l=this.delegate)&&l.inputControllerWillPaste(a),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertHTML(a.html):void 0})),this.afterRender=function(t){return function(){var e;return null!=(e=t.delegate)?e.inputControllerDidPaste(a):void 0}}(this)):(null!=(c=n.files)?c.length:void 0)?(a.type="File",a.file=n.files[0],null!=(h=this.delegate)&&h.inputControllerWillPaste(a),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertFile(a.file):void 0})),this.afterRender=function(t){return function(){var e;return null!=(e=t.delegate)?e.inputControllerDidPaste(a):void 0}}(this)):void 0},insertFromYank:function(){return this.insertString(this.event.data)},insertLineBreak:function(){return this.insertString("\n")},insertLink:function(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList:function(){return this.toggleAttributeIfSupported("number")},insertParagraph:function(){var t;return null!=(t=this.delegate)&&t.inputControllerWillPerformTyping(),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.insertLineBreak():void 0}))},insertReplacementText:function(){return this.insertString(this.event.dataTransfer.getData("text/plain"),{updatePosition:!1})},insertText:function(){var t,e;return this.insertString(null!=(t=this.event.data)?t:null!=(e=this.event.dataTransfer)?e.getData("text/plain"):void 0)},insertTranspose:function(){return this.insertString(this.event.data)},insertUnorderedList:function(){return this.toggleAttributeIfSupported("bullet")}},u.prototype.insertString=function(t,e){var n;return null==t&&(t=""),null!=(n=this.delegate)&&n.inputControllerWillPerformTyping(),this.withTargetDOMRange((function(){var n;return null!=(n=this.responder)?n.insertString(t,e):void 0}))},u.prototype.toggleAttributeIfSupported=function(e){var n;return a.call(t.getAllAttributeNames(),e)>=0?(null!=(n=this.delegate)&&n.inputControllerWillPerformFormatting(e),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.toggleCurrentAttribute(e):void 0}))):void 0},u.prototype.activateAttributeIfSupported=function(e,n){var i;return a.call(t.getAllAttributeNames(),e)>=0?(null!=(i=this.delegate)&&i.inputControllerWillPerformFormatting(e),this.withTargetDOMRange((function(){var t;return null!=(t=this.responder)?t.setCurrentAttribute(e,n):void 0}))):void 0},u.prototype.deleteInDirection=function(t,e){var n,i,r,o;return(null!=e?e:{recordUndoEntry:!0}).recordUndoEntry&&null!=(r=this.delegate)&&r.inputControllerWillPerformTyping(),o=this,i=function(){var e;return null!=(e=o.responder)?e.deleteInDirection(t):void 0},(n=this.getTargetDOMRange({minLength:2}))?this.withTargetDOMRange(n,i):i()},u.prototype.withTargetDOMRange=function(e,n){var i;return"function"==typeof e&&(n=e,e=this.getTargetDOMRange()),e?null!=(i=this.responder)?i.withTargetDOMRange(e,n.bind(this)):void 0:(t.selectionChangeObserver.reset(),n.call(this))},u.prototype.getTargetDOMRange=function(t){var e,n,i,r;return i=(null!=t?t:{minLength:0}).minLength,(r="function"==typeof(e=this.event).getTargetRanges?e.getTargetRanges():void 0)&&r.length&&(n=p(r[0]),0===i||n.toString().length>=i)?n:void 0},p=function(t){var e;return(e=document.createRange()).setStart(t.startContainer,t.startOffset),e.setEnd(t.endContainer,t.endOffset),e},u.prototype.withEvent=function(t,e){var n;this.event=t;try{n=e.call(this)}finally{this.event=null}return n},l=function(t){var e,n;return a.call(null!=(e=null!=(n=t.dataTransfer)?n.types:void 0)?e:[],"Files")>=0},h=function(t){var e;return(e=t.clipboardData)?a.call(e.types,"Files")>=0&&1===e.types.length&&e.files.length>=1:void 0},d=function(t){var e;return(e=t.clipboardData)?a.call(e.types,"text/plain")>=0&&1===e.types.length:void 0},c=function(t){var e;return e=[],t.altKey&&e.push("alt"),t.shiftKey&&e.push("shift"),e.push(t.key),e},f=function(t){return{x:t.clientX,y:t.clientY}},u}(t.InputController)}.call(this),function(){var e,n,i,r,o,a,s,u,l=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty;n=t.defer,i=t.handleEvent,a=t.makeElement,u=t.tagName,s=t.config,o=s.lang,e=s.css,r=s.keyNames,t.AttachmentEditorController=function(s){function h(t,e,n,i){this.attachmentPiece=t,this.element=e,this.container=n,this.options=null!=i?i:{},this.didBlurCaption=l(this.didBlurCaption,this),this.didChangeCaption=l(this.didChangeCaption,this),this.didInputCaption=l(this.didInputCaption,this),this.didKeyDownCaption=l(this.didKeyDownCaption,this),this.didClickActionButton=l(this.didClickActionButton,this),this.didClickToolbar=l(this.didClickToolbar,this),this.attachment=this.attachmentPiece.attachment,"a"===u(this.element)&&(this.element=this.element.firstChild),this.install()}var d;return function(t,e){function n(){this.constructor=t}for(var i in e)c.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(h,s),d=function(t){return function(){var e;return(e=t.apply(this,arguments)).do(),null==this.undos&&(this.undos=[]),this.undos.push(e.undo)}},h.prototype.install=function(){return this.makeElementMutable(),this.addToolbar(),this.attachment.isPreviewable()?this.installCaptionEditor():void 0},h.prototype.uninstall=function(){var t,e;for(this.savePendingCaption();e=this.undos.pop();)e();return null!=(t=this.delegate)?t.didUninstallAttachmentEditor(this):void 0},h.prototype.savePendingCaption=function(){var t,e,n;return null!=this.pendingCaption?(t=this.pendingCaption,this.pendingCaption=null,t?null!=(e=this.delegate)&&"function"==typeof e.attachmentEditorDidRequestUpdatingAttributesForAttachment?e.attachmentEditorDidRequestUpdatingAttributesForAttachment({caption:t},this.attachment):void 0:null!=(n=this.delegate)&&"function"==typeof n.attachmentEditorDidRequestRemovingAttributeForAttachment?n.attachmentEditorDidRequestRemovingAttributeForAttachment("caption",this.attachment):void 0):void 0},h.prototype.makeElementMutable=d((function(){return{do:(t=this,function(){return t.element.dataset.trixMutable=!0}),undo:function(t){return function(){return delete t.element.dataset.trixMutable}}(this)};var t})),h.prototype.addToolbar=d((function(){var n,r;return n=a({tagName:"div",className:e.attachmentToolbar,data:{trixMutable:!0},childNodes:a({tagName:"div",className:"trix-button-row",childNodes:a({tagName:"span",className:"trix-button-group trix-button-group--actions",childNodes:a({tagName:"button",className:"trix-button trix-button--remove",textContent:o.remove,attributes:{title:o.remove},data:{trixAction:"remove"}})})})}),this.attachment.isPreviewable()&&n.appendChild(a({tagName:"div",className:e.attachmentMetadataContainer,childNodes:a({tagName:"span",className:e.attachmentMetadata,childNodes:[a({tagName:"span",className:e.attachmentName,textContent:this.attachment.getFilename(),attributes:{title:this.attachment.getFilename()}}),a({tagName:"span",className:e.attachmentSize,textContent:this.attachment.getFormattedFilesize()})]})})),i("click",{onElement:n,withCallback:this.didClickToolbar}),i("click",{onElement:n,matchingSelector:"[data-trix-action]",withCallback:this.didClickActionButton}),{do:(r=this,function(){return r.element.appendChild(n)}),undo:function(){return t.removeNode(n)}}})),h.prototype.installCaptionEditor=d((function(){var r,s,u,l,c,h;return(l=a({tagName:"textarea",className:e.attachmentCaptionEditor,attributes:{placeholder:o.captionPlaceholder},data:{trixMutable:!0}})).value=this.attachmentPiece.getCaption(),(c=l.cloneNode()).classList.add("trix-autoresize-clone"),c.tabIndex=-1,r=function(){return c.value=l.value,l.style.height=c.scrollHeight+"px"},i("input",{onElement:l,withCallback:r}),i("input",{onElement:l,withCallback:this.didInputCaption}),i("keydown",{onElement:l,withCallback:this.didKeyDownCaption}),i("change",{onElement:l,withCallback:this.didChangeCaption}),i("blur",{onElement:l,withCallback:this.didBlurCaption}),u=this.element.querySelector("figcaption"),s=u.cloneNode(),{do:(h=this,function(){return u.style.display="none",s.appendChild(l),s.appendChild(c),s.classList.add(e.attachmentCaption+"--editing"),u.parentElement.insertBefore(s,u),r(),h.options.editCaption?n((function(){return l.focus()})):void 0}),undo:function(){return t.removeNode(s),u.style.display=null}}})),h.prototype.didClickToolbar=function(t){return t.preventDefault(),t.stopPropagation()},h.prototype.didClickActionButton=function(t){var e;if("remove"===t.target.getAttribute("data-trix-action"))return null!=(e=this.delegate)?e.attachmentEditorDidRequestRemovalOfAttachment(this.attachment):void 0},h.prototype.didKeyDownCaption=function(t){var e;return"return"===r[t.keyCode]?(t.preventDefault(),this.savePendingCaption(),null!=(e=this.delegate)&&"function"==typeof e.attachmentEditorDidRequestDeselectingAttachment?e.attachmentEditorDidRequestDeselectingAttachment(this.attachment):void 0):void 0},h.prototype.didInputCaption=function(t){return this.pendingCaption=t.target.value.replace(/\s/g," ").trim()},h.prototype.didChangeCaption=function(){return this.savePendingCaption()},h.prototype.didBlurCaption=function(){return this.savePendingCaption()},h}(t.BasicObject)}.call(this),function(){var e,n,i,r={}.hasOwnProperty;i=t.makeElement,e=t.config.css,t.AttachmentView=function(o){function a(){a.__super__.constructor.apply(this,arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}var s;return function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(a,o),a.attachmentSelector="[data-trix-attachment]",a.prototype.createContentNodes=function(){return[]},a.prototype.createNodes=function(){var t,n,r,o,a,u,l;if(t=o=i({tagName:"figure",className:this.getClassName(),data:this.getData(),editable:!1}),(n=this.getHref())&&(o=i({tagName:"a",editable:!1,attributes:{href:n,tabindex:-1}}),t.appendChild(o)),this.attachment.hasContent())o.innerHTML=this.attachment.getContent();else for(r=0,a=(l=this.createContentNodes()).length;a>r;r++)u=l[r],o.appendChild(u);return o.appendChild(this.createCaptionElement()),this.attachment.isPending()&&(this.progressElement=i({tagName:"progress",attributes:{class:e.attachmentProgress,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:["progressElement",this.attachment.id].join("/")}}),t.appendChild(this.progressElement)),[s("left"),t,s("right")]},a.prototype.createCaptionElement=function(){var t,n,r,o,a,s,u;return r=i({tagName:"figcaption",className:e.attachmentCaption}),(t=this.attachmentPiece.getCaption())?(r.classList.add(e.attachmentCaption+"--edited"),r.textContent=t):((n=this.getCaptionConfig()).name&&(o=this.attachment.getFilename()),n.size&&(s=this.attachment.getFormattedFilesize()),o&&(a=i({tagName:"span",className:e.attachmentName,textContent:o}),r.appendChild(a)),s&&(o&&r.appendChild(document.createTextNode(" ")),u=i({tagName:"span",className:e.attachmentSize,textContent:s}),r.appendChild(u))),r},a.prototype.getClassName=function(){var t,n;return n=[e.attachment,e.attachment+"--"+this.attachment.getType()],(t=this.attachment.getExtension())&&n.push(e.attachment+"--"+t),n.join(" ")},a.prototype.getData=function(){var t,e;return e={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:this.attachment.id},(t=this.attachmentPiece.attributes).isEmpty()||(e.trixAttributes=JSON.stringify(t)),this.attachment.isPending()&&(e.trixSerialize=!1),e},a.prototype.getHref=function(){return n(this.attachment.getContent(),"a")?void 0:this.attachment.getHref()},a.prototype.getCaptionConfig=function(){var e,n,i;return i=this.attachment.getType(),e=t.copyObject(null!=(n=t.config.attachments[i])?n.caption:void 0),"file"===i&&(e.name=!0),e},a.prototype.findProgressElement=function(){var t;return null!=(t=this.findElement())?t.querySelector("progress"):void 0},s=function(e){return i({tagName:"span",textContent:t.ZERO_WIDTH_SPACE,data:{trixCursorTarget:e,trixSerialize:!1}})},a.prototype.attachmentDidChangeUploadProgress=function(){var t,e;return e=this.attachment.getUploadProgress(),null!=(t=this.findProgressElement())?t.value=e:void 0},a}(t.ObjectView),n=function(t,e){var n;return(n=i("div")).innerHTML=null!=t?t:"",n.querySelector(e)}}.call(this),function(){var e,n={}.hasOwnProperty;e=t.makeElement,t.PreviewableAttachmentView=function(i){function r(){r.__super__.constructor.apply(this,arguments),this.attachment.previewDelegate=this}return function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(r,i),r.prototype.createContentNodes=function(){return this.image=e({tagName:"img",attributes:{src:""},data:{trixMutable:!0}}),this.refresh(this.image),[this.image]},r.prototype.createCaptionElement=function(){var e;return(e=r.__super__.createCaptionElement.apply(this,arguments)).textContent||e.setAttribute("data-trix-placeholder",t.config.lang.captionPlaceholder),e},r.prototype.refresh=function(t){var e;return null==t&&(t=null!=(e=this.findElement())?e.querySelector("img"):void 0),t?this.updateAttributesForImage(t):void 0},r.prototype.updateAttributesForImage=function(t){var e,n,i,r,o,a;return o=this.attachment.getURL(),n=this.attachment.getPreviewURL(),t.src=n||o,n===o?t.removeAttribute("data-trix-serialized-attributes"):(i=JSON.stringify({src:o}),t.setAttribute("data-trix-serialized-attributes",i)),a=this.attachment.getWidth(),e=this.attachment.getHeight(),null!=a&&(t.width=a),null!=e&&(t.height=e),r=["imageElement",this.attachment.id,t.src,t.width,t.height].join("/"),t.dataset.trixStoreKey=r},r.prototype.attachmentDidChangeAttributes=function(){return this.refresh(this.image),this.refresh()},r}(t.AttachmentView)}.call(this),function(){var e,n,i,r={}.hasOwnProperty;i=t.makeElement,e=t.findInnerElement,n=t.getTextConfig,t.PieceView=function(o){function a(){var t;a.__super__.constructor.apply(this,arguments),this.piece=this.object,this.attributes=this.piece.getAttributes(),t=this.options,this.textConfig=t.textConfig,this.context=t.context,this.piece.attachment?this.attachment=this.piece.attachment:this.string=this.piece.toString()}var s;return function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(a,o),a.prototype.createNodes=function(){var t,n,i,r,o,a;if(a=this.attachment?this.createAttachmentNodes():this.createStringNodes(),t=this.createElement()){for(i=e(t),n=0,r=a.length;r>n;n++)o=a[n],i.appendChild(o);a=[t]}return a},a.prototype.createAttachmentNodes=function(){var e;return e=this.attachment.isPreviewable()?t.PreviewableAttachmentView:t.AttachmentView,this.createChildView(e,this.piece.attachment,{piece:this.piece}).getNodes()},a.prototype.createStringNodes=function(){var t,e,n,r,o,a,s,u,l;if(null!=(s=this.textConfig)?s.plaintext:void 0)return[document.createTextNode(this.string)];for(a=[],n=e=0,r=(u=this.string.split("\n")).length;r>e;n=++e)l=u[n],n>0&&(t=i("br"),a.push(t)),l.length&&(o=document.createTextNode(this.preserveSpaces(l)),a.push(o));return a},a.prototype.createElement=function(){var t,e,r,o,a,s,u,l,c;for(o in l={},s=this.attributes)if(c=s[o],(t=n(o))&&(t.tagName&&(a=i(t.tagName),r?(r.appendChild(a),r=a):e=r=a),t.styleProperty&&(l[t.styleProperty]=c),t.style))for(o in u=t.style)c=u[o],l[o]=c;if(Object.keys(l).length)for(o in null==e&&(e=i("span")),l)c=l[o],e.style[o]=c;return e},a.prototype.createContainerElement=function(){var t,e,r,o,a;for(r in o=this.attributes)if(a=o[r],(e=n(r))&&e.groupTagName)return(t={})[r]=a,i(e.groupTagName,t)},s=t.NON_BREAKING_SPACE,a.prototype.preserveSpaces=function(t){return this.context.isLast&&(t=t.replace(/\ $/,s)),t=t.replace(/(\S)\ {3}(\S)/g,"$1 "+s+" $2").replace(/\ {2}/g,s+" ").replace(/\ {2}/g," "+s),(this.context.isFirst||this.context.followsWhitespace)&&(t=t.replace(/^\ /,s)),t},a}(t.ObjectView)}.call(this),function(){var e={}.hasOwnProperty;t.TextView=function(n){function i(){i.__super__.constructor.apply(this,arguments),this.text=this.object,this.textConfig=this.options.textConfig}var r;return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(i,n),i.prototype.createNodes=function(){var e,n,i,o,a,s,u,l,c,h;for(s=[],o=(l=t.ObjectGroup.groupObjects(this.getPieces())).length-1,i=n=0,a=l.length;a>n;i=++n)u=l[i],e={},0===i&&(e.isFirst=!0),i===o&&(e.isLast=!0),r(c)&&(e.followsWhitespace=!0),h=this.findOrCreateCachedChildView(t.PieceView,u,{textConfig:this.textConfig,context:e}),s.push.apply(s,h.getNodes()),c=u;return s},i.prototype.getPieces=function(){var t,e,n,i,r;for(r=[],t=0,e=(i=this.text.getPieces()).length;e>t;t++)(n=i[t]).hasAttribute("blockBreak")||r.push(n);return r},r=function(t){return/\s$/.test(null!=t?t.toString():void 0)},i}(t.ObjectView)}.call(this),function(){var e,n,i,r={}.hasOwnProperty;i=t.makeElement,n=t.getBlockConfig,e=t.config.css,t.BlockView=function(o){function a(){a.__super__.constructor.apply(this,arguments),this.block=this.object,this.attributes=this.block.getAttributes()}return function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(a,o),a.prototype.createNodes=function(){var e,r,o,a,s,u,l,c,h,d;if(u=[document.createComment("block")],this.block.isEmpty()?u.push(i("br")):(h=null!=(l=n(this.block.getLastAttribute()))?l.text:void 0,d=this.findOrCreateCachedChildView(t.TextView,this.block.text,{textConfig:h}),u.push.apply(u,d.getNodes()),this.shouldAddExtraNewlineElement()&&u.push(i("br"))),this.attributes.length)return u;for(c=t.config.blockAttributes.default.tagName,this.block.isRTL()&&(e={dir:"rtl"}),r=i({tagName:c,attributes:e}),o=0,a=u.length;a>o;o++)s=u[o],r.appendChild(s);return[r]},a.prototype.createContainerElement=function(t){var r,o,a,s,u;return r=this.attributes[t],u=n(r).tagName,0===t&&this.block.isRTL()&&(o={dir:"rtl"}),"attachmentGallery"===r&&(s=this.block.getBlockBreakPosition(),a=e.attachmentGallery+" "+e.attachmentGallery+"--"+s),i({tagName:u,className:a,attributes:o})},a.prototype.shouldAddExtraNewlineElement=function(){return/\n\n$/.test(this.block.toString())},a}(t.ObjectView)}.call(this),function(){var e,n,i={}.hasOwnProperty;e=t.defer,n=t.makeElement,t.DocumentView=function(r){function o(){o.__super__.constructor.apply(this,arguments),this.element=this.options.element,this.elementStore=new t.ElementStore,this.setDocument(this.object)}var a,s,u;return function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(o,r),o.render=function(t){var e,i;return(i=new this(t,{element:e=n("div")})).render(),i.sync(),e},o.prototype.setDocument=function(t){return t.isEqualTo(this.document)?void 0:this.document=this.object=t},o.prototype.render=function(){var e,i,r,o,a,s,u;if(this.childViews=[],this.shadowElement=n("div"),!this.document.isEmpty()){for(s=[],e=0,i=(a=t.ObjectGroup.groupObjects(this.document.getBlocks(),{asTree:!0})).length;i>e;e++)o=a[e],u=this.findOrCreateCachedChildView(t.BlockView,o),s.push(function(){var t,e,n,i;for(i=[],t=0,e=(n=u.getNodes()).length;e>t;t++)r=n[t],i.push(this.shadowElement.appendChild(r));return i}.call(this));return s}},o.prototype.isSynced=function(){return a(this.shadowElement,this.element)},o.prototype.sync=function(){var t;for(t=this.createDocumentFragmentForSync();this.element.lastChild;)this.element.removeChild(this.element.lastChild);return this.element.appendChild(t),this.didSync()},o.prototype.didSync=function(){return this.elementStore.reset(s(this.element)),e((t=this,function(){return t.garbageCollectCachedViews()}));var t},o.prototype.createDocumentFragmentForSync=function(){var t,e,n,i,r,o,a,u,l,c;for(e=document.createDocumentFragment(),n=0,r=(u=this.shadowElement.childNodes).length;r>n;n++)a=u[n],e.appendChild(a.cloneNode(!0));for(i=0,o=(l=s(e)).length;o>i;i++)t=l[i],(c=this.elementStore.remove(t))&&t.parentNode.replaceChild(c,t);return e},s=function(t){return t.querySelectorAll("[data-trix-store-key]")},a=function(t,e){return u(t.innerHTML)===u(e.innerHTML)},u=function(t){return t.replace(/&nbsp;/g," ")},o}(t.ObjectView)}.call(this),function(){var e,n,i,r,o,a=function(t,e){return function(){return t.apply(e,arguments)}},s={}.hasOwnProperty;i=t.findClosestElementFromNode,r=t.handleEvent,o=t.innerElementIsActive,n=t.defer,e=t.AttachmentView.attachmentSelector,t.CompositionController=function(u){function l(n,i){this.element=n,this.composition=i,this.didClickAttachment=a(this.didClickAttachment,this),this.didBlur=a(this.didBlur,this),this.didFocus=a(this.didFocus,this),this.documentView=new t.DocumentView(this.composition.document,{element:this.element}),r("focus",{onElement:this.element,withCallback:this.didFocus}),r("blur",{onElement:this.element,withCallback:this.didBlur}),r("click",{onElement:this.element,matchingSelector:"a[contenteditable=false]",preventDefault:!0}),r("mousedown",{onElement:this.element,matchingSelector:e,withCallback:this.didClickAttachment}),r("click",{onElement:this.element,matchingSelector:"a"+e,preventDefault:!0})}return function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(l,u),l.prototype.didFocus=function(){var t,e,n,i;return i=this,t=function(){var t;return i.focused?void 0:(i.focused=!0,null!=(t=i.delegate)&&"function"==typeof t.compositionControllerDidFocus?t.compositionControllerDidFocus():void 0)},null!=(e=null!=(n=this.blurPromise)?n.then(t):void 0)?e:t()},l.prototype.didBlur=function(){return this.blurPromise=new Promise((t=this,function(e){return n((function(){var n;return o(t.element)||(t.focused=null,null!=(n=t.delegate)&&"function"==typeof n.compositionControllerDidBlur&&n.compositionControllerDidBlur()),t.blurPromise=null,e()}))}));var t},l.prototype.didClickAttachment=function(t,e){var n,r,o;return n=this.findAttachmentForElement(e),r=null!=i(t.target,{matchingSelector:"figcaption"}),null!=(o=this.delegate)&&"function"==typeof o.compositionControllerDidSelectAttachment?o.compositionControllerDidSelectAttachment(n,{editCaption:r}):void 0},l.prototype.getSerializableElement=function(){return this.isEditingAttachment()?this.documentView.shadowElement:this.element},l.prototype.render=function(){var t,e,n;return this.revision!==this.composition.revision&&(this.documentView.setDocument(this.composition.document),this.documentView.render(),this.revision=this.composition.revision),this.canSyncDocumentView()&&!this.documentView.isSynced()&&(null!=(t=this.delegate)&&"function"==typeof t.compositionControllerWillSyncDocumentView&&t.compositionControllerWillSyncDocumentView(),this.documentView.sync(),null!=(e=this.delegate)&&"function"==typeof e.compositionControllerDidSyncDocumentView&&e.compositionControllerDidSyncDocumentView()),null!=(n=this.delegate)&&"function"==typeof n.compositionControllerDidRender?n.compositionControllerDidRender():void 0},l.prototype.rerenderViewForObject=function(t){return this.invalidateViewForObject(t),this.render()},l.prototype.invalidateViewForObject=function(t){return this.documentView.invalidateViewForObject(t)},l.prototype.isViewCachingEnabled=function(){return this.documentView.isViewCachingEnabled()},l.prototype.enableViewCaching=function(){return this.documentView.enableViewCaching()},l.prototype.disableViewCaching=function(){return this.documentView.disableViewCaching()},l.prototype.refreshViewCache=function(){return this.documentView.garbageCollectCachedViews()},l.prototype.isEditingAttachment=function(){return null!=this.attachmentEditor},l.prototype.installAttachmentEditorForAttachment=function(e,n){var i,r,o;if((null!=(o=this.attachmentEditor)?o.attachment:void 0)!==e&&(r=this.documentView.findElementForObject(e)))return this.uninstallAttachmentEditor(),i=this.composition.document.getAttachmentPieceForAttachment(e),this.attachmentEditor=new t.AttachmentEditorController(i,r,this.element,n),this.attachmentEditor.delegate=this},l.prototype.uninstallAttachmentEditor=function(){var t;return null!=(t=this.attachmentEditor)?t.uninstall():void 0},l.prototype.didUninstallAttachmentEditor=function(){return this.attachmentEditor=null,this.render()},l.prototype.attachmentEditorDidRequestUpdatingAttributesForAttachment=function(t,e){var n;return null!=(n=this.delegate)&&"function"==typeof n.compositionControllerWillUpdateAttachment&&n.compositionControllerWillUpdateAttachment(e),this.composition.updateAttributesForAttachment(t,e)},l.prototype.attachmentEditorDidRequestRemovingAttributeForAttachment=function(t,e){var n;return null!=(n=this.delegate)&&"function"==typeof n.compositionControllerWillUpdateAttachment&&n.compositionControllerWillUpdateAttachment(e),this.composition.removeAttributeForAttachment(t,e)},l.prototype.attachmentEditorDidRequestRemovalOfAttachment=function(t){var e;return null!=(e=this.delegate)&&"function"==typeof e.compositionControllerDidRequestRemovalOfAttachment?e.compositionControllerDidRequestRemovalOfAttachment(t):void 0},l.prototype.attachmentEditorDidRequestDeselectingAttachment=function(t){var e;return null!=(e=this.delegate)&&"function"==typeof e.compositionControllerDidRequestDeselectingAttachment?e.compositionControllerDidRequestDeselectingAttachment(t):void 0},l.prototype.canSyncDocumentView=function(){return!this.isEditingAttachment()},l.prototype.findAttachmentForElement=function(t){return this.composition.document.getAttachmentById(parseInt(t.dataset.trixId,10))},l}(t.BasicObject)}.call(this),function(){var e,n,i,r=function(t,e){return function(){return t.apply(e,arguments)}},o={}.hasOwnProperty;n=t.handleEvent,i=t.triggerEvent,e=t.findClosestElementFromNode,t.ToolbarController=function(t){function a(t){this.element=t,this.didKeyDownDialogInput=r(this.didKeyDownDialogInput,this),this.didClickDialogButton=r(this.didClickDialogButton,this),this.didClickAttributeButton=r(this.didClickAttributeButton,this),this.didClickActionButton=r(this.didClickActionButton,this),this.attributes={},this.actions={},this.resetDialogInputs(),n("mousedown",{onElement:this.element,matchingSelector:s,withCallback:this.didClickActionButton}),n("mousedown",{onElement:this.element,matchingSelector:u,withCallback:this.didClickAttributeButton}),n("click",{onElement:this.element,matchingSelector:m,preventDefault:!0}),n("click",{onElement:this.element,matchingSelector:l,withCallback:this.didClickDialogButton}),n("keydown",{onElement:this.element,matchingSelector:c,withCallback:this.didKeyDownDialogInput})}var s,u,l,c,h,d,f,p,g,m;return function(t,e){function n(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(a,t),m=(u="[data-trix-attribute]")+", "+(s="[data-trix-action]"),(h="[data-trix-dialog]")+"[data-trix-active]",l=h+" [data-trix-method]",c=h+" [data-trix-input]",a.prototype.didClickActionButton=function(t,e){var n,i,r;return null!=(i=this.delegate)&&i.toolbarDidClickButton(),t.preventDefault(),n=d(e),this.getDialog(n)?this.toggleDialog(n):null!=(r=this.delegate)?r.toolbarDidInvokeAction(n):void 0},a.prototype.didClickAttributeButton=function(t,e){var n,i,r;return null!=(i=this.delegate)&&i.toolbarDidClickButton(),t.preventDefault(),n=f(e),this.getDialog(n)?this.toggleDialog(n):null!=(r=this.delegate)&&r.toolbarDidToggleAttribute(n),this.refreshAttributeButtons()},a.prototype.didClickDialogButton=function(t,n){var i;return i=e(n,{matchingSelector:h}),this[n.getAttribute("data-trix-method")].call(this,i)},a.prototype.didKeyDownDialogInput=function(t,e){var n,i;return 13===t.keyCode&&(t.preventDefault(),n=e.getAttribute("name"),i=this.getDialog(n),this.setAttribute(i)),27===t.keyCode?(t.preventDefault(),this.hideDialog()):void 0},a.prototype.updateActions=function(t){return this.actions=t,this.refreshActionButtons()},a.prototype.refreshActionButtons=function(){return this.eachActionButton((t=this,function(e,n){return e.disabled=!1===t.actions[n]}));var t},a.prototype.eachActionButton=function(t){var e,n,i,r,o;for(o=[],n=0,i=(r=this.element.querySelectorAll(s)).length;i>n;n++)e=r[n],o.push(t(e,d(e)));return o},a.prototype.updateAttributes=function(t){return this.attributes=t,this.refreshAttributeButtons()},a.prototype.refreshAttributeButtons=function(){return this.eachAttributeButton((t=this,function(e,n){return e.disabled=!1===t.attributes[n],t.attributes[n]||t.dialogIsVisible(n)?(e.setAttribute("data-trix-active",""),e.classList.add("trix-active")):(e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"))}));var t},a.prototype.eachAttributeButton=function(t){var e,n,i,r,o;for(o=[],n=0,i=(r=this.element.querySelectorAll(u)).length;i>n;n++)e=r[n],o.push(t(e,f(e)));return o},a.prototype.applyKeyboardCommand=function(t){var e,n,r,o,a,s;for(o=JSON.stringify(t.sort()),r=0,a=(s=this.element.querySelectorAll("[data-trix-key]")).length;a>r;r++)if(n=(e=s[r]).getAttribute("data-trix-key").split("+"),JSON.stringify(n.sort())===o)return i("mousedown",{onElement:e}),!0;return!1},a.prototype.dialogIsVisible=function(t){var e;return(e=this.getDialog(t))?e.hasAttribute("data-trix-active"):void 0},a.prototype.toggleDialog=function(t){return this.dialogIsVisible(t)?this.hideDialog():this.showDialog(t)},a.prototype.showDialog=function(t){var e,n,i,r,o,a,s,u,l;for(this.hideDialog(),null!=(a=this.delegate)&&a.toolbarWillShowDialog(),(n=this.getDialog(t)).setAttribute("data-trix-active",""),n.classList.add("trix-active"),i=0,o=(s=n.querySelectorAll("input[disabled]")).length;o>i;i++)s[i].removeAttribute("disabled");return(e=f(n))&&(r=g(n,t))&&(r.value=null!=(u=this.attributes[e])?u:"",r.select()),null!=(l=this.delegate)?l.toolbarDidShowDialog(t):void 0},a.prototype.setAttribute=function(t){var e,n,i;return e=f(t),(n=g(t,e)).willValidate&&!n.checkValidity()?(n.setAttribute("data-trix-validate",""),n.classList.add("trix-validate"),n.focus()):(null!=(i=this.delegate)&&i.toolbarDidUpdateAttribute(e,n.value),this.hideDialog())},a.prototype.removeAttribute=function(t){var e,n;return e=f(t),null!=(n=this.delegate)&&n.toolbarDidRemoveAttribute(e),this.hideDialog()},a.prototype.hideDialog=function(){var t,e;return(t=this.element.querySelector("[data-trix-dialog][data-trix-active]"))?(t.removeAttribute("data-trix-active"),t.classList.remove("trix-active"),this.resetDialogInputs(),null!=(e=this.delegate)?e.toolbarDidHideDialog(p(t)):void 0):void 0},a.prototype.resetDialogInputs=function(){var t,e,n,i,r;for(r=[],t=0,n=(i=this.element.querySelectorAll(c)).length;n>t;t++)(e=i[t]).setAttribute("disabled","disabled"),e.removeAttribute("data-trix-validate"),r.push(e.classList.remove("trix-validate"));return r},a.prototype.getDialog=function(t){return this.element.querySelector("[data-trix-dialog="+t+"]")},g=function(t,e){return null==e&&(e=f(t)),t.querySelector("[data-trix-input][name='"+e+"']")},d=function(t){return t.getAttribute("data-trix-action")},f=function(t){var e;return null!=(e=t.getAttribute("data-trix-attribute"))?e:t.getAttribute("data-trix-dialog-attribute")},p=function(t){return t.getAttribute("data-trix-dialog")},a}(t.BasicObject)}.call(this),function(){var e={}.hasOwnProperty;t.ImagePreloadOperation=function(t){function n(t){this.url=t}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(n,t),n.prototype.perform=function(t){var e,n;return(e=new Image).onload=(n=this,function(){return e.width=n.width=e.naturalWidth,e.height=n.height=e.naturalHeight,t(!0,e)}),e.onerror=function(){return t(!1)},e.src=this.url},n}(t.Operation)}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}},n={}.hasOwnProperty;t.Attachment=function(i){function r(n){null==n&&(n={}),this.releaseFile=e(this.releaseFile,this),r.__super__.constructor.apply(this,arguments),this.attributes=t.Hash.box(n),this.didChangeAttributes()}return function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(r,i),r.previewablePattern=/^image(\/(gif|png|jpe?g)|$)/,r.attachmentForFile=function(t){var e;return(e=new this(this.attributesForFile(t))).setFile(t),e},r.attributesForFile=function(e){return new t.Hash({filename:e.name,filesize:e.size,contentType:e.type})},r.fromJSON=function(t){return new this(t)},r.prototype.getAttribute=function(t){return this.attributes.get(t)},r.prototype.hasAttribute=function(t){return this.attributes.has(t)},r.prototype.getAttributes=function(){return this.attributes.toObject()},r.prototype.setAttributes=function(t){var e,n,i;return null==t&&(t={}),e=this.attributes.merge(t),this.attributes.isEqualTo(e)?void 0:(this.attributes=e,this.didChangeAttributes(),null!=(n=this.previewDelegate)&&"function"==typeof n.attachmentDidChangeAttributes&&n.attachmentDidChangeAttributes(this),null!=(i=this.delegate)&&"function"==typeof i.attachmentDidChangeAttributes?i.attachmentDidChangeAttributes(this):void 0)},r.prototype.didChangeAttributes=function(){return this.isPreviewable()?this.preloadURL():void 0},r.prototype.isPending=function(){return null!=this.file&&!(this.getURL()||this.getHref())},r.prototype.isPreviewable=function(){return this.attributes.has("previewable")?this.attributes.get("previewable"):this.constructor.previewablePattern.test(this.getContentType())},r.prototype.getType=function(){return this.hasContent()?"content":this.isPreviewable()?"preview":"file"},r.prototype.getURL=function(){return this.attributes.get("url")},r.prototype.getHref=function(){return this.attributes.get("href")},r.prototype.getFilename=function(){var t;return null!=(t=this.attributes.get("filename"))?t:""},r.prototype.getFilesize=function(){return this.attributes.get("filesize")},r.prototype.getFormattedFilesize=function(){var e;return"number"==typeof(e=this.attributes.get("filesize"))?t.config.fileSize.formatter(e):""},r.prototype.getExtension=function(){var t;return null!=(t=this.getFilename().match(/\.(\w+)$/))?t[1].toLowerCase():void 0},r.prototype.getContentType=function(){return this.attributes.get("contentType")},r.prototype.hasContent=function(){return this.attributes.has("content")},r.prototype.getContent=function(){return this.attributes.get("content")},r.prototype.getWidth=function(){return this.attributes.get("width")},r.prototype.getHeight=function(){return this.attributes.get("height")},r.prototype.getFile=function(){return this.file},r.prototype.setFile=function(t){return this.file=t,this.isPreviewable()?this.preloadFile():void 0},r.prototype.releaseFile=function(){return this.releasePreloadedFile(),this.file=null},r.prototype.getUploadProgress=function(){var t;return null!=(t=this.uploadProgress)?t:0},r.prototype.setUploadProgress=function(t){var e;return this.uploadProgress!==t?(this.uploadProgress=t,null!=(e=this.uploadProgressDelegate)&&"function"==typeof e.attachmentDidChangeUploadProgress?e.attachmentDidChangeUploadProgress(this):void 0):void 0},r.prototype.toJSON=function(){return this.getAttributes()},r.prototype.getCacheKey=function(){return[r.__super__.getCacheKey.apply(this,arguments),this.attributes.getCacheKey(),this.getPreviewURL()].join("/")},r.prototype.getPreviewURL=function(){return this.previewURL||this.preloadingURL},r.prototype.setPreviewURL=function(t){var e,n;return t!==this.getPreviewURL()?(this.previewURL=t,null!=(e=this.previewDelegate)&&"function"==typeof e.attachmentDidChangeAttributes&&e.attachmentDidChangeAttributes(this),null!=(n=this.delegate)&&"function"==typeof n.attachmentDidChangePreviewURL?n.attachmentDidChangePreviewURL(this):void 0):void 0},r.prototype.preloadURL=function(){return this.preload(this.getURL(),this.releaseFile)},r.prototype.preloadFile=function(){return this.file?(this.fileObjectURL=URL.createObjectURL(this.file),this.preload(this.fileObjectURL)):void 0},r.prototype.releasePreloadedFile=function(){return this.fileObjectURL?(URL.revokeObjectURL(this.fileObjectURL),this.fileObjectURL=null):void 0},r.prototype.preload=function(e,n){var i,r;return e&&e!==this.getPreviewURL()?(this.preloadingURL=e,new t.ImagePreloadOperation(e).then((r=this,function(t){var i,o;return o=t.width,i=t.height,r.getWidth()&&r.getHeight()||r.setAttributes({width:o,height:i}),r.preloadingURL=null,r.setPreviewURL(e),"function"==typeof n?n():void 0})).catch((i=this,function(){return i.preloadingURL=null,"function"==typeof n?n():void 0}))):void 0},r}(t.Object)}.call(this),function(){var e={}.hasOwnProperty;t.Piece=function(n){function i(e,n){null==n&&(n={}),i.__super__.constructor.apply(this,arguments),this.attributes=t.Hash.box(n)}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(i,n),i.types={},i.registerType=function(t,e){return e.type=t,this.types[t]=e},i.fromJSON=function(t){var e;return(e=this.types[t.type])?e.fromJSON(t):void 0},i.prototype.copyWithAttributes=function(t){return new this.constructor(this.getValue(),t)},i.prototype.copyWithAdditionalAttributes=function(t){return this.copyWithAttributes(this.attributes.merge(t))},i.prototype.copyWithoutAttribute=function(t){return this.copyWithAttributes(this.attributes.remove(t))},i.prototype.copy=function(){return this.copyWithAttributes(this.attributes)},i.prototype.getAttribute=function(t){return this.attributes.get(t)},i.prototype.getAttributesHash=function(){return this.attributes},i.prototype.getAttributes=function(){return this.attributes.toObject()},i.prototype.getCommonAttributes=function(){var t,e,n;return(n=pieceList.getPieceAtIndex(0))?(t=n.attributes,e=t.getKeys(),pieceList.eachPiece((function(n){return e=t.getKeysCommonToHash(n.attributes),t=t.slice(e)})),t.toObject()):{}},i.prototype.hasAttribute=function(t){return this.attributes.has(t)},i.prototype.hasSameStringValueAsPiece=function(t){return null!=t&&this.toString()===t.toString()},i.prototype.hasSameAttributesAsPiece=function(t){return null!=t&&(this.attributes===t.attributes||this.attributes.isEqualTo(t.attributes))},i.prototype.isBlockBreak=function(){return!1},i.prototype.isEqualTo=function(t){return i.__super__.isEqualTo.apply(this,arguments)||this.hasSameConstructorAs(t)&&this.hasSameStringValueAsPiece(t)&&this.hasSameAttributesAsPiece(t)},i.prototype.isEmpty=function(){return 0===this.length},i.prototype.isSerializable=function(){return!0},i.prototype.toJSON=function(){return{type:this.constructor.type,attributes:this.getAttributes()}},i.prototype.contentsForInspection=function(){return{type:this.constructor.type,attributes:this.attributes.inspect()}},i.prototype.canBeGrouped=function(){return this.hasAttribute("href")},i.prototype.canBeGroupedWith=function(t){return this.getAttribute("href")===t.getAttribute("href")},i.prototype.getLength=function(){return this.length},i.prototype.canBeConsolidatedWith=function(){return!1},i}(t.Object)}.call(this),function(){var e={}.hasOwnProperty;t.Piece.registerType("attachment",t.AttachmentPiece=function(n){function i(t){this.attachment=t,i.__super__.constructor.apply(this,arguments),this.length=1,this.ensureAttachmentExclusivelyHasAttribute("href"),this.attachment.hasContent()||this.removeProhibitedAttributes()}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(i,n),i.fromJSON=function(e){return new this(t.Attachment.fromJSON(e.attachment),e.attributes)},i.permittedAttributes=["caption","presentation"],i.prototype.ensureAttachmentExclusivelyHasAttribute=function(t){return this.hasAttribute(t)?(this.attachment.hasAttribute(t)||this.attachment.setAttributes(this.attributes.slice(t)),this.attributes=this.attributes.remove(t)):void 0},i.prototype.removeProhibitedAttributes=function(){var t;return(t=this.attributes.slice(this.constructor.permittedAttributes)).isEqualTo(this.attributes)?void 0:this.attributes=t},i.prototype.getValue=function(){return this.attachment},i.prototype.isSerializable=function(){return!this.attachment.isPending()},i.prototype.getCaption=function(){var t;return null!=(t=this.attributes.get("caption"))?t:""},i.prototype.isEqualTo=function(t){var e;return i.__super__.isEqualTo.apply(this,arguments)&&this.attachment.id===(null!=t&&null!=(e=t.attachment)?e.id:void 0)},i.prototype.toString=function(){return t.OBJECT_REPLACEMENT_CHARACTER},i.prototype.toJSON=function(){var t;return(t=i.__super__.toJSON.apply(this,arguments)).attachment=this.attachment,t},i.prototype.getCacheKey=function(){return[i.__super__.getCacheKey.apply(this,arguments),this.attachment.getCacheKey()].join("/")},i.prototype.toConsole=function(){return JSON.stringify(this.toString())},i}(t.Piece))}.call(this),function(){var e,n={}.hasOwnProperty;e=t.normalizeNewlines,t.Piece.registerType("string",t.StringPiece=function(t){function i(t){i.__super__.constructor.apply(this,arguments),this.string=e(t),this.length=this.string.length}return function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(i,t),i.fromJSON=function(t){return new this(t.string,t.attributes)},i.prototype.getValue=function(){return this.string},i.prototype.toString=function(){return this.string.toString()},i.prototype.isBlockBreak=function(){return"\n"===this.toString()&&!0===this.getAttribute("blockBreak")},i.prototype.toJSON=function(){var t;return(t=i.__super__.toJSON.apply(this,arguments)).string=this.string,t},i.prototype.canBeConsolidatedWith=function(t){return null!=t&&this.hasSameConstructorAs(t)&&this.hasSameAttributesAsPiece(t)},i.prototype.consolidateWith=function(t){return new this.constructor(this.toString()+t.toString(),this.attributes)},i.prototype.splitAtOffset=function(t){var e,n;return 0===t?(e=null,n=this):t===this.length?(e=this,n=null):(e=new this.constructor(this.string.slice(0,t),this.attributes),n=new this.constructor(this.string.slice(t),this.attributes)),[e,n]},i.prototype.toConsole=function(){var t;return(t=this.string).length>15&&(t=t.slice(0,14)+"…"),JSON.stringify(t.toString())},i}(t.Piece))}.call(this),function(){var e,n={}.hasOwnProperty,i=[].slice;e=t.spliceArray,t.SplittableList=function(t){function r(t){null==t&&(t=[]),r.__super__.constructor.apply(this,arguments),this.objects=t.slice(0),this.length=this.objects.length}var o,a,s;return function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype}(r,t),r.box=function(t){return t instanceof this?t:new this(t)},r.prototype.indexOf=function(t){return this.objects.indexOf(t)},r.prototype.splice=function(){var t;return t=1<=arguments.length?i.call(arguments,0):[],new this.constructor(e.apply(null,[this.objects].concat(i.call(t))))},r.prototype.eachObject=function(t){var e,n,i,r,o,a;for(a=[],n=e=0,i=(o=this.objects).length;i>e;n=++e)r=o[n],a.push(t(r,n));return a},r.prototype.insertObjectAtIndex=function(t,e){return this.splice(e,0,t)},r.prototype.insertSplittableListAtIndex=function(t,e){return this.splice.apply(this,[e,0].concat(i.call(t.objects)))},r.prototype.insertSplittableListAtPosition=function(t,e){var n,i,r;return i=(r=this.splitObjectAtPosition(e))[0],n=r[1],new this.constructor(i).insertSplittableListAtIndex(t,n)},r.prototype.editObjectAtIndex=function(t,e){return this.replaceObjectAtIndex(e(this.objects[t]),t)},r.prototype.replaceObjectAtIndex=function(t,e){return this.splice(e,1,t)},r.prototype.removeObjectAtIndex=function(t){return this.splice(t,1)},r.prototype.getObjectAtIndex=function(t){return this.objects[t]},r.prototype.getSplittableListInRange=function(t){var e,n,i,r;return n=(i=this.splitObjectsAtRange(t))[0],e=i[1],r=i[2],new this.constructor(n.slice(e,r+1))},r.prototype.selectSplittableList=function(t){var e,n;return n=function(){var n,i,r,o;for(o=[],n=0,i=(r=this.objects).length;i>n;n++)e=r[n],t(e)&&o.push(e);return o}.call(this),new this.constructor(n)},r.prototype.removeObjectsInRange=function(t){var e,n,i,r;return n=(i=this.splitObjectsAtRange(t))[0],e=i[1],r=i[2],new this.constructor(n).splice(e,r-e+1)},r.prototype.transformObjectsInRange=function(t,e){var n,i,r,o,a,s,u;return a=this.splitObjectsAtRange(t),o=a[0],i=a[1],s=a[2],u=function(){var t,a,u;for(u=[],n=t=0,a=o.length;a>t;n=++t)r=o[n],u.push(n>=i&&s>=n?e(r):r);return u}(),new this.constructor(u)},r.prototype.splitObjectsAtRange=function(t){var e,n,i,r,a;return n=(r=this.splitObjectAtPosition(s(t)))[0],e=r[1],i=r[2],[n=(a=new this.constructor(n).splitObjectAtPosition(o(t)+i))[0],e,a[1]-1]},r.prototype.getObjectAtPosition=function(t){var e,n;return e=(n=this.findIndexAndOffsetAtPosition(t)).index,n.offset,this.objects[e]},r.prototype.splitObjectAtPosition=function(t){var e,n,i,r,o,a,s,u,l;return e=(o=this.findIndexAndOffsetAtPosition(t)).index,r=o.offset,i=this.objects.slice(0),null!=e?0===r?(u=e,l=0):(n=(a=this.getObjectAtIndex(e).splitAtOffset(r))[0],s=a[1],i.splice(e,1,n,s),u=e+1,l=n.getLength()-r):(u=i.length,l=0),[i,u,l]},r.prototype.consolidate=function(){var t,e,n,i,r,o;for(i=[],r=this.objects[0],t=0,e=(o=this.objects.slice(1)).length;e>t;t++)n=o[t],("function"==typeof r.canBeConsolidatedWith?r.canBeConsolidatedWith(n):void 0)?r=r.consolidateWith(n):(i.push(r),r=n);return null!=r&&i.push(r),new this.constructor(i)},r.prototype.consolidateFromIndexToIndex=function(t,e){var n,r;return r=this.objects.slice(0).slice(t,e+1),n=new this.constructor(r).consolidate().toArray(),this.splice.apply(this,[t,r.length].concat(i.call(n)))},r.prototype.findIndexAndOffsetAtPosition=function(t){var e,n,i,r,o,a;for(e=0,i=n=0,r=(a=this.objects).length;r>n;i=++n){if(o=e+a[i].getLength(),t>=e&&o>t)return{index:i,offset:t-e};e=o}return{index:null,offset:null}},r.prototype.findPositionAtIndexAndOffset=function(t,e){var n,i,r,o,a,s;for(a=0,n=i=0,r=(s=this.objects).length;r>i;n=++i)if(o=s[n],t>n)a+=o.getLength();else if(n===t){a+=e;break}return a},r.prototype.getEndPosition=function(){var t,e;return null!=this.endPosition?this.endPosition:this.endPosition=function(){var n,i,r;for(e=0,n=0,i=(r=this.objects).length;i>n;n++)t=r[n],e+=t.getLength();return e}.call(this)},r.prototype.toString=function(){return this.objects.join("")},r.prototype.toArray=function(){return this.objects.slice(0)},r.prototype.toJSON=function(){return this.toArray()},r.prototype.isEqualTo=function(t){return r.__super__.isEqualTo.apply(this,arguments)||a(this.objects,null!=t?t.objects:void 0)},a=function(t,e){var n,i,r,o,a;if(null==e&&(e=[]),t.length!==e.length)return!1;for(a=!0,i=n=0,r=t.length;r>n;i=++n)o=t[i],a&&!o.isEqualTo(e[i])&&(a=!1);return a},r.prototype.contentsForInspection=function(){var t;return{objects:"["+function(){var e,n,i,r;for(r=[],e=0,n=(i=this.objects).length;n>e;e++)t=i[e],r.push(t.inspect());return r}.call(this).join(", ")+"]"}},s=function(t){return t[0]},o=function(t){return t[1]},r}(t.Object)}.call(this),function(){var e={}.hasOwnProperty;t.Text=function(n){function i(e){var n;null==e&&(e=[]),i.__super__.constructor.apply(this,arguments),this.pieceList=new t.SplittableList(function(){var t,i,r;for(r=[],t=0,i=e.length;i>t;t++)(n=e[t]).isEmpty()||r.push(n);return r}())}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(i,n),i.textForAttachmentWithAttributes=function(e,n){return new this([new t.AttachmentPiece(e,n)])},i.textForStringWithAttributes=function(e,n){return new this([new t.StringPiece(e,n)])},i.fromJSON=function(e){var n;return new this(function(){var i,r,o;for(o=[],i=0,r=e.length;r>i;i++)n=e[i],o.push(t.Piece.fromJSON(n));return o}())},i.prototype.copy=function(){return this.copyWithPieceList(this.pieceList)},i.prototype.copyWithPieceList=function(t){return new this.constructor(t.consolidate().toArray())},i.prototype.copyUsingObjectMap=function(t){var e,n;return n=function(){var n,i,r,o,a;for(a=[],n=0,i=(r=this.getPieces()).length;i>n;n++)e=r[n],a.push(null!=(o=t.find(e))?o:e);return a}.call(this),new this.constructor(n)},i.prototype.appendText=function(t){return this.insertTextAtPosition(t,this.getLength())},i.prototype.insertTextAtPosition=function(t,e){return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(t.pieceList,e))},i.prototype.removeTextAtRange=function(t){return this.copyWithPieceList(this.pieceList.removeObjectsInRange(t))},i.prototype.replaceTextAtRange=function(t,e){return this.removeTextAtRange(e).insertTextAtPosition(t,e[0])},i.prototype.moveTextFromRangeToPosition=function(t,e){var n,i;if(!(t[0]<=e&&e<=t[1]))return n=(i=this.getTextAtRange(t)).getLength(),t[0]<e&&(e-=n),this.removeTextAtRange(t).insertTextAtPosition(i,e)},i.prototype.addAttributeAtRange=function(t,e,n){var i;return(i={})[t]=e,this.addAttributesAtRange(i,n)},i.prototype.addAttributesAtRange=function(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,(function(e){return e.copyWithAdditionalAttributes(t)})))},i.prototype.removeAttributeAtRange=function(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,(function(e){return e.copyWithoutAttribute(t)})))},i.prototype.setAttributesAtRange=function(t,e){return this.copyWithPieceList(this.pieceList.transformObjectsInRange(e,(function(e){return e.copyWithAttributes(t)})))},i.prototype.getAttributesAtPosition=function(t){var e,n;return null!=(e=null!=(n=this.pieceList.getObjectAtPosition(t))?n.getAttributes():void 0)?e:{}},i.prototype.getCommonAttributes=function(){var e,n;return e=function(){var t,e,i,r;for(r=[],t=0,e=(i=this.pieceList.toArray()).length;e>t;t++)n=i[t],r.push(n.getAttributes());return r}.call(this),t.Hash.fromCommonAttributesOfObjects(e).toObject()},i.prototype.getCommonAttributesAtRange=function(t){var e;return null!=(e=this.getTextAtRange(t).getCommonAttributes())?e:{}},i.prototype.getExpandedRangeForAttributeAtOffset=function(t,e){var n,i,r;for(n=r=e,i=this.getLength();n>0&&this.getCommonAttributesAtRange([n-1,r])[t];)n--;for(;i>r&&this.getCommonAttributesAtRange([e,r+1])[t];)r++;return[n,r]},i.prototype.getTextAtRange=function(t){return this.copyWithPieceList(this.pieceList.getSplittableListInRange(t))},i.prototype.getStringAtRange=function(t){return this.pieceList.getSplittableListInRange(t).toString()},i.prototype.getStringAtPosition=function(t){return this.getStringAtRange([t,t+1])},i.prototype.startsWithString=function(t){return this.getStringAtRange([0,t.length])===t},i.prototype.endsWithString=function(t){var e;return e=this.getLength(),this.getStringAtRange([e-t.length,e])===t},i.prototype.getAttachmentPieces=function(){var t,e,n,i,r;for(r=[],t=0,e=(i=this.pieceList.toArray()).length;e>t;t++)null!=(n=i[t]).attachment&&r.push(n);return r},i.prototype.getAttachments=function(){var t,e,n,i,r;for(r=[],t=0,e=(i=this.getAttachmentPieces()).length;e>t;t++)n=i[t],r.push(n.attachment);return r},i.prototype.getAttachmentAndPositionById=function(t){var e,n,i,r,o,a;for(r=0,e=0,n=(o=this.pieceList.toArray()).length;n>e;e++){if((null!=(a=(i=o[e]).attachment)?a.id:void 0)===t)return{attachment:i.attachment,position:r};r+=i.length}return{attachment:null,position:null}},i.prototype.getAttachmentById=function(t){var e,n;return e=(n=this.getAttachmentAndPositionById(t)).attachment,n.position,e},i.prototype.getRangeOfAttachment=function(t){var e,n;return t=(n=this.getAttachmentAndPositionById(t.id)).attachment,e=n.position,null!=t?[e,e+1]:void 0},i.prototype.updateAttributesForAttachment=function(t,e){var n;return(n=this.getRangeOfAttachment(e))?this.addAttributesAtRange(t,n):this},i.prototype.getLength=function(){return this.pieceList.getEndPosition()},i.prototype.isEmpty=function(){return 0===this.getLength()},i.prototype.isEqualTo=function(t){var e;return i.__super__.isEqualTo.apply(this,arguments)||(null!=t&&null!=(e=t.pieceList)?e.isEqualTo(this.pieceList):void 0)},i.prototype.isBlockBreak=function(){return 1===this.getLength()&&this.pieceList.getObjectAtIndex(0).isBlockBreak()},i.prototype.eachPiece=function(t){return this.pieceList.eachObject(t)},i.prototype.getPieces=function(){return this.pieceList.toArray()},i.prototype.getPieceAtPosition=function(t){return this.pieceList.getObjectAtPosition(t)},i.prototype.contentsForInspection=function(){return{pieceList:this.pieceList.inspect()}},i.prototype.toSerializableText=function(){var t;return t=this.pieceList.selectSplittableList((function(t){return t.isSerializable()})),this.copyWithPieceList(t)},i.prototype.toString=function(){return this.pieceList.toString()},i.prototype.toJSON=function(){return this.pieceList.toJSON()},i.prototype.toConsole=function(){var t;return JSON.stringify(function(){var e,n,i,r;for(r=[],e=0,n=(i=this.pieceList.toArray()).length;n>e;e++)t=i[e],r.push(JSON.parse(t.toConsole()));return r}.call(this))},i.prototype.getDirection=function(){return t.getDirection(this.toString())},i.prototype.isRTL=function(){return"rtl"===this.getDirection()},i}(t.Object)}.call(this),function(){var e,n,i,r,o={}.hasOwnProperty,a=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},s=[].slice;e=t.arraysAreEqual,r=t.spliceArray,n=t.getBlockConfig,t.getBlockAttributeNames,i=t.getListAttributeNames,t.Block=function(u){function l(e,n){null==e&&(e=new t.Text),null==n&&(n=[]),l.__super__.constructor.apply(this,arguments),this.text=h(e),this.attributes=n}var c,h,d,f,p,g,m,v,y;return function(t,e){function n(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(l,u),l.fromJSON=function(e){return new this(t.Text.fromJSON(e.text),e.attributes)},l.prototype.isEmpty=function(){return this.text.isBlockBreak()},l.prototype.isEqualTo=function(t){return l.__super__.isEqualTo.apply(this,arguments)||this.text.isEqualTo(null!=t?t.text:void 0)&&e(this.attributes,null!=t?t.attributes:void 0)},l.prototype.copyWithText=function(t){return new this.constructor(t,this.attributes)},l.prototype.copyWithoutText=function(){return this.copyWithText(null)},l.prototype.copyWithAttributes=function(t){return new this.constructor(this.text,t)},l.prototype.copyWithoutAttributes=function(){return this.copyWithAttributes(null)},l.prototype.copyUsingObjectMap=function(t){var e;return this.copyWithText((e=t.find(this.text))?e:this.text.copyUsingObjectMap(t))},l.prototype.addAttribute=function(t){var e;return e=this.attributes.concat(f(t)),this.copyWithAttributes(e)},l.prototype.removeAttribute=function(t){var e,i;return i=n(t).listAttribute,e=g(g(this.attributes,t),i),this.copyWithAttributes(e)},l.prototype.removeLastAttribute=function(){return this.removeAttribute(this.getLastAttribute())},l.prototype.getLastAttribute=function(){return p(this.attributes)},l.prototype.getAttributes=function(){return this.attributes.slice(0)},l.prototype.getAttributeLevel=function(){return this.attributes.length},l.prototype.getAttributeAtLevel=function(t){return this.attributes[t-1]},l.prototype.hasAttribute=function(t){return a.call(this.attributes,t)>=0},l.prototype.hasAttributes=function(){return this.getAttributeLevel()>0},l.prototype.getLastNestableAttribute=function(){return p(this.getNestableAttributes())},l.prototype.getNestableAttributes=function(){var t,e,i,r,o;for(o=[],e=0,i=(r=this.attributes).length;i>e;e++)t=r[e],n(t).nestable&&o.push(t);return o},l.prototype.getNestingLevel=function(){return this.getNestableAttributes().length},l.prototype.decreaseNestingLevel=function(){var t;return(t=this.getLastNestableAttribute())?this.removeAttribute(t):this},l.prototype.increaseNestingLevel=function(){var t,e,n;return(t=this.getLastNestableAttribute())?(n=this.attributes.lastIndexOf(t),e=r.apply(null,[this.attributes,n+1,0].concat(s.call(f(t)))),this.copyWithAttributes(e)):this},l.prototype.getListItemAttributes=function(){var t,e,i,r,o;for(o=[],e=0,i=(r=this.attributes).length;i>e;e++)t=r[e],n(t).listAttribute&&o.push(t);return o},l.prototype.isListItem=function(){var t;return null!=(t=n(this.getLastAttribute()))?t.listAttribute:void 0},l.prototype.isTerminalBlock=function(){var t;return null!=(t=n(this.getLastAttribute()))?t.terminal:void 0},l.prototype.breaksOnReturn=function(){var t;return null!=(t=n(this.getLastAttribute()))?t.breakOnReturn:void 0},l.prototype.findLineBreakInDirectionFromPosition=function(t,e){var n,i;return i=this.toString(),-1!==(n=function(){switch(t){case"forward":return i.indexOf("\n",e);case"backward":return i.slice(0,e).lastIndexOf("\n")}}())?n:void 0},l.prototype.contentsForInspection=function(){return{text:this.text.inspect(),attributes:this.attributes}},l.prototype.toString=function(){return this.text.toString()},l.prototype.toJSON=function(){return{text:this.text,attributes:this.attributes}},l.prototype.getDirection=function(){return this.text.getDirection()},l.prototype.isRTL=function(){return this.text.isRTL()},l.prototype.getLength=function(){return this.text.getLength()},l.prototype.canBeConsolidatedWith=function(t){return!this.hasAttributes()&&!t.hasAttributes()&&this.getDirection()===t.getDirection()},l.prototype.consolidateWith=function(e){var n,i;return n=t.Text.textForStringWithAttributes("\n"),i=this.getTextWithoutBlockBreak().appendText(n),this.copyWithText(i.appendText(e.text))},l.prototype.splitAtOffset=function(t){var e,n;return 0===t?(e=null,n=this):t===this.getLength()?(e=this,n=null):(e=this.copyWithText(this.text.getTextAtRange([0,t])),n=this.copyWithText(this.text.getTextAtRange([t,this.getLength()]))),[e,n]},l.prototype.getBlockBreakPosition=function(){return this.text.getLength()-1},l.prototype.getTextWithoutBlockBreak=function(){return m(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()},l.prototype.canBeGrouped=function(t){return this.attributes[t]},l.prototype.canBeGroupedWith=function(t,e){var r,o,s,u;return o=(s=t.getAttributes())[e],!((r=this.attributes[e])!==o||!1===n(r).group&&(u=s[e+1],a.call(i(),u)<0)||this.getDirection()!==t.getDirection()&&!t.isEmpty())},h=function(t){return t=y(t),c(t)},y=function(e){var n,i,r,o,a,u;return o=!1,u=e.getPieces(),i=2<=u.length?s.call(u,0,n=u.length-1):(n=0,[]),null==(r=u[n++])?e:(i=function(){var t,e,n;for(n=[],t=0,e=i.length;e>t;t++)(a=i[t]).isBlockBreak()?(o=!0,n.push(v(a))):n.push(a);return n}(),o?new t.Text(s.call(i).concat([r])):e)},d=t.Text.textForStringWithAttributes("\n",{blockBreak:!0}),c=function(t){return m(t)?t:t.appendText(d)},m=function(t){var e;return 0!==(e=t.getLength())&&t.getTextAtRange([e-1,e]).isBlockBreak()},v=function(t){return t.copyWithoutAttribute("blockBreak")},f=function(t){var e;return null!=(e=n(t).listAttribute)?[e,t]:[t]},p=function(t){return t.slice(-1)[0]},g=function(t,e){var n;return-1===(n=t.lastIndexOf(e))?t:r(t,n,1)},l}(t.Object)}.call(this),function(){var e,n,i,r={}.hasOwnProperty,o=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=[].slice;n=t.tagName,i=t.walkTree,e=t.nodeIsAttachmentElement,t.HTMLSanitizer=function(s){function u(t,e){var n;n=null!=e?e:{},this.allowedAttributes=n.allowedAttributes,this.forbiddenProtocols=n.forbiddenProtocols,this.forbiddenElements=n.forbiddenElements,null==this.allowedAttributes&&(this.allowedAttributes=l),null==this.forbiddenProtocols&&(this.forbiddenProtocols=h),null==this.forbiddenElements&&(this.forbiddenElements=c),this.body=d(t)}var l,c,h,d;return function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(u,s),l="style href src width height class".split(" "),h="javascript:".split(" "),c="script iframe".split(" "),u.sanitize=function(t,e){var n;return(n=new this(t,e)).sanitize(),n},u.prototype.sanitize=function(){return this.sanitizeElements(),this.normalizeListElementNesting()},u.prototype.getHTML=function(){return this.body.innerHTML},u.prototype.getBody=function(){return this.body},u.prototype.sanitizeElements=function(){var e,n,r,o,a;for(a=i(this.body),o=[];a.nextNode();)switch((r=a.currentNode).nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(r)?o.push(r):this.sanitizeElement(r);break;case Node.COMMENT_NODE:o.push(r)}for(e=0,n=o.length;n>e;e++)r=o[e],t.removeNode(r);return this.body},u.prototype.sanitizeElement=function(t){var e,n,i,r,s;for(t.hasAttribute("href")&&(r=t.protocol,o.call(this.forbiddenProtocols,r)>=0&&t.removeAttribute("href")),e=0,n=(s=a.call(t.attributes)).length;n>e;e++)i=s[e].name,o.call(this.allowedAttributes,i)>=0||0===i.indexOf("data-trix")||t.removeAttribute(i);return t},u.prototype.normalizeListElementNesting=function(){var t,e,i,r,o;for(t=0,e=(o=a.call(this.body.querySelectorAll("ul,ol"))).length;e>t;t++)(r=(i=o[t]).previousElementSibling)&&"li"===n(r)&&r.appendChild(i);return this.body},u.prototype.elementIsRemovable=function(t){return(null!=t?t.nodeType:void 0)===Node.ELEMENT_NODE?this.elementIsForbidden(t)||this.elementIsntSerializable(t):void 0},u.prototype.elementIsForbidden=function(t){var e;return e=n(t),o.call(this.forbiddenElements,e)>=0},u.prototype.elementIsntSerializable=function(t){return"false"===t.getAttribute("data-trix-serialize")&&!e(t)},d=function(t){var e,n,i,r,o;for(null==t&&(t=""),t=t.replace(/<\/html[^>]*>[^]*$/i,"</html>"),(e=document.implementation.createHTMLDocument("")).documentElement.innerHTML=t,i=0,r=(o=e.head.querySelectorAll("style")).length;r>i;i++)n=o[i],e.body.appendChild(n);return e.body},u}(t.BasicObject)}.call(this),function(){var e,n,i,r,o,a,s,u,l,c,h,d={}.hasOwnProperty,f=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=t.arraysAreEqual,a=t.makeElement,c=t.tagName,o=t.getBlockTagNames,h=t.walkTree,r=t.findClosestElementFromNode,i=t.elementContainsNode,s=t.nodeIsAttachmentElement,u=t.normalizeSpaces,n=t.breakableWhitespacePattern,l=t.squishBreakableWhitespace,t.HTMLParser=function(p){function g(t,e){this.html=t,this.referenceElement=(null!=e?e:{}).referenceElement,this.blocks=[],this.blockElements=[],this.processedElements=[]}var m,v,y,b,_,E,x,A,D,w,k,T;return function(t,e){function n(){this.constructor=t}for(var i in e)d.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(g,p),g.parse=function(t,e){var n;return(n=new this(t,e)).parse(),n},g.prototype.getDocument=function(){return t.Document.fromJSON(this.blocks)},g.prototype.parse=function(){var e,n;try{for(this.createHiddenContainer(),e=t.HTMLSanitizer.sanitize(this.html).getHTML(),this.containerElement.innerHTML=e,n=h(this.containerElement,{usingFilter:x});n.nextNode();)this.processNode(n.currentNode);return this.translateBlockElementMarginsToNewlines()}finally{this.removeHiddenContainer()}},g.prototype.createHiddenContainer=function(){return this.referenceElement?(this.containerElement=this.referenceElement.cloneNode(!1),this.containerElement.removeAttribute("id"),this.containerElement.setAttribute("data-trix-internal",""),this.containerElement.style.display="none",this.referenceElement.parentNode.insertBefore(this.containerElement,this.referenceElement.nextSibling)):(this.containerElement=a({tagName:"div",style:{display:"none"}}),document.body.appendChild(this.containerElement))},g.prototype.removeHiddenContainer=function(){return t.removeNode(this.containerElement)},x=function(t){return"style"===c(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},g.prototype.processNode=function(t){switch(t.nodeType){case Node.TEXT_NODE:if(!this.isInsignificantTextNode(t))return this.appendBlockForTextNode(t),this.processTextNode(t);break;case Node.ELEMENT_NODE:return this.appendBlockForElement(t),this.processElement(t)}},g.prototype.appendBlockForTextNode=function(t){var n,i,r;return(i=t.parentNode)===this.currentBlockElement&&this.isBlockElement(t.previousSibling)?this.appendStringWithAttributes("\n"):i!==this.containerElement&&!this.isBlockElement(i)||(n=this.getBlockAttributes(i),e(n,null!=(r=this.currentBlock)?r.attributes:void 0))?void 0:(this.currentBlock=this.appendBlockForAttributesWithElement(n,i),this.currentBlockElement=i)},g.prototype.appendBlockForElement=function(t){var n,r,o,a;if(o=this.isBlockElement(t),r=i(this.currentBlockElement,t),o&&!this.isBlockElement(t.firstChild)){if((!this.isInsignificantTextNode(t.firstChild)||!this.isBlockElement(t.firstElementChild))&&(n=this.getBlockAttributes(t),t.firstChild))return r&&e(n,this.currentBlock.attributes)?this.appendStringWithAttributes("\n"):(this.currentBlock=this.appendBlockForAttributesWithElement(n,t),this.currentBlockElement=t)}else if(this.currentBlockElement&&!r&&!o)return(a=this.findParentBlockElement(t))?this.appendBlockForElement(a):(this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null)},g.prototype.findParentBlockElement=function(t){var e;for(e=t.parentElement;e&&e!==this.containerElement;){if(this.isBlockElement(e)&&f.call(this.blockElements,e)>=0)return e;e=e.parentElement}return null},g.prototype.processTextNode=function(t){var e,n;return n=t.data,v(t.parentNode)||(n=l(n),k(null!=(e=t.previousSibling)?e.textContent:void 0)&&(n=_(n))),this.appendStringWithAttributes(n,this.getTextAttributes(t.parentNode))},g.prototype.processElement=function(t){var e,n,i,r,o;if(s(t))return e=A(t,"attachment"),Object.keys(e).length&&(r=this.getTextAttributes(t),this.appendAttachmentWithAttributes(e,r),t.innerHTML=""),this.processedElements.push(t);switch(c(t)){case"br":return this.isExtraBR(t)||this.isBlockElement(t.nextSibling)||this.appendStringWithAttributes("\n",this.getTextAttributes(t)),this.processedElements.push(t);case"img":for(n in e={url:t.getAttribute("src"),contentType:"image"},i=b(t))o=i[n],e[n]=o;return this.appendAttachmentWithAttributes(e,this.getTextAttributes(t)),this.processedElements.push(t);case"tr":if(t.parentNode.firstChild!==t)return this.appendStringWithAttributes("\n");break;case"td":if(t.parentNode.firstChild!==t)return this.appendStringWithAttributes(" | ")}},g.prototype.appendBlockForAttributesWithElement=function(t,e){var n;return this.blockElements.push(e),n=m(t),this.blocks.push(n),n},g.prototype.appendEmptyBlock=function(){return this.appendBlockForAttributesWithElement([],null)},g.prototype.appendStringWithAttributes=function(t,e){return this.appendPiece(w(t,e))},g.prototype.appendAttachmentWithAttributes=function(t,e){return this.appendPiece(D(t,e))},g.prototype.appendPiece=function(t){return 0===this.blocks.length&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(t)},g.prototype.appendStringToTextAtIndex=function(t,e){var n,i;return"string"===(null!=(n=(i=this.blocks[e].text)[i.length-1])?n.type:void 0)?n.string+=t:i.push(w(t))},g.prototype.prependStringToTextAtIndex=function(t,e){var n,i;return"string"===(null!=(n=(i=this.blocks[e].text)[0])?n.type:void 0)?n.string=t+n.string:i.unshift(w(t))},w=function(t,e){return null==e&&(e={}),"string",{string:t=u(t),attributes:e,type:"string"}},D=function(t,e){return null==e&&(e={}),"attachment",{attachment:t,attributes:e,type:"attachment"}},m=function(t){return null==t&&(t={}),{text:[],attributes:t}},g.prototype.getTextAttributes=function(e){var n,i,o,a,u,l,c,h,d,f,p,g;for(n in o={},d=t.config.textAttributes)if((u=d[n]).tagName&&r(e,{matchingSelector:u.tagName,untilNode:this.containerElement}))o[n]=!0;else if(u.parser){if(g=u.parser(e)){for(i=!1,l=0,h=(f=this.findBlockElementAncestors(e)).length;h>l;l++)if(a=f[l],u.parser(a)===g){i=!0;break}i||(o[n]=g)}}else u.styleProperty&&(g=e.style[u.styleProperty])&&(o[n]=g);if(s(e))for(c in p=A(e,"attributes"))g=p[c],o[c]=g;return o},g.prototype.getBlockAttributes=function(e){var n,i,r,o;for(i=[];e&&e!==this.containerElement;){for(n in o=t.config.blockAttributes)!1!==(r=o[n]).parse&&c(e)===r.tagName&&(("function"==typeof r.test?r.test(e):void 0)||!r.test)&&(i.push(n),r.listAttribute&&i.push(r.listAttribute));e=e.parentNode}return i.reverse()},g.prototype.findBlockElementAncestors=function(t){var e,n;for(e=[];t&&t!==this.containerElement;)n=c(t),f.call(o(),n)>=0&&e.push(t),t=t.parentNode;return e},A=function(t,e){try{return JSON.parse(t.getAttribute("data-trix-"+e))}catch(t){return{}}},b=function(t){var e,n,i;return i=t.getAttribute("width"),n=t.getAttribute("height"),e={},i&&(e.width=parseInt(i,10)),n&&(e.height=parseInt(n,10)),e},g.prototype.isBlockElement=function(t){var e;if((null!=t?t.nodeType:void 0)===Node.ELEMENT_NODE&&!s(t)&&!r(t,{matchingSelector:"td",untilNode:this.containerElement}))return e=c(t),f.call(o(),e)>=0||"block"===window.getComputedStyle(t).display},g.prototype.isInsignificantTextNode=function(t){var e,n,i;if((null!=t?t.nodeType:void 0)===Node.TEXT_NODE&&T(t.data)&&(n=t.parentNode,i=t.previousSibling,e=t.nextSibling,(!E(n.previousSibling)||this.isBlockElement(n.previousSibling))&&!v(n)))return!i||this.isBlockElement(i)||!e||this.isBlockElement(e)},g.prototype.isExtraBR=function(t){return"br"===c(t)&&this.isBlockElement(t.parentNode)&&t.parentNode.lastChild===t},v=function(t){var e;return"pre"===(e=window.getComputedStyle(t).whiteSpace)||"pre-wrap"===e||"pre-line"===e},E=function(t){return t&&!k(t.textContent)},g.prototype.translateBlockElementMarginsToNewlines=function(){var t,e,n,i,r,o,a;for(t=this.getMarginOfDefaultBlockElement(),a=[],n=e=0,i=(o=this.blocks).length;i>e;n=++e)o[n],(r=this.getMarginOfBlockElementAtIndex(n))&&(r.top>2*t.top&&this.prependStringToTextAtIndex("\n",n),a.push(r.bottom>2*t.bottom?this.appendStringToTextAtIndex("\n",n):void 0));return a},g.prototype.getMarginOfBlockElementAtIndex=function(t){var e,n;return!(e=this.blockElements[t])||!e.textContent||(n=c(e),f.call(o(),n)>=0||f.call(this.processedElements,e)>=0)?void 0:y(e)},g.prototype.getMarginOfDefaultBlockElement=function(){var e;return e=a(t.config.blockAttributes.default.tagName),this.containerElement.appendChild(e),y(e)},y=function(t){var e;return"block"===(e=window.getComputedStyle(t)).display?{top:parseInt(e.marginTop),bottom:parseInt(e.marginBottom)}:void 0},_=function(t){return t.replace(RegExp("^"+n.source+"+"),"")},T=function(t){return RegExp("^"+n.source+"*$").test(t)},k=function(t){return/\s$/.test(t)},g}(t.BasicObject)}.call(this),function(){var e,n,i,r,o={}.hasOwnProperty,a=[].slice,s=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=t.arraysAreEqual,i=t.normalizeRange,r=t.rangeIsCollapsed,n=t.getBlockConfig,t.Document=function(u){function l(e){null==e&&(e=[]),l.__super__.constructor.apply(this,arguments),0===e.length&&(e=[new t.Block]),this.blockList=t.SplittableList.box(e)}var c;return function(t,e){function n(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(l,u),l.fromJSON=function(e){var n;return new this(function(){var i,r,o;for(o=[],i=0,r=e.length;r>i;i++)n=e[i],o.push(t.Block.fromJSON(n));return o}())},l.fromHTML=function(e,n){return t.HTMLParser.parse(e,n).getDocument()},l.fromString=function(e,n){var i;return i=t.Text.textForStringWithAttributes(e,n),new this([new t.Block(i)])},l.prototype.isEmpty=function(){var t;return 1===this.blockList.length&&((t=this.getBlockAtIndex(0)).isEmpty()&&!t.hasAttributes())},l.prototype.copy=function(t){var e;return null==t&&(t={}),e=t.consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray(),new this.constructor(e)},l.prototype.copyUsingObjectsFromDocument=function(e){var n;return n=new t.ObjectMap(e.getObjects()),this.copyUsingObjectMap(n)},l.prototype.copyUsingObjectMap=function(t){var e,n,i;return n=function(){var n,r,o,a;for(a=[],n=0,r=(o=this.getBlocks()).length;r>n;n++)e=o[n],a.push((i=t.find(e))?i:e.copyUsingObjectMap(t));return a}.call(this),new this.constructor(n)},l.prototype.copyWithBaseBlockAttributes=function(t){var e,n,i;return null==t&&(t=[]),i=function(){var i,r,o,a;for(a=[],i=0,r=(o=this.getBlocks()).length;r>i;i++)n=o[i],e=t.concat(n.getAttributes()),a.push(n.copyWithAttributes(e));return a}.call(this),new this.constructor(i)},l.prototype.replaceBlock=function(t,e){var n;return-1===(n=this.blockList.indexOf(t))?this:new this.constructor(this.blockList.replaceObjectAtIndex(e,n))},l.prototype.insertDocumentAtRange=function(t,e){var n,o,a,s,u,l,c;return o=t.blockList,u=(e=i(e))[0],a=(l=this.locationFromPosition(u)).index,s=l.offset,c=this,n=this.getBlockAtPosition(u),r(e)&&n.isEmpty()&&!n.hasAttributes()?c=new this.constructor(c.blockList.removeObjectAtIndex(a)):n.getBlockBreakPosition()===s&&u++,c=c.removeTextAtRange(e),new this.constructor(c.blockList.insertSplittableListAtPosition(o,u))},l.prototype.mergeDocumentAtRange=function(t,n){var r,o,a,s,u,l,c,h,d,f,p,g;return p=(n=i(n))[0],f=this.locationFromPosition(p),o=this.getBlockAtIndex(f.index).getAttributes(),r=t.getBaseBlockAttributes(),g=o.slice(-r.length),e(r,g)?(c=o.slice(0,-r.length),l=t.copyWithBaseBlockAttributes(c)):l=t.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(o),a=l.getBlockCount(),s=l.getBlockAtIndex(0),e(o,s.getAttributes())?(u=s.getTextWithoutBlockBreak(),d=this.insertTextAtRange(u,n),a>1&&(l=new this.constructor(l.getBlocks().slice(1)),h=p+u.getLength(),d=d.insertDocumentAtRange(l,h))):d=this.insertDocumentAtRange(l,n),d},l.prototype.insertTextAtRange=function(t,e){var n,r,o,a,s;return s=(e=i(e))[0],r=(a=this.locationFromPosition(s)).index,o=a.offset,n=this.removeTextAtRange(e),new this.constructor(n.blockList.editObjectAtIndex(r,(function(e){return e.copyWithText(e.text.insertTextAtPosition(t,o))})))},l.prototype.removeTextAtRange=function(t){var e,n,o,a,s,u,l,c,h,d,f,p,g,m,v,y,b,_;return c=(d=t=i(t))[0],y=d[1],r(t)?this:(u=(f=this.locationRangeFromRange(t))[0],m=f[1],s=u.index,l=u.offset,a=this.getBlockAtIndex(s),g=m.index,v=m.offset,p=this.getBlockAtIndex(g),y-c==1&&a.getBlockBreakPosition()===l&&p.getBlockBreakPosition()!==v&&"\n"===p.text.getStringAtPosition(v)?o=this.blockList.editObjectAtIndex(g,(function(t){return t.copyWithText(t.text.removeTextAtRange([v,v+1]))})):(h=a.text.getTextAtRange([0,l]),b=p.text.getTextAtRange([v,p.getLength()]),_=h.appendText(b),n=s!==g&&0===l&&a.getAttributeLevel()>=p.getAttributeLevel()?p.copyWithText(_):a.copyWithText(_),e=g+1-s,o=this.blockList.splice(s,e,n)),new this.constructor(o))},l.prototype.moveTextFromRangeToPosition=function(t,e){var n,r,o,s,u,l,c,h,d,f;return d=(l=t=i(t))[0],o=l[1],e>=d&&o>=e?this:(r=this.getDocumentAtRange(t),h=this.removeTextAtRange(t),(u=e>d)&&(e-=r.getLength()),s=(c=r.getBlocks())[0],0===(n=2<=c.length?a.call(c,1):[]).length?(f=s.getTextWithoutBlockBreak(),u&&(e+=1)):f=s.text,h=h.insertTextAtRange(f,e),0===n.length?h:(r=new this.constructor(n),e+=f.getLength(),h.insertDocumentAtRange(r,e)))},l.prototype.addAttributeAtRange=function(t,e,i){var r;return r=this.blockList,this.eachBlockAtRange(i,(function(i,o,a){return r=r.editObjectAtIndex(a,(function(){return n(t)?i.addAttribute(t,e):o[0]===o[1]?i:i.copyWithText(i.text.addAttributeAtRange(t,e,o))}))})),new this.constructor(r)},l.prototype.addAttribute=function(t,e){var n;return n=this.blockList,this.eachBlock((function(i,r){return n=n.editObjectAtIndex(r,(function(){return i.addAttribute(t,e)}))})),new this.constructor(n)},l.prototype.removeAttributeAtRange=function(t,e){var i;return i=this.blockList,this.eachBlockAtRange(e,(function(e,r,o){return n(t)?i=i.editObjectAtIndex(o,(function(){return e.removeAttribute(t)})):r[0]!==r[1]?i=i.editObjectAtIndex(o,(function(){return e.copyWithText(e.text.removeAttributeAtRange(t,r))})):void 0})),new this.constructor(i)},l.prototype.updateAttributesForAttachment=function(t,e){var n,i,r;return i=this.getRangeOfAttachment(e)[0],n=this.locationFromPosition(i).index,r=this.getTextAtIndex(n),new this.constructor(this.blockList.editObjectAtIndex(n,(function(n){return n.copyWithText(r.updateAttributesForAttachment(t,e))})))},l.prototype.removeAttributeForAttachment=function(t,e){var n;return n=this.getRangeOfAttachment(e),this.removeAttributeAtRange(t,n)},l.prototype.insertBlockBreakAtRange=function(e){var n,r,o,a;return a=(e=i(e))[0],o=this.locationFromPosition(a).offset,r=this.removeTextAtRange(e),0===o&&(n=[new t.Block]),new this.constructor(r.blockList.insertSplittableListAtPosition(new t.SplittableList(n),a))},l.prototype.applyBlockAttributeAtRange=function(t,e,i){var r,o,a,s;return o=(a=this.expandRangeToLineBreaksAndSplitBlocks(i)).document,i=a.range,(r=n(t)).listAttribute?(s=(o=o.removeLastListAttributeAtRange(i,{exceptAttributeName:t})).convertLineBreaksToBlockBreaksInRange(i),o=s.document,i=s.range):o=r.exclusive?o.removeBlockAttributesAtRange(i):r.terminal?o.removeLastTerminalAttributeAtRange(i):o.consolidateBlocksAtRange(i),o.addAttributeAtRange(t,e,i)},l.prototype.removeLastListAttributeAtRange=function(t,e){var i;return null==e&&(e={}),i=this.blockList,this.eachBlockAtRange(t,(function(t,r,o){var a;if((a=t.getLastAttribute())&&n(a).listAttribute&&a!==e.exceptAttributeName)return i=i.editObjectAtIndex(o,(function(){return t.removeAttribute(a)}))})),new this.constructor(i)},l.prototype.removeLastTerminalAttributeAtRange=function(t){var e;return e=this.blockList,this.eachBlockAtRange(t,(function(t,i,r){var o;if((o=t.getLastAttribute())&&n(o).terminal)return e=e.editObjectAtIndex(r,(function(){return t.removeAttribute(o)}))})),new this.constructor(e)},l.prototype.removeBlockAttributesAtRange=function(t){var e;return e=this.blockList,this.eachBlockAtRange(t,(function(t,n,i){return t.hasAttributes()?e=e.editObjectAtIndex(i,(function(){return t.copyWithoutAttributes()})):void 0})),new this.constructor(e)},l.prototype.expandRangeToLineBreaksAndSplitBlocks=function(t){var e,n,r,o,a,s,u,l,c;return c=(s=t=i(t))[0],o=s[1],l=this.locationFromPosition(c),r=this.locationFromPosition(o),u=(e=this).getBlockAtIndex(l.index),null!=(l.offset=u.findLineBreakInDirectionFromPosition("backward",l.offset))&&(a=e.positionFromLocation(l),e=e.insertBlockBreakAtRange([a,a+1]),r.index+=1,r.offset-=e.getBlockAtIndex(l.index).getLength(),l.index+=1),l.offset=0,0===r.offset&&r.index>l.index?(r.index-=1,r.offset=e.getBlockAtIndex(r.index).getBlockBreakPosition()):("\n"===(n=e.getBlockAtIndex(r.index)).text.getStringAtRange([r.offset-1,r.offset])?r.offset-=1:r.offset=n.findLineBreakInDirectionFromPosition("forward",r.offset),r.offset!==n.getBlockBreakPosition()&&(a=e.positionFromLocation(r),e=e.insertBlockBreakAtRange([a,a+1]))),c=e.positionFromLocation(l),o=e.positionFromLocation(r),{document:e,range:t=i([c,o])}},l.prototype.convertLineBreaksToBlockBreaksInRange=function(t){var e,n,r;return n=(t=i(t))[0],r=this.getStringAtRange(t).slice(0,-1),e=this,r.replace(/.*?\n/g,(function(t){return n+=t.length,e=e.insertBlockBreakAtRange([n-1,n])})),{document:e,range:t}},l.prototype.consolidateBlocksAtRange=function(t){var e,n,r,o,a;return a=(r=t=i(t))[0],n=r[1],o=this.locationFromPosition(a).index,e=this.locationFromPosition(n).index,new this.constructor(this.blockList.consolidateFromIndexToIndex(o,e))},l.prototype.getDocumentAtRange=function(t){var e;return t=i(t),e=this.blockList.getSplittableListInRange(t).toArray(),new this.constructor(e)},l.prototype.getStringAtRange=function(t){var e,n;return(n=t=i(t))[n.length-1]!==this.getLength()&&(e=-1),this.getDocumentAtRange(t).toString().slice(0,e)},l.prototype.getBlockAtIndex=function(t){return this.blockList.getObjectAtIndex(t)},l.prototype.getBlockAtPosition=function(t){var e;return e=this.locationFromPosition(t).index,this.getBlockAtIndex(e)},l.prototype.getTextAtIndex=function(t){var e;return null!=(e=this.getBlockAtIndex(t))?e.text:void 0},l.prototype.getTextAtPosition=function(t){var e;return e=this.locationFromPosition(t).index,this.getTextAtIndex(e)},l.prototype.getPieceAtPosition=function(t){var e,n,i;return e=(i=this.locationFromPosition(t)).index,n=i.offset,this.getTextAtIndex(e).getPieceAtPosition(n)},l.prototype.getCharacterAtPosition=function(t){var e,n,i;return e=(i=this.locationFromPosition(t)).index,n=i.offset,this.getTextAtIndex(e).getStringAtRange([n,n+1])},l.prototype.getLength=function(){return this.blockList.getEndPosition()},l.prototype.getBlocks=function(){return this.blockList.toArray()},l.prototype.getBlockCount=function(){return this.blockList.length},l.prototype.getEditCount=function(){return this.editCount},l.prototype.eachBlock=function(t){return this.blockList.eachObject(t)},l.prototype.eachBlockAtRange=function(t,e){var n,r,o,a,s,u,l,c,h,d,f,p;if(f=(u=t=i(t))[0],o=u[1],d=this.locationFromPosition(f),r=this.locationFromPosition(o),d.index===r.index)return n=this.getBlockAtIndex(d.index),p=[d.offset,r.offset],e(n,p,d.index);for(h=[],s=a=l=d.index,c=r.index;c>=l?c>=a:a>=c;s=c>=l?++a:--a)(n=this.getBlockAtIndex(s))?(p=function(){switch(s){case d.index:return[d.offset,n.text.getLength()];case r.index:return[0,r.offset];default:return[0,n.text.getLength()]}}(),h.push(e(n,p,s))):h.push(void 0);return h},l.prototype.getCommonAttributesAtRange=function(e){var n,o,a;return o=(e=i(e))[0],r(e)?this.getCommonAttributesAtPosition(o):(a=[],n=[],this.eachBlockAtRange(e,(function(t,e){return e[0]!==e[1]?(a.push(t.text.getCommonAttributesAtRange(e)),n.push(c(t))):void 0})),t.Hash.fromCommonAttributesOfObjects(a).merge(t.Hash.fromCommonAttributesOfObjects(n)).toObject())},l.prototype.getCommonAttributesAtPosition=function(e){var n,i,r,o,a,u,l,h,d,f;if(a=(d=this.locationFromPosition(e)).index,h=d.offset,!(r=this.getBlockAtIndex(a)))return{};for(l in o=c(r),n=r.text.getAttributesAtPosition(h),i=r.text.getAttributesAtPosition(h-1),u=function(){var e,n;for(l in n=[],e=t.config.textAttributes)(f=e[l]).inheritable&&n.push(l);return n}(),i)((f=i[l])===n[l]||s.call(u,l)>=0)&&(o[l]=f);return o},l.prototype.getRangeOfCommonAttributeAtPosition=function(t,e){var n,r,o,a,s,u,l,c;return o=(s=this.locationFromPosition(e)).index,a=s.offset,c=(u=this.getTextAtIndex(o).getExpandedRangeForAttributeAtOffset(t,a))[0],r=u[1],l=this.positionFromLocation({index:o,offset:c}),n=this.positionFromLocation({index:o,offset:r}),i([l,n])},l.prototype.getBaseBlockAttributes=function(){var t,e,n,i,r,o,a;for(t=this.getBlockAtIndex(0).getAttributes(),n=i=1,a=this.getBlockCount();a>=1?a>i:i>a;n=a>=1?++i:--i)e=this.getBlockAtIndex(n).getAttributes(),o=Math.min(t.length,e.length),t=function(){var n,i,a;for(a=[],r=n=0,i=o;(i>=0?i>n:n>i)&&e[r]===t[r];r=i>=0?++n:--n)a.push(e[r]);return a}();return t},c=function(t){var e,n;return n={},(e=t.getLastAttribute())&&(n[e]=!0),n},l.prototype.getAttachmentById=function(t){var e,n,i,r;for(n=0,i=(r=this.getAttachments()).length;i>n;n++)if((e=r[n]).id===t)return e},l.prototype.getAttachmentPieces=function(){var t;return t=[],this.blockList.eachObject((function(e){var n;return n=e.text,t=t.concat(n.getAttachmentPieces())})),t},l.prototype.getAttachments=function(){var t,e,n,i,r;for(r=[],t=0,e=(i=this.getAttachmentPieces()).length;e>t;t++)n=i[t],r.push(n.attachment);return r},l.prototype.getRangeOfAttachment=function(t){var e,n,r,o,a,s,u;for(o=0,n=e=0,r=(a=this.blockList.toArray()).length;r>e;n=++e){if(u=(s=a[n].text).getRangeOfAttachment(t))return i([o+u[0],o+u[1]]);o+=s.getLength()}},l.prototype.getLocationRangeOfAttachment=function(t){var e;return e=this.getRangeOfAttachment(t),this.locationRangeFromRange(e)},l.prototype.getAttachmentPieceForAttachment=function(t){var e,n,i,r;for(e=0,n=(r=this.getAttachmentPieces()).length;n>e;e++)if((i=r[e]).attachment===t)return i},l.prototype.findRangesForBlockAttribute=function(t){var e,n,i,r,o,a,s;for(o=0,a=[],n=0,i=(s=this.getBlocks()).length;i>n;n++)r=(e=s[n]).getLength(),e.hasAttribute(t)&&a.push([o,o+r]),o+=r;return a},l.prototype.findRangesForTextAttribute=function(t,e){var n,i,r,o,a,s,u,l,c,h;for(h=(null!=e?e:{}).withValue,s=0,u=[],l=[],o=function(e){return null!=h?e.getAttribute(t)===h:e.hasAttribute(t)},n=0,i=(c=this.getPieces()).length;i>n;n++)r=(a=c[n]).getLength(),o(a)&&(u[1]===s?u[1]=s+r:l.push(u=[s,s+r])),s+=r;return l},l.prototype.locationFromPosition=function(t){var e,n;return null!=(n=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,t))).index?n:{index:(e=this.getBlocks()).length-1,offset:e[e.length-1].getLength()}},l.prototype.positionFromLocation=function(t){return this.blockList.findPositionAtIndexAndOffset(t.index,t.offset)},l.prototype.locationRangeFromPosition=function(t){return i(this.locationFromPosition(t))},l.prototype.locationRangeFromRange=function(t){var e,n,r,o;if(t=i(t))return o=t[0],n=t[1],r=this.locationFromPosition(o),e=this.locationFromPosition(n),i([r,e])},l.prototype.rangeFromLocationRange=function(t){var e,n;return t=i(t),e=this.positionFromLocation(t[0]),r(t)||(n=this.positionFromLocation(t[1])),i([e,n])},l.prototype.isEqualTo=function(t){return this.blockList.isEqualTo(null!=t?t.blockList:void 0)},l.prototype.getTexts=function(){var t,e,n,i,r;for(r=[],e=0,n=(i=this.getBlocks()).length;n>e;e++)t=i[e],r.push(t.text);return r},l.prototype.getPieces=function(){var t,e,n,i,r;for(n=[],t=0,e=(i=this.getTexts()).length;e>t;t++)r=i[t],n.push.apply(n,r.getPieces());return n},l.prototype.getObjects=function(){return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())},l.prototype.toSerializableDocument=function(){var t;return t=[],this.blockList.eachObject((function(e){return t.push(e.copyWithText(e.text.toSerializableText()))})),new this.constructor(t)},l.prototype.toString=function(){return this.blockList.toString()},l.prototype.toJSON=function(){return this.blockList.toJSON()},l.prototype.toConsole=function(){var t;return JSON.stringify(function(){var e,n,i,r;for(r=[],e=0,n=(i=this.blockList.toArray()).length;n>e;e++)t=i[e],r.push(JSON.parse(t.text.toConsole()));return r}.call(this))},l}(t.Object)}.call(this),function(){t.LineBreakInsertion=function(){function t(t){var e;this.composition=t,this.document=this.composition.document,e=this.composition.getSelectedRange(),this.startPosition=e[0],this.endPosition=e[1],this.startLocation=this.document.locationFromPosition(this.startPosition),this.endLocation=this.document.locationFromPosition(this.endPosition),this.block=this.document.getBlockAtIndex(this.endLocation.index),this.breaksOnReturn=this.block.breaksOnReturn(),this.previousCharacter=this.block.text.getStringAtPosition(this.endLocation.offset-1),this.nextCharacter=this.block.text.getStringAtPosition(this.endLocation.offset)}return t.prototype.shouldInsertBlockBreak=function(){return this.block.hasAttributes()&&this.block.isListItem()&&!this.block.isEmpty()?0!==this.startLocation.offset:this.breaksOnReturn&&"\n"!==this.nextCharacter},t.prototype.shouldBreakFormattedBlock=function(){return this.block.hasAttributes()&&!this.block.isListItem()&&(this.breaksOnReturn&&"\n"===this.nextCharacter||"\n"===this.previousCharacter)},t.prototype.shouldDecreaseListLevel=function(){return this.block.hasAttributes()&&this.block.isListItem()&&this.block.isEmpty()},t.prototype.shouldPrependListItem=function(){return this.block.isListItem()&&0===this.startLocation.offset&&!this.block.isEmpty()},t.prototype.shouldRemoveLastBlockAttribute=function(){return this.block.hasAttributes()&&!this.block.isListItem()&&this.block.isEmpty()},t}()}.call(this),function(){var e,n,i,r,o,a,s,u,l,c,h={}.hasOwnProperty;a=t.normalizeRange,l=t.rangesAreEqual,u=t.rangeIsCollapsed,s=t.objectsAreEqual,e=t.arrayStartsWith,c=t.summarizeArrayChange,i=t.getAllAttributeNames,r=t.getBlockConfig,o=t.getTextConfig,n=t.extend,t.Composition=function(d){function f(){this.document=new t.Document,this.attachments=[],this.currentAttributes={},this.revision=0}return function(t,e){function n(){this.constructor=t}for(var i in e)h.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(f,d),f.prototype.setDocument=function(t){var e;return t.isEqualTo(this.document)?void 0:(this.document=t,this.refreshAttachments(),this.revision++,null!=(e=this.delegate)&&"function"==typeof e.compositionDidChangeDocument?e.compositionDidChangeDocument(t):void 0)},f.prototype.getSnapshot=function(){return{document:this.document,selectedRange:this.getSelectedRange()}},f.prototype.loadSnapshot=function(e){var n,i,r,o;return n=e.document,o=e.selectedRange,null!=(i=this.delegate)&&"function"==typeof i.compositionWillLoadSnapshot&&i.compositionWillLoadSnapshot(),this.setDocument(null!=n?n:new t.Document),this.setSelection(null!=o?o:[0,0]),null!=(r=this.delegate)&&"function"==typeof r.compositionDidLoadSnapshot?r.compositionDidLoadSnapshot():void 0},f.prototype.insertText=function(t,e){var n,i,r,o;return o=(null!=e?e:{updatePosition:!0}).updatePosition,i=this.getSelectedRange(),this.setDocument(this.document.insertTextAtRange(t,i)),n=(r=i[0])+t.getLength(),o&&this.setSelection(n),this.notifyDelegateOfInsertionAtRange([r,n])},f.prototype.insertBlock=function(e){var n;return null==e&&(e=new t.Block),n=new t.Document([e]),this.insertDocument(n)},f.prototype.insertDocument=function(e){var n,i,r;return null==e&&(e=new t.Document),i=this.getSelectedRange(),this.setDocument(this.document.insertDocumentAtRange(e,i)),n=(r=i[0])+e.getLength(),this.setSelection(n),this.notifyDelegateOfInsertionAtRange([r,n])},f.prototype.insertString=function(e,n){var i,r;return i=this.getCurrentTextAttributes(),r=t.Text.textForStringWithAttributes(e,i),this.insertText(r,n)},f.prototype.insertBlockBreak=function(){var t,e,n;return e=this.getSelectedRange(),this.setDocument(this.document.insertBlockBreakAtRange(e)),t=(n=e[0])+1,this.setSelection(t),this.notifyDelegateOfInsertionAtRange([n,t])},f.prototype.insertLineBreak=function(){var e,n;return(n=new t.LineBreakInsertion(this)).shouldDecreaseListLevel()?(this.decreaseListLevel(),this.setSelection(n.startPosition)):n.shouldPrependListItem()?(e=new t.Document([n.block.copyWithoutText()]),this.insertDocument(e)):n.shouldInsertBlockBreak()?this.insertBlockBreak():n.shouldRemoveLastBlockAttribute()?this.removeLastBlockAttribute():n.shouldBreakFormattedBlock()?this.breakFormattedBlock(n):this.insertString("\n")},f.prototype.insertHTML=function(e){var n,i,r,o;return n=t.Document.fromHTML(e),r=this.getSelectedRange(),this.setDocument(this.document.mergeDocumentAtRange(n,r)),i=(o=r[0])+n.getLength()-1,this.setSelection(i),this.notifyDelegateOfInsertionAtRange([o,i])},f.prototype.replaceHTML=function(e){var n,i,r;return n=t.Document.fromHTML(e).copyUsingObjectsFromDocument(this.document),i=this.getLocationRange({strict:!1}),r=this.document.rangeFromLocationRange(i),this.setDocument(n),this.setSelection(r)},f.prototype.insertFile=function(t){return this.insertFiles([t])},f.prototype.insertFiles=function(e){var n,i,r,o,a,s;for(i=[],o=0,a=e.length;a>o;o++)r=e[o],(null!=(s=this.delegate)?s.compositionShouldAcceptFile(r):void 0)&&(n=t.Attachment.attachmentForFile(r),i.push(n));return this.insertAttachments(i)},f.prototype.insertAttachment=function(t){return this.insertAttachments([t])},f.prototype.insertAttachments=function(e){var n,i,r,o,a,s,u,l,c;for(l=new t.Text,o=0,a=e.length;a>o;o++)c=(n=e[o]).getType(),s=null!=(u=t.config.attachments[c])?u.presentation:void 0,r=this.getCurrentTextAttributes(),s&&(r.presentation=s),i=t.Text.textForAttachmentWithAttributes(n,r),l=l.appendText(i);return this.insertText(l)},f.prototype.shouldManageDeletingInDirection=function(t){var e;if(e=this.getLocationRange(),u(e)){if("backward"===t&&0===e[0].offset)return!0;if(this.shouldManageMovingCursorInDirection(t))return!0}else if(e[0].index!==e[1].index)return!0;return!1},f.prototype.deleteInDirection=function(t,e){var n,i,r,o,a,s,l,c;return o=(null!=e?e:{}).length,a=this.getLocationRange(),s=this.getSelectedRange(),(l=u(s))?r="backward"===t&&0===a[0].offset:c=a[0].index!==a[1].index,!(r&&this.canDecreaseBlockAttributeLevel()&&(i=this.getBlock(),i.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),this.setSelection(s[0]),i.isEmpty()))&&(l&&(s=this.getExpandedRangeInDirection(t,{length:o}),"backward"===t&&(n=this.getAttachmentAtRange(s))),n?(this.editAttachment(n),!1):(this.setDocument(this.document.removeTextAtRange(s)),this.setSelection(s[0]),!r&&!c&&void 0))},f.prototype.moveTextFromRange=function(t){var e;return e=this.getSelectedRange()[0],this.setDocument(this.document.moveTextFromRangeToPosition(t,e)),this.setSelection(e)},f.prototype.removeAttachment=function(t){var e;return(e=this.document.getRangeOfAttachment(t))?(this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(e)),this.setSelection(e[0])):void 0},f.prototype.removeLastBlockAttribute=function(){var t,e,n,i;return i=(n=this.getSelectedRange())[0],e=n[1],t=this.document.getBlockAtPosition(e),this.removeCurrentAttribute(t.getLastAttribute()),this.setSelection(i)}," ",f.prototype.insertPlaceholder=function(){return this.placeholderPosition=this.getPosition(),this.insertString(" ")},f.prototype.selectPlaceholder=function(){return null!=this.placeholderPosition?(this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+" ".length]),this.getSelectedRange()):void 0},f.prototype.forgetPlaceholder=function(){return this.placeholderPosition=null},f.prototype.hasCurrentAttribute=function(t){var e;return null!=(e=this.currentAttributes[t])&&!1!==e},f.prototype.toggleCurrentAttribute=function(t){var e;return(e=!this.currentAttributes[t])?this.setCurrentAttribute(t,e):this.removeCurrentAttribute(t)},f.prototype.canSetCurrentAttribute=function(t){return r(t)?this.canSetCurrentBlockAttribute(t):this.canSetCurrentTextAttribute(t)},f.prototype.canSetCurrentTextAttribute=function(){var t,e,n,i;if(t=this.getSelectedDocument()){for(e=0,n=(i=t.getAttachments()).length;n>e;e++)if(!i[e].hasContent())return!1;return!0}},f.prototype.canSetCurrentBlockAttribute=function(){var t;if(t=this.getBlock())return!t.isTerminalBlock()},f.prototype.setCurrentAttribute=function(t,e){return r(t)?this.setBlockAttribute(t,e):(this.setTextAttribute(t,e),this.currentAttributes[t]=e,this.notifyDelegateOfCurrentAttributesChange())},f.prototype.setTextAttribute=function(e,n){var i,r;if(i=this.getSelectedRange())return i[0]!==i[1]?this.setDocument(this.document.addAttributeAtRange(e,n,i)):"href"===e?(r=t.Text.textForStringWithAttributes(n,{href:n}),this.insertText(r)):void 0},f.prototype.setBlockAttribute=function(t,e){var n;if(n=this.getSelectedRange())return this.canSetCurrentAttribute(t)?(this.getBlock(),this.setDocument(this.document.applyBlockAttributeAtRange(t,e,n)),this.setSelection(n)):void 0},f.prototype.removeCurrentAttribute=function(t){return r(t)?(this.removeBlockAttribute(t),this.updateCurrentAttributes()):(this.removeTextAttribute(t),delete this.currentAttributes[t],this.notifyDelegateOfCurrentAttributesChange())},f.prototype.removeTextAttribute=function(t){var e;if(e=this.getSelectedRange())return this.setDocument(this.document.removeAttributeAtRange(t,e))},f.prototype.removeBlockAttribute=function(t){var e;if(e=this.getSelectedRange())return this.setDocument(this.document.removeAttributeAtRange(t,e))},f.prototype.canDecreaseNestingLevel=function(){var t;return(null!=(t=this.getBlock())?t.getNestingLevel():void 0)>0},f.prototype.canIncreaseNestingLevel=function(){var t,n,i;if(t=this.getBlock())return null!=(i=r(t.getLastNestableAttribute()))&&i.listAttribute?(n=this.getPreviousBlock())?e(n.getListItemAttributes(),t.getListItemAttributes()):void 0:t.getNestingLevel()>0},f.prototype.decreaseNestingLevel=function(){var t;if(t=this.getBlock())return this.setDocument(this.document.replaceBlock(t,t.decreaseNestingLevel()))},f.prototype.increaseNestingLevel=function(){var t;if(t=this.getBlock())return this.setDocument(this.document.replaceBlock(t,t.increaseNestingLevel()))},f.prototype.canDecreaseBlockAttributeLevel=function(){var t;return(null!=(t=this.getBlock())?t.getAttributeLevel():void 0)>0},f.prototype.decreaseBlockAttributeLevel=function(){var t,e;return(t=null!=(e=this.getBlock())?e.getLastAttribute():void 0)?this.removeCurrentAttribute(t):void 0},f.prototype.decreaseListLevel=function(){var t,e,n,i,r,o;for(o=this.getSelectedRange()[0],n=r=this.document.locationFromPosition(o).index,t=this.getBlock().getAttributeLevel();(e=this.document.getBlockAtIndex(n+1))&&e.isListItem()&&e.getAttributeLevel()>t;)n++;return o=this.document.positionFromLocation({index:r,offset:0}),i=this.document.positionFromLocation({index:n,offset:0}),this.setDocument(this.document.removeLastListAttributeAtRange([o,i]))},f.prototype.updateCurrentAttributes=function(){var t,e,n,r,o,a;if(a=this.getSelectedRange({ignoreLock:!0})){for(e=this.document.getCommonAttributesAtRange(a),n=0,r=(o=i()).length;r>n;n++)e[t=o[n]]||this.canSetCurrentAttribute(t)||(e[t]=!1);if(!s(e,this.currentAttributes))return this.currentAttributes=e,this.notifyDelegateOfCurrentAttributesChange()}},f.prototype.getCurrentAttributes=function(){return n.call({},this.currentAttributes)},f.prototype.getCurrentTextAttributes=function(){var t,e,n,i;for(e in t={},n=this.currentAttributes)!1!==(i=n[e])&&o(e)&&(t[e]=i);return t},f.prototype.freezeSelection=function(){return this.setCurrentAttribute("frozen",!0)},f.prototype.thawSelection=function(){return this.removeCurrentAttribute("frozen")},f.prototype.hasFrozenSelection=function(){return this.hasCurrentAttribute("frozen")},f.proxyMethod("getSelectionManager().getPointRange"),f.proxyMethod("getSelectionManager().setLocationRangeFromPointRange"),f.proxyMethod("getSelectionManager().createLocationRangeFromDOMRange"),f.proxyMethod("getSelectionManager().locationIsCursorTarget"),f.proxyMethod("getSelectionManager().selectionIsExpanded"),f.proxyMethod("delegate?.getSelectionManager"),f.prototype.setSelection=function(t){var e,n;return e=this.document.locationRangeFromRange(t),null!=(n=this.delegate)?n.compositionDidRequestChangingSelectionToLocationRange(e):void 0},f.prototype.getSelectedRange=function(){var t;return(t=this.getLocationRange())?this.document.rangeFromLocationRange(t):void 0},f.prototype.setSelectedRange=function(t){var e;return e=this.document.locationRangeFromRange(t),this.getSelectionManager().setLocationRange(e)},f.prototype.getPosition=function(){var t;return(t=this.getLocationRange())?this.document.positionFromLocation(t[0]):void 0},f.prototype.getLocationRange=function(t){var e,n;return null!=(e=null!=(n=this.targetLocationRange)?n:this.getSelectionManager().getLocationRange(t))?e:a({index:0,offset:0})},f.prototype.withTargetLocationRange=function(t,e){var n;this.targetLocationRange=t;try{n=e()}finally{this.targetLocationRange=null}return n},f.prototype.withTargetRange=function(t,e){var n;return n=this.document.locationRangeFromRange(t),this.withTargetLocationRange(n,e)},f.prototype.withTargetDOMRange=function(t,e){var n;return n=this.createLocationRangeFromDOMRange(t,{strict:!1}),this.withTargetLocationRange(n,e)},f.prototype.getExpandedRangeInDirection=function(t,e){var n,i,r,o;return i=(null!=e?e:{}).length,o=(r=this.getSelectedRange())[0],n=r[1],"backward"===t?i?o-=i:o=this.translateUTF16PositionFromOffset(o,-1):i?n+=i:n=this.translateUTF16PositionFromOffset(n,1),a([o,n])},f.prototype.shouldManageMovingCursorInDirection=function(t){var e;return!!this.editingAttachment||(e=this.getExpandedRangeInDirection(t),null!=this.getAttachmentAtRange(e))},f.prototype.moveCursorInDirection=function(t){var e,n,i,r;return this.editingAttachment?i=this.document.getRangeOfAttachment(this.editingAttachment):(r=this.getSelectedRange(),i=this.getExpandedRangeInDirection(t),n=!l(r,i)),this.setSelectedRange("backward"===t?i[0]:i[1]),n&&(e=this.getAttachmentAtRange(i))?this.editAttachment(e):void 0},f.prototype.expandSelectionInDirection=function(t,e){var n,i;return n=(null!=e?e:{}).length,i=this.getExpandedRangeInDirection(t,{length:n}),this.setSelectedRange(i)},f.prototype.expandSelectionForEditing=function(){return this.hasCurrentAttribute("href")?this.expandSelectionAroundCommonAttribute("href"):void 0},f.prototype.expandSelectionAroundCommonAttribute=function(t){var e,n;return e=this.getPosition(),n=this.document.getRangeOfCommonAttributeAtPosition(t,e),this.setSelectedRange(n)},f.prototype.selectionContainsAttachments=function(){var t;return(null!=(t=this.getSelectedAttachments())?t.length:void 0)>0},f.prototype.selectionIsInCursorTarget=function(){return this.editingAttachment||this.positionIsCursorTarget(this.getPosition())},f.prototype.positionIsCursorTarget=function(t){var e;return(e=this.document.locationFromPosition(t))?this.locationIsCursorTarget(e):void 0},f.prototype.positionIsBlockBreak=function(t){var e;return null!=(e=this.document.getPieceAtPosition(t))?e.isBlockBreak():void 0},f.prototype.getSelectedDocument=function(){var t;return(t=this.getSelectedRange())?this.document.getDocumentAtRange(t):void 0},f.prototype.getSelectedAttachments=function(){var t;return null!=(t=this.getSelectedDocument())?t.getAttachments():void 0},f.prototype.getAttachments=function(){return this.attachments.slice(0)},f.prototype.refreshAttachments=function(){var t,e,n,i,r,o,a,s,u,l,h,d;for(n=this.document.getAttachments(),t=(s=c(this.attachments,n)).added,h=s.removed,this.attachments=n,i=0,o=h.length;o>i;i++)(e=h[i]).delegate=null,null!=(u=this.delegate)&&"function"==typeof u.compositionDidRemoveAttachment&&u.compositionDidRemoveAttachment(e);for(d=[],r=0,a=t.length;a>r;r++)(e=t[r]).delegate=this,d.push(null!=(l=this.delegate)&&"function"==typeof l.compositionDidAddAttachment?l.compositionDidAddAttachment(e):void 0);return d},f.prototype.attachmentDidChangeAttributes=function(t){var e;return this.revision++,null!=(e=this.delegate)&&"function"==typeof e.compositionDidEditAttachment?e.compositionDidEditAttachment(t):void 0},f.prototype.attachmentDidChangePreviewURL=function(t){var e;return this.revision++,null!=(e=this.delegate)&&"function"==typeof e.compositionDidChangeAttachmentPreviewURL?e.compositionDidChangeAttachmentPreviewURL(t):void 0},f.prototype.editAttachment=function(t,e){var n;if(t!==this.editingAttachment)return this.stopEditingAttachment(),this.editingAttachment=t,null!=(n=this.delegate)&&"function"==typeof n.compositionDidStartEditingAttachment?n.compositionDidStartEditingAttachment(this.editingAttachment,e):void 0},f.prototype.stopEditingAttachment=function(){var t;if(this.editingAttachment)return null!=(t=this.delegate)&&"function"==typeof t.compositionDidStopEditingAttachment&&t.compositionDidStopEditingAttachment(this.editingAttachment),this.editingAttachment=null},f.prototype.updateAttributesForAttachment=function(t,e){return this.setDocument(this.document.updateAttributesForAttachment(t,e))},f.prototype.removeAttributeForAttachment=function(t,e){return this.setDocument(this.document.removeAttributeForAttachment(t,e))},f.prototype.breakFormattedBlock=function(e){var n,i,r,o,a;return i=e.document,n=e.block,a=[(o=e.startPosition)-1,o],n.getBlockBreakPosition()===e.startLocation.offset?(n.breaksOnReturn()&&"\n"===e.nextCharacter?o+=1:i=i.removeTextAtRange(a),a=[o,o]):"\n"===e.nextCharacter?"\n"===e.previousCharacter?a=[o-1,o+1]:(a=[o,o+1],o+=1):e.startLocation.offset-1!=0&&(o+=1),r=new t.Document([n.removeLastAttribute().copyWithoutText()]),this.setDocument(i.insertDocumentAtRange(r,a)),this.setSelection(o)},f.prototype.getPreviousBlock=function(){var t,e;return(e=this.getLocationRange())&&(t=e[0].index)>0?this.document.getBlockAtIndex(t-1):void 0},f.prototype.getBlock=function(){var t;return(t=this.getLocationRange())?this.document.getBlockAtIndex(t[0].index):void 0},f.prototype.getAttachmentAtRange=function(e){var n;return(n=this.document.getDocumentAtRange(e)).toString()===t.OBJECT_REPLACEMENT_CHARACTER+"\n"?n.getAttachments()[0]:void 0},f.prototype.notifyDelegateOfCurrentAttributesChange=function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.compositionDidChangeCurrentAttributes?t.compositionDidChangeCurrentAttributes(this.currentAttributes):void 0},f.prototype.notifyDelegateOfInsertionAtRange=function(t){var e;return null!=(e=this.delegate)&&"function"==typeof e.compositionDidPerformInsertionAtRange?e.compositionDidPerformInsertionAtRange(t):void 0},f.prototype.translateUTF16PositionFromOffset=function(t,e){var n,i;return n=(i=this.document.toUTF16String()).offsetFromUCS2Offset(t),i.offsetToUCS2Offset(n+e)},f}(t.BasicObject)}.call(this),function(){var e={}.hasOwnProperty;t.UndoManager=function(t){function n(t){this.composition=t,this.undoEntries=[],this.redoEntries=[]}var i;return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(n,t),n.prototype.recordUndoEntry=function(t,e){var n,r,o,a,s;return r=(a=null!=e?e:{}).context,n=a.consolidatable,o=this.undoEntries.slice(-1)[0],n&&i(o,t,r)?void 0:(s=this.createEntry({description:t,context:r}),this.undoEntries.push(s),this.redoEntries=[])},n.prototype.undo=function(){var t,e;return(e=this.undoEntries.pop())?(t=this.createEntry(e),this.redoEntries.push(t),this.composition.loadSnapshot(e.snapshot)):void 0},n.prototype.redo=function(){var t,e;return(t=this.redoEntries.pop())?(e=this.createEntry(t),this.undoEntries.push(e),this.composition.loadSnapshot(t.snapshot)):void 0},n.prototype.canUndo=function(){return this.undoEntries.length>0},n.prototype.canRedo=function(){return this.redoEntries.length>0},n.prototype.createEntry=function(t){var e,n,i;return n=(i=null!=t?t:{}).description,e=i.context,{description:null!=n?n.toString():void 0,context:JSON.stringify(e),snapshot:this.composition.getSnapshot()}},i=function(t,e,n){return(null!=t?t.description:void 0)===(null!=e?e.toString():void 0)&&(null!=t?t.context:void 0)===JSON.stringify(n)},n}(t.BasicObject)}.call(this),function(){var e;t.attachmentGalleryFilter=function(t){var n;return(n=new e(t)).perform(),n.getSnapshot()},e=function(){function t(t){this.document=t.document,this.selectedRange=t.selectedRange}var e;return e="attachmentGallery","presentation","gallery",t.prototype.perform=function(){return this.removeBlockAttribute(),this.applyBlockAttribute()},t.prototype.getSnapshot=function(){return{document:this.document,selectedRange:this.selectedRange}},t.prototype.removeBlockAttribute=function(){var t,n,i,r,o;for(o=[],t=0,n=(r=this.findRangesOfBlocks()).length;n>t;t++)i=r[t],o.push(this.document=this.document.removeAttributeAtRange(e,i));return o},t.prototype.applyBlockAttribute=function(){var t,n,i,r,o,a;for(i=0,a=[],t=0,n=(o=this.findRangesOfPieces()).length;n>t;t++)(r=o[t])[1]-r[0]>1&&(r[0]+=i,r[1]+=i,"\n"!==this.document.getCharacterAtPosition(r[1])&&(this.document=this.document.insertBlockBreakAtRange(r[1]),r[1]<this.selectedRange[1]&&this.moveSelectedRangeForward(),r[1]++,i++),0!==r[0]&&"\n"!==this.document.getCharacterAtPosition(r[0]-1)&&(this.document=this.document.insertBlockBreakAtRange(r[0]),r[0]<this.selectedRange[0]&&this.moveSelectedRangeForward(),r[0]++,i++),a.push(this.document=this.document.applyBlockAttributeAtRange(e,!0,r)));return a},t.prototype.findRangesOfBlocks=function(){return this.document.findRangesForBlockAttribute(e)},t.prototype.findRangesOfPieces=function(){return this.document.findRangesForTextAttribute("presentation",{withValue:"gallery"})},t.prototype.moveSelectedRangeForward=function(){return this.selectedRange[0]+=1,this.selectedRange[1]+=1},t}()}.call(this),function(){t.Editor=function(){function e(e,i,r){var o,a;this.composition=e,this.selectionManager=i,this.element=r,this.insertFiles=(o=this.insertFiles,a=this,function(){return o.apply(a,arguments)}),this.undoManager=new t.UndoManager(this.composition),this.filters=n.slice(0)}var n;return n=[t.attachmentGalleryFilter],e.prototype.loadDocument=function(t){return this.loadSnapshot({document:t,selectedRange:[0,0]})},e.prototype.loadHTML=function(e){return null==e&&(e=""),this.loadDocument(t.Document.fromHTML(e,{referenceElement:this.element}))},e.prototype.loadJSON=function(e){var n,i;return n=e.document,i=e.selectedRange,n=t.Document.fromJSON(n),this.loadSnapshot({document:n,selectedRange:i})},e.prototype.loadSnapshot=function(e){return this.undoManager=new t.UndoManager(this.composition),this.composition.loadSnapshot(e)},e.prototype.getDocument=function(){return this.composition.document},e.prototype.getSelectedDocument=function(){return this.composition.getSelectedDocument()},e.prototype.getSnapshot=function(){return this.composition.getSnapshot()},e.prototype.toJSON=function(){return this.getSnapshot()},e.prototype.deleteInDirection=function(t){return this.composition.deleteInDirection(t)},e.prototype.insertAttachment=function(t){return this.composition.insertAttachment(t)},e.prototype.insertAttachments=function(t){return this.composition.insertAttachments(t)},e.prototype.insertDocument=function(t){return this.composition.insertDocument(t)},e.prototype.insertFile=function(t){return this.composition.insertFile(t)},e.prototype.insertFiles=function(t){return this.composition.insertFiles(t)},e.prototype.insertHTML=function(t){return this.composition.insertHTML(t)},e.prototype.insertString=function(t){return this.composition.insertString(t)},e.prototype.insertText=function(t){return this.composition.insertText(t)},e.prototype.insertLineBreak=function(){return this.composition.insertLineBreak()},e.prototype.getSelectedRange=function(){return this.composition.getSelectedRange()},e.prototype.getPosition=function(){return this.composition.getPosition()},e.prototype.getClientRectAtPosition=function(t){var e;return e=this.getDocument().locationRangeFromRange([t,t+1]),this.selectionManager.getClientRectAtLocationRange(e)},e.prototype.expandSelectionInDirection=function(t){return this.composition.expandSelectionInDirection(t)},e.prototype.moveCursorInDirection=function(t){return this.composition.moveCursorInDirection(t)},e.prototype.setSelectedRange=function(t){return this.composition.setSelectedRange(t)},e.prototype.activateAttribute=function(t,e){return null==e&&(e=!0),this.composition.setCurrentAttribute(t,e)},e.prototype.attributeIsActive=function(t){return this.composition.hasCurrentAttribute(t)},e.prototype.canActivateAttribute=function(t){return this.composition.canSetCurrentAttribute(t)},e.prototype.deactivateAttribute=function(t){return this.composition.removeCurrentAttribute(t)},e.prototype.canDecreaseNestingLevel=function(){return this.composition.canDecreaseNestingLevel()},e.prototype.canIncreaseNestingLevel=function(){return this.composition.canIncreaseNestingLevel()},e.prototype.decreaseNestingLevel=function(){return this.canDecreaseNestingLevel()?this.composition.decreaseNestingLevel():void 0},e.prototype.increaseNestingLevel=function(){return this.canIncreaseNestingLevel()?this.composition.increaseNestingLevel():void 0},e.prototype.canRedo=function(){return this.undoManager.canRedo()},e.prototype.canUndo=function(){return this.undoManager.canUndo()},e.prototype.recordUndoEntry=function(t,e){var n,i,r;return i=(r=null!=e?e:{}).context,n=r.consolidatable,this.undoManager.recordUndoEntry(t,{context:i,consolidatable:n})},e.prototype.redo=function(){return this.canRedo()?this.undoManager.redo():void 0},e.prototype.undo=function(){return this.canUndo()?this.undoManager.undo():void 0},e}()}.call(this),function(){var e={}.hasOwnProperty;t.ManagedAttachment=function(t){function n(t,e){var n;this.attachmentManager=t,this.attachment=e,n=this.attachment,this.id=n.id,this.file=n.file}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(n,t),n.prototype.remove=function(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)},n.proxyMethod("attachment.getAttribute"),n.proxyMethod("attachment.hasAttribute"),n.proxyMethod("attachment.setAttribute"),n.proxyMethod("attachment.getAttributes"),n.proxyMethod("attachment.setAttributes"),n.proxyMethod("attachment.isPending"),n.proxyMethod("attachment.isPreviewable"),n.proxyMethod("attachment.getURL"),n.proxyMethod("attachment.getHref"),n.proxyMethod("attachment.getFilename"),n.proxyMethod("attachment.getFilesize"),n.proxyMethod("attachment.getFormattedFilesize"),n.proxyMethod("attachment.getExtension"),n.proxyMethod("attachment.getContentType"),n.proxyMethod("attachment.getFile"),n.proxyMethod("attachment.setFile"),n.proxyMethod("attachment.releaseFile"),n.proxyMethod("attachment.getUploadProgress"),n.proxyMethod("attachment.setUploadProgress"),n}(t.BasicObject)}.call(this),function(){var e={}.hasOwnProperty;t.AttachmentManager=function(n){function i(t){var e,n,i;for(null==t&&(t=[]),this.managedAttachments={},n=0,i=t.length;i>n;n++)e=t[n],this.manageAttachment(e)}return function(t,n){function i(){this.constructor=t}for(var r in n)e.call(n,r)&&(t[r]=n[r]);i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype}(i,n),i.prototype.getAttachments=function(){var t,e,n,i;for(e in i=[],n=this.managedAttachments)t=n[e],i.push(t);return i},i.prototype.manageAttachment=function(e){var n,i;return null!=(n=this.managedAttachments)[i=e.id]?n[i]:n[i]=new t.ManagedAttachment(this,e)},i.prototype.attachmentIsManaged=function(t){return t.id in this.managedAttachments},i.prototype.requestRemovalOfAttachment=function(t){var e;return this.attachmentIsManaged(t)&&null!=(e=this.delegate)&&"function"==typeof e.attachmentManagerDidRequestRemovalOfAttachment?e.attachmentManagerDidRequestRemovalOfAttachment(t):void 0},i.prototype.unmanageAttachment=function(t){var e;return e=this.managedAttachments[t.id],delete this.managedAttachments[t.id],e},i}(t.BasicObject)}.call(this),function(){var e,n,i,r,o,a,s,u,l,c,h;e=t.elementContainsNode,n=t.findChildIndexOfNode,o=t.nodeIsBlockStart,a=t.nodeIsBlockStartComment,r=t.nodeIsBlockContainer,s=t.nodeIsCursorTarget,u=t.nodeIsEmptyTextNode,l=t.nodeIsTextNode,i=t.nodeIsAttachmentElement,c=t.tagName,h=t.walkTree,t.LocationMapper=function(){function t(t){this.element=t}var d,f,p,g;return t.prototype.findLocationFromContainerAndOffset=function(t,i,r){var a,u,c,d,g,m,v;for(m=(null!=r?r:{strict:!0}).strict,u=0,c=!1,d={index:0,offset:0},(a=this.findAttachmentElementParentForNode(t))&&(t=a.parentNode,i=n(a)),v=h(this.element,{usingFilter:p});v.nextNode();){if((g=v.currentNode)===t&&l(t)){s(g)||(d.offset+=i);break}if(g.parentNode===t){if(u++===i)break}else if(!e(t,g)&&u>0)break;o(g,{strict:m})?(c&&d.index++,d.offset=0,c=!0):d.offset+=f(g)}return d},t.prototype.findContainerAndOffsetFromLocation=function(t){var e,i,a,u,c;if(0===t.index&&0===t.offset){for(e=this.element,u=0;e.firstChild;)if(e=e.firstChild,r(e)){u=1;break}return[e,u]}if(i=(c=this.findNodeAndOffsetFromLocation(t))[0],a=c[1],i){if(l(i))0===f(i)?(e=i.parentNode.parentNode,u=n(i.parentNode),s(i,{name:"right"})&&u++):(e=i,u=t.offset-a);else{if(e=i.parentNode,!o(i.previousSibling)&&!r(e))for(;i===e.lastChild&&(i=e,e=e.parentNode,!r(e)););u=n(i),0!==t.offset&&u++}return[e,u]}},t.prototype.findNodeAndOffsetFromLocation=function(t){var e,n,i,r,o,a,u,c;for(u=0,n=0,i=(c=this.getSignificantNodesForIndex(t.index)).length;i>n;n++){if(e=c[n],r=f(e),t.offset<=u+r)if(l(e)){if(o=e,a=u,t.offset===a&&s(o))break}else o||(o=e,a=u);if((u+=r)>t.offset)break}return[o,a]},t.prototype.findAttachmentElementParentForNode=function(t){for(;t&&t!==this.element;){if(i(t))return t;t=t.parentNode}},t.prototype.getSignificantNodesForIndex=function(t){var e,n,i,r,o;for(i=[],o=h(this.element,{usingFilter:d}),r=!1;o.nextNode();)if(n=o.currentNode,a(n)){if(null!=e?e++:e=0,e===t)r=!0;else if(r)break}else r&&i.push(n);return i},f=function(t){return t.nodeType===Node.TEXT_NODE?s(t)?0:t.textContent.length:"br"===c(t)||i(t)?1:0},d=function(t){return g(t)===NodeFilter.FILTER_ACCEPT?p(t):NodeFilter.FILTER_REJECT},g=function(t){return u(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},p=function(t){return i(t.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},t}()}.call(this),function(){var e,n,i=[].slice;e=t.getDOMRange,n=t.setDOMRange,t.PointMapper=function(){function t(){}return t.prototype.createDOMRangeFromPoint=function(t){var i,r,o,a,s,u,l,c;if(l=t.x,c=t.y,document.caretPositionFromPoint)return o=(s=document.caretPositionFromPoint(l,c)).offsetNode,r=s.offset,(i=document.createRange()).setStart(o,r),i;if(document.caretRangeFromPoint)return document.caretRangeFromPoint(l,c);if(document.body.createTextRange){a=e();try{(u=document.body.createTextRange()).moveToPoint(l,c),u.select()}catch(t){}return i=e(),n(a),i}},t.prototype.getClientRectsForDOMRange=function(t){var e;return[(e=i.call(t.getClientRects()))[0],e[e.length-1]]},t}()}.call(this),function(){var e,n=function(t,e){return function(){return t.apply(e,arguments)}},i={}.hasOwnProperty,r=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=t.getDOMRange,t.SelectionChangeObserver=function(t){function o(){this.run=n(this.run,this),this.update=n(this.update,this),this.selectionManagers=[]}var a;return function(t,e){function n(){this.constructor=t}for(var r in e)i.call(e,r)&&(t[r]=e[r]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(o,t),o.prototype.start=function(){return this.started?void 0:(this.started=!0,"onselectionchange"in document?document.addEventListener("selectionchange",this.update,!0):this.run())},o.prototype.stop=function(){return this.started?(this.started=!1,document.removeEventListener("selectionchange",this.update,!0)):void 0},o.prototype.registerSelectionManager=function(t){return r.call(this.selectionManagers,t)<0?(this.selectionManagers.push(t),this.start()):void 0},o.prototype.unregisterSelectionManager=function(t){var e;return this.selectionManagers=function(){var n,i,r,o;for(o=[],n=0,i=(r=this.selectionManagers).length;i>n;n++)(e=r[n])!==t&&o.push(e);return o}.call(this),0===this.selectionManagers.length?this.stop():void 0},o.prototype.notifySelectionManagersOfSelectionChange=function(){var t,e,n,i,r;for(i=[],t=0,e=(n=this.selectionManagers).length;e>t;t++)r=n[t],i.push(r.selectionDidChange());return i},o.prototype.update=function(){var t;return t=e(),a(t,this.domRange)?void 0:(this.domRange=t,this.notifySelectionManagersOfSelectionChange())},o.prototype.reset=function(){return this.domRange=null,this.update()},o.prototype.run=function(){return this.started?(this.update(),requestAnimationFrame(this.run)):void 0},a=function(t,e){return(null!=t?t.startContainer:void 0)===(null!=e?e.startContainer:void 0)&&(null!=t?t.startOffset:void 0)===(null!=e?e.startOffset:void 0)&&(null!=t?t.endContainer:void 0)===(null!=e?e.endContainer:void 0)&&(null!=t?t.endOffset:void 0)===(null!=e?e.endOffset:void 0)},o}(t.BasicObject),null==t.selectionChangeObserver&&(t.selectionChangeObserver=new t.SelectionChangeObserver)}.call(this),function(){var e,n,i,r,o,a,s,u,l,c,h=function(t,e){return function(){return t.apply(e,arguments)}},d={}.hasOwnProperty;i=t.getDOMSelection,n=t.getDOMRange,c=t.setDOMRange,e=t.elementContainsNode,a=t.nodeIsCursorTarget,o=t.innerElementIsActive,r=t.handleEvent,s=t.normalizeRange,u=t.rangeIsCollapsed,l=t.rangesAreEqual,t.SelectionManager=function(f){function p(e){this.element=e,this.selectionDidChange=h(this.selectionDidChange,this),this.didMouseDown=h(this.didMouseDown,this),this.locationMapper=new t.LocationMapper(this.element),this.pointMapper=new t.PointMapper,this.lockCount=0,r("mousedown",{onElement:this.element,withCallback:this.didMouseDown})}return function(t,e){function n(){this.constructor=t}for(var i in e)d.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(p,f),p.prototype.getLocationRange=function(t){var e;return null==t&&(t={}),!1===t.strict?this.createLocationRangeFromDOMRange(n(),{strict:!1}):t.ignoreLock?this.currentLocationRange:null!=(e=this.lockedLocationRange)?e:this.currentLocationRange},p.prototype.setLocationRange=function(t){var e;if(!this.lockedLocationRange)return t=s(t),(e=this.createDOMRangeFromLocationRange(t))?(c(e),this.updateCurrentLocationRange(t)):void 0},p.prototype.setLocationRangeFromPointRange=function(t){var e,n;return t=s(t),n=this.getLocationAtPoint(t[0]),e=this.getLocationAtPoint(t[1]),this.setLocationRange([n,e])},p.prototype.getClientRectAtLocationRange=function(t){var e;return(e=this.createDOMRangeFromLocationRange(t))?this.getClientRectsForDOMRange(e)[1]:void 0},p.prototype.locationIsCursorTarget=function(t){var e,n;return e=(n=this.findNodeAndOffsetFromLocation(t))[0],n[1],a(e)},p.prototype.lock=function(){return 0==this.lockCount++?(this.updateCurrentLocationRange(),this.lockedLocationRange=this.getLocationRange()):void 0},p.prototype.unlock=function(){var t;return 0==--this.lockCount&&(t=this.lockedLocationRange,this.lockedLocationRange=null,null!=t)?this.setLocationRange(t):void 0},p.prototype.clearSelection=function(){var t;return null!=(t=i())?t.removeAllRanges():void 0},p.prototype.selectionIsCollapsed=function(){var t;return!0===(null!=(t=n())?t.collapsed:void 0)},p.prototype.selectionIsExpanded=function(){return!this.selectionIsCollapsed()},p.prototype.createLocationRangeFromDOMRange=function(t,e){var n,i;if(null!=t&&this.domRangeWithinElement(t)&&(i=this.findLocationFromContainerAndOffset(t.startContainer,t.startOffset,e)))return t.collapsed||(n=this.findLocationFromContainerAndOffset(t.endContainer,t.endOffset,e)),s([i,n])},p.proxyMethod("locationMapper.findLocationFromContainerAndOffset"),p.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"),p.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"),p.proxyMethod("pointMapper.createDOMRangeFromPoint"),p.proxyMethod("pointMapper.getClientRectsForDOMRange"),p.prototype.didMouseDown=function(){return this.pauseTemporarily()},p.prototype.pauseTemporarily=function(){var t,n,i,o,a;return this.paused=!0,a=this,n=function(){var t,n;for(a.paused=!1,clearTimeout(o),t=0,n=i.length;n>t;t++)i[t].destroy();return e(document,a.element)?a.selectionDidChange():void 0},o=setTimeout(n,200),i=function(){var e,i,o,a;for(a=[],e=0,i=(o=["mousemove","keydown"]).length;i>e;e++)t=o[e],a.push(r(t,{onElement:document,withCallback:n}));return a}()},p.prototype.selectionDidChange=function(){return this.paused||o(this.element)?void 0:this.updateCurrentLocationRange()},p.prototype.updateCurrentLocationRange=function(t){var e;return(null!=t?t:t=this.createLocationRangeFromDOMRange(n()))&&!l(t,this.currentLocationRange)?(this.currentLocationRange=t,null!=(e=this.delegate)&&"function"==typeof e.locationRangeDidChange?e.locationRangeDidChange(this.currentLocationRange.slice(0)):void 0):void 0},p.prototype.createDOMRangeFromLocationRange=function(t){var e,n,i,r;return i=this.findContainerAndOffsetFromLocation(t[0]),n=u(t)?i:null!=(r=this.findContainerAndOffsetFromLocation(t[1]))?r:i,null!=i&&null!=n?((e=document.createRange()).setStart.apply(e,i),e.setEnd.apply(e,n),e):void 0},p.prototype.getLocationAtPoint=function(t){var e,n;return(e=this.createDOMRangeFromPoint(t))&&null!=(n=this.createLocationRangeFromDOMRange(e))?n[0]:void 0},p.prototype.domRangeWithinElement=function(t){return t.collapsed?e(this.element,t.startContainer):e(this.element,t.startContainer)&&e(this.element,t.endContainer)},p}(t.BasicObject)}.call(this),function(){var e,n,i,r,o={}.hasOwnProperty,a=[].slice;i=t.rangeIsCollapsed,r=t.rangesAreEqual,n=t.objectsAreEqual,e=t.getBlockConfig,t.EditorController=function(s){function u(e){var n,i;this.editorElement=e.editorElement,n=e.document,i=e.html,this.selectionManager=new t.SelectionManager(this.editorElement),this.selectionManager.delegate=this,this.composition=new t.Composition,this.composition.delegate=this,this.attachmentManager=new t.AttachmentManager(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=new(t["Level"+t.config.input.getLevel()+"InputController"])(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new t.CompositionController(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new t.ToolbarController(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new t.Editor(this.composition,this.selectionManager,this.editorElement),null!=n?this.editor.loadDocument(n):this.editor.loadHTML(i)}var l;return function(t,e){function n(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype}(u,s),u.prototype.registerSelectionManager=function(){return t.selectionChangeObserver.registerSelectionManager(this.selectionManager)},u.prototype.unregisterSelectionManager=function(){return t.selectionChangeObserver.unregisterSelectionManager(this.selectionManager)},u.prototype.render=function(){return this.compositionController.render()},u.prototype.reparse=function(){return this.composition.replaceHTML(this.editorElement.innerHTML)},u.prototype.compositionDidChangeDocument=function(){return this.notifyEditorElement("document-change"),this.handlingInput?void 0:this.render()},u.prototype.compositionDidChangeCurrentAttributes=function(t){return this.currentAttributes=t,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})},u.prototype.compositionDidPerformInsertionAtRange=function(t){return this.pasting?this.pastedRange=t:void 0},u.prototype.compositionShouldAcceptFile=function(t){return this.notifyEditorElement("file-accept",{file:t})},u.prototype.compositionDidAddAttachment=function(t){var e;return e=this.attachmentManager.manageAttachment(t),this.notifyEditorElement("attachment-add",{attachment:e})},u.prototype.compositionDidEditAttachment=function(t){var e;return this.compositionController.rerenderViewForObject(t),e=this.attachmentManager.manageAttachment(t),this.notifyEditorElement("attachment-edit",{attachment:e}),this.notifyEditorElement("change")},u.prototype.compositionDidChangeAttachmentPreviewURL=function(t){return this.compositionController.invalidateViewForObject(t),this.notifyEditorElement("change")},u.prototype.compositionDidRemoveAttachment=function(t){var e;return e=this.attachmentManager.unmanageAttachment(t),this.notifyEditorElement("attachment-remove",{attachment:e})},u.prototype.compositionDidStartEditingAttachment=function(t,e){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(t),this.compositionController.installAttachmentEditorForAttachment(t,e),this.selectionManager.setLocationRange(this.attachmentLocationRange)},u.prototype.compositionDidStopEditingAttachment=function(){return this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null},u.prototype.compositionDidRequestChangingSelectionToLocationRange=function(t){return!this.loadingSnapshot||this.isFocused()?(this.requestedLocationRange=t,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()):void 0},u.prototype.compositionWillLoadSnapshot=function(){return this.loadingSnapshot=!0},u.prototype.compositionDidLoadSnapshot=function(){return this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1},u.prototype.getSelectionManager=function(){return this.selectionManager},u.proxyMethod("getSelectionManager().setLocationRange"),u.proxyMethod("getSelectionManager().getLocationRange"),u.prototype.attachmentManagerDidRequestRemovalOfAttachment=function(t){return this.removeAttachment(t)},u.prototype.compositionControllerWillSyncDocumentView=function(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()},u.prototype.compositionControllerDidSyncDocumentView=function(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")},u.prototype.compositionControllerDidRender=function(){return null!=this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision},u.prototype.compositionControllerDidFocus=function(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")},u.prototype.compositionControllerDidBlur=function(){return this.notifyEditorElement("blur")},u.prototype.compositionControllerDidSelectAttachment=function(t,e){return this.toolbarController.hideDialog(),this.composition.editAttachment(t,e)},u.prototype.compositionControllerDidRequestDeselectingAttachment=function(t){var e,n;return e=null!=(n=this.attachmentLocationRange)?n:this.composition.document.getLocationRangeOfAttachment(t),this.selectionManager.setLocationRange(e[1])},u.prototype.compositionControllerWillUpdateAttachment=function(t){return this.editor.recordUndoEntry("Edit Attachment",{context:t.id,consolidatable:!0})},u.prototype.compositionControllerDidRequestRemovalOfAttachment=function(t){return this.removeAttachment(t)},u.prototype.inputControllerWillHandleInput=function(){return this.handlingInput=!0,this.requestedRender=!1},u.prototype.inputControllerDidRequestRender=function(){return this.requestedRender=!0},u.prototype.inputControllerDidHandleInput=function(){return this.handlingInput=!1,this.requestedRender?(this.requestedRender=!1,this.render()):void 0},u.prototype.inputControllerDidAllowUnhandledInput=function(){return this.notifyEditorElement("change")},u.prototype.inputControllerDidRequestReparse=function(){return this.reparse()},u.prototype.inputControllerWillPerformTyping=function(){return this.recordTypingUndoEntry()},u.prototype.inputControllerWillPerformFormatting=function(t){return this.recordFormattingUndoEntry(t)},u.prototype.inputControllerWillCutText=function(){return this.editor.recordUndoEntry("Cut")},u.prototype.inputControllerWillPaste=function(t){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:t})},u.prototype.inputControllerDidPaste=function(t){return t.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:t})},u.prototype.inputControllerWillMoveText=function(){return this.editor.recordUndoEntry("Move")},u.prototype.inputControllerWillAttachFiles=function(){return this.editor.recordUndoEntry("Drop Files")},u.prototype.inputControllerWillPerformUndo=function(){return this.editor.undo()},u.prototype.inputControllerWillPerformRedo=function(){return this.editor.redo()},u.prototype.inputControllerDidReceiveKeyboardCommand=function(t){return this.toolbarController.applyKeyboardCommand(t)},u.prototype.inputControllerDidStartDrag=function(){return this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()},u.prototype.inputControllerDidReceiveDragOverPoint=function(t){return this.selectionManager.setLocationRangeFromPointRange(t)},u.prototype.inputControllerDidCancelDrag=function(){return this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null},u.prototype.locationRangeDidChange=function(t){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!r(this.attachmentLocationRange,t)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")},u.prototype.toolbarDidClickButton=function(){return this.getLocationRange()?void 0:this.setLocationRange({index:0,offset:0})},u.prototype.toolbarDidInvokeAction=function(t){return this.invokeAction(t)},u.prototype.toolbarDidToggleAttribute=function(t){return this.recordFormattingUndoEntry(t),this.composition.toggleCurrentAttribute(t),this.render(),this.selectionFrozen?void 0:this.editorElement.focus()},u.prototype.toolbarDidUpdateAttribute=function(t,e){return this.recordFormattingUndoEntry(t),this.composition.setCurrentAttribute(t,e),this.render(),this.selectionFrozen?void 0:this.editorElement.focus()},u.prototype.toolbarDidRemoveAttribute=function(t){return this.recordFormattingUndoEntry(t),this.composition.removeCurrentAttribute(t),this.render(),this.selectionFrozen?void 0:this.editorElement.focus()},u.prototype.toolbarWillShowDialog=function(){return this.composition.expandSelectionForEditing(),this.freezeSelection()},u.prototype.toolbarDidShowDialog=function(t){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:t})},u.prototype.toolbarDidHideDialog=function(t){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:t})},u.prototype.freezeSelection=function(){return this.selectionFrozen?void 0:(this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render())},u.prototype.thawSelection=function(){return this.selectionFrozen?(this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()):void 0},u.prototype.actions={undo:{test:function(){return this.editor.canUndo()},perform:function(){return this.editor.undo()}},redo:{test:function(){return this.editor.canRedo()},perform:function(){return this.editor.redo()}},link:{test:function(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test:function(){return this.editor.canIncreaseNestingLevel()},perform:function(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test:function(){return this.editor.canDecreaseNestingLevel()},perform:function(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:function(){return!0},perform:function(){return t.config.input.pickFiles(this.editor.insertFiles)}}},u.prototype.canInvokeAction=function(t){var e,n;return!!this.actionIsExternal(t)||!!(null!=(e=this.actions[t])&&null!=(n=e.test)?n.call(this):void 0)},u.prototype.invokeAction=function(t){var e,n;return this.actionIsExternal(t)?this.notifyEditorElement("action-invoke",{actionName:t}):null!=(e=this.actions[t])&&null!=(n=e.perform)?n.call(this):void 0},u.prototype.actionIsExternal=function(t){return/^x-./.test(t)},u.prototype.getCurrentActions=function(){var t,e;for(t in e={},this.actions)e[t]=this.canInvokeAction(t);return e},u.prototype.updateCurrentActions=function(){var t;return t=this.getCurrentActions(),n(t,this.currentActions)?void 0:(this.currentActions=t,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions}))},u.prototype.runEditorFilters=function(){var t,e,n,i,r,o,a,s;for(s=this.composition.getSnapshot(),n=0,i=(r=this.editor.filters).length;i>n;n++)e=r[n],t=s.document,a=s.selectedRange,null==(s=null!=(o=e.call(this.editor,s))?o:{}).document&&(s.document=t),null==s.selectedRange&&(s.selectedRange=a);return l(s,this.composition.getSnapshot())?void 0:this.composition.loadSnapshot(s)},l=function(t,e){return r(t.selectedRange,e.selectedRange)&&t.document.isEqualTo(e.document)},u.prototype.updateInputElement=function(){var e,n;return e=this.compositionController.getSerializableElement(),n=t.serializeToContentType(e,"text/html"),this.editorElement.setInputElementValue(n)},u.prototype.notifyEditorElement=function(t,e){switch(t){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(t,e)},u.prototype.removeAttachment=function(t){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(t),this.render()},u.prototype.recordFormattingUndoEntry=function(t){var n,r;return n=e(t),r=this.selectionManager.getLocationRange(),n||!i(r)?this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0}):void 0},u.prototype.recordTypingUndoEntry=function(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})},u.prototype.getUndoContext=function(){var t;return t=1<=arguments.length?a.call(arguments,0):[],[this.getLocationContext(),this.getTimeContext()].concat(a.call(t))},u.prototype.getLocationContext=function(){var t;return t=this.selectionManager.getLocationRange(),i(t)?t[0].index:t},u.prototype.getTimeContext=function(){return t.config.undoInterval>0?Math.floor((new Date).getTime()/t.config.undoInterval):0},u.prototype.isFocused=function(){var t;return this.editorElement===(null!=(t=this.editorElement.ownerDocument)?t.activeElement:void 0)},u.prototype.isFocusedInvisibly=function(){return this.isFocused()&&!this.getLocationRange()},u}(t.Controller)}.call(this),function(){var e,n,i,r,o,a,s,u,l,c,h,d,f,p,g,m,v=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};n=t.browser,a=t.makeElement,s=t.triggerEvent,r=t.handleEvent,o=t.handleEventOnce,i=t.findClosestElementFromNode,e=t.AttachmentView.attachmentSelector,t.registerElement("trix-editor",(p=0,l=function(t){return!document.querySelector(":focus")&&t.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===t?t.focus():void 0},g=function(t){return t.hasAttribute("contenteditable")?void 0:(t.setAttribute("contenteditable",""),o("focus",{onElement:t,withCallback:function(){return c(t)}}))},c=function(t){return d(t),m(t)},d=function(t){return("function"==typeof document.queryCommandSupported?document.queryCommandSupported("enableObjectResizing"):void 0)?(document.execCommand("enableObjectResizing",!1,!1),r("mscontrolselect",{onElement:t,preventDefault:!0})):void 0},m=function(){var e;return!("function"==typeof document.queryCommandSupported?document.queryCommandSupported("DefaultParagraphSeparator"):void 0)||"div"!==(e=t.config.blockAttributes.default.tagName)&&"p"!==e?void 0:document.execCommand("DefaultParagraphSeparator",!1,e)},u=function(t){return t.hasAttribute("role")?void 0:t.setAttribute("role","textbox")},f=function(t){var e;if(!t.hasAttribute("aria-label")&&!t.hasAttribute("aria-labelledby"))return(e=function(){var e,n;return(n=function(){var n,i,r,o;for(o=[],n=0,i=(r=t.labels).length;i>n;n++)(e=r[n]).contains(t)||o.push(e.textContent);return o}().join(" "))?t.setAttribute("aria-label",n):t.removeAttribute("aria-label")})(),r("focus",{onElement:t,withCallback:e})},h=n.forcesObjectResizing?{display:"inline",width:"auto"}:{display:"inline-block",width:"1px"},{defaultCSS:"%t {\n  display: block;\n}\n\n%t:empty:not(:focus)::before {\n  content: attr(placeholder);\n  color: graytext;\n  cursor: text;\n  pointer-events: none;\n}\n\n%t a[contenteditable=false] {\n  cursor: text;\n}\n\n%t img {\n  max-width: 100%;\n  height: auto;\n}\n\n%t "+e+" figcaption textarea {\n  resize: none;\n}\n\n%t "+e+" figcaption textarea.trix-autoresize-clone {\n  position: absolute;\n  left: -9999px;\n  max-height: 0px;\n}\n\n%t "+e+" figcaption[data-trix-placeholder]:empty::before {\n  content: attr(data-trix-placeholder);\n  color: graytext;\n}\n\n%t [data-trix-cursor-target] {\n  display: "+h.display+" !important;\n  width: "+h.width+" !important;\n  padding: 0 !important;\n  margin: 0 !important;\n  border: none !important;\n}\n\n%t [data-trix-cursor-target=left] {\n  vertical-align: top !important;\n  margin-left: -1px !important;\n}\n\n%t [data-trix-cursor-target=right] {\n  vertical-align: bottom !important;\n  margin-right: -1px !important;\n}",trixId:{get:function(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++p),this.trixId)}},labels:{get:function(){var t,e,n;return e=[],this.id&&this.ownerDocument&&e.push.apply(e,this.ownerDocument.querySelectorAll("label[for='"+this.id+"']")),(t=i(this,{matchingSelector:"label"}))&&((n=t.control)===this||null===n)&&e.push(t),e}},toolbarElement:{get:function(){var t,e,n;return this.hasAttribute("toolbar")?null!=(e=this.ownerDocument)?e.getElementById(this.getAttribute("toolbar")):void 0:this.parentNode?(n="trix-toolbar-"+this.trixId,this.setAttribute("toolbar",n),t=a("trix-toolbar",{id:n}),this.parentNode.insertBefore(t,this),t):void 0}},inputElement:{get:function(){var t,e,n;return this.hasAttribute("input")?null!=(n=this.ownerDocument)?n.getElementById(this.getAttribute("input")):void 0:this.parentNode?(e="trix-input-"+this.trixId,this.setAttribute("input",e),t=a("input",{type:"hidden",id:e}),this.parentNode.insertBefore(t,this.nextElementSibling),t):void 0}},editor:{get:function(){var t;return null!=(t=this.editorController)?t.editor:void 0}},name:{get:function(){var t;return null!=(t=this.inputElement)?t.name:void 0}},value:{get:function(){var t;return null!=(t=this.inputElement)?t.value:void 0},set:function(t){var e;return this.defaultValue=t,null!=(e=this.editor)?e.loadHTML(this.defaultValue):void 0}},notify:function(t,e){return this.editorController?s("trix-"+t,{onElement:this,attributes:e}):void 0},setInputElementValue:function(t){var e;return null!=(e=this.inputElement)?e.value=t:void 0},initialize:function(){return this.hasAttribute("data-trix-internal")?void 0:(g(this),u(this),f(this))},connect:function(){return this.hasAttribute("data-trix-internal")?void 0:(this.editorController||(s("trix-before-initialize",{onElement:this}),this.editorController=new t.EditorController({editorElement:this,html:this.defaultValue=this.value}),requestAnimationFrame((e=this,function(){return s("trix-initialize",{onElement:e})}))),this.editorController.registerSelectionManager(),this.registerResetListener(),this.registerClickListener(),l(this));var e},disconnect:function(){var t;return null!=(t=this.editorController)&&t.unregisterSelectionManager(),this.unregisterResetListener(),this.unregisterClickListener()},registerResetListener:function(){return this.resetListener=this.resetBubbled.bind(this),window.addEventListener("reset",this.resetListener,!1)},unregisterResetListener:function(){return window.removeEventListener("reset",this.resetListener,!1)},registerClickListener:function(){return this.clickListener=this.clickBubbled.bind(this),window.addEventListener("click",this.clickListener,!1)},unregisterClickListener:function(){return window.removeEventListener("click",this.clickListener,!1)},resetBubbled:function(t){var e;if(!t.defaultPrevented&&t.target===(null!=(e=this.inputElement)?e.form:void 0))return this.reset()},clickBubbled:function(t){var e;if(!(t.defaultPrevented||this.contains(t.target)||!(e=i(t.target,{matchingSelector:"label"}))||v.call(this.labels,e)<0))return this.focus()},reset:function(){return this.value=this.defaultValue}}))}.call(this),function(){}.call(this)}).call(this),"object"==$u(e)&&e.exports?e.exports=t:"function"==typeof define&&n.amdO&&define(t)}.call(t)})),sl=1e3,ul=6e4,ll=36e5,cl="millisecond",hl="second",dl="minute",fl="hour",pl="day",gl="week",ml="month",vl="quarter",yl="year",bl="date",_l="Invalid Date",El=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,xl=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Al={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},Dl=function(t,e,n){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(n)+t},wl={s:Dl,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),i=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+Dl(i,2,"0")+":"+Dl(r,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var i=12*(n.year()-e.year())+(n.month()-e.month()),r=e.clone().add(i,ml),o=n-r<0,a=e.clone().add(i+(o?-1:1),ml);return+(-(i+(n-r)/(o?r-a:a-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:ml,y:yl,w:gl,d:pl,D:bl,h:fl,m:dl,s:hl,ms:cl,Q:vl}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},kl="en",Tl={};Tl[kl]=Al;var Cl=function(t){return t instanceof Rl},Sl=function(t,e,n){var i;if(!t)return kl;if("string"==typeof t)Tl[t]&&(i=t),e&&(Tl[t]=e,i=t);else{var r=t.name;Tl[r]=t,i=r}return!n&&i&&(kl=i),i||!n&&kl},Il=function(t,e){if(Cl(t))return t.clone();var n="object"===$u(e)?e:{};return n.date=t,n.args=arguments,new Rl(n)},Ol=wl;Ol.l=Sl,Ol.i=Cl,Ol.w=function(t,e){return Il(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var Rl=function(){function t(t){this.$L=Sl(t.locale,null,!0),this.parse(t)}var e=t.prototype;return e.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(Ol.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var i=e.match(El);if(i){var r=i[2]-1||0,o=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},e.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},e.$utils=function(){return Ol},e.isValid=function(){return!(this.$d.toString()===_l)},e.isSame=function(t,e){var n=Il(t);return this.startOf(e)<=n&&n<=this.endOf(e)},e.isAfter=function(t,e){return Il(t)<this.startOf(e)},e.isBefore=function(t,e){return this.endOf(e)<Il(t)},e.$g=function(t,e,n){return Ol.u(t)?this[e]:this.set(n,t)},e.unix=function(){return Math.floor(this.valueOf()/1e3)},e.valueOf=function(){return this.$d.getTime()},e.startOf=function(t,e){var n=this,i=!!Ol.u(e)||e,r=Ol.p(t),o=function(t,e){var r=Ol.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return i?r:r.endOf(pl)},a=function(t,e){return Ol.w(n.toDate()[t].apply(n.toDate("s"),(i?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},s=this.$W,u=this.$M,l=this.$D,c="set"+(this.$u?"UTC":"");switch(r){case yl:return i?o(1,0):o(31,11);case ml:return i?o(1,u):o(0,u+1);case gl:var h=this.$locale().weekStart||0,d=(s<h?s+7:s)-h;return o(i?l-d:l+(6-d),u);case pl:case bl:return a(c+"Hours",0);case fl:return a(c+"Minutes",1);case dl:return a(c+"Seconds",2);case hl:return a(c+"Milliseconds",3);default:return this.clone()}},e.endOf=function(t){return this.startOf(t,!1)},e.$set=function(t,e){var n,i=Ol.p(t),r="set"+(this.$u?"UTC":""),o=(n={},n[pl]=r+"Date",n[bl]=r+"Date",n[ml]=r+"Month",n[yl]=r+"FullYear",n[fl]=r+"Hours",n[dl]=r+"Minutes",n[hl]=r+"Seconds",n[cl]=r+"Milliseconds",n)[i],a=i===pl?this.$D+(e-this.$W):e;if(i===ml||i===yl){var s=this.clone().set(bl,1);s.$d[o](a),s.init(),this.$d=s.set(bl,Math.min(this.$D,s.daysInMonth())).$d}else o&&this.$d[o](a);return this.init(),this},e.set=function(t,e){return this.clone().$set(t,e)},e.get=function(t){return this[Ol.p(t)]()},e.add=function(t,e){var n,i=this;t=Number(t);var r=Ol.p(e),o=function(e){var n=Il(i);return Ol.w(n.date(n.date()+Math.round(e*t)),i)};if(r===ml)return this.set(ml,this.$M+t);if(r===yl)return this.set(yl,this.$y+t);if(r===pl)return o(1);if(r===gl)return o(7);var a=(n={},n[dl]=ul,n[fl]=ll,n[hl]=sl,n)[r]||1,s=this.$d.getTime()+t*a;return Ol.w(s,this)},e.subtract=function(t,e){return this.add(-1*t,e)},e.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||_l;var i=t||"YYYY-MM-DDTHH:mm:ssZ",r=Ol.z(this),o=this.$H,a=this.$m,s=this.$M,u=n.weekdays,l=n.months,c=function(t,n,r,o){return t&&(t[n]||t(e,i))||r[n].substr(0,o)},h=function(t){return Ol.s(o%12||12,t,"0")},d=n.meridiem||function(t,e,n){var i=t<12?"AM":"PM";return n?i.toLowerCase():i},f={YY:String(this.$y).slice(-2),YYYY:this.$y,M:s+1,MM:Ol.s(s+1,2,"0"),MMM:c(n.monthsShort,s,l,3),MMMM:c(l,s),D:this.$D,DD:Ol.s(this.$D,2,"0"),d:String(this.$W),dd:c(n.weekdaysMin,this.$W,u,2),ddd:c(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:Ol.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,a,!0),A:d(o,a,!1),m:String(a),mm:Ol.s(a,2,"0"),s:String(this.$s),ss:Ol.s(this.$s,2,"0"),SSS:Ol.s(this.$ms,3,"0"),Z:r};return i.replace(xl,(function(t,e){return e||f[t]||r.replace(":","")}))},e.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},e.diff=function(t,e,n){var i,r=Ol.p(e),o=Il(t),a=(o.utcOffset()-this.utcOffset())*ul,s=this-o,u=Ol.m(this,o);return u=(i={},i[yl]=u/12,i[ml]=u,i[vl]=u/3,i[gl]=(s-a)/6048e5,i[pl]=(s-a)/864e5,i[fl]=s/ll,i[dl]=s/ul,i[hl]=s/sl,i)[r]||s,n?u:Ol.a(u)},e.daysInMonth=function(){return this.endOf(ml).$D},e.$locale=function(){return Tl[this.$L]},e.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),i=Sl(t,e,!0);return i&&(n.$L=i),n},e.clone=function(){return Ol.w(this.$d,this)},e.toDate=function(){return new Date(this.valueOf())},e.toJSON=function(){return this.isValid()?this.toISOString():null},e.toISOString=function(){return this.$d.toISOString()},e.toString=function(){return this.$d.toUTCString()},t}(),Ml=Rl.prototype;Il.prototype=Ml,[["$ms",cl],["$s",hl],["$m",dl],["$H",fl],["$W",pl],["$M",ml],["$y",yl],["$D",bl]].forEach((function(t){Ml[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),Il.extend=function(t,e){return t.$i||(t(e,Rl,Il),t.$i=!0),Il},Il.locale=Sl,Il.isDayjs=Cl,Il.unix=function(t){return Il(1e3*t)},Il.en=Tl[kl],Il.Ls=Tl,Il.p={};var Ll=Il,Pl=el(nl()),Fl=el(il()),Bl=el(rl()),Nl=el(ol());Ll.extend(Pl.default),Ll.extend(Fl.default),Ll.extend(Bl.default),Ll.extend(Nl.default),window.dayjs=Ll;var jl,Vl,zl=function(t){t.data("dateTimePickerFormComponent",(function(t){var e=t.displayFormat,n=t.firstDayOfWeek,i=t.format,r=t.isAutofocused,o=t.maxDate,a=t.minDate,s=t.state,u=Ll.tz.guess();return Ll.locale(window.dayjs_locale),{daysInFocusedMonth:[],displayText:"",emptyDaysInFocusedMonth:[],focusedDate:null,focusedMonth:null,focusedYear:null,hour:null,maxDate:o,minDate:a,minute:null,open:!1,second:null,state:s,init:function(){var t,e,n,i,o,a,s,l=this;this.focusedDate=Ll().tz(u),this.maxDate=Ll(this.maxDate),this.maxDate.isValid()||(this.maxDate=null),this.minDate=Ll(this.minDate),this.minDate.isValid()||(this.minDate=null);var c=null!==(t=this.getSelectedDate())&&void 0!==t?t:Ll().tz(u).hour(0).minute(0).second(0);(null!==this.maxDate&&c.isAfter(this.maxDate)||null!==this.minDate&&c.isBefore(this.minDate))&&(c=null),this.hour=null!==(e=null===(n=c)||void 0===n?void 0:n.hour())&&void 0!==e?e:0,this.minute=null!==(i=null===(o=c)||void 0===o?void 0:o.minute())&&void 0!==i?i:0,this.second=null!==(a=null===(s=c)||void 0===s?void 0:s.second())&&void 0!==a?a:0,this.setDisplayText(),r&&this.openPicker(),this.$watch("focusedMonth",(function(){l.focusedMonth=+l.focusedMonth,l.focusedDate.month()!==l.focusedMonth&&(l.focusedDate=l.focusedDate.month(l.focusedMonth))})),this.$watch("focusedYear",(function(){if(l.focusedYear){var t=+l.focusedYear;Number.isInteger(t)||(t=Ll().tz(u).year(),l.focusedYear=t),l.focusedDate.year()!==t&&(l.focusedDate=l.focusedDate.year(t))}})),this.$watch("focusedDate",(function(){var t=l.focusedDate.month(),e=l.focusedDate.year();l.focusedMonth!==t&&(l.focusedMonth=t),l.focusedYear!==e&&(l.focusedYear=e),l.setupDaysGrid(),l.$nextTick((function(){l.evaluatePosition()}))})),this.$watch("hour",(function(){var t,e,n=+l.hour;Number.isInteger(n)?l.hour=n>23?0:n<0?23:n:l.hour=0;var i=null!==(t=l.getSelectedDate())&&void 0!==t?t:l.focusedDate;l.setState(i.hour(null!==(e=l.hour)&&void 0!==e?e:0))})),this.$watch("minute",(function(){var t,e,n=+l.minute;Number.isInteger(n)?l.minute=n>59?0:n<0?59:n:l.minute=0;var i=null!==(t=l.getSelectedDate())&&void 0!==t?t:l.focusedDate;l.setState(i.minute(null!==(e=l.minute)&&void 0!==e?e:0))})),this.$watch("second",(function(){var t,e,n=+l.second;Number.isInteger(n)?l.second=n>59?0:n<0?59:n:l.second=0;var i=null!==(t=l.getSelectedDate())&&void 0!==t?t:l.focusedDate;l.setState(i.second(null!==(e=l.second)&&void 0!==e?e:0))})),this.$watch("state",(function(){var t,e,n,i,r,o,a=l.getSelectedDate();null!==l.maxDate&&a.isAfter(l.maxDate)&&(a=null),null!==l.minDate&&a.isBefore(l.minDate)&&(a=null),l.hour=null!==(t=null===(e=a)||void 0===e?void 0:e.hour())&&void 0!==t?t:0,l.minute=null!==(n=null===(i=a)||void 0===i?void 0:i.minute())&&void 0!==n?n:0,l.second=null!==(r=null===(o=a)||void 0===o?void 0:o.second())&&void 0!==r?r:0,l.setDisplayText()}))},clearState:function(){this.setState(null),this.closePicker()},closePicker:function(){this.open=!1},dateIsDisabled:function(t){return!(!this.maxDate||!t.isAfter(this.maxDate))||!(!this.minDate||!t.isBefore(this.minDate))},dayIsDisabled:function(t){var e;return null!==(e=this.focusedDate)&&void 0!==e||(this.focusedDate=Ll().tz(u)),this.dateIsDisabled(this.focusedDate.date(t))},dayIsSelected:function(t){var e,n=this.getSelectedDate();return null!==n&&(null!==(e=this.focusedDate)&&void 0!==e||(this.focusedDate=Ll().tz(u)),n.date()===t&&n.month()===this.focusedDate.month()&&n.year()===this.focusedDate.year())},dayIsToday:function(t){var e,n=Ll().tz(u);return null!==(e=this.focusedDate)&&void 0!==e||(this.focusedDate=n),n.date()===t&&n.month()===this.focusedDate.month()&&n.year()===this.focusedDate.year()},evaluatePosition:function(){for(var t=window.innerHeight-this.$refs.button.offsetHeight,e=this.$refs.button;e;)t-=e.offsetTop,e=e.offsetParent;this.$refs.picker.offsetHeight<=t?this.$refs.picker.style.bottom="auto":this.$refs.picker.style.bottom="".concat(this.$refs.button.offsetHeight,"px")},focusPreviousDay:function(){var t;null!==(t=this.focusedDate)&&void 0!==t||(this.focusedDate=Ll().tz(u)),this.focusedDate=this.focusedDate.subtract(1,"day")},focusPreviousWeek:function(){var t;null!==(t=this.focusedDate)&&void 0!==t||(this.focusedDate=Ll().tz(u)),this.focusedDate=this.focusedDate.subtract(1,"week")},focusNextDay:function(){var t;null!==(t=this.focusedDate)&&void 0!==t||(this.focusedDate=Ll().tz(u)),this.focusedDate=this.focusedDate.add(1,"day")},focusNextWeek:function(){var t;null!==(t=this.focusedDate)&&void 0!==t||(this.focusedDate=Ll().tz(u)),this.focusedDate=this.focusedDate.add(1,"week")},getDayLabels:function(){var t=Ll.weekdaysShort();return 0===n?t:[].concat(Gu(t.slice(n)),Gu(t.slice(0,n)))},getSelectedDate:function(){var t=Ll(this.state,i);return t.isValid()?t:null},openPicker:function(){var t,e=this;this.focusedDate=null!==(t=this.getSelectedDate())&&void 0!==t?t:Ll().tz(u),this.setupDaysGrid(),this.open=!0,this.$nextTick((function(){e.evaluatePosition()}))},selectDate:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&this.setFocusedDay(e),null!==(t=this.focusedDate)&&void 0!==t||(this.focusedDate=Ll().tz(u)),this.setState(this.focusedDate)},setDisplayText:function(){this.displayText=this.getSelectedDate()?this.getSelectedDate().format(e):""},setupDaysGrid:function(){var t;null!==(t=this.focusedDate)&&void 0!==t||(this.focusedDate=Ll().tz(u)),this.emptyDaysInFocusedMonth=Array.from({length:this.focusedDate.date(8-n).day()},(function(t,e){return e+1})),this.daysInFocusedMonth=Array.from({length:this.focusedDate.daysInMonth()},(function(t,e){return e+1}))},setFocusedDay:function(t){var e;this.focusedDate=(null!==(e=this.focusedDate)&&void 0!==e?e:Ll().tz(u)).date(t)},setState:function(t){var e,n,r;if(null===t)return this.state=null,void this.setDisplayText();this.dateIsDisabled(t)||(this.state=t.hour(null!==(e=this.hour)&&void 0!==e?e:0).minute(null!==(n=this.minute)&&void 0!==n?n:0).second(null!==(r=this.second)&&void 0!==r?r:0).format(i),this.setDisplayText())},togglePickerVisibility:function(){this.open?this.closePicker():this.openPicker()}}}))},Ul=function(t){return t instanceof HTMLElement},Gl=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=zu({},t),r=[],o=[],a=function(){return zu({},i)},s=function(){var t=[].concat(r);return r.length=0,t},u=function(){var t=[].concat(o);o.length=0,t.forEach((function(t){var e=t.type,n=t.data;l(e,n)}))},l=function(t,e,n){!n||document.hidden?(f[t]&&f[t](e),r.push({type:t,data:e})):o.push({type:t,data:e})},c=function(t){for(var e,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return d[t]?(e=d)[t].apply(e,i):null},h={getState:a,processActionQueue:s,processDispatchQueue:u,dispatch:l,query:c},d={};e.forEach((function(t){d=zu(zu({},t(i)),d)}));var f={};return n.forEach((function(t){f=zu(zu({},t(l,c,i)),f)})),h},Wl=function(t,e){for(var n in t)t.hasOwnProperty(n)&&e(n,t[n])},Hl=function(t){var e={};return Wl(t,(function(n){!function(t,e,n){"function"!=typeof n?Object.defineProperty(t,e,zu({},n)):t[e]=n}(e,n,t[n])})),e},ql=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null===n)return t.getAttribute(e)||t.hasAttribute(e);t.setAttribute(e,n)},$l="http://www.w3.org/2000/svg",Yl=["svg","path"],Xl=function(t){return Yl.includes(t)},Kl=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};"object"===$u(e)&&(n=e,e=null);var i=Xl(t)?document.createElementNS($l,t):document.createElement(t);return e&&(Xl(t)?ql(i,"class",e):i.className=e),Wl(n,(function(t,e){ql(i,t,e)})),i},Zl=function(t){return function(e,n){void 0!==n&&t.children[n]?t.insertBefore(e,t.children[n]):t.appendChild(e)}},Jl=function(t,e){return function(t,n){return void 0!==n?e.splice(n,0,t):e.push(t),t}},Ql=function(t,e){return function(n){return e.splice(e.indexOf(n),1),n.element.parentNode&&t.removeChild(n.element),n}},tc="undefined"!=typeof window&&void 0!==window.document,ec=function(){return tc},nc="children"in(ec()?Kl("svg"):{})?function(t){return t.children.length}:function(t){return t.childNodes.length},ic=function(t,e,n,i){var r=n[0]||t.left,o=n[1]||t.top,a=r+t.width,s=o+t.height*(i[1]||1),u={element:zu({},t),inner:{left:t.left,top:t.top,right:t.right,bottom:t.bottom},outer:{left:r,top:o,right:a,bottom:s}};return e.filter((function(t){return!t.isRectIgnored()})).map((function(t){return t.rect})).forEach((function(t){rc(u.inner,zu({},t.inner)),rc(u.outer,zu({},t.outer))})),oc(u.inner),u.outer.bottom+=u.element.marginBottom,u.outer.right+=u.element.marginRight,oc(u.outer),u},rc=function(t,e){e.top+=t.top,e.right+=t.left,e.bottom+=t.top,e.left+=t.left,e.bottom>t.bottom&&(t.bottom=e.bottom),e.right>t.right&&(t.right=e.right)},oc=function(t){t.width=t.right-t.left,t.height=t.bottom-t.top},ac=function(t){return"number"==typeof t},sc=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.001;return Math.abs(t-e)<i&&Math.abs(n)<i},uc=function(t){return t<.5?2*t*t:(4-2*t)*t-1},lc={spring:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.stiffness,n=void 0===e?.5:e,i=t.damping,r=void 0===i?.75:i,o=t.mass,a=void 0===o?10:o,s=null,u=null,l=0,c=!1,h=function(t,e){if(!c){if(!ac(s)||!ac(u))return c=!0,void(l=0);sc(u+=l+=-(u-s)*n/a,s,l*=r)||e?(u=s,l=0,c=!0,f.onupdate(u),f.oncomplete(u)):f.onupdate(u)}},d=function(t){if(ac(t)&&!ac(u)&&(u=t),null===s&&(s=t,u=t),u===(s=t)||void 0===s)return c=!0,l=0,f.onupdate(u),void f.oncomplete(u);c=!1},f=Hl({interpolate:h,target:{set:d,get:function(){return s}},resting:{get:function(){return c}},onupdate:function(t){},oncomplete:function(t){}});return f},tween:function(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.duration,r=void 0===i?500:i,o=n.easing,a=void 0===o?uc:o,s=n.delay,u=void 0===s?0:s,l=null,c=!0,h=!1,d=null,f=function(n,i){c||null===d||(null===l&&(l=n),n-l<u||((t=n-l-u)>=r||i?(t=1,e=h?0:1,p.onupdate(e*d),p.oncomplete(e*d),c=!0):(e=t/r,p.onupdate((t>=0?a(h?1-e:e):0)*d))))},p=Hl({interpolate:f,target:{get:function(){return h?0:d},set:function(t){if(null===d)return d=t,p.onupdate(t),void p.oncomplete(t);t<d?(d=1,h=!0):(h=!1,d=t),c=!1,l=null}},resting:{get:function(){return c}},onupdate:function(t){},oncomplete:function(t){}});return p}},cc=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];(e=Array.isArray(e)?e:[e]).forEach((function(e){t.forEach((function(t){var r=t,o=function(){return n[t]},a=function(e){return n[t]=e};"object"===$u(t)&&(r=t.key,o=t.getter||o,a=t.setter||a),e[r]&&!i||(e[r]={get:o,set:a})}))}))},hc=function(t){return null!=t},dc={opacity:1,scaleX:1,scaleY:1,translateX:0,translateY:0,rotateX:0,rotateY:0,rotateZ:0,originX:0,originY:0},fc=function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!0;for(var n in e)if(e[n]!==t[n])return!0;return!1},pc=function(t,e){var n=e.opacity,i=e.perspective,r=e.translateX,o=e.translateY,a=e.scaleX,s=e.scaleY,u=e.rotateX,l=e.rotateY,c=e.rotateZ,h=e.originX,d=e.originY,f=e.width,p=e.height,g="",m="";(hc(h)||hc(d))&&(m+="transform-origin: ".concat(h||0,"px ").concat(d||0,"px;")),hc(i)&&(g+="perspective(".concat(i,"px) ")),(hc(r)||hc(o))&&(g+="translate3d(".concat(r||0,"px, ").concat(o||0,"px, 0) ")),(hc(a)||hc(s))&&(g+="scale3d(".concat(hc(a)?a:1,", ").concat(hc(s)?s:1,", 1) ")),hc(c)&&(g+="rotateZ(".concat(c,"rad) ")),hc(u)&&(g+="rotateX(".concat(u,"rad) ")),hc(l)&&(g+="rotateY(".concat(l,"rad) ")),g.length&&(m+="transform:".concat(g,";")),hc(n)&&(m+="opacity:".concat(n,";"),0===n&&(m+="visibility:hidden;"),n<1&&(m+="pointer-events:none;")),hc(p)&&(m+="height:".concat(p,"px;")),hc(f)&&(m+="width:".concat(f,"px;"));var v=t.elementCurrentStyle||"";m.length===v.length&&m===v||(t.style.cssText=m,t.elementCurrentStyle=m)},gc={styles:function(t){var e=t.mixinConfig,n=t.viewProps,i=t.viewInternalAPI,r=t.viewExternalAPI,o=t.view,a=zu({},n),s={};cc(e,[i,r],n);var u=function(){return o.rect?ic(o.rect,o.childViews,[n.translateX||0,n.translateY||0],[n.scaleX||0,n.scaleY||0]):null};return i.rect={get:u},r.rect={get:u},e.forEach((function(t){n[t]=void 0===a[t]?dc[t]:a[t]})),{write:function(){if(fc(s,n))return pc(o.element,n),Object.assign(s,zu({},n)),!0},destroy:function(){}}},listeners:function(t){t.mixinConfig,t.viewProps,t.viewInternalAPI;var e,n=t.viewExternalAPI,i=(t.viewState,t.view),r=[],o=(e=i.element,function(t,n){e.addEventListener(t,n)}),a=function(t){return function(e,n){t.removeEventListener(e,n)}}(i.element);return n.on=function(t,e){r.push({type:t,fn:e}),o(t,e)},n.off=function(t,e){r.splice(r.findIndex((function(n){return n.type===t&&n.fn===e})),1),a(t,e)},{write:function(){return!0},destroy:function(){r.forEach((function(t){a(t.type,t.fn)}))}}},animations:function(t){var e=t.mixinConfig,n=t.viewProps,i=t.viewInternalAPI,r=t.viewExternalAPI,o=zu({},n),a=[];return Wl(e,(function(t,e){var s=function(t,e,n){var i=t[e]&&"object"===$u(t[e][n])?t[e][n]:t[e]||t,r="string"==typeof i?i:i.type,o="object"===$u(i)?zu({},i):{};return lc[r]?lc[r](o):null}(e);s&&(s.onupdate=function(e){n[t]=e},s.target=o[t],cc([{key:t,setter:function(t){s.target!==t&&(s.target=t)},getter:function(){return n[t]}}],[i,r],n,!0),a.push(s))})),{write:function(t){var e=document.hidden,n=!0;return a.forEach((function(i){i.resting||(n=!1),i.interpolate(t,e)})),n},destroy:function(){}}},apis:function(t){var e=t.mixinConfig,n=t.viewProps,i=t.viewExternalAPI;cc(e,i,n)}},mc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.layoutCalculated||(t.paddingTop=parseInt(n.paddingTop,10)||0,t.marginTop=parseInt(n.marginTop,10)||0,t.marginRight=parseInt(n.marginRight,10)||0,t.marginBottom=parseInt(n.marginBottom,10)||0,t.marginLeft=parseInt(n.marginLeft,10)||0,e.layoutCalculated=!0),t.left=e.offsetLeft||0,t.top=e.offsetTop||0,t.width=e.offsetWidth||0,t.height=e.offsetHeight||0,t.right=t.left+t.width,t.bottom=t.top+t.height,t.scrollTop=e.scrollTop,t.hidden=null===e.offsetParent,t},vc=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.tag,n=void 0===e?"div":e,i=t.name,r=void 0===i?null:i,o=t.attributes,a=void 0===o?{}:o,s=t.read,u=void 0===s?function(){}:s,l=t.write,c=void 0===l?function(){}:l,h=t.create,d=void 0===h?function(){}:h,f=t.destroy,p=void 0===f?function(){}:f,g=t.filterFrameActionsForChild,m=void 0===g?function(t,e){return e}:g,v=t.didCreateView,y=void 0===v?function(){}:v,b=t.didWriteView,_=void 0===b?function(){}:b,E=t.ignoreRect,x=void 0!==E&&E,A=t.ignoreRectUpdate,D=void 0!==A&&A,w=t.mixins,k=void 0===w?[]:w;return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=Kl(n,"filepond--".concat(r),a),o=window.getComputedStyle(i,null),s=mc(),l=null,h=!1,f=[],g=[],v={},b={},E=[c],A=[u],w=[p],T=function(){return i},C=function(){return f.concat()},S=function(){return v},I=function(t){return function(e,n){return e(t,n)}},O=function(){return l||(l=ic(s,f,[0,0],[1,1]))},R=function(){return o},M=function(){l=null,f.forEach((function(t){return t._read()})),!(D&&s.width&&s.height)&&mc(s,i,o);var t={root:V,props:e,rect:s};A.forEach((function(e){return e(t)}))},L=function(t,n,i){var r=0===n.length;return E.forEach((function(o){!1===o({props:e,root:V,actions:n,timestamp:t,shouldOptimize:i})&&(r=!1)})),g.forEach((function(e){!1===e.write(t)&&(r=!1)})),f.filter((function(t){return!!t.element.parentNode})).forEach((function(e){e._write(t,m(e,n),i)||(r=!1)})),f.forEach((function(e,o){e.element.parentNode||(V.appendChild(e.element,o),e._read(),e._write(t,m(e,n),i),r=!1)})),h=r,_({props:e,root:V,actions:n,timestamp:t}),r},P=function(){g.forEach((function(t){return t.destroy()})),w.forEach((function(t){t({root:V,props:e})})),f.forEach((function(t){return t._destroy()}))},F={element:{get:T},style:{get:R},childViews:{get:C}},B=zu(zu({},F),{},{rect:{get:O},ref:{get:S},is:function(t){return r===t},appendChild:Zl(i),createChildView:I(t),linkView:function(t){return f.push(t),t},unlinkView:function(t){f.splice(f.indexOf(t),1)},appendChildView:Jl(0,f),removeChildView:Ql(i,f),registerWriter:function(t){return E.push(t)},registerReader:function(t){return A.push(t)},registerDestroyer:function(t){return w.push(t)},invalidateLayout:function(){return i.layoutCalculated=!1},dispatch:t.dispatch,query:t.query}),N={element:{get:T},childViews:{get:C},rect:{get:O},resting:{get:function(){return h}},isRectIgnored:function(){return x},_read:M,_write:L,_destroy:P},j=zu(zu({},F),{},{rect:{get:function(){return s}}});Object.keys(k).sort((function(t,e){return"styles"===t?1:"styles"===e?-1:0})).forEach((function(t){var n=gc[t]({mixinConfig:k[t],viewProps:e,viewState:b,viewInternalAPI:B,viewExternalAPI:N,view:Hl(j)});n&&g.push(n)}));var V=Hl(B);d({root:V,props:e});var z=nc(i);return f.forEach((function(t,e){V.appendChild(t.element,z+e)})),y(V),Hl(N)}},yc=function(t,e){return function(n){var i=n.root,r=n.props,o=n.actions,a=void 0===o?[]:o,s=n.timestamp,u=n.shouldOptimize;a.filter((function(e){return t[e.type]})).forEach((function(e){return t[e.type]({root:i,props:r,action:e.data,timestamp:s,shouldOptimize:u})})),e&&e({root:i,props:r,actions:a,timestamp:s,shouldOptimize:u})}},bc=function(t,e){return e.parentNode.insertBefore(t,e)},_c=function(t,e){return e.parentNode.insertBefore(t,e.nextSibling)},Ec=function(t){return Array.isArray(t)},xc=function(t){return null==t},Ac=function(t){return t.trim()},Dc=function(t){return""+t},wc=function(t){return"boolean"==typeof t},kc=function(t){return wc(t)?t:"true"===t},Tc=function(t){return"string"==typeof t},Cc=function(t){return ac(t)?t:Tc(t)?Dc(t).replace(/[a-z]+/gi,""):0},Sc=function(t){return parseInt(Cc(t),10)},Ic=function(t){return parseFloat(Cc(t))},Oc=function(t){return ac(t)&&isFinite(t)&&Math.floor(t)===t},Rc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if(Oc(t))return t;var n=Dc(t).trim();return/MB$/i.test(n)?(n=n.replace(/MB$i/,"").trim(),Sc(n)*e*e):/KB/i.test(n)?(n=n.replace(/KB$i/,"").trim(),Sc(n)*e):Sc(n)},Mc=function(t){return"function"==typeof t},Lc={process:"POST",patch:"PATCH",revert:"DELETE",fetch:"GET",restore:"GET",load:"GET"},Pc=function(t,e,n,i,r){if(null===e)return null;if("function"==typeof e)return e;var o={url:"GET"===n||"PATCH"===n?"?".concat(t,"="):"",method:n,headers:r,withCredentials:!1,timeout:i,onload:null,ondata:null,onerror:null};if(Tc(e))return o.url=e,o;if(Object.assign(o,e),Tc(o.headers)){var a=o.headers.split(/:(.+)/);o.headers={header:a[0],value:a[1]}}return o.withCredentials=kc(o.withCredentials),o},Fc=function(t){return"object"===$u(t)&&null!==t},Bc=function(t){return Ec(t)?"array":function(t){return null===t}(t)?"null":Oc(t)?"int":/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(t)?"bytes":function(t){return Fc(t)&&Tc(t.url)&&Fc(t.process)&&Fc(t.revert)&&Fc(t.restore)&&Fc(t.fetch)}(t)?"api":$u(t)},Nc={array:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return xc(t)?[]:Ec(t)?t:Dc(t).split(e).map(Ac).filter((function(t){return t.length}))},boolean:kc,int:function(t){return"bytes"===Bc(t)?Rc(t):Sc(t)},number:Ic,float:Ic,bytes:Rc,string:function(t){return Mc(t)?t:Dc(t)},function:function(t){return function(t){for(var e=self,n=t.split("."),i=null;i=n.shift();)if(!(e=e[i]))return null;return e}(t)},serverapi:function(t){return(n={}).url=Tc(e=t)?e:e.url||"",n.timeout=e.timeout?parseInt(e.timeout,10):0,n.headers=e.headers?e.headers:{},Wl(Lc,(function(t){n[t]=Pc(t,e[t],Lc[t],n.timeout,n.headers)})),n.process=e.process||Tc(e)||e.url?n.process:null,n.remove=e.remove||null,delete n.headers,n;var e,n},object:function(t){try{return JSON.parse(t.replace(/{\s*'/g,'{"').replace(/'\s*}/g,'"}').replace(/'\s*:/g,'":').replace(/:\s*'/g,':"').replace(/,\s*'/g,',"').replace(/'\s*,/g,'",'))}catch(t){return null}}},jc=function(t,e,n){if(t===e)return t;var i,r=Bc(t);if(r!==n){var o=(i=t,Nc[n](i));if(r=Bc(o),null===o)throw'Trying to assign value with incorrect type to "'.concat(option,'", allowed type: "').concat(n,'"');t=o}return t},Vc=function(t){var e={};return Wl(t,(function(n){var i,r,o,a=t[n];e[n]=(i=a[0],r=a[1],o=i,{enumerable:!0,get:function(){return o},set:function(t){o=jc(t,i,r)}})})),Hl(e)},zc=function(t){return{items:[],listUpdateTimeout:null,itemUpdateTimeout:null,processingQueue:[],options:Vc(t)}},Uc=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return t.split(/(?=[A-Z])/).map((function(t){return t.toLowerCase()})).join(e)},Gc=function(t,e){var n={};return Wl(e,(function(e){n[e]={get:function(){return t.getState().options[e]},set:function(n){t.dispatch("SET_".concat(Uc(e,"_").toUpperCase()),{value:n})}}})),n},Wc=function(t){return function(e,n,i){var r={};return Wl(t,(function(t){var n=Uc(t,"_").toUpperCase();r["SET_".concat(n)]=function(r){try{i.options[t]=r.value}catch(t){}e("DID_SET_".concat(n),{value:i.options[t]})}})),r}},Hc=function(t){return function(e){var n={};return Wl(t,(function(t){n["GET_".concat(Uc(t,"_").toUpperCase())]=function(n){return e.options[t]}})),n}},qc=1,$c=2,Yc=3,Xc=4,Kc=5,Zc=function(){return Math.random().toString(36).substr(2,9)},Jc=function(t,e){return t.splice(e,1)},Qc=function(){var t=[],e=function(e,n){Jc(t,t.findIndex((function(t){return t.event===e&&(t.cb===n||!n)})))},n=function(e,n,i){t.filter((function(t){return t.event===e})).map((function(t){return t.cb})).forEach((function(t){return function(t,e){e?t():document.hidden?Promise.resolve(1).then(t):setTimeout(t,0)}((function(){return t.apply(void 0,Gu(n))}),i)}))};return{fireSync:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];n(t,i,!0)},fire:function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];n(t,i,!1)},on:function(e,n){t.push({event:e,cb:n})},onOnce:function(n,i){t.push({event:n,cb:function(){e(n,i),i.apply(void 0,arguments)}})},off:e}},th=function(t,e,n){Object.getOwnPropertyNames(t).filter((function(t){return!n.includes(t)})).forEach((function(n){return Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))},eh=["fire","process","revert","load","on","off","onOnce","retryLoad","extend","archive","archived","release","released","requestProcessing","freeze"],nh=function(t){var e={};return th(t,e,eh),e},ih=function(t){t.forEach((function(e,n){e.released&&Jc(t,n)}))},rh={INIT:1,IDLE:2,PROCESSING_QUEUED:9,PROCESSING:3,PROCESSING_COMPLETE:5,PROCESSING_ERROR:6,PROCESSING_REVERT_ERROR:10,LOADING:7,LOAD_ERROR:8},oh={INPUT:1,LIMBO:2,LOCAL:3},ah=function(t){return/[^0-9]+/.exec(t)},sh=function(){return ah(1.1.toLocaleString())[0]},uh={BOOLEAN:"boolean",INT:"int",NUMBER:"number",STRING:"string",ARRAY:"array",OBJECT:"object",FUNCTION:"function",ACTION:"action",SERVER_API:"serverapi",REGEX:"regex"},lh=[],ch=function(t,e,n){return new Promise((function(i,r){var o=lh.filter((function(e){return e.key===t})).map((function(t){return t.cb}));if(0!==o.length){var a=o.shift();o.reduce((function(t,e){return t.then((function(t){return e(t,n)}))}),a(e,n)).then((function(t){return i(t)})).catch((function(t){return r(t)}))}else i(e)}))},hh=function(t,e,n){return lh.filter((function(e){return e.key===t})).map((function(t){return t.cb(e,n)}))},dh=function(t,e){return lh.push({key:t,cb:e})},fh=function(){return zu({},ph)},ph={id:[null,uh.STRING],name:["filepond",uh.STRING],disabled:[!1,uh.BOOLEAN],className:[null,uh.STRING],required:[!1,uh.BOOLEAN],captureMethod:[null,uh.STRING],allowSyncAcceptAttribute:[!0,uh.BOOLEAN],allowDrop:[!0,uh.BOOLEAN],allowBrowse:[!0,uh.BOOLEAN],allowPaste:[!0,uh.BOOLEAN],allowMultiple:[!1,uh.BOOLEAN],allowReplace:[!0,uh.BOOLEAN],allowRevert:[!0,uh.BOOLEAN],allowRemove:[!0,uh.BOOLEAN],allowProcess:[!0,uh.BOOLEAN],allowReorder:[!1,uh.BOOLEAN],allowDirectoriesOnly:[!1,uh.BOOLEAN],storeAsFile:[!1,uh.BOOLEAN],forceRevert:[!1,uh.BOOLEAN],maxFiles:[null,uh.INT],checkValidity:[!1,uh.BOOLEAN],itemInsertLocationFreedom:[!0,uh.BOOLEAN],itemInsertLocation:["before",uh.STRING],itemInsertInterval:[75,uh.INT],dropOnPage:[!1,uh.BOOLEAN],dropOnElement:[!0,uh.BOOLEAN],dropValidation:[!1,uh.BOOLEAN],ignoredFiles:[[".ds_store","thumbs.db","desktop.ini"],uh.ARRAY],instantUpload:[!0,uh.BOOLEAN],maxParallelUploads:[2,uh.INT],allowMinimumUploadDuration:[!0,uh.BOOLEAN],chunkUploads:[!1,uh.BOOLEAN],chunkForce:[!1,uh.BOOLEAN],chunkSize:[5e6,uh.INT],chunkRetryDelays:[[500,1e3,3e3],uh.ARRAY],server:[null,uh.SERVER_API],fileSizeBase:[1e3,uh.INT],labelFileSizeBytes:["bytes",uh.STRING],labelFileSizeKilobytes:["KB",uh.STRING],labelFileSizeMegabytes:["MB",uh.STRING],labelFileSizeGigabytes:["GB",uh.STRING],labelDecimalSeparator:[sh(),uh.STRING],labelThousandsSeparator:[(jl=sh(),Vl=1e3.toLocaleString(),Vl!==1e3.toString()?ah(Vl)[0]:"."===jl?",":"."),uh.STRING],labelIdle:['Drag & Drop your files or <span class="filepond--label-action">Browse</span>',uh.STRING],labelInvalidField:["Field contains invalid files",uh.STRING],labelFileWaitingForSize:["Waiting for size",uh.STRING],labelFileSizeNotAvailable:["Size not available",uh.STRING],labelFileCountSingular:["file in list",uh.STRING],labelFileCountPlural:["files in list",uh.STRING],labelFileLoading:["Loading",uh.STRING],labelFileAdded:["Added",uh.STRING],labelFileLoadError:["Error during load",uh.STRING],labelFileRemoved:["Removed",uh.STRING],labelFileRemoveError:["Error during remove",uh.STRING],labelFileProcessing:["Uploading",uh.STRING],labelFileProcessingComplete:["Upload complete",uh.STRING],labelFileProcessingAborted:["Upload cancelled",uh.STRING],labelFileProcessingError:["Error during upload",uh.STRING],labelFileProcessingRevertError:["Error during revert",uh.STRING],labelTapToCancel:["tap to cancel",uh.STRING],labelTapToRetry:["tap to retry",uh.STRING],labelTapToUndo:["tap to undo",uh.STRING],labelButtonRemoveItem:["Remove",uh.STRING],labelButtonAbortItemLoad:["Abort",uh.STRING],labelButtonRetryItemLoad:["Retry",uh.STRING],labelButtonAbortItemProcessing:["Cancel",uh.STRING],labelButtonUndoItemProcessing:["Undo",uh.STRING],labelButtonRetryItemProcessing:["Retry",uh.STRING],labelButtonProcessItem:["Upload",uh.STRING],iconRemove:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M11.586 13l-2.293 2.293a1 1 0 0 0 1.414 1.414L13 14.414l2.293 2.293a1 1 0 0 0 1.414-1.414L14.414 13l2.293-2.293a1 1 0 0 0-1.414-1.414L13 11.586l-2.293-2.293a1 1 0 0 0-1.414 1.414L11.586 13z" fill="currentColor" fill-rule="nonzero"/></svg>',uh.STRING],iconProcess:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M14 10.414v3.585a1 1 0 0 1-2 0v-3.585l-1.293 1.293a1 1 0 0 1-1.414-1.415l3-3a1 1 0 0 1 1.414 0l3 3a1 1 0 0 1-1.414 1.415L14 10.414zM9 18a1 1 0 0 1 0-2h8a1 1 0 0 1 0 2H9z" fill="currentColor" fill-rule="evenodd"/></svg>',uh.STRING],iconRetry:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M10.81 9.185l-.038.02A4.997 4.997 0 0 0 8 13.683a5 5 0 0 0 5 5 5 5 0 0 0 5-5 1 1 0 0 1 2 0A7 7 0 1 1 9.722 7.496l-.842-.21a.999.999 0 1 1 .484-1.94l3.23.806c.535.133.86.675.73 1.21l-.804 3.233a.997.997 0 0 1-1.21.73.997.997 0 0 1-.73-1.21l.23-.928v-.002z" fill="currentColor" fill-rule="nonzero"/></svg>',uh.STRING],iconUndo:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M9.185 10.81l.02-.038A4.997 4.997 0 0 1 13.683 8a5 5 0 0 1 5 5 5 5 0 0 1-5 5 1 1 0 0 0 0 2A7 7 0 1 0 7.496 9.722l-.21-.842a.999.999 0 1 0-1.94.484l.806 3.23c.133.535.675.86 1.21.73l3.233-.803a.997.997 0 0 0 .73-1.21.997.997 0 0 0-1.21-.73l-.928.23-.002-.001z" fill="currentColor" fill-rule="nonzero"/></svg>',uh.STRING],iconDone:['<svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M18.293 9.293a1 1 0 0 1 1.414 1.414l-7.002 7a1 1 0 0 1-1.414 0l-3.998-4a1 1 0 1 1 1.414-1.414L12 15.586l6.294-6.293z" fill="currentColor" fill-rule="nonzero"/></svg>',uh.STRING],oninit:[null,uh.FUNCTION],onwarning:[null,uh.FUNCTION],onerror:[null,uh.FUNCTION],onactivatefile:[null,uh.FUNCTION],oninitfile:[null,uh.FUNCTION],onaddfilestart:[null,uh.FUNCTION],onaddfileprogress:[null,uh.FUNCTION],onaddfile:[null,uh.FUNCTION],onprocessfilestart:[null,uh.FUNCTION],onprocessfileprogress:[null,uh.FUNCTION],onprocessfileabort:[null,uh.FUNCTION],onprocessfilerevert:[null,uh.FUNCTION],onprocessfile:[null,uh.FUNCTION],onprocessfiles:[null,uh.FUNCTION],onremovefile:[null,uh.FUNCTION],onpreparefile:[null,uh.FUNCTION],onupdatefiles:[null,uh.FUNCTION],onreorderfiles:[null,uh.FUNCTION],beforeDropFile:[null,uh.FUNCTION],beforeAddFile:[null,uh.FUNCTION],beforeRemoveFile:[null,uh.FUNCTION],beforePrepareFile:[null,uh.FUNCTION],stylePanelLayout:[null,uh.STRING],stylePanelAspectRatio:[null,uh.STRING],styleItemPanelAspectRatio:[null,uh.STRING],styleButtonRemoveItemPosition:["left",uh.STRING],styleButtonProcessItemPosition:["right",uh.STRING],styleLoadIndicatorPosition:["right",uh.STRING],styleProgressIndicatorPosition:["right",uh.STRING],styleButtonRemoveItemAlign:[!1,uh.BOOLEAN],files:[[],uh.ARRAY],credits:[["https://pqina.nl/","Powered by PQINA"],uh.ARRAY]},gh=function(t,e){return xc(e)?t[0]||null:Oc(e)?t[e]||null:("object"===$u(e)&&(e=e.id),t.find((function(t){return t.id===e}))||null)},mh=function(t){if(xc(t))return t;if(/:/.test(t)){var e=t.split(":");return e[1]/e[0]}return parseFloat(t)},vh=function(t){return t.filter((function(t){return!t.archived}))},yh={EMPTY:0,IDLE:1,ERROR:2,BUSY:3,READY:4},bh=null,_h=[rh.LOAD_ERROR,rh.PROCESSING_ERROR,rh.PROCESSING_REVERT_ERROR],Eh=[rh.LOADING,rh.PROCESSING,rh.PROCESSING_QUEUED,rh.INIT],xh=[rh.PROCESSING_COMPLETE],Ah=function(t){return _h.includes(t.status)},Dh=function(t){return Eh.includes(t.status)},wh=function(t){return xh.includes(t.status)},kh=function(t){return Fc(t.options.server)&&(Fc(t.options.server.process)||Mc(t.options.server.process))},Th=function(t){return{GET_STATUS:function(){var e=vh(t.items),n=yh.EMPTY,i=yh.ERROR,r=yh.BUSY,o=yh.IDLE,a=yh.READY;return 0===e.length?n:e.some(Ah)?i:e.some(Dh)?r:e.some(wh)?a:o},GET_ITEM:function(e){return gh(t.items,e)},GET_ACTIVE_ITEM:function(e){return gh(vh(t.items),e)},GET_ACTIVE_ITEMS:function(){return vh(t.items)},GET_ITEMS:function(){return t.items},GET_ITEM_NAME:function(e){var n=gh(t.items,e);return n?n.filename:null},GET_ITEM_SIZE:function(e){var n=gh(t.items,e);return n?n.fileSize:null},GET_STYLES:function(){return Object.keys(t.options).filter((function(t){return/^style/.test(t)})).map((function(e){return{name:e,value:t.options[e]}}))},GET_PANEL_ASPECT_RATIO:function(){return/circle/.test(t.options.stylePanelLayout)?1:mh(t.options.stylePanelAspectRatio)},GET_ITEM_PANEL_ASPECT_RATIO:function(){return t.options.styleItemPanelAspectRatio},GET_ITEMS_BY_STATUS:function(e){return vh(t.items).filter((function(t){return t.status===e}))},GET_TOTAL_ITEMS:function(){return vh(t.items).length},SHOULD_UPDATE_FILE_INPUT:function(){return t.options.storeAsFile&&function(){if(null===bh)try{var t=new DataTransfer;t.items.add(new File(["hello world"],"This_Works.txt"));var e=document.createElement("input");e.setAttribute("type","file"),e.files=t.files,bh=1===e.files.length}catch(t){bh=!1}return bh}()&&!kh(t)},IS_ASYNC:function(){return kh(t)},GET_FILE_SIZE_LABELS:function(t){return{labelBytes:t("GET_LABEL_FILE_SIZE_BYTES")||void 0,labelKilobytes:t("GET_LABEL_FILE_SIZE_KILOBYTES")||void 0,labelMegabytes:t("GET_LABEL_FILE_SIZE_MEGABYTES")||void 0,labelGigabytes:t("GET_LABEL_FILE_SIZE_GIGABYTES")||void 0}}}},Ch=function(t,e,n){return Math.max(Math.min(n,t),e)},Sh=function(t){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i.test(t)},Ih=function(t){return t.split("/").pop().split("?").shift()},Oh=function(t){return t.split(".").pop()},Rh=function(t){if("string"!=typeof t)return"";var e=t.split("/").pop();return/svg/.test(e)?"svg":/zip|compressed/.test(e)?"zip":/plain/.test(e)?"txt":/msword/.test(e)?"doc":/[a-z]+/.test(e)?"jpeg"===e?"jpg":e:""},Mh=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(e+t).slice(-e.length)},Lh=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;return"".concat(t.getFullYear(),"-").concat(Mh(t.getMonth()+1,"00"),"-").concat(Mh(t.getDate(),"00"),"_").concat(Mh(t.getHours(),"00"),"-").concat(Mh(t.getMinutes(),"00"),"-").concat(Mh(t.getSeconds(),"00"))},Ph=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r="string"==typeof n?t.slice(0,t.size,n):t.slice(0,t.size,t.type);return r.lastModifiedDate=new Date,t._relativePath&&(r._relativePath=t._relativePath),Tc(e)||(e=Lh()),e&&null===i&&Oh(e)?r.name=e:(i=i||Rh(r.type),r.name=e+(i?"."+i:"")),r},Fh=function(t,e){var n=window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(n){var i=new n;return i.append(t),i.getBlob(e)}return new Blob([t],{type:e})},Bh=function(t){return(/^data:(.+);/.exec(t)||[])[1]||null},Nh=function(t){var e=Bh(t),n=function(t){return atob(function(t){return t.split(",")[1].replace(/\s/g,"")}(t))}(t);return function(t,e){for(var n=new ArrayBuffer(t.length),i=new Uint8Array(n),r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return Fh(n,e)}(n,e)},jh=function(t){if(!/^content-disposition:/i.test(t))return null;var e=t.split(/filename=|filename\*=.+''/).splice(1).map((function(t){return t.trim().replace(/^["']|[;"']{0,2}$/g,"")})).filter((function(t){return t.length}));return e.length?decodeURI(e[e.length-1]):null},Vh=function(t){if(/content-length:/i.test(t)){var e=t.match(/[0-9]+/)[0];return e?parseInt(e,10):null}return null},zh=function(t){return/x-content-transfer-id:/i.test(t)&&(t.split(":")[1]||"").trim()||null},Uh=function(t){var e,n={source:null,name:null,size:null},i=Wu(t.split("\n"));try{for(i.s();!(e=i.n()).done;){var r=e.value,o=jh(r);if(o)n.name=o;else{var a=Vh(r);if(a)n.size=a;else{var s=zh(r);s&&(n.source=s)}}}}catch(t){i.e(t)}finally{i.f()}return n},Gh=function(t){var e={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},n=function(n){t?(e.timestamp=Date.now(),e.request=t(n,(function(t){e.duration=Date.now()-e.timestamp,e.complete=!0,t instanceof Blob&&(t=Ph(t,t.name||Ih(n))),i.fire("load",t instanceof Blob?t:t?t.body:null)}),(function(t){i.fire("error","string"==typeof t?{type:"error",code:0,body:t}:t)}),(function(t,n,r){r&&(e.size=r),e.duration=Date.now()-e.timestamp,t?(e.progress=n/r,i.fire("progress",e.progress)):e.progress=null}),(function(){i.fire("abort")}),(function(t){var n=Uh("string"==typeof t?t:t.headers);i.fire("meta",{size:e.size||n.size,filename:n.name,source:n.source})}))):i.fire("error",{type:"error",body:"Can't load URL",code:400})},i=zu(zu({},Qc()),{},{setSource:function(t){return e.source=t},getProgress:function(){return e.progress},abort:function(){e.request&&e.request.abort&&e.request.abort()},load:function(){var t,r,o=e.source;i.fire("init",o),o instanceof File?i.fire("load",o):o instanceof Blob?i.fire("load",Ph(o,o.name)):Sh(o)?i.fire("load",Ph(Nh(o),t,null,r)):n(o)}});return i},Wh=function(t){return/GET|HEAD/.test(t)},Hh=function(t,e,n){var i={onheaders:function(){},onprogress:function(){},onload:function(){},ontimeout:function(){},onerror:function(){},onabort:function(){},abort:function(){r=!0,a.abort()}},r=!1,o=!1;n=zu({method:"POST",headers:{},withCredentials:!1},n),e=encodeURI(e),Wh(n.method)&&t&&(e="".concat(e).concat(encodeURIComponent("string"==typeof t?t:JSON.stringify(t))));var a=new XMLHttpRequest;return(Wh(n.method)?a:a.upload).onprogress=function(t){r||i.onprogress(t.lengthComputable,t.loaded,t.total)},a.onreadystatechange=function(){a.readyState<2||4===a.readyState&&0===a.status||o||(o=!0,i.onheaders(a))},a.onload=function(){a.status>=200&&a.status<300?i.onload(a):i.onerror(a)},a.onerror=function(){return i.onerror(a)},a.onabort=function(){r=!0,i.onabort()},a.ontimeout=function(){return i.ontimeout(a)},a.open(n.method,e,!0),Oc(n.timeout)&&(a.timeout=n.timeout),Object.keys(n.headers).forEach((function(t){var e=unescape(encodeURIComponent(n.headers[t]));a.setRequestHeader(t,e)})),n.responseType&&(a.responseType=n.responseType),n.withCredentials&&(a.withCredentials=!0),a.send(t),i},qh=function(t,e,n,i){return{type:t,code:e,body:n,headers:i}},$h=function(t){return function(e){t(qh("error",0,"Timeout",e.getAllResponseHeaders()))}},Yh=function(t){return/\?/.test(t)},Xh=function(){for(var t="",e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return n.forEach((function(e){t+=Yh(t)&&Yh(e)?e.replace(/\?/,"&"):e})),t},Kh=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if("function"==typeof e)return e;if(!e||!Tc(e.url))return null;var n=e.onload||function(t){return t},i=e.onerror||function(t){return null};return function(r,o,a,s,u,l){var c=Hh(r,Xh(t,e.url),zu(zu({},e),{},{responseType:"blob"}));return c.onload=function(t){var i=t.getAllResponseHeaders(),a=Uh(i).name||Ih(r);o(qh("load",t.status,"HEAD"===e.method?null:Ph(n(t.response),a),i))},c.onerror=function(t){a(qh("error",t.status,i(t.response)||t.statusText,t.getAllResponseHeaders()))},c.onheaders=function(t){l(qh("headers",t.status,null,t.getAllResponseHeaders()))},c.ontimeout=$h(a),c.onprogress=s,c.onabort=u,c}},Zh=0,Jh=1,Qh=2,td=3,ed=4,nd=function(t,e,n,i,r,o,a,s,u,l,c){for(var h=[],d=c.chunkTransferId,f=c.chunkServer,p=c.chunkSize,g=c.chunkRetryDelays,m={serverId:d,aborted:!1},v=e.ondata||function(t){return t},y=e.onload||function(t,e){return"HEAD"===e?t.getResponseHeader("Upload-Offset"):t.response},b=e.onerror||function(t){return null},_=Math.floor(i.size/p),E=0;E<=_;E++){var x=E*p,A=i.slice(x,x+p,"application/offset+octet-stream");h[E]={index:E,size:A.size,offset:x,data:A,file:i,progress:0,retries:Gu(g),status:Zh,error:null,request:null,timeout:null}}var D,w,k,T,C=function(t){return t.status===Zh||t.status===td},S=function(e){if(!m.aborted)if(e=e||h.find(C)){e.status=Qh,e.progress=null;var n=f.ondata||function(t){return t},r=f.onerror||function(t){return null},s=Xh(t,f.url,m.serverId),l="function"==typeof f.headers?f.headers(e):zu(zu({},f.headers),{},{"Content-Type":"application/offset+octet-stream","Upload-Offset":e.offset,"Upload-Length":i.size,"Upload-Name":i.name}),c=e.request=Hh(n(e.data),s,zu(zu({},f),{},{headers:l}));c.onload=function(){e.status=Jh,e.request=null,R()},c.onprogress=function(t,n,i){e.progress=t?n:null,O()},c.onerror=function(t){e.status=td,e.request=null,e.error=r(t.response)||t.statusText,I(e)||a(qh("error",t.status,r(t.response)||t.statusText,t.getAllResponseHeaders()))},c.ontimeout=function(t){e.status=td,e.request=null,I(e)||$h(a)(t)},c.onabort=function(){e.status=Zh,e.request=null,u()}}else h.every((function(t){return t.status===Jh}))&&o(m.serverId)},I=function(t){return 0!==t.retries.length&&(t.status=ed,clearTimeout(t.timeout),t.timeout=setTimeout((function(){S(t)}),t.retries.shift()),!0)},O=function(){var t=h.reduce((function(t,e){return null===t||null===e.progress?null:t+e.progress}),0);if(null===t)return s(!1,0,0);var e=h.reduce((function(t,e){return t+e.size}),0);s(!0,t,e)},R=function(){h.filter((function(t){return t.status===Qh})).length>=1||S()};return m.serverId?(D=function(t){m.aborted||(h.filter((function(e){return e.offset<t})).forEach((function(t){t.status=Jh,t.progress=t.size})),R())},w=Xh(t,f.url,m.serverId),k={headers:"function"==typeof e.headers?e.headers(m.serverId):zu({},e.headers),method:"HEAD"},(T=Hh(null,w,k)).onload=function(t){return D(y(t,k.method))},T.onerror=function(t){return a(qh("error",t.status,b(t.response)||t.statusText,t.getAllResponseHeaders()))},T.ontimeout=$h(a)):function(o){var s=new FormData;Fc(r)&&s.append(n,JSON.stringify(r));var u="function"==typeof e.headers?e.headers(i,r):zu(zu({},e.headers),{},{"Upload-Length":i.size}),l=zu(zu({},e),{},{headers:u}),c=Hh(v(s),Xh(t,e.url),l);c.onload=function(t){return o(y(t,l.method))},c.onerror=function(t){return a(qh("error",t.status,b(t.response)||t.statusText,t.getAllResponseHeaders()))},c.ontimeout=$h(a)}((function(t){m.aborted||(l(t),m.serverId=t,R())})),{abort:function(){m.aborted=!0,h.forEach((function(t){clearTimeout(t.timeout),t.request&&t.request.abort()}))}}},id=function(t,e,n,i){return function(r,o,a,s,u,l,c){if(r){var h=i.chunkUploads,d=h&&r.size>i.chunkSize,f=h&&(d||i.chunkForce);if(r instanceof Blob&&f)return nd(t,e,n,r,o,a,s,u,l,c,i);var p=e.ondata||function(t){return t},g=e.onload||function(t){return t},m=e.onerror||function(t){return null},v="function"==typeof e.headers?e.headers(r,o)||{}:zu({},e.headers),y=zu(zu({},e),{},{headers:v}),b=new FormData;Fc(o)&&b.append(n,JSON.stringify(o)),(r instanceof Blob?[{name:null,file:r}]:r).forEach((function(t){b.append(n,t.file,null===t.name?t.file.name:"".concat(t.name).concat(t.file.name))}));var _=Hh(p(b),Xh(t,e.url),y);return _.onload=function(t){a(qh("load",t.status,g(t.response),t.getAllResponseHeaders()))},_.onerror=function(t){s(qh("error",t.status,m(t.response)||t.statusText,t.getAllResponseHeaders()))},_.ontimeout=$h(s),_.onprogress=u,_.onabort=l,_}}},rd=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0;if("function"==typeof e)return e;if(!e||!Tc(e.url))return function(t,e){return e()};var n=e.onload||function(t){return t},i=e.onerror||function(t){return null};return function(r,o,a){var s=Hh(r,t+e.url,e);return s.onload=function(t){o(qh("load",t.status,n(t.response),t.getAllResponseHeaders()))},s.onerror=function(t){a(qh("error",t.status,i(t.response)||t.statusText,t.getAllResponseHeaders()))},s.ontimeout=$h(a),s}},od=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t+Math.random()*(e-t)},ad=function(t,e){var n={complete:!1,perceivedProgress:0,perceivedPerformanceUpdater:null,progress:null,timestamp:null,perceivedDuration:0,duration:0,request:null,response:null},i=e.allowMinimumUploadDuration,r=function(){n.request&&(n.perceivedPerformanceUpdater.clear(),n.request.abort&&n.request.abort(),n.complete=!0)},o=i?function(){return n.progress?Math.min(n.progress,n.perceivedProgress):null}:function(){return n.progress||null},a=i?function(){return Math.min(n.duration,n.perceivedDuration)}:function(){return n.duration},s=zu(zu({},Qc()),{},{process:function(e,r){var o=function(){0!==n.duration&&null!==n.progress&&s.fire("progress",s.getProgress())},a=function(){n.complete=!0,s.fire("load-perceived",n.response.body)};s.fire("start"),n.timestamp=Date.now(),n.perceivedPerformanceUpdater=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:25,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,r=null,o=Date.now(),a=function a(){var s=Date.now()-o,u=od(n,i);s+u>e&&(u=s+u-e);var l=s/e;l>=1||document.hidden?t(1):(t(l),r=setTimeout(a,u))};return e>0&&a(),{clear:function(){clearTimeout(r)}}}((function(t){n.perceivedProgress=t,n.perceivedDuration=Date.now()-n.timestamp,o(),n.response&&1===n.perceivedProgress&&!n.complete&&a()}),i?od(750,1500):0),n.request=t(e,r,(function(t){n.response=Fc(t)?t:{type:"load",code:200,body:"".concat(t),headers:{}},n.duration=Date.now()-n.timestamp,n.progress=1,s.fire("load",n.response.body),(!i||i&&1===n.perceivedProgress)&&a()}),(function(t){n.perceivedPerformanceUpdater.clear(),s.fire("error",Fc(t)?t:{type:"error",code:0,body:"".concat(t)})}),(function(t,e,i){n.duration=Date.now()-n.timestamp,n.progress=t?e/i:null,o()}),(function(){n.perceivedPerformanceUpdater.clear(),s.fire("abort",n.response?n.response.body:null)}),(function(t){s.fire("transfer",t)}))},abort:r,getProgress:o,getDuration:a,reset:function(){r(),n.complete=!1,n.perceivedProgress=0,n.progress=0,n.timestamp=null,n.perceivedDuration=0,n.duration=0,n.request=null,n.response=null}});return s},sd=function(t){return t.substr(0,t.lastIndexOf("."))||t},ud=function(t){var e=[t.name,t.size,t.type];return t instanceof Blob||Sh(t)?e[0]=t.name||Lh():Sh(t)?(e[1]=t.length,e[2]=Bh(t)):Tc(t)&&(e[0]=Ih(t),e[1]=0,e[2]="application/octet-stream"),{name:e[0],size:e[1],type:e[2]}},ld=function(t){return!!(t instanceof File||t instanceof Blob&&t.name)},cd=function t(e){if(!Fc(e))return e;var n=Ec(e)?[]:{};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];n[i]=r&&Fc(r)?t(r):r}return n},hd=function(t,e){var n=function(t,e){return xc(e)?0:Tc(e)?t.findIndex((function(t){return t.id===e})):-1}(t,e);if(!(n<0))return t[n]||null},dd=function(t,e,n,i,r,o){var a=Hh(null,t,{method:"GET",responseType:"blob"});return a.onload=function(n){var i=n.getAllResponseHeaders(),r=Uh(i).name||Ih(t);e(qh("load",n.status,Ph(n.response,r),i))},a.onerror=function(t){n(qh("error",t.status,t.statusText,t.getAllResponseHeaders()))},a.onheaders=function(t){o(qh("headers",t.status,null,t.getAllResponseHeaders()))},a.ontimeout=$h(n),a.onprogress=i,a.onabort=r,a},fd=function(t){return 0===t.indexOf("//")&&(t=location.protocol+t),t.toLowerCase().replace("blob:","").replace(/([a-z])?:\/\//,"$1").split("/")[0]},pd=function(t){return function(){return Mc(t)?t.apply(void 0,arguments):t}},gd=function(t,e){clearTimeout(e.listUpdateTimeout),e.listUpdateTimeout=setTimeout((function(){t("DID_UPDATE_ITEMS",{items:vh(e.items)})}),0)},md=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return new Promise((function(e){if(!t)return e(!0);var i=t.apply(void 0,n);return null==i?e(!0):"boolean"==typeof i?e(i):void("function"==typeof i.then&&i.then(e))}))},vd=function(t,e){t.items.sort((function(t,n){return e(nh(t),nh(n))}))},yd=function(t,e){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.query,r=n.success,o=void 0===r?function(){}:r,a=n.failure,s=void 0===a?function(){}:a,u=ju(n,Eu),l=gh(t.items,i);l?e(l,o,s,u||{}):s({error:qh("error",0,"Item not found"),file:null})}},bd=function(t,e,n){return{ABORT_ALL:function(){vh(n.items).forEach((function(t){t.freeze(),t.abortLoad(),t.abortProcessing()}))},DID_SET_FILES:function(e){var i=e.value,r=(void 0===i?[]:i).map((function(t){return{source:t.source?t.source:t,options:t.options}})),o=vh(n.items);o.forEach((function(e){r.find((function(t){return t.source===e.source||t.source===e.file}))||t("REMOVE_ITEM",{query:e,remove:!1})})),o=vh(n.items),r.forEach((function(e,n){o.find((function(t){return t.source===e.source||t.file===e.source}))||t("ADD_ITEM",zu(zu({},e),{},{interactionMethod:Kc,index:n}))}))},DID_UPDATE_ITEM_METADATA:function(i){var r=i.id,o=i.action,a=i.change;a.silent||(clearTimeout(n.itemUpdateTimeout),n.itemUpdateTimeout=setTimeout((function(){var i=hd(n.items,r);if(e("IS_ASYNC")){i.origin===oh.LOCAL&&t("DID_LOAD_ITEM",{id:i.id,error:null,serverFileReference:i.source});var s,u=function(){setTimeout((function(){t("REQUEST_ITEM_PROCESSING",{query:r})}),32)};return i.status===rh.PROCESSING_COMPLETE?(s=n.options.instantUpload,void i.revert(rd(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then(s?u:function(){}).catch((function(){}))):i.status===rh.PROCESSING?function(t){i.abortProcessing().then(t?u:function(){})}(n.options.instantUpload):void(n.options.instantUpload&&u())}ch("SHOULD_PREPARE_OUTPUT",!1,{item:i,query:e,action:o,change:a}).then((function(n){var o=e("GET_BEFORE_PREPARE_FILE");o&&(n=o(i,n)),n&&t("REQUEST_PREPARE_OUTPUT",{query:r,item:i,success:function(e){t("DID_PREPARE_OUTPUT",{id:r,file:e})}},!0)}))}),0))},MOVE_ITEM:function(t){var e=t.query,i=t.index,r=gh(n.items,e);if(r){var o=n.items.indexOf(r);o!==(i=Ch(i,0,n.items.length-1))&&n.items.splice(i,0,n.items.splice(o,1)[0])}},SORT:function(i){var r=i.compare;vd(n,r),t("DID_SORT_ITEMS",{items:e("GET_ACTIVE_ITEMS")})},ADD_ITEMS:function(n){var i=n.items,r=n.index,o=n.interactionMethod,a=n.success,s=void 0===a?function(){}:a,u=n.failure,l=void 0===u?function(){}:u,c=r;if(-1===r||void 0===r){var h=e("GET_ITEM_INSERT_LOCATION"),d=e("GET_TOTAL_ITEMS");c="before"===h?0:d}var f=e("GET_IGNORED_FILES"),p=i.filter((function(t){return ld(t)?!f.includes(t.name.toLowerCase()):!xc(t)})).map((function(e){return new Promise((function(n,i){t("ADD_ITEM",{interactionMethod:o,source:e.source||e,success:n,failure:i,index:c++,options:e.options||{}})}))}));Promise.all(p).then(s).catch(l)},ADD_ITEM:function(i){var r=i.source,o=i.index,a=void 0===o?-1:o,s=i.interactionMethod,u=i.success,l=void 0===u?function(){}:u,c=i.failure,h=void 0===c?function(){}:c,d=i.options,f=void 0===d?{}:d;if(xc(r))h({error:qh("error",0,"No source"),file:null});else if(!ld(r)||!n.options.ignoredFiles.includes(r.name.toLowerCase())){if(!function(t){var e=vh(t.items).length;if(!t.options.allowMultiple)return 0===e;var n=t.options.maxFiles;return null===n||e<n}(n)){if(n.options.allowMultiple||!n.options.allowMultiple&&!n.options.allowReplace){var p=qh("warning",0,"Max files");return t("DID_THROW_MAX_FILES",{source:r,error:p}),void h({error:p,file:null})}var g=vh(n.items)[0];if(g.status===rh.PROCESSING_COMPLETE||g.status===rh.PROCESSING_REVERT_ERROR){var m=e("GET_FORCE_REVERT");if(g.revert(rd(n.options.server.url,n.options.server.revert),m).then((function(){m&&t("ADD_ITEM",{source:r,index:a,interactionMethod:s,success:l,failure:h,options:f})})).catch((function(){})),m)return}t("REMOVE_ITEM",{query:g.id})}var v="local"===f.type?oh.LOCAL:"limbo"===f.type?oh.LIMBO:oh.INPUT,y=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=Zc(),r={archived:!1,frozen:!1,released:!1,source:null,file:n,serverFileReference:e,transferId:null,processingAborted:!1,status:e?rh.PROCESSING_COMPLETE:rh.INIT,activeLoader:null,activeProcessor:null},o=null,a={},s=function(t){return r.status=t},u=function(t){if(!r.released&&!r.frozen){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];p.fire.apply(p,[t].concat(n))}},l=function(e,n,i){r.source=e,p.fireSync("init"),r.file?p.fireSync("load-skip"):(r.file=ud(e),n.on("init",(function(){u("load-init")})),n.on("meta",(function(e){r.file.size=e.size,r.file.filename=e.filename,e.source&&(t=oh.LIMBO,r.serverFileReference=e.source,r.status=rh.PROCESSING_COMPLETE),u("load-meta")})),n.on("progress",(function(t){s(rh.LOADING),u("load-progress",t)})),n.on("error",(function(t){s(rh.LOAD_ERROR),u("load-request-error",t)})),n.on("abort",(function(){s(rh.INIT),u("load-abort")})),n.on("load",(function(e){r.activeLoader=null;var n=function(e){r.file=ld(e)?e:r.file,t===oh.LIMBO&&r.serverFileReference?s(rh.PROCESSING_COMPLETE):s(rh.IDLE),u("load")};r.serverFileReference?n(e):i(e,n,(function(t){r.file=e,u("load-meta"),s(rh.LOAD_ERROR),u("load-file-error",t)}))})),n.setSource(e),r.activeLoader=n,n.load())},c=function t(e,n){if(r.processingAborted)r.processingAborted=!1;else if(s(rh.PROCESSING),o=null,r.file instanceof Blob){e.on("load",(function(t){r.transferId=null,r.serverFileReference=t})),e.on("transfer",(function(t){r.transferId=t})),e.on("load-perceived",(function(t){r.activeProcessor=null,r.transferId=null,r.serverFileReference=t,s(rh.PROCESSING_COMPLETE),u("process-complete",t)})),e.on("start",(function(){u("process-start")})),e.on("error",(function(t){r.activeProcessor=null,s(rh.PROCESSING_ERROR),u("process-error",t)})),e.on("abort",(function(t){r.activeProcessor=null,r.serverFileReference=t,s(rh.IDLE),u("process-abort"),o&&o()})),e.on("progress",(function(t){u("process-progress",t)}));var i=console.error;n(r.file,(function(t){r.archived||e.process(t,zu({},a))}),i),r.activeProcessor=e}else p.on("load",(function(){t(e,n)}))},h=function(){return new Promise((function(t){if(!r.activeProcessor)return r.processingAborted=!0,s(rh.IDLE),u("process-abort"),void t();o=function(){t()},r.activeProcessor.abort()}))},d=function(t,e){return new Promise((function(n,i){var o=null!==r.serverFileReference?r.serverFileReference:r.transferId;null!==o?(t(o,(function(){r.serverFileReference=null,r.transferId=null,n()}),(function(t){e?(s(rh.PROCESSING_REVERT_ERROR),u("process-revert-error"),i(t)):n()})),s(rh.IDLE),u("process-revert")):n()}))},f=function(t,e,n){var i=t.split("."),r=i[0],o=i.pop(),s=a;i.forEach((function(t){return s=s[t]})),JSON.stringify(s[o])!==JSON.stringify(e)&&(s[o]=e,u("metadata-update",{key:r,value:a[r],silent:n}))},p=zu(zu({id:{get:function(){return i}},origin:{get:function(){return t},set:function(e){return t=e}},serverId:{get:function(){return r.serverFileReference}},transferId:{get:function(){return r.transferId}},status:{get:function(){return r.status}},filename:{get:function(){return r.file.name}},filenameWithoutExtension:{get:function(){return sd(r.file.name)}},fileExtension:{get:function(){return Oh(r.file.name)}},fileType:{get:function(){return r.file.type}},fileSize:{get:function(){return r.file.size}},file:{get:function(){return r.file}},relativePath:{get:function(){return r.file._relativePath}},source:{get:function(){return r.source}},getMetadata:function(t){return cd(t?a[t]:a)},setMetadata:function(t,e,n){if(Fc(t)){var i=t;return Object.keys(i).forEach((function(t){f(t,i[t],e)})),t}return f(t,e,n),e},extend:function(t,e){return g[t]=e},abortLoad:function(){r.activeLoader?r.activeLoader.abort():(s(rh.INIT),u("load-abort"))},retryLoad:function(){r.activeLoader&&r.activeLoader.load()},requestProcessing:function(){r.processingAborted=!1,s(rh.PROCESSING_QUEUED)},abortProcessing:h,load:l,process:c,revert:d},Qc()),{},{freeze:function(){return r.frozen=!0},release:function(){return r.released=!0},released:{get:function(){return r.released}},archive:function(){return r.archived=!0},archived:{get:function(){return r.archived}}}),g=Hl(p);return g}(v,v===oh.INPUT?null:r,f.file);Object.keys(f.metadata||{}).forEach((function(t){y.setMetadata(t,f.metadata[t])})),hh("DID_CREATE_ITEM",y,{query:e,dispatch:t});var b=e("GET_ITEM_INSERT_LOCATION");n.options.itemInsertLocationFreedom||(a="before"===b?-1:n.items.length),function(t,e,n){xc(e)||(void 0===n?t.push(e):function(t,e,n){t.splice(e,0,n)}(t,n=Ch(n,0,t.length),e))}(n.items,y,a),Mc(b)&&r&&vd(n,b);var _=y.id;y.on("init",(function(){t("DID_INIT_ITEM",{id:_})})),y.on("load-init",(function(){t("DID_START_ITEM_LOAD",{id:_})})),y.on("load-meta",(function(){t("DID_UPDATE_ITEM_META",{id:_})})),y.on("load-progress",(function(e){t("DID_UPDATE_ITEM_LOAD_PROGRESS",{id:_,progress:e})})),y.on("load-request-error",(function(e){var i=pd(n.options.labelFileLoadError)(e);if(e.code>=400&&e.code<500)return t("DID_THROW_ITEM_INVALID",{id:_,error:e,status:{main:i,sub:"".concat(e.code," (").concat(e.body,")")}}),void h({error:e,file:nh(y)});t("DID_THROW_ITEM_LOAD_ERROR",{id:_,error:e,status:{main:i,sub:n.options.labelTapToRetry}})})),y.on("load-file-error",(function(e){t("DID_THROW_ITEM_INVALID",{id:_,error:e.status,status:e.status}),h({error:e.status,file:nh(y)})})),y.on("load-abort",(function(){t("REMOVE_ITEM",{query:_})})),y.on("load-skip",(function(){t("COMPLETE_LOAD_ITEM",{query:_,item:y,data:{source:r,success:l}})})),y.on("load",(function(){var i=function(i){i?(y.on("metadata-update",(function(e){t("DID_UPDATE_ITEM_METADATA",{id:_,change:e})})),ch("SHOULD_PREPARE_OUTPUT",!1,{item:y,query:e}).then((function(i){var o=e("GET_BEFORE_PREPARE_FILE");o&&(i=o(y,i));var a=function(){t("COMPLETE_LOAD_ITEM",{query:_,item:y,data:{source:r,success:l}}),gd(t,n)};i?t("REQUEST_PREPARE_OUTPUT",{query:_,item:y,success:function(e){t("DID_PREPARE_OUTPUT",{id:_,file:e}),a()}},!0):a()}))):t("REMOVE_ITEM",{query:_})};ch("DID_LOAD_ITEM",y,{query:e,dispatch:t}).then((function(){md(e("GET_BEFORE_ADD_FILE"),nh(y)).then(i)})).catch((function(e){if(!e||!e.error||!e.status)return i(!1);t("DID_THROW_ITEM_INVALID",{id:_,error:e.error,status:e.status})}))})),y.on("process-start",(function(){t("DID_START_ITEM_PROCESSING",{id:_})})),y.on("process-progress",(function(e){t("DID_UPDATE_ITEM_PROCESS_PROGRESS",{id:_,progress:e})})),y.on("process-error",(function(e){t("DID_THROW_ITEM_PROCESSING_ERROR",{id:_,error:e,status:{main:pd(n.options.labelFileProcessingError)(e),sub:n.options.labelTapToRetry}})})),y.on("process-revert-error",(function(e){t("DID_THROW_ITEM_PROCESSING_REVERT_ERROR",{id:_,error:e,status:{main:pd(n.options.labelFileProcessingRevertError)(e),sub:n.options.labelTapToRetry}})})),y.on("process-complete",(function(e){t("DID_COMPLETE_ITEM_PROCESSING",{id:_,error:null,serverFileReference:e}),t("DID_DEFINE_VALUE",{id:_,value:e})})),y.on("process-abort",(function(){t("DID_ABORT_ITEM_PROCESSING",{id:_})})),y.on("process-revert",(function(){t("DID_REVERT_ITEM_PROCESSING",{id:_}),t("DID_DEFINE_VALUE",{id:_,value:null})})),t("DID_ADD_ITEM",{id:_,index:a,interactionMethod:s}),gd(t,n);var E=n.options.server||{},x=E.url,A=E.load,D=E.restore,w=E.fetch;y.load(r,Gh(v===oh.INPUT?Tc(r)&&function(t){return(t.indexOf(":")>-1||t.indexOf("//")>-1)&&fd(location.href)!==fd(t)}(r)&&w?Kh(x,w):dd:Kh(x,v===oh.LIMBO?D:A)),(function(t,n,i){ch("LOAD_FILE",t,{query:e}).then(n).catch(i)}))}},REQUEST_PREPARE_OUTPUT:function(t){var n=t.item,i=t.success,r=t.failure,o=void 0===r?function(){}:r,a={error:qh("error",0,"Item not found"),file:null};if(n.archived)return o(a);ch("PREPARE_OUTPUT",n.file,{query:e,item:n}).then((function(t){ch("COMPLETE_PREPARE_OUTPUT",t,{query:e,item:n}).then((function(t){if(n.archived)return o(a);i(t)}))}))},COMPLETE_LOAD_ITEM:function(i){var r=i.item,o=i.data,a=o.success,s=o.source,u=e("GET_ITEM_INSERT_LOCATION");if(Mc(u)&&s&&vd(n,u),t("DID_LOAD_ITEM",{id:r.id,error:null,serverFileReference:r.origin===oh.INPUT?null:s}),a(nh(r)),r.origin!==oh.LOCAL)return r.origin===oh.LIMBO?(t("DID_COMPLETE_ITEM_PROCESSING",{id:r.id,error:null,serverFileReference:s}),void t("DID_DEFINE_VALUE",{id:r.id,value:r.serverId||s})):void(e("IS_ASYNC")&&n.options.instantUpload&&t("REQUEST_ITEM_PROCESSING",{query:r.id}));t("DID_LOAD_LOCAL_ITEM",{id:r.id})},RETRY_ITEM_LOAD:yd(n,(function(t){t.retryLoad()})),REQUEST_ITEM_PREPARE:yd(n,(function(e,n,i){t("REQUEST_PREPARE_OUTPUT",{query:e.id,item:e,success:function(i){t("DID_PREPARE_OUTPUT",{id:e.id,file:i}),n({file:e,output:i})},failure:i},!0)})),REQUEST_ITEM_PROCESSING:yd(n,(function(i,r,o){if(i.status===rh.IDLE||i.status===rh.PROCESSING_ERROR)i.status!==rh.PROCESSING_QUEUED&&(i.requestProcessing(),t("DID_REQUEST_ITEM_PROCESSING",{id:i.id}),t("PROCESS_ITEM",{query:i,success:r,failure:o},!0));else{var a=function(){return t("REQUEST_ITEM_PROCESSING",{query:i,success:r,failure:o})},s=function(){return document.hidden?a():setTimeout(a,32)};i.status===rh.PROCESSING_COMPLETE||i.status===rh.PROCESSING_REVERT_ERROR?i.revert(rd(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then(s).catch((function(){})):i.status===rh.PROCESSING&&i.abortProcessing().then(s)}})),PROCESS_ITEM:yd(n,(function(i,r,o){var a=e("GET_MAX_PARALLEL_UPLOADS");if(e("GET_ITEMS_BY_STATUS",rh.PROCESSING).length!==a){if(i.status!==rh.PROCESSING){var s=function e(){var i=n.processingQueue.shift();if(i){var r=i.id,o=i.success,a=i.failure,s=gh(n.items,r);s&&!s.archived?t("PROCESS_ITEM",{query:r,success:o,failure:a},!0):e()}};i.onOnce("process-complete",(function(){r(nh(i)),s();var o=n.options.server;if(n.options.instantUpload&&i.origin===oh.LOCAL&&Mc(o.remove)){var a=function(){};i.origin=oh.LIMBO,n.options.server.remove(i.source,a,a)}e("GET_ITEMS_BY_STATUS",rh.PROCESSING_COMPLETE).length===n.items.length&&t("DID_COMPLETE_ITEM_PROCESSING_ALL")})),i.onOnce("process-error",(function(t){o({error:t,file:nh(i)}),s()}));var u=n.options;i.process(ad(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;return"function"==typeof e?function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return e.apply(void 0,[n].concat(r,[i]))}:e&&Tc(e.url)?id(t,e,n,i):null}(u.server.url,u.server.process,u.name,{chunkTransferId:i.transferId,chunkServer:u.server.patch,chunkUploads:u.chunkUploads,chunkForce:u.chunkForce,chunkSize:u.chunkSize,chunkRetryDelays:u.chunkRetryDelays}),{allowMinimumUploadDuration:e("GET_ALLOW_MINIMUM_UPLOAD_DURATION")}),(function(n,r,o){ch("PREPARE_OUTPUT",n,{query:e,item:i}).then((function(e){t("DID_PREPARE_OUTPUT",{id:i.id,file:e}),r(e)})).catch(o)}))}}else n.processingQueue.push({id:i.id,success:r,failure:o})})),RETRY_ITEM_PROCESSING:yd(n,(function(e){t("REQUEST_ITEM_PROCESSING",{query:e})})),REQUEST_REMOVE_ITEM:yd(n,(function(n){md(e("GET_BEFORE_REMOVE_FILE"),nh(n)).then((function(e){e&&t("REMOVE_ITEM",{query:n})}))})),RELEASE_ITEM:yd(n,(function(t){t.release()})),REMOVE_ITEM:yd(n,(function(i,r,o,a){var s=function(){var e=i.id;hd(n.items,e).archive(),t("DID_REMOVE_ITEM",{error:null,id:e,item:i}),gd(t,n),r(nh(i))},u=n.options.server;i.origin===oh.LOCAL&&u&&Mc(u.remove)&&!1!==a.remove?(t("DID_START_ITEM_REMOVE",{id:i.id}),u.remove(i.source,(function(){return s()}),(function(e){t("DID_THROW_ITEM_REMOVE_ERROR",{id:i.id,error:qh("error",0,e,null),status:{main:pd(n.options.labelFileRemoveError)(e),sub:n.options.labelTapToRetry}})}))):((a.revert&&i.origin!==oh.LOCAL&&null!==i.serverId||n.options.chunkUploads&&i.file.size>n.options.chunkSize||n.options.chunkUploads&&n.options.chunkForce)&&i.revert(rd(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")),s())})),ABORT_ITEM_LOAD:yd(n,(function(t){t.abortLoad()})),ABORT_ITEM_PROCESSING:yd(n,(function(e){e.serverId?t("REVERT_ITEM_PROCESSING",{id:e.id}):e.abortProcessing().then((function(){n.options.instantUpload&&t("REMOVE_ITEM",{query:e.id})}))})),REQUEST_REVERT_ITEM_PROCESSING:yd(n,(function(i){if(n.options.instantUpload){var r=function(e){e&&t("REVERT_ITEM_PROCESSING",{query:i})},o=e("GET_BEFORE_REMOVE_FILE");if(!o)return r(!0);var a=o(nh(i));return null==a?r(!0):"boolean"==typeof a?r(a):void("function"==typeof a.then&&a.then(r))}t("REVERT_ITEM_PROCESSING",{query:i})})),REVERT_ITEM_PROCESSING:yd(n,(function(i){i.revert(rd(n.options.server.url,n.options.server.revert),e("GET_FORCE_REVERT")).then((function(){var e=n.options.instantUpload||function(t){return!ld(t.file)}(i);e&&t("REMOVE_ITEM",{query:i.id})})).catch((function(){}))})),SET_OPTIONS:function(e){var n=e.options,i=Object.keys(n),r=_d.filter((function(t){return i.includes(t)}));[].concat(Gu(r),Gu(Object.keys(n).filter((function(t){return!r.includes(t)})))).forEach((function(e){t("SET_".concat(Uc(e,"_").toUpperCase()),{value:n[e]})}))}}},_d=["server"],Ed=function(t){return document.createElement(t)},xd=function(t,e){var n=t.childNodes[0];n?e!==n.nodeValue&&(n.nodeValue=e):(n=document.createTextNode(e),t.appendChild(n))},Ad=function(t,e,n,i){var r=(i%360-90)*Math.PI/180;return{x:t+n*Math.cos(r),y:e+n*Math.sin(r)}},Dd=function(t,e,n,i,r){var o=1;return r>i&&r-i<=.5&&(o=0),i>r&&i-r>=.5&&(o=0),function(t,e,n,i,r,o){var a=Ad(t,e,n,r),s=Ad(t,e,n,i);return["M",a.x,a.y,"A",n,n,0,o,0,s.x,s.y].join(" ")}(t,e,n,360*Math.min(.9999,i),360*Math.min(.9999,r),o)},wd=vc({tag:"div",name:"progress-indicator",ignoreRectUpdate:!0,ignoreRect:!0,create:function(t){var e=t.root,n=t.props;n.spin=!1,n.progress=0,n.opacity=0;var i=Kl("svg");e.ref.path=Kl("path",{"stroke-width":2,"stroke-linecap":"round"}),i.appendChild(e.ref.path),e.ref.svg=i,e.appendChild(i)},write:function(t){var e=t.root,n=t.props;if(0!==n.opacity){n.align&&(e.element.dataset.align=n.align);var i=parseInt(ql(e.ref.path,"stroke-width"),10),r=.5*e.rect.element.width,o=0,a=0;n.spin?(o=0,a=.5):(o=0,a=n.progress);var s=Dd(r,r,r-i,o,a);ql(e.ref.path,"d",s),ql(e.ref.path,"stroke-opacity",n.spin||n.progress>0?1:0)}},mixins:{apis:["progress","spin","align"],styles:["opacity"],animations:{opacity:{type:"tween",duration:500},progress:{type:"spring",stiffness:.95,damping:.65,mass:10}}}}),kd=vc({tag:"button",attributes:{type:"button"},ignoreRect:!0,ignoreRectUpdate:!0,name:"file-action-button",mixins:{apis:["label"],styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}},listeners:!0},create:function(t){var e=t.root,n=t.props;e.element.innerHTML=(n.icon||"")+"<span>".concat(n.label,"</span>"),n.isDisabled=!1},write:function(t){var e=t.root,n=t.props,i=n.isDisabled,r=e.query("GET_DISABLED")||0===n.opacity;r&&!i?(n.isDisabled=!0,ql(e.element,"disabled","disabled")):!r&&i&&(n.isDisabled=!1,e.element.removeAttribute("disabled"))}}),Td=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.labelBytes,o=void 0===r?"bytes":r,a=i.labelKilobytes,s=void 0===a?"KB":a,u=i.labelMegabytes,l=void 0===u?"MB":u,c=i.labelGigabytes,h=void 0===c?"GB":c,d=n,f=n*n,p=n*n*n;return(t=Math.round(Math.abs(t)))<d?"".concat(t," ").concat(o):t<f?"".concat(Math.floor(t/d)," ").concat(s):t<p?"".concat(Cd(t/f,1,e)," ").concat(l):"".concat(Cd(t/p,2,e)," ").concat(h)},Cd=function(t,e,n){return t.toFixed(e).split(".").filter((function(t){return"0"!==t})).join(n)},Sd=function(t){var e=t.root,n=t.props;xd(e.ref.fileSize,Td(e.query("GET_ITEM_SIZE",n.id),".",e.query("GET_FILE_SIZE_BASE"),e.query("GET_FILE_SIZE_LABELS",e.query))),xd(e.ref.fileName,e.query("GET_ITEM_NAME",n.id))},Id=function(t){var e=t.root,n=t.props;Oc(e.query("GET_ITEM_SIZE",n.id))?Sd({root:e,props:n}):xd(e.ref.fileSize,e.query("GET_LABEL_FILE_SIZE_NOT_AVAILABLE"))},Od=vc({name:"file-info",ignoreRect:!0,ignoreRectUpdate:!0,write:yc({DID_LOAD_ITEM:Sd,DID_UPDATE_ITEM_META:Sd,DID_THROW_ITEM_LOAD_ERROR:Id,DID_THROW_ITEM_INVALID:Id}),didCreateView:function(t){hh("CREATE_VIEW",zu(zu({},t),{},{view:t}))},create:function(t){var e=t.root,n=t.props,i=Ed("span");i.className="filepond--file-info-main",ql(i,"aria-hidden","true"),e.appendChild(i),e.ref.fileName=i;var r=Ed("span");r.className="filepond--file-info-sub",e.appendChild(r),e.ref.fileSize=r,xd(r,e.query("GET_LABEL_FILE_WAITING_FOR_SIZE")),xd(i,e.query("GET_ITEM_NAME",n.id))},mixins:{styles:["translateX","translateY"],animations:{translateX:"spring",translateY:"spring"}}}),Rd=function(t){return Math.round(100*t)},Md=function(t){var e=t.root,n=t.action,i=null===n.progress?e.query("GET_LABEL_FILE_LOADING"):"".concat(e.query("GET_LABEL_FILE_LOADING")," ").concat(Rd(n.progress),"%");xd(e.ref.main,i),xd(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))},Ld=function(t){var e=t.root;xd(e.ref.main,""),xd(e.ref.sub,"")},Pd=function(t){var e=t.root,n=t.action;xd(e.ref.main,n.status.main),xd(e.ref.sub,n.status.sub)},Fd=vc({name:"file-status",ignoreRect:!0,ignoreRectUpdate:!0,write:yc({DID_LOAD_ITEM:Ld,DID_REVERT_ITEM_PROCESSING:Ld,DID_REQUEST_ITEM_PROCESSING:function(t){var e=t.root;xd(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING")),xd(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))},DID_ABORT_ITEM_PROCESSING:function(t){var e=t.root;xd(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_ABORTED")),xd(e.ref.sub,e.query("GET_LABEL_TAP_TO_RETRY"))},DID_COMPLETE_ITEM_PROCESSING:function(t){var e=t.root;xd(e.ref.main,e.query("GET_LABEL_FILE_PROCESSING_COMPLETE")),xd(e.ref.sub,e.query("GET_LABEL_TAP_TO_UNDO"))},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(t){var e=t.root,n=t.action,i=null===n.progress?e.query("GET_LABEL_FILE_PROCESSING"):"".concat(e.query("GET_LABEL_FILE_PROCESSING")," ").concat(Rd(n.progress),"%");xd(e.ref.main,i),xd(e.ref.sub,e.query("GET_LABEL_TAP_TO_CANCEL"))},DID_UPDATE_ITEM_LOAD_PROGRESS:Md,DID_THROW_ITEM_LOAD_ERROR:Pd,DID_THROW_ITEM_INVALID:Pd,DID_THROW_ITEM_PROCESSING_ERROR:Pd,DID_THROW_ITEM_PROCESSING_REVERT_ERROR:Pd,DID_THROW_ITEM_REMOVE_ERROR:Pd}),didCreateView:function(t){hh("CREATE_VIEW",zu(zu({},t),{},{view:t}))},create:function(t){var e=t.root,n=Ed("span");n.className="filepond--file-status-main",e.appendChild(n),e.ref.main=n;var i=Ed("span");i.className="filepond--file-status-sub",e.appendChild(i),e.ref.sub=i,Md({root:e,action:{progress:null}})},mixins:{styles:["translateX","translateY","opacity"],animations:{opacity:{type:"tween",duration:250},translateX:"spring",translateY:"spring"}}}),Bd={AbortItemLoad:{label:"GET_LABEL_BUTTON_ABORT_ITEM_LOAD",action:"ABORT_ITEM_LOAD",className:"filepond--action-abort-item-load",align:"LOAD_INDICATOR_POSITION"},RetryItemLoad:{label:"GET_LABEL_BUTTON_RETRY_ITEM_LOAD",action:"RETRY_ITEM_LOAD",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-load",align:"BUTTON_PROCESS_ITEM_POSITION"},RemoveItem:{label:"GET_LABEL_BUTTON_REMOVE_ITEM",action:"REQUEST_REMOVE_ITEM",icon:"GET_ICON_REMOVE",className:"filepond--action-remove-item",align:"BUTTON_REMOVE_ITEM_POSITION"},ProcessItem:{label:"GET_LABEL_BUTTON_PROCESS_ITEM",action:"REQUEST_ITEM_PROCESSING",icon:"GET_ICON_PROCESS",className:"filepond--action-process-item",align:"BUTTON_PROCESS_ITEM_POSITION"},AbortItemProcessing:{label:"GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING",action:"ABORT_ITEM_PROCESSING",className:"filepond--action-abort-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RetryItemProcessing:{label:"GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING",action:"RETRY_ITEM_PROCESSING",icon:"GET_ICON_RETRY",className:"filepond--action-retry-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"},RevertItemProcessing:{label:"GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING",action:"REQUEST_REVERT_ITEM_PROCESSING",icon:"GET_ICON_UNDO",className:"filepond--action-revert-item-processing",align:"BUTTON_PROCESS_ITEM_POSITION"}},Nd=[];
  /*!
   * FilePond 4.30.3
   * Licensed under MIT, https://opensource.org/licenses/MIT/
   * Please visit https://pqina.nl/filepond/ for details.
   */Wl(Bd,(function(t){Nd.push(t)}));var jd,Vd=function(t){if("right"===Wd(t))return 0;var e=t.ref.buttonRemoveItem.rect.element;return e.hidden?null:e.width+e.left},zd=function(t){return t.ref.buttonAbortItemLoad.rect.element.width},Ud=function(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.height/4)},Gd=function(t){return Math.floor(t.ref.buttonRemoveItem.rect.element.left/2)},Wd=function(t){return t.query("GET_STYLE_BUTTON_REMOVE_ITEM_POSITION")},Hd={buttonAbortItemLoad:{opacity:0},buttonRetryItemLoad:{opacity:0},buttonRemoveItem:{opacity:0},buttonProcessItem:{opacity:0},buttonAbortItemProcessing:{opacity:0},buttonRetryItemProcessing:{opacity:0},buttonRevertItemProcessing:{opacity:0},loadProgressIndicator:{opacity:0,align:function(t){return t.query("GET_STYLE_LOAD_INDICATOR_POSITION")}},processProgressIndicator:{opacity:0,align:function(t){return t.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}},processingCompleteIndicator:{opacity:0,scaleX:.75,scaleY:.75},info:{translateX:0,translateY:0,opacity:0},status:{translateX:0,translateY:0,opacity:0}},qd={buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Vd},status:{translateX:Vd}},$d={buttonAbortItemProcessing:{opacity:1},processProgressIndicator:{opacity:1},status:{opacity:1}},Yd={DID_THROW_ITEM_INVALID:{buttonRemoveItem:{opacity:1},info:{translateX:Vd},status:{translateX:Vd,opacity:1}},DID_START_ITEM_LOAD:{buttonAbortItemLoad:{opacity:1},loadProgressIndicator:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_LOAD_ERROR:{buttonRetryItemLoad:{opacity:1},buttonRemoveItem:{opacity:1},info:{translateX:Vd},status:{opacity:1}},DID_START_ITEM_REMOVE:{processProgressIndicator:{opacity:1,align:Wd},info:{translateX:Vd},status:{opacity:0}},DID_THROW_ITEM_REMOVE_ERROR:{processProgressIndicator:{opacity:0,align:Wd},buttonRemoveItem:{opacity:1},info:{translateX:Vd},status:{opacity:1,translateX:Vd}},DID_LOAD_ITEM:qd,DID_LOAD_LOCAL_ITEM:{buttonRemoveItem:{opacity:1},info:{translateX:Vd},status:{translateX:Vd}},DID_START_ITEM_PROCESSING:$d,DID_REQUEST_ITEM_PROCESSING:$d,DID_UPDATE_ITEM_PROCESS_PROGRESS:$d,DID_COMPLETE_ITEM_PROCESSING:{buttonRevertItemProcessing:{opacity:1},info:{opacity:1},status:{opacity:1}},DID_THROW_ITEM_PROCESSING_ERROR:{buttonRemoveItem:{opacity:1},buttonRetryItemProcessing:{opacity:1},status:{opacity:1},info:{translateX:Vd}},DID_THROW_ITEM_PROCESSING_REVERT_ERROR:{buttonRevertItemProcessing:{opacity:1},status:{opacity:1},info:{opacity:1}},DID_ABORT_ITEM_PROCESSING:{buttonRemoveItem:{opacity:1},buttonProcessItem:{opacity:1},info:{translateX:Vd},status:{opacity:1}},DID_REVERT_ITEM_PROCESSING:qd},Xd=vc({create:function(t){var e=t.root;e.element.innerHTML=e.query("GET_ICON_DONE")},name:"processing-complete-indicator",ignoreRect:!0,mixins:{styles:["scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",opacity:{type:"tween",duration:250}}}}),Kd=yc({DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING:function(t){var e=t.root,n=t.action;e.ref.buttonAbortItemProcessing.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD:function(t){var e=t.root,n=t.action;e.ref.buttonAbortItemLoad.label=n.value},DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL:function(t){var e=t.root,n=t.action;e.ref.buttonAbortItemRemoval.label=n.value},DID_REQUEST_ITEM_PROCESSING:function(t){var e=t.root;e.ref.processProgressIndicator.spin=!0,e.ref.processProgressIndicator.progress=0},DID_START_ITEM_LOAD:function(t){var e=t.root;e.ref.loadProgressIndicator.spin=!0,e.ref.loadProgressIndicator.progress=0},DID_START_ITEM_REMOVE:function(t){var e=t.root;e.ref.processProgressIndicator.spin=!0,e.ref.processProgressIndicator.progress=0},DID_UPDATE_ITEM_LOAD_PROGRESS:function(t){var e=t.root,n=t.action;e.ref.loadProgressIndicator.spin=!1,e.ref.loadProgressIndicator.progress=n.progress},DID_UPDATE_ITEM_PROCESS_PROGRESS:function(t){var e=t.root,n=t.action;e.ref.processProgressIndicator.spin=!1,e.ref.processProgressIndicator.progress=n.progress}}),Zd=vc({create:function(t){var e,n=t.root,i=t.props,r=Object.keys(Bd).reduce((function(t,e){return t[e]=zu({},Bd[e]),t}),{}),o=i.id,a=n.query("GET_ALLOW_REVERT"),s=n.query("GET_ALLOW_REMOVE"),u=n.query("GET_ALLOW_PROCESS"),l=n.query("GET_INSTANT_UPLOAD"),c=n.query("IS_ASYNC"),h=n.query("GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN");c?u&&!a?e=function(t){return!/RevertItemProcessing/.test(t)}:!u&&a?e=function(t){return!/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(t)}:u||a||(e=function(t){return!/Process/.test(t)}):e=function(t){return!/Process/.test(t)};var d=e?Nd.filter(e):Nd.concat();if(l&&a&&(r.RevertItemProcessing.label="GET_LABEL_BUTTON_REMOVE_ITEM",r.RevertItemProcessing.icon="GET_ICON_REMOVE"),c&&!a){var f=Yd.DID_COMPLETE_ITEM_PROCESSING;f.info.translateX=Gd,f.info.translateY=Ud,f.status.translateY=Ud,f.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}if(c&&!u&&(["DID_START_ITEM_PROCESSING","DID_REQUEST_ITEM_PROCESSING","DID_UPDATE_ITEM_PROCESS_PROGRESS","DID_THROW_ITEM_PROCESSING_ERROR"].forEach((function(t){Yd[t].status.translateY=Ud})),Yd.DID_THROW_ITEM_PROCESSING_ERROR.status.translateX=zd),h&&a){r.RevertItemProcessing.align="BUTTON_REMOVE_ITEM_POSITION";var p=Yd.DID_COMPLETE_ITEM_PROCESSING;p.info.translateX=Vd,p.status.translateY=Ud,p.processingCompleteIndicator={opacity:1,scaleX:1,scaleY:1}}s||(r.RemoveItem.disabled=!0),Wl(r,(function(t,e){var i=n.createChildView(kd,{label:n.query(e.label),icon:n.query(e.icon),opacity:0});d.includes(t)&&n.appendChildView(i),e.disabled&&(i.element.setAttribute("disabled","disabled"),i.element.setAttribute("hidden","hidden")),i.element.dataset.align=n.query("GET_STYLE_".concat(e.align)),i.element.classList.add(e.className),i.on("click",(function(t){t.stopPropagation(),e.disabled||n.dispatch(e.action,{query:o})})),n.ref["button".concat(t)]=i})),n.ref.processingCompleteIndicator=n.appendChildView(n.createChildView(Xd)),n.ref.processingCompleteIndicator.element.dataset.align=n.query("GET_STYLE_BUTTON_PROCESS_ITEM_POSITION"),n.ref.info=n.appendChildView(n.createChildView(Od,{id:o})),n.ref.status=n.appendChildView(n.createChildView(Fd,{id:o}));var g=n.appendChildView(n.createChildView(wd,{opacity:0,align:n.query("GET_STYLE_LOAD_INDICATOR_POSITION")}));g.element.classList.add("filepond--load-indicator"),n.ref.loadProgressIndicator=g;var m=n.appendChildView(n.createChildView(wd,{opacity:0,align:n.query("GET_STYLE_PROGRESS_INDICATOR_POSITION")}));m.element.classList.add("filepond--process-indicator"),n.ref.processProgressIndicator=m,n.ref.activeStyles=[]},write:function(t){var e=t.root,n=t.actions,i=t.props;Kd({root:e,actions:n,props:i});var r=n.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return Yd[t.type]}));if(r){e.ref.activeStyles=[];var o=Yd[r.type];Wl(Hd,(function(t,n){var i=e.ref[t];Wl(n,(function(n,r){var a=o[t]&&void 0!==o[t][n]?o[t][n]:r;e.ref.activeStyles.push({control:i,key:n,value:a})}))}))}e.ref.activeStyles.forEach((function(t){var n=t.control,i=t.key,r=t.value;n[i]="function"==typeof r?r(e):r}))},didCreateView:function(t){hh("CREATE_VIEW",zu(zu({},t),{},{view:t}))},name:"file"}),Jd=vc({create:function(t){var e=t.root,n=t.props;e.ref.fileName=Ed("legend"),e.appendChild(e.ref.fileName),e.ref.file=e.appendChildView(e.createChildView(Zd,{id:n.id})),e.ref.data=!1},ignoreRect:!0,write:yc({DID_LOAD_ITEM:function(t){var e=t.root,n=t.props;xd(e.ref.fileName,e.query("GET_ITEM_NAME",n.id))}}),didCreateView:function(t){hh("CREATE_VIEW",zu(zu({},t),{},{view:t}))},tag:"fieldset",name:"file-wrapper"}),Qd={type:"spring",damping:.6,mass:7},tf=function(t,e,n){var i=vc({name:"panel-".concat(e.name," filepond--").concat(n),mixins:e.mixins,ignoreRectUpdate:!0}),r=t.createChildView(i,e.props);t.ref[e.name]=t.appendChildView(r)},ef=vc({name:"panel",read:function(t){var e=t.root;return t.props.heightCurrent=e.ref.bottom.translateY},write:function(t){var e=t.root,n=t.props;if(null!==e.ref.scalable&&n.scalable===e.ref.scalable||(e.ref.scalable=!wc(n.scalable)||n.scalable,e.element.dataset.scalable=e.ref.scalable),n.height){var i=e.ref.top.rect.element,r=e.ref.bottom.rect.element,o=Math.max(i.height+r.height,n.height);e.ref.center.translateY=i.height,e.ref.center.scaleY=(o-i.height-r.height)/100,e.ref.bottom.translateY=o-r.height}},create:function(t){var e=t.root,n=t.props;[{name:"top"},{name:"center",props:{translateY:null,scaleY:null},mixins:{animations:{scaleY:Qd},styles:["translateY","scaleY"]}},{name:"bottom",props:{translateY:null},mixins:{animations:{translateY:Qd},styles:["translateY"]}}].forEach((function(t){tf(e,t,n.name)})),e.element.classList.add("filepond--".concat(n.name)),e.ref.scalable=null},ignoreRect:!0,mixins:{apis:["height","heightCurrent","scalable"]}}),nf={type:"spring",stiffness:.75,damping:.45,mass:10},rf="spring",of={DID_START_ITEM_LOAD:"busy",DID_UPDATE_ITEM_LOAD_PROGRESS:"loading",DID_THROW_ITEM_INVALID:"load-invalid",DID_THROW_ITEM_LOAD_ERROR:"load-error",DID_LOAD_ITEM:"idle",DID_THROW_ITEM_REMOVE_ERROR:"remove-error",DID_START_ITEM_REMOVE:"busy",DID_START_ITEM_PROCESSING:"busy processing",DID_REQUEST_ITEM_PROCESSING:"busy processing",DID_UPDATE_ITEM_PROCESS_PROGRESS:"processing",DID_COMPLETE_ITEM_PROCESSING:"processing-complete",DID_THROW_ITEM_PROCESSING_ERROR:"processing-error",DID_THROW_ITEM_PROCESSING_REVERT_ERROR:"processing-revert-error",DID_ABORT_ITEM_PROCESSING:"cancelled",DID_REVERT_ITEM_PROCESSING:"idle"},af=yc({DID_UPDATE_PANEL_HEIGHT:function(t){var e=t.root,n=t.action;e.height=n.height}}),sf=yc({DID_GRAB_ITEM:function(t){var e=t.root;t.props.dragOrigin={x:e.translateX,y:e.translateY}},DID_DRAG_ITEM:function(t){t.root.element.dataset.dragState="drag"},DID_DROP_ITEM:function(t){var e=t.root,n=t.props;n.dragOffset=null,n.dragOrigin=null,e.element.dataset.dragState="drop"}},(function(t){var e=t.root,n=t.actions,i=t.props,r=t.shouldOptimize;"drop"===e.element.dataset.dragState&&e.scaleX<=1&&(e.element.dataset.dragState="idle");var o=n.concat().filter((function(t){return/^DID_/.test(t.type)})).reverse().find((function(t){return of[t.type]}));o&&o.type!==i.currentState&&(i.currentState=o.type,e.element.dataset.filepondItemState=of[i.currentState]||"");var a=e.query("GET_ITEM_PANEL_ASPECT_RATIO")||e.query("GET_PANEL_ASPECT_RATIO");a?r||(e.height=e.rect.element.width*a):(af({root:e,actions:n,props:i}),!e.height&&e.ref.container.rect.element.height>0&&(e.height=e.ref.container.rect.element.height)),r&&(e.ref.panel.height=null),e.ref.panel.height=e.height})),uf=vc({create:function(t){var e=t.root,n=t.props;if(e.ref.handleClick=function(t){return e.dispatch("DID_ACTIVATE_ITEM",{id:n.id})},e.element.id="filepond--item-".concat(n.id),e.element.addEventListener("click",e.ref.handleClick),e.ref.container=e.appendChildView(e.createChildView(Jd,{id:n.id})),e.ref.panel=e.appendChildView(e.createChildView(ef,{name:"item-panel"})),e.ref.panel.height=null,n.markedForRemoval=!1,e.query("GET_ALLOW_REORDER")){e.element.dataset.dragState="idle";e.element.addEventListener("pointerdown",(function(t){if(t.isPrimary){var i=!1,r=t.pageX,o=t.pageY;n.dragOrigin={x:e.translateX,y:e.translateY},n.dragCenter={x:t.offsetX,y:t.offsetY};var a,s,u,l=(a=e.query("GET_ACTIVE_ITEMS"),s=a.map((function(t){return t.id})),u=void 0,{setIndex:function(t){u=t},getIndex:function(){return u},getItemIndex:function(t){return s.indexOf(t.id)}});e.dispatch("DID_GRAB_ITEM",{id:n.id,dragState:l});var c=function(t){t.isPrimary&&(t.stopPropagation(),t.preventDefault(),n.dragOffset={x:t.pageX-r,y:t.pageY-o},n.dragOffset.x*n.dragOffset.x+n.dragOffset.y*n.dragOffset.y>16&&!i&&(i=!0,e.element.removeEventListener("click",e.ref.handleClick)),e.dispatch("DID_DRAG_ITEM",{id:n.id,dragState:l}))};document.addEventListener("pointermove",c),document.addEventListener("pointerup",(function t(a){a.isPrimary&&(document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",t),n.dragOffset={x:a.pageX-r,y:a.pageY-o},e.dispatch("DID_DROP_ITEM",{id:n.id,dragState:l}),i&&setTimeout((function(){return e.element.addEventListener("click",e.ref.handleClick)}),0))}))}}))}},write:sf,destroy:function(t){var e=t.root,n=t.props;e.element.removeEventListener("click",e.ref.handleClick),e.dispatch("RELEASE_ITEM",{query:n.id})},tag:"li",name:"item",mixins:{apis:["id","interactionMethod","markedForRemoval","spawnDate","dragCenter","dragOrigin","dragOffset"],styles:["translateX","translateY","scaleX","scaleY","opacity","height"],animations:{scaleX:rf,scaleY:rf,translateX:nf,translateY:nf,opacity:{type:"tween",duration:150}}}}),lf=function(t,e){return Math.max(1,Math.floor((t+1)/e))},cf=function(t,e,n){if(n){var i=t.rect.element.width,r=e.length,o=null;if(0===r||n.top<e[0].rect.element.top)return-1;var a=e[0].rect.element,s=a.marginLeft+a.marginRight,u=a.width+s,l=lf(i,u);if(1===l){for(var c=0;c<r;c++){var h=e[c],d=h.rect.outer.top+.5*h.rect.element.height;if(n.top<d)return c}return r}for(var f=a.marginTop+a.marginBottom,p=a.height+f,g=0;g<r;g++){var m=g%l*u,v=Math.floor(g/l)*p,y=v-a.marginTop,b=m+u,_=v+p+a.marginBottom;if(n.top<_&&n.top>y){if(n.left<b)return g;o=g!==r-1?g:null}}return null!==o?o:r}},hf={height:0,width:0,get getHeight(){return this.height},set setHeight(t){0!==this.height&&0!==t||(this.height=t)},get getWidth(){return this.width},set setWidth(t){0!==this.width&&0!==t||(this.width=t)},setDimensions:function(t,e){0!==this.height&&0!==t||(this.height=t),0!==this.width&&0!==e||(this.width=e)}},df=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;t.dragOffset?(t.translateX=null,t.translateY=null,t.translateX=t.dragOrigin.x+t.dragOffset.x,t.translateY=t.dragOrigin.y+t.dragOffset.y,t.scaleX=1.025,t.scaleY=1.025):(t.translateX=e,t.translateY=n,Date.now()>t.spawnDate&&(0===t.opacity&&ff(t,e,n,i,r),t.scaleX=1,t.scaleY=1,t.opacity=1))},ff=function(t,e,n,i,r){t.interactionMethod===Kc?(t.translateX=null,t.translateX=e,t.translateY=null,t.translateY=n):t.interactionMethod===$c?(t.translateX=null,t.translateX=e-20*i,t.translateY=null,t.translateY=n-10*r,t.scaleX=.8,t.scaleY=.8):t.interactionMethod===Yc?(t.translateY=null,t.translateY=n-30):t.interactionMethod===qc&&(t.translateX=null,t.translateX=e-30,t.translateY=null)},pf=function(t){return t.rect.element.height+.5*t.rect.element.marginBottom+.5*t.rect.element.marginTop},gf=yc({DID_ADD_ITEM:function(t){var e=t.root,n=t.action,i=n.id,r=n.index,o=n.interactionMethod;e.ref.addIndex=r;var a=Date.now(),s=a,u=1;if(o!==Kc){u=0;var l=e.query("GET_ITEM_INSERT_INTERVAL"),c=a-e.ref.lastItemSpanwDate;s=c<l?a+(l-c):a}e.ref.lastItemSpanwDate=s,e.appendChildView(e.createChildView(uf,{spawnDate:s,id:i,opacity:u,interactionMethod:o}),r)},DID_REMOVE_ITEM:function(t){var e=t.root,n=t.action.id,i=e.childViews.find((function(t){return t.id===n}));i&&(i.scaleX=.9,i.scaleY=.9,i.opacity=0,i.markedForRemoval=!0)},DID_DRAG_ITEM:function(t){var e=t.root,n=t.action,i=n.id,r=n.dragState,o=e.query("GET_ITEM",{id:i}),a=e.childViews.find((function(t){return t.id===i})),s=e.childViews.length,u=r.getItemIndex(o);if(a){var l,c=a.dragOrigin.x+a.dragOffset.x+a.dragCenter.x,h=a.dragOrigin.y+a.dragOffset.y+a.dragCenter.y,d=pf(a),f=(l=a).rect.element.width+.5*l.rect.element.marginLeft+.5*l.rect.element.marginRight,p=Math.floor(e.rect.outer.width/f);p>s&&(p=s);var g=Math.floor(s/p+1);hf.setHeight=d*g,hf.setWidth=f*p;var m={y:Math.floor(h/d),x:Math.floor(c/f),getGridIndex:function(){return h>hf.getHeight||h<0||c>hf.getWidth||c<0?u:this.y*p+this.x},getColIndex:function(){for(var t=e.query("GET_ACTIVE_ITEMS"),n=e.childViews.filter((function(t){return t.rect.element.height})),i=t.map((function(t){return n.find((function(e){return e.id===t.id}))})),r=i.findIndex((function(t){return t===a})),o=pf(a),s=i.length,u=s,l=0,c=0,d=0,f=0;f<s;f++)if(l=pf(i[f]),h<(c=(d=c)+l)){if(r>f){if(h<d+o){u=f;break}continue}u=f;break}return u}},v=p>1?m.getGridIndex():m.getColIndex();e.dispatch("MOVE_ITEM",{query:a,index:v});var y=r.getIndex();if(void 0===y||y!==v){if(r.setIndex(v),void 0===y)return;e.dispatch("DID_REORDER_ITEMS",{items:e.query("GET_ACTIVE_ITEMS"),origin:u,target:v})}}}}),mf=vc({create:function(t){var e=t.root;ql(e.element,"role","list"),e.ref.lastItemSpanwDate=Date.now()},write:function(t){var e=t.root,n=t.props,i=t.actions,r=t.shouldOptimize;gf({root:e,props:n,actions:i});var o=n.dragCoordinates,a=e.rect.element.width,s=e.childViews.filter((function(t){return t.rect.element.height})),u=e.query("GET_ACTIVE_ITEMS").map((function(t){return s.find((function(e){return e.id===t.id}))})).filter((function(t){return t})),l=o?cf(e,u,o):null,c=e.ref.addIndex||null;e.ref.addIndex=null;var h=0,d=0,f=0;if(0!==u.length){var p=u[0].rect.element,g=p.marginTop+p.marginBottom,m=p.marginLeft+p.marginRight,v=p.width+m,y=p.height+g,b=lf(a,v);if(1===b){var _=0,E=0;u.forEach((function(t,e){if(l){var n=e-l;E=-2===n?.25*-g:-1===n?.75*-g:0===n?.75*g:1===n?.25*g:0}r&&(t.translateX=null,t.translateY=null),t.markedForRemoval||df(t,0,_+E);var i=(t.rect.element.height+g)*(t.markedForRemoval?t.opacity:1);_+=i}))}else{var x=0,A=0;u.forEach((function(t,e){e===l&&(h=1),e===c&&(f+=1),t.markedForRemoval&&t.opacity<.5&&(d-=1);var n=e+f+h+d,i=n%b,o=Math.floor(n/b),a=i*v,s=o*y,u=Math.sign(a-x),p=Math.sign(s-A);x=a,A=s,t.markedForRemoval||(r&&(t.translateX=null,t.translateY=null),df(t,a,s,u,p))}))}}},tag:"ul",name:"list",didWriteView:function(t){var e=t.root;e.childViews.filter((function(t){return t.markedForRemoval&&0===t.opacity&&t.resting})).forEach((function(t){t._destroy(),e.removeChildView(t)}))},filterFrameActionsForChild:function(t,e){return e.filter((function(e){return!e.data||!e.data.id||t.id===e.data.id}))},mixins:{apis:["dragCoordinates"]}}),vf=yc({DID_DRAG:function(t){var e=t.root,n=t.props,i=t.action;e.query("GET_ITEM_INSERT_LOCATION_FREEDOM")&&(n.dragCoordinates={left:i.position.scopeLeft-e.ref.list.rect.element.left,top:i.position.scopeTop-(e.rect.outer.top+e.rect.element.marginTop+e.rect.element.scrollTop)})},DID_END_DRAG:function(t){t.props.dragCoordinates=null}}),yf=vc({create:function(t){var e=t.root,n=t.props;e.ref.list=e.appendChildView(e.createChildView(mf)),n.dragCoordinates=null,n.overflowing=!1},write:function(t){var e=t.root,n=t.props,i=t.actions;if(vf({root:e,props:n,actions:i}),e.ref.list.dragCoordinates=n.dragCoordinates,n.overflowing&&!n.overflow&&(n.overflowing=!1,e.element.dataset.state="",e.height=null),n.overflow){var r=Math.round(n.overflow);r!==e.height&&(n.overflowing=!0,e.element.dataset.state="overflow",e.height=r)}},name:"list-scroller",mixins:{apis:["overflow","dragCoordinates"],styles:["height","translateY"],animations:{translateY:"spring"}}}),bf=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";n?ql(t,e,i):t.removeAttribute(e)},_f=function(t){var e=t.root,n=t.action;e.query("GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE")&&bf(e.element,"accept",!!n.value,n.value?n.value.join(","):"")},Ef=function(t){var e=t.root,n=t.action;bf(e.element,"multiple",n.value)},xf=function(t){var e=t.root,n=t.action;bf(e.element,"webkitdirectory",n.value)},Af=function(t){var e=t.root,n=e.query("GET_DISABLED"),i=e.query("GET_ALLOW_BROWSE"),r=n||!i;bf(e.element,"disabled",r)},Df=function(t){var e=t.root;t.action.value?0===e.query("GET_TOTAL_ITEMS")&&bf(e.element,"required",!0):bf(e.element,"required",!1)},wf=function(t){var e=t.root,n=t.action;bf(e.element,"capture",!!n.value,!0===n.value?"":n.value)},kf=function(t){var e=t.root,n=e.element;e.query("GET_TOTAL_ITEMS")>0?(bf(n,"required",!1),bf(n,"name",!1)):(bf(n,"name",!0,e.query("GET_NAME")),e.query("GET_CHECK_VALIDITY")&&n.setCustomValidity(""),e.query("GET_REQUIRED")&&bf(n,"required",!0))},Tf=vc({tag:"input",name:"browser",ignoreRect:!0,ignoreRectUpdate:!0,attributes:{type:"file"},create:function(t){var e=t.root,n=t.props;e.element.id="filepond--browser-".concat(n.id),ql(e.element,"name",e.query("GET_NAME")),ql(e.element,"aria-controls","filepond--assistant-".concat(n.id)),ql(e.element,"aria-labelledby","filepond--drop-label-".concat(n.id)),_f({root:e,action:{value:e.query("GET_ACCEPTED_FILE_TYPES")}}),Ef({root:e,action:{value:e.query("GET_ALLOW_MULTIPLE")}}),xf({root:e,action:{value:e.query("GET_ALLOW_DIRECTORIES_ONLY")}}),Af({root:e}),Df({root:e,action:{value:e.query("GET_REQUIRED")}}),wf({root:e,action:{value:e.query("GET_CAPTURE_METHOD")}}),e.ref.handleChange=function(t){if(e.element.value){var i=Array.from(e.element.files).map((function(t){return t._relativePath=t.webkitRelativePath,t}));setTimeout((function(){n.onload(i),function(t){if(t&&""!==t.value){try{t.value=""}catch(t){}if(t.value){var e=Ed("form"),n=t.parentNode,i=t.nextSibling;e.appendChild(t),e.reset(),i?n.insertBefore(t,i):n.appendChild(t)}}}(e.element)}),250)}},e.element.addEventListener("change",e.ref.handleChange)},destroy:function(t){var e=t.root;e.element.removeEventListener("change",e.ref.handleChange)},write:yc({DID_LOAD_ITEM:kf,DID_REMOVE_ITEM:kf,DID_THROW_ITEM_INVALID:function(t){var e=t.root;e.query("GET_CHECK_VALIDITY")&&e.element.setCustomValidity(e.query("GET_LABEL_INVALID_FIELD"))},DID_SET_DISABLED:Af,DID_SET_ALLOW_BROWSE:Af,DID_SET_ALLOW_DIRECTORIES_ONLY:xf,DID_SET_ALLOW_MULTIPLE:Ef,DID_SET_ACCEPTED_FILE_TYPES:_f,DID_SET_CAPTURE_METHOD:wf,DID_SET_REQUIRED:Df})}),Cf=13,Sf=32,If=function(t,e){t.innerHTML=e;var n=t.querySelector(".filepond--label-action");return n&&ql(n,"tabindex","0"),e},Of=vc({name:"drop-label",ignoreRect:!0,create:function(t){var e=t.root,n=t.props,i=Ed("label");ql(i,"for","filepond--browser-".concat(n.id)),ql(i,"id","filepond--drop-label-".concat(n.id)),ql(i,"aria-hidden","true"),e.ref.handleKeyDown=function(t){(t.keyCode===Cf||t.keyCode===Sf)&&(t.preventDefault(),e.ref.label.click())},e.ref.handleClick=function(t){t.target===i||i.contains(t.target)||e.ref.label.click()},i.addEventListener("keydown",e.ref.handleKeyDown),e.element.addEventListener("click",e.ref.handleClick),If(i,n.caption),e.appendChild(i),e.ref.label=i},destroy:function(t){var e=t.root;e.ref.label.addEventListener("keydown",e.ref.handleKeyDown),e.element.removeEventListener("click",e.ref.handleClick)},write:yc({DID_SET_LABEL_IDLE:function(t){var e=t.root,n=t.action;If(e.ref.label,n.value)}}),mixins:{styles:["opacity","translateX","translateY"],animations:{opacity:{type:"tween",duration:150},translateX:"spring",translateY:"spring"}}}),Rf=vc({name:"drip-blob",ignoreRect:!0,mixins:{styles:["translateX","translateY","scaleX","scaleY","opacity"],animations:{scaleX:"spring",scaleY:"spring",translateX:"spring",translateY:"spring",opacity:{type:"tween",duration:250}}}}),Mf=yc({DID_DRAG:function(t){var e=t.root,n=t.action;e.ref.blob?(e.ref.blob.translateX=n.position.scopeLeft,e.ref.blob.translateY=n.position.scopeTop,e.ref.blob.scaleX=1,e.ref.blob.scaleY=1,e.ref.blob.opacity=1):function(t){var e=t.root,n=.5*e.rect.element.width,i=.5*e.rect.element.height;e.ref.blob=e.appendChildView(e.createChildView(Rf,{opacity:0,scaleX:2.5,scaleY:2.5,translateX:n,translateY:i}))}({root:e})},DID_DROP:function(t){var e=t.root;e.ref.blob&&(e.ref.blob.scaleX=2.5,e.ref.blob.scaleY=2.5,e.ref.blob.opacity=0)},DID_END_DRAG:function(t){var e=t.root;e.ref.blob&&(e.ref.blob.opacity=0)}}),Lf=vc({ignoreRect:!0,ignoreRectUpdate:!0,name:"drip",write:function(t){var e=t.root,n=t.props,i=t.actions;Mf({root:e,props:n,actions:i});var r=e.ref.blob;0===i.length&&r&&0===r.opacity&&(e.removeChildView(r),e.ref.blob=null)}}),Pf=function(t,e){try{var n=new DataTransfer;e.forEach((function(t){t instanceof File?n.items.add(t):n.items.add(new File([t],t.name,{type:t.type}))})),t.files=n.files}catch(t){return!1}return!0},Ff=function(t,e){return t.ref.fields[e]},Bf=function(t){t.query("GET_ACTIVE_ITEMS").forEach((function(e){t.ref.fields[e.id]&&t.element.appendChild(t.ref.fields[e.id])}))},Nf=function(t){var e=t.root;return Bf(e)},jf=yc({DID_SET_DISABLED:function(t){var e=t.root;e.element.disabled=e.query("GET_DISABLED")},DID_ADD_ITEM:function(t){var e=t.root,n=t.action,i=!(e.query("GET_ITEM",n.id).origin===oh.LOCAL)&&e.query("SHOULD_UPDATE_FILE_INPUT"),r=Ed("input");r.type=i?"file":"hidden",r.name=e.query("GET_NAME"),r.disabled=e.query("GET_DISABLED"),e.ref.fields[n.id]=r,Bf(e)},DID_LOAD_ITEM:function(t){var e=t.root,n=t.action,i=Ff(e,n.id);if(i&&(null!==n.serverFileReference&&(i.value=n.serverFileReference),e.query("SHOULD_UPDATE_FILE_INPUT"))){var r=e.query("GET_ITEM",n.id);Pf(i,[r.file])}},DID_REMOVE_ITEM:function(t){var e=t.root,n=t.action,i=Ff(e,n.id);i&&(i.parentNode&&i.parentNode.removeChild(i),delete e.ref.fields[n.id])},DID_DEFINE_VALUE:function(t){var e=t.root,n=t.action,i=Ff(e,n.id);i&&(null===n.value?i.removeAttribute("value"):i.value=n.value,Bf(e))},DID_PREPARE_OUTPUT:function(t){var e=t.root,n=t.action;e.query("SHOULD_UPDATE_FILE_INPUT")&&setTimeout((function(){var t=Ff(e,n.id);t&&Pf(t,[n.file])}),0)},DID_REORDER_ITEMS:Nf,DID_SORT_ITEMS:Nf}),Vf=vc({tag:"fieldset",name:"data",create:function(t){return t.root.ref.fields={}},write:jf,ignoreRect:!0}),zf=["jpg","jpeg","png","gif","bmp","webp","svg","tiff"],Uf=["css","csv","html","txt"],Gf={zip:"zip|compressed",epub:"application/epub+zip"},Wf=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t=t.toLowerCase(),zf.includes(t)?"image/"+("jpg"===t?"jpeg":"svg"===t?"svg+xml":t):Uf.includes(t)?"text/"+t:Gf[t]||""},Hf=function(t){return new Promise((function(e,n){var i=ep(t);if(i.length&&!qf(t))return e(i);$f(t).then(e)}))},qf=function(t){return!!t.files&&t.files.length>0},$f=function(t){return new Promise((function(e,n){var i=(t.items?Array.from(t.items):[]).filter((function(t){return Yf(t)})).map((function(t){return Xf(t)}));i.length?Promise.all(i).then((function(t){var n=[];t.forEach((function(t){n.push.apply(n,t)})),e(n.filter((function(t){return t})).map((function(t){return t._relativePath||(t._relativePath=t.webkitRelativePath),t})))})).catch(console.error):e(t.files?Array.from(t.files):[])}))},Yf=function(t){if(Qf(t)){var e=tp(t);if(e)return e.isFile||e.isDirectory}return"file"===t.kind},Xf=function(t){return new Promise((function(e,n){Jf(t)?Kf(tp(t)).then(e).catch(n):e([t.getAsFile()])}))},Kf=function(t){return new Promise((function(e,n){var i=[],r=0,o=0,a=function(){0===o&&0===r&&e(i)};!function t(e){r++;var s=e.createReader();!function e(){s.readEntries((function(n){if(0===n.length)return r--,void a();n.forEach((function(e){e.isDirectory?t(e):(o++,e.file((function(t){var n=Zf(t);e.fullPath&&(n._relativePath=e.fullPath),i.push(n),o--,a()})))})),e()}),n)}()}(t)}))},Zf=function(t){if(t.type.length)return t;var e=t.lastModifiedDate,n=t.name,i=Wf(Oh(t.name));return i.length?((t=t.slice(0,t.size,i)).name=n,t.lastModifiedDate=e,t):t},Jf=function(t){return Qf(t)&&(tp(t)||{}).isDirectory},Qf=function(t){return"webkitGetAsEntry"in t},tp=function(t){return t.webkitGetAsEntry()},ep=function(t){var e=[];try{if((e=ip(t)).length)return e;e=np(t)}catch(t){}return e},np=function(t){var e=t.getData("url");return"string"==typeof e&&e.length?[e]:[]},ip=function(t){var e=t.getData("text/html");if("string"==typeof e&&e.length){var n=e.match(/src\s*=\s*"(.+?)"/);if(n)return[n[1]]}return[]},rp=[],op=function(t){return{pageLeft:t.pageX,pageTop:t.pageY,scopeLeft:t.offsetX||t.layerX,scopeTop:t.offsetY||t.layerY}},ap=function(t){var e=rp.find((function(e){return e.element===t}));if(e)return e;var n=sp(t);return rp.push(n),n},sp=function(t){var e=[],n={dragenter:hp,dragover:dp,dragleave:pp,drop:fp},i={};Wl(n,(function(n,r){i[n]=r(t,e),t.addEventListener(n,i[n],!1)}));var r={element:t,addListener:function(o){return e.push(o),function(){e.splice(e.indexOf(o),1),0===e.length&&(rp.splice(rp.indexOf(r),1),Wl(n,(function(e){t.removeEventListener(e,i[e],!1)})))}}};return r},up=function(t,e){var n,i=function(t,e){return"elementFromPoint"in t||(t=document),t.elementFromPoint(e.x,e.y)}("getRootNode"in(n=e)?n.getRootNode():document,{x:t.pageX-window.pageXOffset,y:t.pageY-window.pageYOffset});return i===e||e.contains(i)},lp=null,cp=function(t,e){try{t.dropEffect=e}catch(t){}},hp=function(t,e){return function(t){t.preventDefault(),lp=t.target,e.forEach((function(e){var n=e.element,i=e.onenter;up(t,n)&&(e.state="enter",i(op(t)))}))}},dp=function(t,e){return function(t){t.preventDefault();var n=t.dataTransfer;Hf(n).then((function(i){var r=!1;e.some((function(e){var o=e.filterElement,a=e.element,s=e.onenter,u=e.onexit,l=e.ondrag,c=e.allowdrop;cp(n,"copy");var h=c(i);if(h)if(up(t,a)){if(r=!0,null===e.state)return e.state="enter",void s(op(t));if(e.state="over",o&&!h)return void cp(n,"none");l(op(t))}else o&&!r&&cp(n,"none"),e.state&&(e.state=null,u(op(t)));else cp(n,"none")}))}))}},fp=function(t,e){return function(t){t.preventDefault();var n=t.dataTransfer;Hf(n).then((function(n){e.forEach((function(e){var i=e.filterElement,r=e.element,o=e.ondrop,a=e.onexit,s=e.allowdrop;if(e.state=null,!i||up(t,r))return s(n)?void o(op(t),n):a(op(t))}))}))}},pp=function(t,e){return function(t){lp===t.target&&e.forEach((function(e){var n=e.onexit;e.state=null,n(op(t))}))}},gp=function(t,e,n){t.classList.add("filepond--hopper");var i=n.catchesDropsOnPage,r=n.requiresDropOnElement,o=n.filterItems,a=void 0===o?function(t){return t}:o,s=function(t,e,n){var i=ap(e),r={element:t,filterElement:n,state:null,ondrop:function(){},onenter:function(){},ondrag:function(){},onexit:function(){},onload:function(){},allowdrop:function(){}};return r.destroy=i.addListener(r),r}(t,i?document.documentElement:t,r),u="",l="";s.allowdrop=function(t){return e(a(t))},s.ondrop=function(t,n){var i=a(n);e(i)?(l="drag-drop",c.onload(i,t)):c.ondragend(t)},s.ondrag=function(t){c.ondrag(t)},s.onenter=function(t){l="drag-over",c.ondragstart(t)},s.onexit=function(t){l="drag-exit",c.ondragend(t)};var c={updateHopperState:function(){u!==l&&(t.dataset.hopperState=l,u=l)},onload:function(){},ondragstart:function(){},ondrag:function(){},ondragend:function(){},destroy:function(){s.destroy()}};return c},mp=!1,vp=[],yp=function(t){var e=document.activeElement;if(e&&/textarea|input/i.test(e.nodeName)){for(var n=!1,i=e;i!==document.body;){if(i.classList.contains("filepond--root")){n=!0;break}i=i.parentNode}if(!n)return}Hf(t.clipboardData).then((function(t){t.length&&vp.forEach((function(e){return e(t)}))}))},bp=function(){var t=function(t){e.onload(t)},e={destroy:function(){var e;e=t,Jc(vp,vp.indexOf(e)),0===vp.length&&(document.removeEventListener("paste",yp),mp=!1)},onload:function(){}};return function(t){vp.includes(t)||(vp.push(t),mp||(mp=!0,document.addEventListener("paste",yp)))}(t),e},_p=null,Ep=null,xp=[],Ap=function(t,e){t.element.textContent=e},Dp=function(t,e,n){var i=t.query("GET_TOTAL_ITEMS");Ap(t,"".concat(n," ").concat(e,", ").concat(i," ").concat(1===i?t.query("GET_LABEL_FILE_COUNT_SINGULAR"):t.query("GET_LABEL_FILE_COUNT_PLURAL"))),clearTimeout(Ep),Ep=setTimeout((function(){!function(t){t.element.textContent=""}(t)}),1500)},wp=function(t){return t.element.parentNode.contains(document.activeElement)},kp=function(t){var e=t.root,n=t.action,i=e.query("GET_ITEM",n.id).filename,r=e.query("GET_LABEL_FILE_PROCESSING_ABORTED");Ap(e,"".concat(i," ").concat(r))},Tp=function(t){var e=t.root,n=t.action,i=e.query("GET_ITEM",n.id).filename;Ap(e,"".concat(n.status.main," ").concat(i," ").concat(n.status.sub))},Cp=vc({create:function(t){var e=t.root,n=t.props;e.element.id="filepond--assistant-".concat(n.id),ql(e.element,"role","status"),ql(e.element,"aria-live","polite"),ql(e.element,"aria-relevant","additions")},ignoreRect:!0,ignoreRectUpdate:!0,write:yc({DID_LOAD_ITEM:function(t){var e=t.root,n=t.action;if(wp(e)){e.element.textContent="";var i=e.query("GET_ITEM",n.id);xp.push(i.filename),clearTimeout(_p),_p=setTimeout((function(){Dp(e,xp.join(", "),e.query("GET_LABEL_FILE_ADDED")),xp.length=0}),750)}},DID_REMOVE_ITEM:function(t){var e=t.root,n=t.action;if(wp(e)){var i=n.item;Dp(e,i.filename,e.query("GET_LABEL_FILE_REMOVED"))}},DID_COMPLETE_ITEM_PROCESSING:function(t){var e=t.root,n=t.action,i=e.query("GET_ITEM",n.id).filename,r=e.query("GET_LABEL_FILE_PROCESSING_COMPLETE");Ap(e,"".concat(i," ").concat(r))},DID_ABORT_ITEM_PROCESSING:kp,DID_REVERT_ITEM_PROCESSING:kp,DID_THROW_ITEM_REMOVE_ERROR:Tp,DID_THROW_ITEM_LOAD_ERROR:Tp,DID_THROW_ITEM_INVALID:Tp,DID_THROW_ITEM_PROCESSING_ERROR:Tp}),tag:"span",name:"assistant"}),Sp=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-";return t.replace(new RegExp("".concat(e,"."),"g"),(function(t){return t.charAt(1).toUpperCase()}))},Ip=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=Date.now(),r=null;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];clearTimeout(r);var u=Date.now()-i,l=function(){i=Date.now(),t.apply(void 0,a)};u<e?n||(r=setTimeout(l,e-u)):l()}},Op=function(t){return t.preventDefault()},Rp=function(t){var e=t.ref.list.childViews[0].childViews[0];return e?{top:e.rect.element.marginTop,bottom:e.rect.element.marginBottom}:{top:0,bottom:0}},Mp=function(t){var e=0,n=0,i=t.ref.list,r=i.childViews[0],o=r.childViews.filter((function(t){return t.rect.element.height})),a=t.query("GET_ACTIVE_ITEMS").map((function(t){return o.find((function(e){return e.id===t.id}))})).filter((function(t){return t}));if(0===a.length)return{visual:e,bounds:n};var s=r.rect.element.width,u=cf(r,a,i.dragCoordinates),l=a[0].rect.element,c=l.marginTop+l.marginBottom,h=l.marginLeft+l.marginRight,d=l.width+h,f=l.height+c,p=void 0!==u&&u>=0?1:0,g=a.find((function(t){return t.markedForRemoval&&t.opacity<.45}))?-1:0,m=a.length+p+g,v=lf(s,d);return 1===v?a.forEach((function(t){var i=t.rect.element.height+c;n+=i,e+=i*t.opacity})):(n=Math.ceil(m/v)*f,e=n),{visual:e,bounds:n}},Lp=function(t){var e=t.ref.measureHeight||null;return{cappedHeight:parseInt(t.style.maxHeight,10)||null,fixedHeight:0===e?null:e}},Pp=function(t,e){var n=t.query("GET_ALLOW_REPLACE"),i=t.query("GET_ALLOW_MULTIPLE"),r=t.query("GET_TOTAL_ITEMS"),o=t.query("GET_MAX_FILES"),a=e.length;return!i&&a>1||!!(Oc(o=i||n?o:1)&&r+a>o)&&(t.dispatch("DID_THROW_MAX_FILES",{source:e,error:qh("warning",0,"Max files")}),!0)},Fp=function(t,e,n){var i=t.childViews[0];return cf(i,e,{left:n.scopeLeft-i.rect.element.left,top:n.scopeTop-(t.rect.outer.top+t.rect.element.marginTop+t.rect.element.scrollTop)})},Bp=function(t){var e=t.query("GET_ALLOW_DROP"),n=t.query("GET_DISABLED"),i=e&&!n;if(i&&!t.ref.hopper){var r=gp(t.element,(function(e){var n=t.query("GET_BEFORE_DROP_FILE")||function(){return!0};return!t.query("GET_DROP_VALIDATION")||e.every((function(e){return hh("ALLOW_HOPPER_ITEM",e,{query:t.query}).every((function(t){return!0===t}))&&n(e)}))}),{filterItems:function(e){var n=t.query("GET_IGNORED_FILES");return e.filter((function(t){return!ld(t)||!n.includes(t.name.toLowerCase())}))},catchesDropsOnPage:t.query("GET_DROP_ON_PAGE"),requiresDropOnElement:t.query("GET_DROP_ON_ELEMENT")});r.onload=function(e,n){var i=t.ref.list.childViews[0].childViews.filter((function(t){return t.rect.element.height})),r=t.query("GET_ACTIVE_ITEMS").map((function(t){return i.find((function(e){return e.id===t.id}))})).filter((function(t){return t}));ch("ADD_ITEMS",e,{dispatch:t.dispatch}).then((function(e){if(Pp(t,e))return!1;t.dispatch("ADD_ITEMS",{items:e,index:Fp(t.ref.list,r,n),interactionMethod:$c})})),t.dispatch("DID_DROP",{position:n}),t.dispatch("DID_END_DRAG",{position:n})},r.ondragstart=function(e){t.dispatch("DID_START_DRAG",{position:e})},r.ondrag=Ip((function(e){t.dispatch("DID_DRAG",{position:e})})),r.ondragend=function(e){t.dispatch("DID_END_DRAG",{position:e})},t.ref.hopper=r,t.ref.drip=t.appendChildView(t.createChildView(Lf))}else!i&&t.ref.hopper&&(t.ref.hopper.destroy(),t.ref.hopper=null,t.removeChildView(t.ref.drip))},Np=function(t,e){var n=t.query("GET_ALLOW_BROWSE"),i=t.query("GET_DISABLED"),r=n&&!i;r&&!t.ref.browser?t.ref.browser=t.appendChildView(t.createChildView(Tf,zu(zu({},e),{},{onload:function(e){ch("ADD_ITEMS",e,{dispatch:t.dispatch}).then((function(e){if(Pp(t,e))return!1;t.dispatch("ADD_ITEMS",{items:e,index:-1,interactionMethod:Yc})}))}})),0):!r&&t.ref.browser&&(t.removeChildView(t.ref.browser),t.ref.browser=null)},jp=function(t){var e=t.query("GET_ALLOW_PASTE"),n=t.query("GET_DISABLED"),i=e&&!n;i&&!t.ref.paster?(t.ref.paster=bp(),t.ref.paster.onload=function(e){ch("ADD_ITEMS",e,{dispatch:t.dispatch}).then((function(e){if(Pp(t,e))return!1;t.dispatch("ADD_ITEMS",{items:e,index:-1,interactionMethod:Xc})}))}):!i&&t.ref.paster&&(t.ref.paster.destroy(),t.ref.paster=null)},Vp=yc({DID_SET_ALLOW_BROWSE:function(t){var e=t.root,n=t.props;Np(e,n)},DID_SET_ALLOW_DROP:function(t){var e=t.root;Bp(e)},DID_SET_ALLOW_PASTE:function(t){var e=t.root;jp(e)},DID_SET_DISABLED:function(t){var e=t.root,n=t.props;Bp(e),jp(e),Np(e,n),e.query("GET_DISABLED")?e.element.dataset.disabled="disabled":e.element.removeAttribute("data-disabled")}}),zp=vc({name:"root",read:function(t){var e=t.root;e.ref.measure&&(e.ref.measureHeight=e.ref.measure.offsetHeight)},create:function(t){var e=t.root,n=t.props,i=e.query("GET_ID");i&&(e.element.id=i);var r=e.query("GET_CLASS_NAME");r&&r.split(" ").filter((function(t){return t.length})).forEach((function(t){e.element.classList.add(t)})),e.ref.label=e.appendChildView(e.createChildView(Of,zu(zu({},n),{},{translateY:null,caption:e.query("GET_LABEL_IDLE")}))),e.ref.list=e.appendChildView(e.createChildView(yf,{translateY:null})),e.ref.panel=e.appendChildView(e.createChildView(ef,{name:"panel-root"})),e.ref.assistant=e.appendChildView(e.createChildView(Cp,zu({},n))),e.ref.data=e.appendChildView(e.createChildView(Vf,zu({},n))),e.ref.measure=Ed("div"),e.ref.measure.style.height="100%",e.element.appendChild(e.ref.measure),e.ref.bounds=null,e.query("GET_STYLES").filter((function(t){return!xc(t.value)})).map((function(t){var n=t.name,i=t.value;e.element.dataset[n]=i})),e.ref.widthPrevious=null,e.ref.widthUpdated=Ip((function(){e.ref.updateHistory=[],e.dispatch("DID_RESIZE_ROOT")}),250),e.ref.previousAspectRatio=null,e.ref.updateHistory=[];var o=window.matchMedia("(pointer: fine) and (hover: hover)").matches,a="PointerEvent"in window;e.query("GET_ALLOW_REORDER")&&a&&!o&&(e.element.addEventListener("touchmove",Op,{passive:!1}),e.element.addEventListener("gesturestart",Op));var s=e.query("GET_CREDITS");if(2===s.length){var u=document.createElement("a");u.className="filepond--credits",u.setAttribute("aria-hidden","true"),u.href=s[0],u.tabindex=-1,u.target="_blank",u.rel="noopener noreferrer",u.textContent=s[1],e.element.appendChild(u),e.ref.credits=u}},write:function(t){var e=t.root,n=t.props,i=t.actions;if(Vp({root:e,props:n,actions:i}),i.filter((function(t){return/^DID_SET_STYLE_/.test(t.type)})).filter((function(t){return!xc(t.data.value)})).map((function(t){var n=t.type,i=t.data,r=Sp(n.substr(8).toLowerCase(),"_");e.element.dataset[r]=i.value,e.invalidateLayout()})),!e.rect.element.hidden){e.rect.element.width!==e.ref.widthPrevious&&(e.ref.widthPrevious=e.rect.element.width,e.ref.widthUpdated());var r=e.ref.bounds;r||(r=e.ref.bounds=Lp(e),e.element.removeChild(e.ref.measure),e.ref.measure=null);var o=e.ref,a=o.hopper,s=o.label,u=o.list,l=o.panel;a&&a.updateHopperState();var c=e.query("GET_PANEL_ASPECT_RATIO"),h=e.query("GET_ALLOW_MULTIPLE"),d=e.query("GET_TOTAL_ITEMS"),f=d===(h?e.query("GET_MAX_FILES")||1e6:1),p=i.find((function(t){return"DID_ADD_ITEM"===t.type}));if(f&&p){var g=p.data.interactionMethod;s.opacity=0,h?s.translateY=-40:g===qc?s.translateX=40:s.translateY=g===Yc?40:30}else f||(s.opacity=1,s.translateX=0,s.translateY=0);var m=Rp(e),v=Mp(e),y=s.rect.element.height,b=!h||f?0:y,_=f?u.rect.element.marginTop:0,E=0===d?0:u.rect.element.marginBottom,x=b+_+v.visual+E,A=b+_+v.bounds+E;if(u.translateY=Math.max(0,b-u.rect.element.marginTop)-m.top,c){var D=e.rect.element.width,w=D*c;c!==e.ref.previousAspectRatio&&(e.ref.previousAspectRatio=c,e.ref.updateHistory=[]);var k=e.ref.updateHistory;k.push(D);if(k.length>4)for(var T=k.length,C=T-10,S=0,I=T;I>=C;I--)if(k[I]===k[I-2]&&S++,S>=2)return;l.scalable=!1,l.height=w;var O=w-b-(E-m.bottom)-(f?_:0);v.visual>O?u.overflow=O:u.overflow=null,e.height=w}else if(r.fixedHeight){l.scalable=!1;var R=r.fixedHeight-b-(E-m.bottom)-(f?_:0);v.visual>R?u.overflow=R:u.overflow=null}else if(r.cappedHeight){var M=x>=r.cappedHeight,L=Math.min(r.cappedHeight,x);l.scalable=!0,l.height=M?L:L-m.top-m.bottom;var P=L-b-(E-m.bottom)-(f?_:0);x>r.cappedHeight&&v.visual>P?u.overflow=P:u.overflow=null,e.height=Math.min(r.cappedHeight,A-m.top-m.bottom)}else{var F=d>0?m.top+m.bottom:0;l.scalable=!0,l.height=Math.max(y,x-F),e.height=Math.max(y,A-F)}e.ref.credits&&l.heightCurrent&&(e.ref.credits.style.transform="translateY(".concat(l.heightCurrent,"px)"))}},destroy:function(t){var e=t.root;e.ref.paster&&e.ref.paster.destroy(),e.ref.hopper&&e.ref.hopper.destroy(),e.element.removeEventListener("touchmove",Op),e.element.removeEventListener("gesturestart",Op)},mixins:{styles:["height"]}}),Up=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=null,n=fh(),i=Gl(zc(n),[Th,Hc(n)],[bd,Wc(n)]);i.dispatch("SET_OPTIONS",{options:t});var r=function(){document.hidden||i.dispatch("KICK")};document.addEventListener("visibilitychange",r);var o=null,a=!1,s=!1,u=null,l=null,c=function(){a||(a=!0),clearTimeout(o),o=setTimeout((function(){a=!1,u=null,l=null,s&&(s=!1,i.dispatch("DID_STOP_RESIZE"))}),500)};window.addEventListener("resize",c);var h=zp(i,{id:Zc()}),d=!1,f=!1,p={_read:function(){a&&(l=window.innerWidth,u||(u=l),s||l===u||(i.dispatch("DID_START_RESIZE"),s=!0)),f&&d&&(d=null===h.element.offsetParent),d||(h._read(),f=h.rect.element.hidden)},_write:function(t){var e=i.processActionQueue().filter((function(t){return!/^SET_/.test(t.type)}));d&&!e.length||(y(e),d=h._write(t,e,s),ih(i.query("GET_ITEMS")),d&&i.processDispatchQueue())}},g=function(t){return function(e){var n={type:t};if(!e)return n;if(e.hasOwnProperty("error")&&(n.error=e.error?zu({},e.error):null),e.status&&(n.status=zu({},e.status)),e.file&&(n.output=e.file),e.source)n.file=e.source;else if(e.item||e.id){var r=e.item?e.item:i.query("GET_ITEM",e.id);n.file=r?nh(r):null}return e.items&&(n.items=e.items.map(nh)),/progress/.test(t)&&(n.progress=e.progress),e.hasOwnProperty("origin")&&e.hasOwnProperty("target")&&(n.origin=e.origin,n.target=e.target),n}},m={DID_DESTROY:g("destroy"),DID_INIT:g("init"),DID_THROW_MAX_FILES:g("warning"),DID_INIT_ITEM:g("initfile"),DID_START_ITEM_LOAD:g("addfilestart"),DID_UPDATE_ITEM_LOAD_PROGRESS:g("addfileprogress"),DID_LOAD_ITEM:g("addfile"),DID_THROW_ITEM_INVALID:[g("error"),g("addfile")],DID_THROW_ITEM_LOAD_ERROR:[g("error"),g("addfile")],DID_THROW_ITEM_REMOVE_ERROR:[g("error"),g("removefile")],DID_PREPARE_OUTPUT:g("preparefile"),DID_START_ITEM_PROCESSING:g("processfilestart"),DID_UPDATE_ITEM_PROCESS_PROGRESS:g("processfileprogress"),DID_ABORT_ITEM_PROCESSING:g("processfileabort"),DID_COMPLETE_ITEM_PROCESSING:g("processfile"),DID_COMPLETE_ITEM_PROCESSING_ALL:g("processfiles"),DID_REVERT_ITEM_PROCESSING:g("processfilerevert"),DID_THROW_ITEM_PROCESSING_ERROR:[g("error"),g("processfile")],DID_REMOVE_ITEM:g("removefile"),DID_UPDATE_ITEMS:g("updatefiles"),DID_ACTIVATE_ITEM:g("activatefile"),DID_REORDER_ITEMS:g("reorderfiles")},v=function(t){var e=zu({pond:O},t);delete e.type,h.element.dispatchEvent(new CustomEvent("FilePond:".concat(t.type),{detail:e,bubbles:!0,cancelable:!0,composed:!0}));var n=[];t.hasOwnProperty("error")&&n.push(t.error),t.hasOwnProperty("file")&&n.push(t.file);var r=["type","error","file"];Object.keys(t).filter((function(t){return!r.includes(t)})).forEach((function(e){return n.push(t[e])})),O.fire.apply(O,[t.type].concat(n));var o=i.query("GET_ON".concat(t.type.toUpperCase()));o&&o.apply(void 0,n)},y=function(t){t.length&&t.filter((function(t){return m[t.type]})).forEach((function(t){var e=m[t.type];(Array.isArray(e)?e:[e]).forEach((function(e){"DID_INIT_ITEM"===t.type?v(e(t.data)):setTimeout((function(){v(e(t.data))}),0)}))}))},b=function(t){return i.dispatch("SET_OPTIONS",{options:t})},_=function(t){return i.query("GET_ACTIVE_ITEM",t)},E=function(t){return new Promise((function(e,n){i.dispatch("REQUEST_ITEM_PREPARE",{query:t,success:function(t){e(t)},failure:function(t){n(t)}})}))},x=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(n,i){w([{source:t,options:e}],{index:e.index}).then((function(t){return n(t&&t[0])})).catch(i)}))},A=function(t){return t.file&&t.id},D=function(t,e){return"object"!==$u(t)||A(t)||e||(e=t,t=void 0),i.dispatch("REMOVE_ITEM",zu(zu({},e),{},{query:t})),null===i.query("GET_ACTIVE_ITEM",t)},w=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return new Promise((function(t,n){var r=[],o={};if(Ec(e[0]))r.push.apply(r,e[0]),Object.assign(o,e[1]||{});else{var a=e[e.length-1];"object"!==$u(a)||a instanceof Blob||Object.assign(o,e.pop()),r.push.apply(r,e)}i.dispatch("ADD_ITEMS",{items:r,index:o.index,interactionMethod:qc,success:t,failure:n})}))},k=function(){return i.query("GET_ACTIVE_ITEMS")},T=function(t){return new Promise((function(e,n){i.dispatch("REQUEST_ITEM_PROCESSING",{query:t,success:function(t){e(t)},failure:function(t){n(t)}})}))},C=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=Array.isArray(e[0])?e[0]:e,r=i.length?i:k();return Promise.all(r.map(E))},S=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=Array.isArray(e[0])?e[0]:e;if(!i.length){var r=k().filter((function(t){return!(t.status===rh.IDLE&&t.origin===oh.LOCAL)&&t.status!==rh.PROCESSING&&t.status!==rh.PROCESSING_COMPLETE&&t.status!==rh.PROCESSING_REVERT_ERROR}));return Promise.all(r.map(T))}return Promise.all(i.map(T))},I=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i,r=Array.isArray(e[0])?e[0]:e;"object"===$u(r[r.length-1])?i=r.pop():Array.isArray(e[0])&&(i=e[1]);var o=k();if(!r.length)return Promise.all(o.map((function(t){return D(t,i)})));var a=r.map((function(t){return ac(t)?o[t]?o[t].id:null:t})).filter((function(t){return t}));return a.map((function(t){return D(t,i)}))},O=zu(zu(zu(zu({},Qc()),p),Gc(i,n)),{},{setOptions:b,addFile:x,addFiles:w,getFile:_,processFile:T,prepareFile:E,removeFile:D,moveFile:function(t,e){return i.dispatch("MOVE_ITEM",{query:t,index:e})},getFiles:k,processFiles:S,removeFiles:I,prepareFiles:C,sort:function(t){return i.dispatch("SORT",{compare:t})},browse:function(){var t=h.element.querySelector("input[type=file]");t&&t.click()},destroy:function(){O.fire("destroy",h.element),i.dispatch("ABORT_ALL"),h._destroy(),window.removeEventListener("resize",c),document.removeEventListener("visibilitychange",r),i.dispatch("DID_DESTROY")},insertBefore:function(t){return bc(h.element,t)},insertAfter:function(t){return _c(h.element,t)},appendTo:function(t){return t.appendChild(h.element)},replaceElement:function(t){bc(h.element,t),t.parentNode.removeChild(t),e=t},restoreElement:function(){e&&(_c(e,h.element),h.element.parentNode.removeChild(h.element),e=null)},isAttachedTo:function(t){return h.element===t||e===t},element:{get:function(){return h.element}},status:{get:function(){return i.query("GET_STATUS")}}});return i.dispatch("DID_INIT"),Hl(O)},Gp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={};Wl(fh(),(function(t,n){e[t]=n[0]}));var n=Up(zu(zu({},e),t));return n},Wp=function(t){return Sp(t.replace(/^data-/,""))},Hp=function t(e,n){Wl(n,(function(n,i){Wl(e,(function(t,r){var o=new RegExp(n);if(o.test(t)&&(delete e[t],!1!==i))if(Tc(i))e[i]=r;else{var a,s=i.group;Fc(i)&&!e[s]&&(e[s]={}),e[s][(a=t.replace(o,""),a.charAt(0).toLowerCase()+a.slice(1))]=r}})),i.mapping&&t(e[i.group],i.mapping)}))},qp=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];Wl(t.attributes,(function(e){n.push(t.attributes[e])}));var i=n.filter((function(t){return t.name})).reduce((function(e,n){var i=ql(t,n.name);return e[Wp(n.name)]=i===n.name||i,e}),{});return Hp(i,e),i},$p=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={"^class$":"className","^multiple$":"allowMultiple","^capture$":"captureMethod","^webkitdirectory$":"allowDirectoriesOnly","^server":{group:"server",mapping:{"^process":{group:"process"},"^revert":{group:"revert"},"^fetch":{group:"fetch"},"^restore":{group:"restore"},"^load":{group:"load"}}},"^type$":!1,"^files$":!1};hh("SET_ATTRIBUTE_TO_OPTION_MAP",n);var i=zu({},e),r=qp("FIELDSET"===t.nodeName?t.querySelector("input[type=file]"):t,n);Object.keys(r).forEach((function(t){Fc(r[t])?(Fc(i[t])||(i[t]={}),Object.assign(i[t],r[t])):i[t]=r[t]})),i.files=(e.files||[]).concat(Array.from(t.querySelectorAll("input:not([type=file])")).map((function(t){return{source:t.value,options:{type:t.dataset.type}}})));var o=Gp(i);return t.files&&Array.from(t.files).forEach((function(t){o.addFile(t)})),o.replaceElement(t),o},Yp=function(){return Ul(arguments.length<=0?void 0:arguments[0])?$p.apply(void 0,arguments):Gp.apply(void 0,arguments)},Xp=["fire","_read","_write"],Kp=function(t){var e={};return th(t,e,Xp),e},Zp=function(t,e){return t.replace(/(?:{([a-zA-Z]+)})/g,(function(t,n){return e[n]}))},Jp=function(t){var e=new Blob(["(",t.toString(),")()"],{type:"application/javascript"}),n=URL.createObjectURL(e),i=new Worker(n);return{transfer:function(t,e){},post:function(t,e,n){var r=Zc();i.onmessage=function(t){t.data.id===r&&e(t.data.message)},i.postMessage({id:r,message:t},n)},terminate:function(){i.terminate(),URL.revokeObjectURL(n)}}},Qp=function(t){return new Promise((function(e,n){var i=new Image;i.onload=function(){e(i)},i.onerror=function(t){n(t)},i.src=t}))},tg=function(t,e){var n=t.slice(0,t.size,t.type);return n.lastModifiedDate=t.lastModifiedDate,n.name=e,n},eg=function(t){return tg(t,t.name)},ng=[],ig=function(t){if(!ng.includes(t)){ng.push(t);var e,n=t({addFilter:dh,utils:{Type:uh,forin:Wl,isString:Tc,isFile:ld,toNaturalFileSize:Td,replaceInString:Zp,getExtensionFromFilename:Oh,getFilenameWithoutExtension:sd,guesstimateMimeType:Wf,getFileFromBlob:Ph,getFilenameFromURL:Ih,createRoute:yc,createWorker:Jp,createView:vc,createItemAPI:nh,loadImage:Qp,copyFile:eg,renameFile:tg,createBlob:Fh,applyFilterChain:ch,text:xd,getNumericAspectRatioFromString:mh},views:{fileActionButton:kd}});e=n.options,Object.assign(ph,e)}},rg=(jd=ec()&&!("[object OperaMini]"===Object.prototype.toString.call(window.operamini))&&"visibilityState"in document&&"Promise"in window&&"slice"in Blob.prototype&&"URL"in window&&"createObjectURL"in window.URL&&"performance"in window&&("supports"in(window.CSS||{})||/MSIE|Trident/.test(window.navigator.userAgent)),function(){return jd}),og={apps:[]},ag=function(){},sg={},ug={},lg=ag,cg=ag,hg=ag,dg=ag,fg=ag,pg=ag,gg=ag;if(rg()){!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:60,i="__framePainter";if(window[i])return window[i].readers.push(t),void window[i].writers.push(e);window[i]={readers:[t],writers:[e]};var r=window[i],o=1e3/n,a=null,s=null,u=null,l=null,c=function(){document.hidden?(u=function(){return window.setTimeout((function(){return h(performance.now())}),o)},l=function(){return window.clearTimeout(s)}):(u=function(){return window.requestAnimationFrame(h)},l=function(){return window.cancelAnimationFrame(s)})};document.addEventListener("visibilitychange",(function(){l&&l(),c(),h(performance.now())}));var h=function t(e){s=u(t),a||(a=e);var n=e-a;n<=o||(a=e-n%o,r.readers.forEach((function(t){return t()})),r.writers.forEach((function(t){return t(e)})))};c(),h(performance.now())}((function(){og.apps.forEach((function(t){return t._read()}))}),(function(t){og.apps.forEach((function(e){return e._write(t)}))}));var mg=function t(){document.dispatchEvent(new CustomEvent("FilePond:loaded",{detail:{supported:rg,create:lg,destroy:cg,parse:hg,find:dg,registerPlugin:fg,setOptions:gg}})),document.removeEventListener("DOMContentLoaded",t)};"loading"!==document.readyState?setTimeout((function(){return mg()}),0):document.addEventListener("DOMContentLoaded",mg);var vg=function(){return Wl(fh(),(function(t,e){ug[t]=e[1]}))};zu({},yh),sg=zu({},oh),zu({},rh),ug={},vg(),lg=function(){var t=Yp.apply(void 0,arguments);return t.on("destroy",cg),og.apps.push(t),Kp(t)},cg=function(t){var e=og.apps.findIndex((function(e){return e.isAttachedTo(t)}));return e>=0&&(og.apps.splice(e,1)[0].restoreElement(),!0)},hg=function(t){return Array.from(t.querySelectorAll(".".concat("filepond"))).filter((function(t){return!og.apps.find((function(e){return e.isAttachedTo(t)}))})).map((function(t){return lg(t)}))},dg=function(t){var e=og.apps.find((function(e){return e.isAttachedTo(t)}));return e?Kp(e):null},fg=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];e.forEach(ig),vg()},pg=function(){var t={};return Wl(fh(),(function(e,n){t[e]=n[0]})),t},gg=function(t){return Fc(t)&&(og.apps.forEach((function(e){e.setOptions(t)})),function(t){Wl(t,(function(t,e){ph[t]&&(ph[t][0]=jc(e,ph[t][0],ph[t][1]))}))}(t)),pg()}}
  /*!
   * FilePondPluginFileValidateSize 2.2.5
   * Licensed under MIT, https://opensource.org/licenses/MIT/
   * Please visit https://pqina.nl/filepond/ for details.
   */var yg=function(t){var e=t.addFilter,n=t.utils,i=n.Type,r=n.replaceInString,o=n.toNaturalFileSize;return e("ALLOW_HOPPER_ITEM",(function(t,e){var n=e.query;if(!n("GET_ALLOW_FILE_SIZE_VALIDATION"))return!0;var i=n("GET_MAX_FILE_SIZE");if(null!==i&&t.size>=i)return!1;var r=n("GET_MIN_FILE_SIZE");return!(null!==r&&t.size<=r)})),e("LOAD_FILE",(function(t,e){var n=e.query;return new Promise((function(e,i){if(!n("GET_ALLOW_FILE_SIZE_VALIDATION"))return e(t);var a=n("GET_FILE_VALIDATE_SIZE_FILTER");if(a&&!a(t))return e(t);var s=n("GET_MAX_FILE_SIZE");if(null!==s&&t.size>=s)i({status:{main:n("GET_LABEL_MAX_FILE_SIZE_EXCEEDED"),sub:r(n("GET_LABEL_MAX_FILE_SIZE"),{filesize:o(s,".",n("GET_FILE_SIZE_BASE"),n("GET_FILE_SIZE_LABELS",n))})}});else{var u=n("GET_MIN_FILE_SIZE");if(null!==u&&t.size<=u)i({status:{main:n("GET_LABEL_MIN_FILE_SIZE_EXCEEDED"),sub:r(n("GET_LABEL_MIN_FILE_SIZE"),{filesize:o(u,".",n("GET_FILE_SIZE_BASE"),n("GET_FILE_SIZE_LABELS",n))})}});else{var l=n("GET_MAX_TOTAL_FILE_SIZE");if(null!==l)if(n("GET_ACTIVE_ITEMS").reduce((function(t,e){return t+e.fileSize}),0)>l)return void i({status:{main:n("GET_LABEL_MAX_TOTAL_FILE_SIZE_EXCEEDED"),sub:r(n("GET_LABEL_MAX_TOTAL_FILE_SIZE"),{filesize:o(l,".",n("GET_FILE_SIZE_BASE"),n("GET_FILE_SIZE_LABELS",n))})}});e(t)}}}))})),{options:{allowFileSizeValidation:[!0,i.BOOLEAN],maxFileSize:[null,i.INT],minFileSize:[null,i.INT],maxTotalFileSize:[null,i.INT],fileValidateSizeFilter:[null,i.FUNCTION],labelMinFileSizeExceeded:["File is too small",i.STRING],labelMinFileSize:["Minimum file size is {filesize}",i.STRING],labelMaxFileSizeExceeded:["File is too large",i.STRING],labelMaxFileSize:["Maximum file size is {filesize}",i.STRING],labelMaxTotalFileSizeExceeded:["Maximum total size exceeded",i.STRING],labelMaxTotalFileSize:["Maximum total file size is {filesize}",i.STRING]}}};"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:yg}));var bg=yg,_g=function(t){var e=t.addFilter,n=t.utils,i=n.Type,r=n.isString,o=n.replaceInString,a=n.guesstimateMimeType,s=n.getExtensionFromFilename,u=n.getFilenameFromURL,l=function(t,e){return t.some((function(t){return/\*$/.test(t)?(n=t,(/^[^/]+/.exec(e)||[]).pop()===n.slice(0,-2)):t===e;var n}))},c=function(t,e,n){if(0===e.length)return!0;var i=function(t){var e="";if(r(t)){var n=u(t),i=s(n);i&&(e=a(i))}else e=t.type;return e}(t);return n?new Promise((function(r,o){n(t,i).then((function(t){l(e,t)?r():o()})).catch(o)})):l(e,i)};return e("SET_ATTRIBUTE_TO_OPTION_MAP",(function(t){return Object.assign(t,{accept:"acceptedFileTypes"})})),e("ALLOW_HOPPER_ITEM",(function(t,e){var n=e.query;return!n("GET_ALLOW_FILE_TYPE_VALIDATION")||c(t,n("GET_ACCEPTED_FILE_TYPES"))})),e("LOAD_FILE",(function(t,e){var n=e.query;return new Promise((function(e,i){if(n("GET_ALLOW_FILE_TYPE_VALIDATION")){var r=n("GET_ACCEPTED_FILE_TYPES"),a=n("GET_FILE_VALIDATE_TYPE_DETECT_TYPE"),s=c(t,r,a),u=function(){var t,e=r.map((t=n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP"),function(e){return null!==t[e]&&(t[e]||e)})).filter((function(t){return!1!==t}));i({status:{main:n("GET_LABEL_FILE_TYPE_NOT_ALLOWED"),sub:o(n("GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES"),{allTypes:e.join(", "),allButLastType:e.slice(0,-1).join(", "),lastType:e[e.length-1]})}})};if("boolean"==typeof s)return s?e(t):u();s.then((function(){e(t)})).catch(u)}else e(t)}))})),{options:{allowFileTypeValidation:[!0,i.BOOLEAN],acceptedFileTypes:[[],i.ARRAY],labelFileTypeNotAllowed:["File is of invalid type",i.STRING],fileValidateTypeLabelExpectedTypes:["Expects {allButLastType} or {lastType}",i.STRING],fileValidateTypeLabelExpectedTypesMap:[{},i.OBJECT],fileValidateTypeDetectType:[null,i.FUNCTION]}}};
  /*!
   * FilePondPluginFileValidateType 1.2.6
   * Licensed under MIT, https://opensource.org/licenses/MIT/
   * Please visit https://pqina.nl/filepond/ for details.
   */"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:_g}));var Eg=_g,xg=function(t){return/^image/.test(t.type)},Ag=function(t){var e=t.addFilter,n=t.utils,i=n.Type,r=n.isFile,o=n.getNumericAspectRatioFromString,a=function(t,e){return!(!xg(t.file)||!e("GET_ALLOW_IMAGE_CROP"))},s=function(t){return"object"===$u(t)},u=function(t){return"number"==typeof t},l=function(t,e){return t.setMetadata("crop",Object.assign({},t.getMetadata("crop"),e))};return e("DID_CREATE_ITEM",(function(t,e){var n=e.query;t.extend("setImageCrop",(function(e){if(a(t,n)&&s(center))return t.setMetadata("crop",e),e})),t.extend("setImageCropCenter",(function(e){if(a(t,n)&&s(e))return l(t,{center:e})})),t.extend("setImageCropZoom",(function(e){if(a(t,n)&&u(e))return l(t,{zoom:Math.max(1,e)})})),t.extend("setImageCropRotation",(function(e){if(a(t,n)&&u(e))return l(t,{rotation:e})})),t.extend("setImageCropFlip",(function(e){if(a(t,n)&&s(e))return l(t,{flip:e})})),t.extend("setImageCropAspectRatio",(function(e){if(a(t,n)&&void 0!==e){var i=t.getMetadata("crop"),r=o(e),s={center:{x:.5,y:.5},flip:i?Object.assign({},i.flip):{horizontal:!1,vertical:!1},rotation:0,zoom:1,aspectRatio:r};return t.setMetadata("crop",s),s}}))})),e("DID_LOAD_ITEM",(function(t,e){var n=e.query;return new Promise((function(e,i){var a=t.file;if(!r(a)||!xg(a)||!n("GET_ALLOW_IMAGE_CROP"))return e(t);if(t.getMetadata("crop"))return e(t);var s=n("GET_IMAGE_CROP_ASPECT_RATIO");t.setMetadata("crop",{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},rotation:0,zoom:1,aspectRatio:s?o(s):null}),e(t)}))})),{options:{allowImageCrop:[!0,i.BOOLEAN],imageCropAspectRatio:[null,i.STRING]}}};
  /*!
   * FilePondPluginImageCrop 2.0.6
   * Licensed under MIT, https://opensource.org/licenses/MIT/
   * Please visit https://pqina.nl/filepond/ for details.
   */"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Ag}));var Dg=Ag,wg=65496,kg=65505,Tg=1165519206,Cg=18761,Sg=274,Ig=65280,Og=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.getUint16(e,n)},Rg=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.getUint32(e,n)},Mg="undefined"!=typeof window&&void 0!==window.document,Lg=void 0,Pg=Mg?new Image:{};
  /*!
   * FilePondPluginImageExifOrientation 1.0.11
   * Licensed under MIT, https://opensource.org/licenses/MIT/
   * Please visit https://pqina.nl/filepond/ for details.
   */Pg.onload=function(){return Lg=Pg.naturalWidth>Pg.naturalHeight},Pg.src="data:image/jpg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";var Fg=function(t){var e=t.addFilter,n=t.utils,i=n.Type,r=n.isFile;return e("DID_LOAD_ITEM",(function(t,e){var n=e.query;return new Promise((function(e,i){var o=t.file;if(!(r(o)&&function(t){return/^image\/jpeg/.test(t.type)}(o)&&n("GET_ALLOW_IMAGE_EXIF_ORIENTATION")&&Lg))return e(t);(function(t){return new Promise((function(e,n){var i=new FileReader;i.onload=function(t){var n=new DataView(t.target.result);if(Og(n,0)===wg){for(var i=n.byteLength,r=2;r<i;){var o=Og(n,r);if(r+=2,o===kg){if(Rg(n,r+=2)!==Tg)break;var a=Og(n,r+=6)===Cg;r+=Rg(n,r+4,a);var s=Og(n,r,a);r+=2;for(var u=0;u<s;u++)if(Og(n,r+12*u,a)===Sg)return void e(Og(n,r+12*u+8,a))}else{if((o&Ig)!==Ig)break;r+=Og(n,r)}}e(-1)}else e(-1)},i.readAsArrayBuffer(t.slice(0,65536))}))})(o).then((function(n){t.setMetadata("exif",{orientation:n}),e(t)}))}))})),{options:{allowImageExifOrientation:[!0,i.BOOLEAN]}}};"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:Fg}));var Bg=Fg,Ng=function(t,e){return zg(t.x*e,t.y*e)},jg=function(t,e){return zg(t.x+e.x,t.y+e.y)},Vg=function(t,e,n){var i=Math.cos(e),r=Math.sin(e),o=zg(t.x-n.x,t.y-n.y);return zg(n.x+i*o.x-r*o.y,n.y+r*o.x+i*o.y)},zg=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{x:t,y:e}},Ug=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0;return"string"==typeof t?parseFloat(t)*n:"number"==typeof t?t*(i?e[i]:Math.min(e.width,e.height)):void 0},Gg=function(t){return null!=t},Wg=function(t,e){return Object.keys(e).forEach((function(n){return t.setAttribute(n,e[n])}))},Hg=function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg",t);return e&&Wg(n,e),n},qg={contain:"xMidYMid meet",cover:"xMidYMid slice"},$g={left:"start",center:"middle",right:"end"},Yg=function(t){return function(e){return Hg(t,{id:e.id})}},Xg={image:function(t){var e=Hg("image",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return e.onload=function(){e.setAttribute("opacity",t.opacity||1)},e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.src),e},rect:Yg("rect"),ellipse:Yg("ellipse"),text:Yg("text"),path:Yg("path"),line:function(t){var e=Hg("g",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round"}),n=Hg("line");e.appendChild(n);var i=Hg("path");e.appendChild(i);var r=Hg("path");return e.appendChild(r),e}},Kg={rect:function(t){return Wg(t,zu(zu({},t.rect),t.styles))},ellipse:function(t){var e=t.rect.x+.5*t.rect.width,n=t.rect.y+.5*t.rect.height,i=.5*t.rect.width,r=.5*t.rect.height;return Wg(t,zu({cx:e,cy:n,rx:i,ry:r},t.styles))},image:function(t,e){Wg(t,zu(zu(zu({},t.rect),t.styles),{},{preserveAspectRatio:qg[e.fit]||"none"}))},text:function(t,e,n,i){var r=Ug(e.fontSize,n,i),o=e.fontFamily||"sans-serif",a=e.fontWeight||"normal",s=$g[e.textAlign]||"start";Wg(t,zu(zu(zu({},t.rect),t.styles),{},{"stroke-width":0,"font-weight":a,"font-size":r,"font-family":o,"text-anchor":s})),t.text!==e.text&&(t.text=e.text,t.textContent=e.text.length?e.text:" ")},path:function(t,e,n,i){var r;Wg(t,zu(zu({},t.styles),{},{fill:"none",d:(r=e.points.map((function(t){return{x:Ug(t.x,n,i,"width"),y:Ug(t.y,n,i,"height")}})),r.map((function(t,e){return"".concat(0===e?"M":"L"," ").concat(t.x," ").concat(t.y)})).join(" "))}))},line:function(t,e,n,i){Wg(t,zu(zu(zu({},t.rect),t.styles),{},{fill:"none"}));var r=t.childNodes[0],o=t.childNodes[1],a=t.childNodes[2],s=t.rect,u={x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height};if(Wg(r,{x1:s.x,y1:s.y,x2:u.x,y2:u.y}),e.lineDecoration){o.style.display="none",a.style.display="none";var l=function(t){var e=Math.sqrt(t.x*t.x+t.y*t.y);return 0===e?{x:0,y:0}:zg(t.x/e,t.y/e)}({x:u.x-s.x,y:u.y-s.y}),c=Ug(.05,n,i);if(-1!==e.lineDecoration.indexOf("arrow-begin")){var h=Ng(l,c),d=jg(s,h),f=Vg(s,2,d),p=Vg(s,-2,d);Wg(o,{style:"display:block;",d:"M".concat(f.x,",").concat(f.y," L").concat(s.x,",").concat(s.y," L").concat(p.x,",").concat(p.y)})}if(-1!==e.lineDecoration.indexOf("arrow-end")){var g=Ng(l,-c),m=jg(u,g),v=Vg(u,2,m),y=Vg(u,-2,m);Wg(a,{style:"display:block;",d:"M".concat(v.x,",").concat(v.y," L").concat(u.x,",").concat(u.y," L").concat(y.x,",").concat(y.y)})}}}},Zg=function(t,e,n,i,r){"path"!==e&&(t.rect=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=Ug(t.x,e,n,"width")||Ug(t.left,e,n,"width"),r=Ug(t.y,e,n,"height")||Ug(t.top,e,n,"height"),o=Ug(t.width,e,n,"width"),a=Ug(t.height,e,n,"height"),s=Ug(t.right,e,n,"width"),u=Ug(t.bottom,e,n,"height");return Gg(r)||(r=Gg(a)&&Gg(u)?e.height-a-u:u),Gg(i)||(i=Gg(o)&&Gg(s)?e.width-o-s:s),Gg(o)||(o=Gg(i)&&Gg(s)?e.width-i-s:0),Gg(a)||(a=Gg(r)&&Gg(u)?e.height-r-u:0),{x:i||0,y:r||0,width:o||0,height:a||0}}(n,i,r)),t.styles=function(t,e,n){var i=t.borderStyle||t.lineStyle||"solid",r=t.backgroundColor||t.fontColor||"transparent",o=t.borderColor||t.lineColor||"transparent",a=Ug(t.borderWidth||t.lineWidth,e,n);return{"stroke-linecap":t.lineCap||"round","stroke-linejoin":t.lineJoin||"round","stroke-width":a||0,"stroke-dasharray":"string"==typeof i?"":i.map((function(t){return Ug(t,e,n)})).join(","),stroke:o,fill:r,opacity:t.opacity||1}}(n,i,r),Kg[e](t,n,i,r)},Jg=["x","y","left","top","right","bottom","width","height"],Qg=function(t){var e=Nu(t,2),n=e[0],i=e[1],r=i.points?{}:Jg.reduce((function(t,e){var n;return t[e]="string"==typeof(n=i[e])&&/%/.test(n)?parseFloat(n)/100:n,t}),{});return[n,zu(zu({zIndex:0},i),r)]},tm=function(t,e){return t[1].zIndex>e[1].zIndex?1:t[1].zIndex<e[1].zIndex?-1:0},em=function(t){return t.utils.createView({name:"image-preview-markup",tag:"svg",ignoreRect:!0,mixins:{apis:["width","height","crop","markup","resize","dirty"]},write:function(t){var e=t.root,n=t.props;if(n.dirty){var i=n.crop,r=n.resize,o=n.markup,a=n.width,s=n.height,u=i.width,l=i.height;if(r){var c=r.size,h=c&&c.width,d=c&&c.height,f=r.mode,p=r.upscale;h&&!d&&(d=h),d&&!h&&(h=d);var g=u<h&&l<d;if(!g||g&&p){var m,v=h/u,y=d/l;if("force"===f)u=h,l=d;else"cover"===f?m=Math.max(v,y):"contain"===f&&(m=Math.min(v,y)),u*=m,l*=m}}var b={width:a,height:s};e.element.setAttribute("width",b.width),e.element.setAttribute("height",b.height);var _=Math.min(a/u,s/l);e.element.innerHTML="";var E=e.query("GET_IMAGE_PREVIEW_MARKUP_FILTER");o.filter(E).map(Qg).sort(tm).forEach((function(t){var n=Nu(t,2),i=n[0],r=n[1],o=function(t,e){return Xg[t](e)}(i,r);Zg(o,i,r,b,_),e.element.appendChild(o)}))}}})},nm=function(t,e){return{x:t,y:e}},im=function(t,e){return nm(t.x-e.x,t.y-e.y)},rm=function(t,e){return Math.sqrt(function(t,e){return function(t,e){return t.x*e.x+t.y*e.y}(im(t,e),im(t,e))}(t,e))},om=function(t,e){var n=t,i=e,r=1.5707963267948966-e,o=Math.sin(1.5707963267948966),a=Math.sin(i),s=Math.sin(r),u=Math.cos(r),l=n/o;return nm(u*(l*a),u*(l*s))},am=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=t.height/t.width,r=1,o=e,a=1,s=i;s>o&&(a=(s=o)/i);var u=Math.max(r/a,o/s),l=t.width/(n*u*a),c=l*e;return{width:l,height:c}},sm=function(t,e,n,i){var r=i.x>.5?1-i.x:i.x,o=i.y>.5?1-i.y:i.y,a=2*r*t.width,s=2*o*t.height,u=function(t,e){var n=t.width,i=t.height,r=om(n,e),o=om(i,e),a=nm(t.x+Math.abs(r.x),t.y-Math.abs(r.y)),s=nm(t.x+t.width+Math.abs(o.y),t.y+Math.abs(o.x)),u=nm(t.x-Math.abs(o.y),t.y+t.height-Math.abs(o.x));return{width:rm(a,s),height:rm(a,u)}}(e,n);return Math.max(u.width/a,u.height/s)},um=function(t,e){var n=t.width,i=n*e;return i>t.height&&(n=(i=t.height)/e),{x:.5*(t.width-n),y:.5*(t.height-i),width:n,height:i}},lm={type:"spring",stiffness:.5,damping:.45,mass:10},cm=function(t){return t.utils.createView({name:"image-clip",tag:"div",ignoreRect:!0,mixins:{apis:["crop","markup","resize","width","height","dirty","background"],styles:["width","height","opacity"],animations:{opacity:{type:"tween",duration:250}}},didWriteView:function(t){var e=t.root,n=t.props;n.background&&(e.element.style.backgroundColor=n.background)},create:function(e){var n=e.root,i=e.props;n.ref.image=n.appendChildView(n.createChildView(function(t){return t.utils.createView({name:"image-canvas-wrapper",tag:"div",ignoreRect:!0,mixins:{apis:["crop","width","height"],styles:["originX","originY","translateX","translateY","scaleX","scaleY","rotateZ"],animations:{originX:lm,originY:lm,scaleX:lm,scaleY:lm,translateX:lm,translateY:lm,rotateZ:lm}},create:function(e){var n=e.root,i=e.props;i.width=i.image.width,i.height=i.image.height,n.ref.bitmap=n.appendChildView(n.createChildView(function(t){return t.utils.createView({name:"image-bitmap",ignoreRect:!0,mixins:{styles:["scaleX","scaleY"]},create:function(t){var e=t.root,n=t.props;e.appendChild(n.image)}})}(t),{image:i.image}))},write:function(t){var e=t.root,n=t.props.crop.flip,i=e.ref.bitmap;i.scaleX=n.horizontal?-1:1,i.scaleY=n.vertical?-1:1}})}(t),Object.assign({},i))),n.ref.createMarkup=function(){n.ref.markup||(n.ref.markup=n.appendChildView(n.createChildView(em(t),Object.assign({},i))))},n.ref.destroyMarkup=function(){n.ref.markup&&(n.removeChildView(n.ref.markup),n.ref.markup=null)};var r=n.query("GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR");null!==r&&(n.element.dataset.transparencyIndicator="grid"===r?r:"color")},write:function(t){var e=t.root,n=t.props,i=t.shouldOptimize,r=n.crop,o=n.markup,a=n.resize,s=n.dirty,u=n.width,l=n.height;e.ref.image.crop=r;var c={x:0,y:0,width:u,height:l,center:{x:.5*u,y:.5*l}},h={width:e.ref.image.width,height:e.ref.image.height},d={x:r.center.x*h.width,y:r.center.y*h.height},f={x:c.center.x-h.width*r.center.x,y:c.center.y-h.height*r.center.y},p=2*Math.PI+r.rotation%(2*Math.PI),g=r.aspectRatio||h.height/h.width,m=void 0===r.scaleToFit||r.scaleToFit,v=sm(h,um(c,g),p,m?r.center:{x:.5,y:.5}),y=r.zoom*v;o&&o.length?(e.ref.createMarkup(),e.ref.markup.width=u,e.ref.markup.height=l,e.ref.markup.resize=a,e.ref.markup.dirty=s,e.ref.markup.markup=o,e.ref.markup.crop=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.zoom,i=e.rotation,r=e.center,o=e.aspectRatio;o||(o=t.height/t.width);var a=am(t,o,n),s={x:.5*a.width,y:.5*a.height},u={x:0,y:0,width:a.width,height:a.height,center:s},l=void 0===e.scaleToFit||e.scaleToFit,c=sm(t,um(u,o),i,l?r:{x:.5,y:.5}),h=n*c;return{widthFloat:a.width/h,heightFloat:a.height/h,width:Math.round(a.width/h),height:Math.round(a.height/h)}}(h,r)):e.ref.markup&&e.ref.destroyMarkup();var b=e.ref.image;if(i)return b.originX=null,b.originY=null,b.translateX=null,b.translateY=null,b.rotateZ=null,b.scaleX=null,void(b.scaleY=null);b.originX=d.x,b.originY=d.y,b.translateX=f.x,b.translateY=f.y,b.rotateZ=p,b.scaleX=y,b.scaleY=y}})},hm=0,dm=function(){self.onmessage=function(t){createImageBitmap(t.data.message.file).then((function(e){self.postMessage({id:t.data.id,message:e},[e])}))}},fm=function(){self.onmessage=function(t){for(var e=t.data.message.imageData,n=t.data.message.colorMatrix,i=e.data,r=i.length,o=n[0],a=n[1],s=n[2],u=n[3],l=n[4],c=n[5],h=n[6],d=n[7],f=n[8],p=n[9],g=n[10],m=n[11],v=n[12],y=n[13],b=n[14],_=n[15],E=n[16],x=n[17],A=n[18],D=n[19],w=0,k=0,T=0,C=0,S=0;w<r;w+=4)k=i[w]/255,T=i[w+1]/255,C=i[w+2]/255,S=i[w+3]/255,i[w]=Math.max(0,Math.min(255*(k*o+T*a+C*s+S*u+l),255)),i[w+1]=Math.max(0,Math.min(255*(k*c+T*h+C*d+S*f+p),255)),i[w+2]=Math.max(0,Math.min(255*(k*g+T*m+C*v+S*y+b),255)),i[w+3]=Math.max(0,Math.min(255*(k*_+T*E+C*x+S*A+D),255));self.postMessage({id:t.data.id,message:e},[e.data.buffer])}},pm={1:function(){return[1,0,0,1,0,0]},2:function(t){return[-1,0,0,1,t,0]},3:function(t,e){return[-1,0,0,-1,t,e]},4:function(t,e){return[1,0,0,-1,0,e]},5:function(){return[0,1,1,0,0,0]},6:function(t,e){return[0,1,-1,0,e,0]},7:function(t,e){return[0,-1,-1,0,e,t]},8:function(t){return[0,-1,1,0,0,t]}},gm=function(t,e,n,i){e=Math.round(e),n=Math.round(n);var r=document.createElement("canvas");r.width=e,r.height=n;var o=r.getContext("2d");if(i>=5&&i<=8){var a=[n,e];e=a[0],n=a[1]}return function(t,e,n,i){-1!==i&&t.transform.apply(t,pm[i](e,n))}(o,e,n,i),o.drawImage(t,0,0,e,n),r},mm=function(t){return/^image/.test(t.type)&&!/svg/.test(t.type)},vm=function(t,e){return Math.floor(Math.sqrt(t/(e/4)))},ym=function(t,e){return(e=e||document.createElement("canvas")).width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e},bm=function(t){var e=t.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:function(t){var e=t.root,n=t.props,i='<svg width="500" height="200" viewBox="0 0 500 200" preserveAspectRatio="none">\n    <defs>\n        <radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">\n            <stop offset=\'50%\' stop-color=\'#000000\'/>\n            <stop offset=\'56%\' stop-color=\'#0a0a0a\'/>\n            <stop offset=\'63%\' stop-color=\'#262626\'/>\n            <stop offset=\'69%\' stop-color=\'#4f4f4f\'/>\n            <stop offset=\'75%\' stop-color=\'#808080\'/>\n            <stop offset=\'81%\' stop-color=\'#b1b1b1\'/>\n            <stop offset=\'88%\' stop-color=\'#dadada\'/>\n            <stop offset=\'94%\' stop-color=\'#f6f6f6\'/>\n            <stop offset=\'100%\' stop-color=\'#ffffff\'/>\n        </radialGradient>\n        <mask id="mask-__UID__">\n            <rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>\n        </mask>\n    </defs>\n    <rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>\n</svg>';if(document.querySelector("base")){var r=window.location.href.replace(window.location.hash,"");i=i.replace(/url\(\#/g,"url("+r+"#")}hm++,e.element.classList.add("filepond--image-preview-overlay-".concat(n.status)),e.element.innerHTML=i.replace(/__UID__/g,hm)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),n=function(t){return t.utils.createView({name:"image-preview",tag:"div",ignoreRect:!0,mixins:{apis:["image","crop","markup","resize","dirty","background"],styles:["translateY","scaleX","scaleY","opacity"],animations:{scaleX:lm,scaleY:lm,translateY:lm,opacity:{type:"tween",duration:400}}},create:function(e){var n=e.root,i=e.props;n.ref.clip=n.appendChildView(n.createChildView(cm(t),{id:i.id,image:i.image,crop:i.crop,markup:i.markup,resize:i.resize,dirty:i.dirty,background:i.background}))},write:function(t){var e=t.root,n=t.props,i=t.shouldOptimize,r=e.ref.clip,o=n.image,a=n.crop,s=n.markup,u=n.resize,l=n.dirty;if(r.crop=a,r.markup=s,r.resize=u,r.dirty=l,r.opacity=i?0:1,!i&&!e.rect.element.hidden){var c=o.height/o.width,h=a.aspectRatio||c,d=e.rect.inner.width,f=e.rect.inner.height,p=e.query("GET_IMAGE_PREVIEW_HEIGHT"),g=e.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),m=e.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),v=e.query("GET_PANEL_ASPECT_RATIO"),y=e.query("GET_ALLOW_MULTIPLE");v&&!y&&(p=d*v,h=v);var b=null!==p?p:Math.max(g,Math.min(d*h,m)),_=b/h;_>d&&(b=(_=d)*h),b>f&&(b=f,_=f/h),r.width=_,r.height=b}}})}(t),i=t.utils.createWorker,r=function(t,e,n){return new Promise((function(r){t.ref.imageData||(t.ref.imageData=n.getContext("2d").getImageData(0,0,n.width,n.height));var o=function(t){var e;try{e=new ImageData(t.width,t.height)}catch(n){e=document.createElement("canvas").getContext("2d").createImageData(t.width,t.height)}return e.data.set(new Uint8ClampedArray(t.data)),e}(t.ref.imageData);if(!e||20!==e.length)return n.getContext("2d").putImageData(o,0,0),r();var a=i(fm);a.post({imageData:o,colorMatrix:e},(function(t){n.getContext("2d").putImageData(t,0,0),a.terminate(),r()}),[o.data.buffer])}))},o=function(t){var e=t.root,i=t.props,r=t.image,o=i.id,a=e.query("GET_ITEM",{id:o});if(a){var s,u,l=a.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},c=e.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),h=!1;e.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(s=a.getMetadata("markup")||[],u=a.getMetadata("resize"),h=!0);var d=e.appendChildView(e.createChildView(n,{id:o,image:r,crop:l,resize:u,markup:s,dirty:h,background:c,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),e.childViews.length);e.ref.images.push(d),d.opacity=1,d.scaleX=1,d.scaleY=1,d.translateY=0,setTimeout((function(){e.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:o})}),250)}},a=function(t){var e=t.root;e.ref.overlayShadow.opacity=1,e.ref.overlayError.opacity=0,e.ref.overlaySuccess.opacity=0},s=function(t){var e=t.root;e.ref.overlayShadow.opacity=.25,e.ref.overlayError.opacity=1};return t.utils.createView({name:"image-preview-wrapper",create:function(t){var n=t.root;n.ref.images=[],n.ref.imageData=null,n.ref.imageViewBin=[],n.ref.overlayShadow=n.appendChildView(n.createChildView(e,{opacity:0,status:"idle"})),n.ref.overlaySuccess=n.appendChildView(n.createChildView(e,{opacity:0,status:"success"})),n.ref.overlayError=n.appendChildView(n.createChildView(e,{opacity:0,status:"failure"}))},styles:["height"],apis:["height"],destroy:function(t){t.root.ref.images.forEach((function(t){t.image.width=1,t.image.height=1}))},didWriteView:function(t){t.root.ref.images.forEach((function(t){t.dirty=!1}))},write:t.utils.createRoute({DID_IMAGE_PREVIEW_DRAW:function(t){var e=t.root,n=e.ref.images[e.ref.images.length-1];n.translateY=0,n.scaleX=1,n.scaleY=1,n.opacity=1},DID_IMAGE_PREVIEW_CONTAINER_CREATE:function(t){var e=t.root,n=t.props.id,i=e.query("GET_ITEM",n);if(i){var r,o,a,s=URL.createObjectURL(i.file);r=s,o=function(t,i){e.dispatch("DID_IMAGE_PREVIEW_CALCULATE_SIZE",{id:n,width:t,height:i})},(a=new Image).onload=function(){var t=a.naturalWidth,e=a.naturalHeight;a=null,o(t,e)},a.src=r}},DID_FINISH_CALCULATE_PREVIEWSIZE:function(t){var e=t.root,n=t.props,a=n.id,s=e.query("GET_ITEM",a);if(s){var u,l,c=URL.createObjectURL(s.file),h=function(){var t;(t=c,new Promise((function(e,n){var i=new Image;i.crossOrigin="Anonymous",i.onload=function(){e(i)},i.onerror=function(t){n(t)},i.src=t}))).then(d)},d=function(t){URL.revokeObjectURL(c);var i=(s.getMetadata("exif")||{}).orientation||-1,a=t.width,u=t.height;if(a&&u){if(i>=5&&i<=8){var l=[u,a];a=l[0],u=l[1]}var h=Math.max(1,.75*window.devicePixelRatio),d=e.query("GET_IMAGE_PREVIEW_ZOOM_FACTOR")*h,f=u/a,p=e.rect.element.width,g=e.rect.element.height,m=p,v=m*f;f>1?v=(m=Math.min(a,p*d))*f:m=(v=Math.min(u,g*d))/f;var y=gm(t,m,v,i),b=function(){var i=e.query("GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR")?function(t){var e=Math.min(10/t.width,10/t.height),n=document.createElement("canvas"),i=n.getContext("2d"),r=n.width=Math.ceil(t.width*e),o=n.height=Math.ceil(t.height*e);i.drawImage(t,0,0,r,o);var a=null;try{a=i.getImageData(0,0,r,o).data}catch(t){return null}for(var s=a.length,u=0,l=0,c=0,h=0;h<s;h+=4)u+=a[h]*a[h],l+=a[h+1]*a[h+1],c+=a[h+2]*a[h+2];return{r:u=vm(u,s),g:l=vm(l,s),b:c=vm(c,s)}}(data):null;s.setMetadata("color",i,!0),"close"in t&&t.close(),e.ref.overlayShadow.opacity=1,o({root:e,props:n,image:y})},_=s.getMetadata("filter");_?r(e,_,y).then(b):b()}};if(u=s.file,((l=window.navigator.userAgent.match(/Firefox\/([0-9]+)\./))?parseInt(l[1]):null)<=58||!("createImageBitmap"in window)||!mm(u))h();else{var f=i(dm);f.post({file:s.file},(function(t){f.terminate(),t?d(t):h()}))}}},DID_UPDATE_ITEM_METADATA:function(t){var e=t.root,n=t.props,i=t.action;if(/crop|filter|markup|resize/.test(i.change.key)&&e.ref.images.length){var a=e.query("GET_ITEM",{id:n.id});if(a)if(/filter/.test(i.change.key)){var s=e.ref.images[e.ref.images.length-1];r(e,i.change.value,s.image)}else if(/crop|markup|resize/.test(i.change.key)){var u=a.getMetadata("crop"),l=e.ref.images[e.ref.images.length-1];if(u&&u.aspectRatio&&l.crop&&l.crop.aspectRatio&&Math.abs(u.aspectRatio-l.crop.aspectRatio)>1e-5){var c=function(t){var e=t.root,n=e.ref.images.shift();return n.opacity=0,n.translateY=-15,e.ref.imageViewBin.push(n),n}({root:e});o({root:e,props:n,image:ym(c.image)})}else!function(t){var e=t.root,n=t.props,i=e.query("GET_ITEM",{id:n.id});if(i){var r=e.ref.images[e.ref.images.length-1];r.crop=i.getMetadata("crop"),r.background=e.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),e.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(r.dirty=!0,r.resize=i.getMetadata("resize"),r.markup=i.getMetadata("markup"))}}({root:e,props:n})}}},DID_THROW_ITEM_LOAD_ERROR:s,DID_THROW_ITEM_PROCESSING_ERROR:s,DID_THROW_ITEM_INVALID:s,DID_COMPLETE_ITEM_PROCESSING:function(t){var e=t.root;e.ref.overlayShadow.opacity=.25,e.ref.overlaySuccess.opacity=1},DID_START_ITEM_PROCESSING:a,DID_REVERT_ITEM_PROCESSING:a},(function(t){var e=t.root,n=e.ref.imageViewBin.filter((function(t){return 0===t.opacity}));e.ref.imageViewBin=e.ref.imageViewBin.filter((function(t){return t.opacity>0})),n.forEach((function(t){return function(t,e){t.removeChildView(e),e.image.width=1,e.image.height=1,e._destroy()}(e,t)})),n.length=0}))})},_m=function(t){var e=t.addFilter,n=t.utils,i=n.Type,r=n.createRoute,o=n.isFile,a=bm(t);return e("CREATE_VIEW",(function(t){var e=t.is,n=t.view,i=t.query;if(e("file")&&i("GET_ALLOW_IMAGE_PREVIEW")){var s=function(t){t.root.ref.shouldRescale=!0};n.registerWriter(r({DID_RESIZE_ROOT:s,DID_STOP_RESIZE:s,DID_LOAD_ITEM:function(t){var e=t.root,r=t.props.id,s=i("GET_ITEM",r);if(s&&o(s.file)&&!s.archived){var u=s.file;if(function(t){return/^image/.test(t.type)}(u)&&i("GET_IMAGE_PREVIEW_FILTER_ITEM")(s)){var l="createImageBitmap"in(window||{}),c=i("GET_IMAGE_PREVIEW_MAX_FILE_SIZE");if(!(!l&&c&&u.size>c)){e.ref.imagePreview=n.appendChildView(n.createChildView(a,{id:r}));var h=e.query("GET_IMAGE_PREVIEW_HEIGHT");h&&e.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:s.id,height:h});var d=!l&&u.size>i("GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE");e.dispatch("DID_IMAGE_PREVIEW_CONTAINER_CREATE",{id:r},d)}}}},DID_IMAGE_PREVIEW_CALCULATE_SIZE:function(t){var e=t.root,n=t.action;e.ref.imageWidth=n.width,e.ref.imageHeight=n.height,e.ref.shouldRescale=!0,e.ref.shouldDrawPreview=!0,e.dispatch("KICK")},DID_UPDATE_ITEM_METADATA:function(t){var e=t.root;"crop"===t.action.change.key&&(e.ref.shouldRescale=!0)}},(function(t){var e=t.root,n=t.props;e.ref.imagePreview&&(e.rect.element.hidden||(e.ref.shouldRescale&&(!function(t,e){if(t.ref.imagePreview){var n=e.id,i=t.query("GET_ITEM",{id:n});if(i){var r=t.query("GET_PANEL_ASPECT_RATIO"),o=t.query("GET_ITEM_PANEL_ASPECT_RATIO"),a=t.query("GET_IMAGE_PREVIEW_HEIGHT");if(!(r||o||a)){var s=t.ref,u=s.imageWidth,l=s.imageHeight;if(u&&l){var c=t.query("GET_IMAGE_PREVIEW_MIN_HEIGHT"),h=t.query("GET_IMAGE_PREVIEW_MAX_HEIGHT"),d=(i.getMetadata("exif")||{}).orientation||-1;if(d>=5&&d<=8){var f=[l,u];u=f[0],l=f[1]}if(!mm(i.file)||t.query("GET_IMAGE_PREVIEW_UPSCALE")){var p=2048/u;u*=p,l*=p}var g=l/u,m=(i.getMetadata("crop")||{}).aspectRatio||g,v=Math.max(c,Math.min(l,h)),y=t.rect.element.width,b=Math.min(y*m,v);t.dispatch("DID_UPDATE_PANEL_HEIGHT",{id:i.id,height:b})}}}}}(e,n),e.ref.shouldRescale=!1),e.ref.shouldDrawPreview&&(requestAnimationFrame((function(){requestAnimationFrame((function(){e.dispatch("DID_FINISH_CALCULATE_PREVIEWSIZE",{id:n.id})}))})),e.ref.shouldDrawPreview=!1)))})))}})),{options:{allowImagePreview:[!0,i.BOOLEAN],imagePreviewFilterItem:[function(){return!0},i.FUNCTION],imagePreviewHeight:[null,i.INT],imagePreviewMinHeight:[44,i.INT],imagePreviewMaxHeight:[256,i.INT],imagePreviewMaxFileSize:[null,i.INT],imagePreviewZoomFactor:[2,i.INT],imagePreviewUpscale:[!1,i.BOOLEAN],imagePreviewMaxInstantPreviewFileSize:[1e6,i.INT],imagePreviewTransparencyIndicator:[null,i.STRING],imagePreviewCalculateAverageImageColor:[!1,i.BOOLEAN],imagePreviewMarkupShow:[!0,i.BOOLEAN],imagePreviewMarkupFilter:[function(){return!0},i.FUNCTION]}}};
  /*!
   * FilePondPluginImagePreview 4.6.10
   * Licensed under MIT, https://opensource.org/licenses/MIT/
   * Please visit https://pqina.nl/filepond/ for details.
   */"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:_m}));var Em=_m,xm=function(t){var e=t.addFilter,n=t.utils.Type;return e("DID_LOAD_ITEM",(function(t,e){var n=e.query;return new Promise((function(e,i){var r=t.file;if(!function(t){return/^image/.test(t.type)}(r)||!n("GET_ALLOW_IMAGE_RESIZE"))return e(t);var o=n("GET_IMAGE_RESIZE_MODE"),a=n("GET_IMAGE_RESIZE_TARGET_WIDTH"),s=n("GET_IMAGE_RESIZE_TARGET_HEIGHT"),u=n("GET_IMAGE_RESIZE_UPSCALE");if(null===a&&null===s)return e(t);var l,c,h,d=null===a?s:a,f=null===s?d:s,p=URL.createObjectURL(r);l=p,c=function(n){if(URL.revokeObjectURL(p),!n)return e(t);var i=n.width,r=n.height,a=(t.getMetadata("exif")||{}).orientation||-1;if(a>=5&&a<=8){var s=[r,i];i=s[0],r=s[1]}if(i===d&&r===f)return e(t);if(!u)if("cover"===o){if(i<=d||r<=f)return e(t)}else if(i<=d&&r<=d)return e(t);t.setMetadata("resize",{mode:o,upscale:u,size:{width:d,height:f}}),e(t)},(h=new Image).onload=function(){var t=h.naturalWidth,e=h.naturalHeight;h=null,c({width:t,height:e})},h.onerror=function(){return c(null)},h.src=l}))})),{options:{allowImageResize:[!0,n.BOOLEAN],imageResizeMode:["cover",n.STRING],imageResizeUpscale:[!0,n.BOOLEAN],imageResizeTargetWidth:[null,n.INT],imageResizeTargetHeight:[null,n.INT]}}};
  /*!
   * FilePondPluginImageResize 2.0.10
   * Licensed under MIT, https://opensource.org/licenses/MIT/
   * Please visit https://pqina.nl/filepond/ for details.
   */"undefined"!=typeof window&&void 0!==window.document&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:xm}));var Am=xm,Dm={jpeg:"jpg","svg+xml":"svg"},wm=function(t){return/^image/.test(t.type)},km={1:function(){return[1,0,0,1,0,0]},2:function(t){return[-1,0,0,1,t,0]},3:function(t,e){return[-1,0,0,-1,t,e]},4:function(t,e){return[1,0,0,-1,0,e]},5:function(){return[0,1,1,0,0,0]},6:function(t,e){return[0,1,-1,0,e,0]},7:function(t,e){return[0,-1,-1,0,e,t]},8:function(t){return[0,-1,1,0,0,t]}},Tm=function(t,e){return{x:t,y:e}},Cm=function(t,e){return Tm(t.x-e.x,t.y-e.y)},Sm=function(t,e){return Math.sqrt(function(t,e){return function(t,e){return t.x*e.x+t.y*e.y}(Cm(t,e),Cm(t,e))}(t,e))},Im=function(t,e){var n=t,i=e,r=1.5707963267948966-e,o=Math.sin(1.5707963267948966),a=Math.sin(i),s=Math.sin(r),u=Math.cos(r),l=n/o;return Tm(u*(l*a),u*(l*s))},Om=function(t,e){var n=t.width,i=t.height,r=Im(n,e),o=Im(i,e),a=Tm(t.x+Math.abs(r.x),t.y-Math.abs(r.y)),s=Tm(t.x+t.width+Math.abs(o.y),t.y+Math.abs(o.x)),u=Tm(t.x-Math.abs(o.y),t.y+t.height-Math.abs(o.x));return{width:Sm(a,s),height:Sm(a,u)}},Rm=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{x:.5,y:.5},r=i.x>.5?1-i.x:i.x,o=i.y>.5?1-i.y:i.y,a=2*r*t.width,s=2*o*t.height,u=Om(e,n);return Math.max(u.width/a,u.height/s)},Mm=function(t,e){var n=t.width,i=n*e;return i>t.height&&(n=(i=t.height)/e),{x:.5*(t.width-n),y:.5*(t.height-i),width:n,height:i}},Lm=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=t.height/t.width,r=1,o=e,a=1,s=i;s>o&&(a=(s=o)/i);var u=Math.max(r/a,o/s),l=t.width/(n*u*a),c=l*e;return{width:l,height:c}},Pm=function(t){t.width=1,t.height=1,t.getContext("2d").clearRect(0,0,1,1)},Fm=function(t){return t&&(t.horizontal||t.vertical)},Bm=function(t,e,n){if(e<=1&&!Fm(n))return t.width=t.naturalWidth,t.height=t.naturalHeight,t;var i=document.createElement("canvas"),r=t.naturalWidth,o=t.naturalHeight,a=e>=5&&e<=8;a?(i.width=o,i.height=r):(i.width=r,i.height=o);var s=i.getContext("2d");if(e&&s.transform.apply(s,function(t,e,n){return-1===n&&(n=1),km[n](t,e)}(r,o,e)),Fm(n)){var u=[1,0,0,1,0,0];(!a&&n.horizontal||a&n.vertical)&&(u[0]=-1,u[4]=r),(!a&&n.vertical||a&&n.horizontal)&&(u[3]=-1,u[5]=o),s.transform.apply(s,u)}return s.drawImage(t,0,0,r,o),i},Nm=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=i.canvasMemoryLimit,o=i.background,a=void 0===o?null:o,s=n.zoom||1,u=Bm(t,e,n.flip),l={width:u.width,height:u.height},c=n.aspectRatio||l.height/l.width,h=Lm(l,c,s);if(r){var d=h.width*h.height;if(d>r){var f=Math.sqrt(r)/Math.sqrt(d);l.width=Math.floor(l.width*f),l.height=Math.floor(l.height*f),h=Lm(l,c,s)}}var p=document.createElement("canvas"),g={x:.5*h.width,y:.5*h.height},m={x:0,y:0,width:h.width,height:h.height,center:g},v=void 0===n.scaleToFit||n.scaleToFit,y=s*Rm(l,Mm(m,c),n.rotation,v?n.center:{x:.5,y:.5});p.width=Math.round(h.width/y),p.height=Math.round(h.height/y),g.x/=y,g.y/=y;var b={x:g.x-l.width*(n.center?n.center.x:.5),y:g.y-l.height*(n.center?n.center.y:.5)},_=p.getContext("2d");a&&(_.fillStyle=a,_.fillRect(0,0,p.width,p.height)),_.translate(g.x,g.y),_.rotate(n.rotation||0),_.drawImage(u,b.x-g.x,b.y-g.y,l.width,l.height);var E=_.getImageData(0,0,p.width,p.height);return Pm(p),E};
  /*!
   * FilePondPluginImageTransform 3.8.7
   * Licensed under MIT, https://opensource.org/licenses/MIT/
   * Please visit https://pqina.nl/filepond/ for details.
   */"undefined"!=typeof window&&void 0!==window.document&&(HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(t,e,n){var i=this.toDataURL(e,n).split(",")[1];setTimeout((function(){for(var n=atob(i),r=n.length,o=new Uint8Array(r),a=0;a<r;a++)o[a]=n.charCodeAt(a);t(new Blob([o],{type:e||"image/png"}))}))}}));var jm=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Promise((function(i){var r=n?n(t):t;Promise.resolve(r).then((function(t){t.toBlob(i,e.type,e.quality)}))}))},Vm=function(t,e){return Wm(t.x*e,t.y*e)},zm=function(t,e){return Wm(t.x+e.x,t.y+e.y)},Um=function(t){var e=Math.sqrt(t.x*t.x+t.y*t.y);return 0===e?{x:0,y:0}:Wm(t.x/e,t.y/e)},Gm=function(t,e,n){var i=Math.cos(e),r=Math.sin(e),o=Wm(t.x-n.x,t.y-n.y);return Wm(n.x+i*o.x-r*o.y,n.y+r*o.x+i*o.y)},Wm=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{x:t,y:e}},Hm=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0;return"string"==typeof t?parseFloat(t)*n:"number"==typeof t?t*(i?e[i]:Math.min(e.width,e.height)):void 0},qm=function(t,e,n){var i=t.borderStyle||t.lineStyle||"solid",r=t.backgroundColor||t.fontColor||"transparent",o=t.borderColor||t.lineColor||"transparent",a=Hm(t.borderWidth||t.lineWidth,e,n);return{"stroke-linecap":t.lineCap||"round","stroke-linejoin":t.lineJoin||"round","stroke-width":a||0,"stroke-dasharray":"string"==typeof i?"":i.map((function(t){return Hm(t,e,n)})).join(","),stroke:o,fill:r,opacity:t.opacity||1}},$m=function(t){return null!=t},Ym=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=Hm(t.x,e,n,"width")||Hm(t.left,e,n,"width"),r=Hm(t.y,e,n,"height")||Hm(t.top,e,n,"height"),o=Hm(t.width,e,n,"width"),a=Hm(t.height,e,n,"height"),s=Hm(t.right,e,n,"width"),u=Hm(t.bottom,e,n,"height");return $m(r)||(r=$m(a)&&$m(u)?e.height-a-u:u),$m(i)||(i=$m(o)&&$m(s)?e.width-o-s:s),$m(o)||(o=$m(i)&&$m(s)?e.width-i-s:0),$m(a)||(a=$m(r)&&$m(u)?e.height-r-u:0),{x:i||0,y:r||0,width:o||0,height:a||0}},Xm=function(t,e){return Object.keys(e).forEach((function(n){return t.setAttribute(n,e[n])}))},Km=function(t,e){var n=document.createElementNS("http://www.w3.org/2000/svg",t);return e&&Xm(n,e),n},Zm={contain:"xMidYMid meet",cover:"xMidYMid slice"},Jm={left:"start",center:"middle",right:"end"},Qm=function(t){return function(e){return Km(t,{id:e.id})}},tv={image:function(t){var e=Km("image",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0"});return e.onload=function(){e.setAttribute("opacity",t.opacity||1)},e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.src),e},rect:Qm("rect"),ellipse:Qm("ellipse"),text:Qm("text"),path:Qm("path"),line:function(t){var e=Km("g",{id:t.id,"stroke-linecap":"round","stroke-linejoin":"round"}),n=Km("line");e.appendChild(n);var i=Km("path");e.appendChild(i);var r=Km("path");return e.appendChild(r),e}},ev={rect:function(t){return Xm(t,zu(zu({},t.rect),t.styles))},ellipse:function(t){var e=t.rect.x+.5*t.rect.width,n=t.rect.y+.5*t.rect.height,i=.5*t.rect.width,r=.5*t.rect.height;return Xm(t,zu({cx:e,cy:n,rx:i,ry:r},t.styles))},image:function(t,e){Xm(t,zu(zu(zu({},t.rect),t.styles),{},{preserveAspectRatio:Zm[e.fit]||"none"}))},text:function(t,e,n,i){var r=Hm(e.fontSize,n,i),o=e.fontFamily||"sans-serif",a=e.fontWeight||"normal",s=Jm[e.textAlign]||"start";Xm(t,zu(zu(zu({},t.rect),t.styles),{},{"stroke-width":0,"font-weight":a,"font-size":r,"font-family":o,"text-anchor":s})),t.text!==e.text&&(t.text=e.text,t.textContent=e.text.length?e.text:" ")},path:function(t,e,n,i){var r;Xm(t,zu(zu({},t.styles),{},{fill:"none",d:(r=e.points.map((function(t){return{x:Hm(t.x,n,i,"width"),y:Hm(t.y,n,i,"height")}})),r.map((function(t,e){return"".concat(0===e?"M":"L"," ").concat(t.x," ").concat(t.y)})).join(" "))}))},line:function(t,e,n,i){Xm(t,zu(zu(zu({},t.rect),t.styles),{},{fill:"none"}));var r=t.childNodes[0],o=t.childNodes[1],a=t.childNodes[2],s=t.rect,u={x:t.rect.x+t.rect.width,y:t.rect.y+t.rect.height};if(Xm(r,{x1:s.x,y1:s.y,x2:u.x,y2:u.y}),e.lineDecoration){o.style.display="none",a.style.display="none";var l=Um({x:u.x-s.x,y:u.y-s.y}),c=Hm(.05,n,i);if(-1!==e.lineDecoration.indexOf("arrow-begin")){var h=Vm(l,c),d=zm(s,h),f=Gm(s,2,d),p=Gm(s,-2,d);Xm(o,{style:"display:block;",d:"M".concat(f.x,",").concat(f.y," L").concat(s.x,",").concat(s.y," L").concat(p.x,",").concat(p.y)})}if(-1!==e.lineDecoration.indexOf("arrow-end")){var g=Vm(l,-c),m=zm(u,g),v=Gm(u,2,m),y=Gm(u,-2,m);Xm(a,{style:"display:block;",d:"M".concat(v.x,",").concat(v.y," L").concat(u.x,",").concat(u.y," L").concat(y.x,",").concat(y.y)})}}}},nv=function(t,e){return tv[t](e)},iv=function(t,e,n,i,r){"path"!==e&&(t.rect=Ym(n,i,r)),t.styles=qm(n,i,r),ev[e](t,n,i,r)},rv=function(t,e){return t[1].zIndex>e[1].zIndex?1:t[1].zIndex<e[1].zIndex?-1:0},ov=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;return new Promise((function(r){var o=i.background,a=void 0===o?null:o,s=new FileReader;s.onloadend=function(){var t=s.result,i=document.createElement("div");i.style.cssText="position:absolute;pointer-events:none;width:0;height:0;visibility:hidden;",i.innerHTML=t;var o=i.querySelector("svg");document.body.appendChild(i);var u=o.getBBox();i.parentNode.removeChild(i);var l=i.querySelector("title"),c=o.getAttribute("viewBox")||"",h=o.getAttribute("width")||"",d=o.getAttribute("height")||"",f=parseFloat(h)||null,p=parseFloat(d)||null,g=(h.match(/[a-z]+/)||[])[0]||"",m=(d.match(/[a-z]+/)||[])[0]||"",v=c.split(" ").map(parseFloat),y=v.length?{x:v[0],y:v[1],width:v[2],height:v[3]}:u,b=null!=f?f:y.width,_=null!=p?p:y.height;o.style.overflow="visible",o.setAttribute("width",b),o.setAttribute("height",_);var E="";if(n&&n.length){var x={width:b,height:_};E=n.sort(rv).reduce((function(t,e){var n=nv(e[0],e[1]);return iv(n,e[0],e[1],x),n.removeAttribute("id"),1===n.getAttribute("opacity")&&n.removeAttribute("opacity"),t+"\n"+n.outerHTML+"\n"}),""),E="\n\n<g>".concat(E.replace(/&nbsp;/g," "),"</g>\n\n")}var A=e.aspectRatio||_/b,D=b,w=D*A,k=void 0===e.scaleToFit||e.scaleToFit,T=e.center?e.center.x:.5,C=e.center?e.center.y:.5,S=Rm({width:b,height:_},Mm({width:D,height:w},A),e.rotation,k?{x:T,y:C}:{x:.5,y:.5}),I=e.zoom*S,O=e.rotation*(180/Math.PI),R={x:.5*D,y:.5*w},M={x:R.x-b*T,y:R.y-_*C},L=["rotate(".concat(O," ").concat(R.x," ").concat(R.y,")"),"translate(".concat(R.x," ").concat(R.y,")"),"scale(".concat(I,")"),"translate(".concat(-R.x," ").concat(-R.y,")"),"translate(".concat(M.x," ").concat(M.y,")")],P=e.flip&&e.flip.horizontal,F=e.flip&&e.flip.vertical,B=["scale(".concat(P?-1:1," ").concat(F?-1:1,")"),"translate(".concat(P?-b:0," ").concat(F?-_:0,")")],N='<?xml version="1.0" encoding="UTF-8"?>\n<svg width="'.concat(D).concat(g,'" height="').concat(w).concat(m,'" \nviewBox="0 0 ').concat(D," ").concat(w,'" ').concat(a?'style="background:'+a+'" ':"",'\npreserveAspectRatio="xMinYMin"\nxmlns:xlink="http://www.w3.org/1999/xlink"\nxmlns="http://www.w3.org/2000/svg">\n\x3c!-- Generated by PQINA - https://pqina.nl/ --\x3e\n<title>').concat(l?l.textContent:"",'</title>\n<g transform="').concat(L.join(" "),'">\n<g transform="').concat(B.join(" "),'">\n').concat(o.outerHTML).concat(E,"\n</g>\n</g>\n</svg>");r(N)},s.readAsText(t)}))},av=function(t){var e;try{e=new ImageData(t.width,t.height)}catch(n){e=document.createElement("canvas").getContext("2d").createImageData(t.width,t.height)}return e.data.set(t.data),e},sv=function(){var t={resize:function(t,e){var i=e.mode,a=void 0===i?"contain":i,s=e.upscale,u=void 0!==s&&s,l=e.width,c=e.height,h=e.matrix;if(h=!h||r(h)?null:h,!l&&!c)return o(t,h);null===l?l=c:null===c&&(c=l);if("force"!==a){var d=l/t.width,f=c/t.height,p=1;if("cover"===a?p=Math.max(d,f):"contain"===a&&(p=Math.min(d,f)),p>1&&!1===u)return o(t,h);l=t.width*p,c=t.height*p}for(var g=t.width,m=t.height,v=Math.round(l),y=Math.round(c),b=t.data,_=new Uint8ClampedArray(v*y*4),E=g/v,x=m/y,A=Math.ceil(.5*E),D=Math.ceil(.5*x),w=0;w<y;w++)for(var k=0;k<v;k++){for(var T=4*(k+w*v),C=0,S=0,I=0,O=0,R=0,M=0,L=0,P=(w+.5)*x,F=Math.floor(w*x);F<(w+1)*x;F++)for(var B=Math.abs(P-(F+.5))/D,N=(k+.5)*E,j=B*B,V=Math.floor(k*E);V<(k+1)*E;V++){var z=Math.abs(N-(V+.5))/A,U=Math.sqrt(j+z*z);if(U>=-1&&U<=1&&(C=2*U*U*U-3*U*U+1)>0){var G=b[(z=4*(V+F*g))+3];L+=C*G,I+=C,G<255&&(C=C*G/250),O+=C*b[z],R+=C*b[z+1],M+=C*b[z+2],S+=C}}_[T]=O/S,_[T+1]=R/S,_[T+2]=M/S,_[T+3]=L/I,h&&n(T,_,h)}return{data:_,width:v,height:y}},filter:o},e=function(e,n){var i=e.transforms,r=null;if(i.forEach((function(t){"filter"===t.type&&(r=t)})),r){var o=null;i.forEach((function(t){"resize"===t.type&&(o=t)})),o&&(o.data.matrix=r.data,i=i.filter((function(t){return"filter"!==t.type})))}n(function(e,n){return e.forEach((function(e){n=t[e.type](n,e.data)})),n}(i,e.imageData))};self.onmessage=function(t){e(t.data.message,(function(e){self.postMessage({id:t.data.id,message:e},[e.data.buffer])}))};function n(t,e,n){var i=e[t]/255,r=e[t+1]/255,o=e[t+2]/255,a=e[t+3]/255,s=i*n[0]+r*n[1]+o*n[2]+a*n[3]+n[4],u=i*n[5]+r*n[6]+o*n[7]+a*n[8]+n[9],l=i*n[10]+r*n[11]+o*n[12]+a*n[13]+n[14],c=i*n[15]+r*n[16]+o*n[17]+a*n[18]+n[19],h=Math.max(0,s*c)+1*(1-c),d=Math.max(0,u*c)+1*(1-c),f=Math.max(0,l*c)+1*(1-c);e[t]=255*Math.max(0,Math.min(1,h)),e[t+1]=255*Math.max(0,Math.min(1,d)),e[t+2]=255*Math.max(0,Math.min(1,f))}var i=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function r(t){return self.JSON.stringify(t||[])===i}function o(t,e){if(!e||r(e))return t;for(var n=t.data,i=n.length,o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],d=e[7],f=e[8],p=e[9],g=e[10],m=e[11],v=e[12],y=e[13],b=e[14],_=e[15],E=e[16],x=e[17],A=e[18],D=e[19],w=0,k=0,T=0,C=0,S=0,I=0,O=0,R=0,M=0,L=0,P=0,F=0;w<i;w+=4)I=(k=n[w]/255)*o+(T=n[w+1]/255)*a+(C=n[w+2]/255)*s+(S=n[w+3]/255)*u+l,O=k*c+T*h+C*d+S*f+p,R=k*g+T*m+C*v+S*y+b,M=k*_+T*E+C*x+S*A+D,L=Math.max(0,I*M)+1*(1-M),P=Math.max(0,O*M)+1*(1-M),F=Math.max(0,R*M)+1*(1-M),n[w]=255*Math.max(0,Math.min(1,L)),n[w+1]=255*Math.max(0,Math.min(1,P)),n[w+2]=255*Math.max(0,Math.min(1,F));return t}},uv=function(t,e){if(1165519206===t.getUint32(e+4,!1)){e+=4;var n=18761===t.getUint16(e+=6,!1);e+=t.getUint32(e+4,n);var i=t.getUint16(e,n);e+=2;for(var r=0;r<i;r++)if(274===t.getUint16(e+12*r,n))return t.setUint16(e+12*r+8,1,n),!0;return!1}},lv=function(t){return new Promise((function(e){var n=new FileReader;n.onload=function(){return e(function(t){var e=new DataView(t);if(65496!==e.getUint16(0))return null;for(var n,i,r=2,o=!1;r<e.byteLength&&(n=e.getUint16(r,!1),i=e.getUint16(r+2,!1)+2,n>=65504&&n<=65519||65534===n)&&(o||(o=uv(e,r)),!(r+i>e.byteLength));)r+=i;return t.slice(0,r)}(n.result)||null)},n.readAsArrayBuffer(t.slice(0,262144))}))},cv=function(t,e){var n=window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(n){var i=new n;return i.append(t),i.getBlob(e)}return new Blob([t],{type:e})},hv=function(t){var e=new Blob(["(",t.toString(),")()"],{type:"application/javascript"}),n=URL.createObjectURL(e),i=new Worker(n),r=[];return{transfer:function(){},post:function(t,e,n){var o=Math.random().toString(36).substr(2,9);r[o]=e,i.onmessage=function(t){var e=r[t.data.id];e&&(e(t.data.message),delete r[t.data.id])},i.postMessage({id:o,message:t},n)},terminate:function(){i.terminate(),URL.revokeObjectURL(n)}}},dv=function(t){return new Promise((function(e,n){var i=new Image;i.onload=function(){e(i)},i.onerror=function(t){n(t)},i.src=t}))},fv=function(t,e){return new Promise((function(n){var i,r={width:t.width,height:t.height},o=t.getContext("2d"),a=e.sort(rv).map((function(t){return function(){return new Promise((function(e){mv[t[0]](o,r,t[1],e)&&e()}))}}));(i=a,i.reduce((function(t,e){return t.then((function(t){return e().then(Array.prototype.concat.bind(t))}))}),Promise.resolve([]))).then((function(){return n(t)}))}))},pv=function(t,e){t.beginPath(),t.lineCap=e["stroke-linecap"],t.lineJoin=e["stroke-linejoin"],t.lineWidth=e["stroke-width"],e["stroke-dasharray"].length&&t.setLineDash(e["stroke-dasharray"].split(",")),t.fillStyle=e.fill,t.strokeStyle=e.stroke,t.globalAlpha=e.opacity||1},gv=function(t){t.fill(),t.stroke(),t.globalAlpha=1},mv={rect:function(t,e,n){var i=Ym(n,e),r=qm(n,e);return pv(t,r),t.rect(i.x,i.y,i.width,i.height),gv(t),!0},ellipse:function(t,e,n){var i=Ym(n,e),r=qm(n,e);pv(t,r);var o=i.x,a=i.y,s=i.width,u=i.height,l=.5522848,c=s/2*l,h=u/2*l,d=o+s,f=a+u,p=o+s/2,g=a+u/2;return t.moveTo(o,g),t.bezierCurveTo(o,g-h,p-c,a,p,a),t.bezierCurveTo(p+c,a,d,g-h,d,g),t.bezierCurveTo(d,g+h,p+c,f,p,f),t.bezierCurveTo(p-c,f,o,g+h,o,g),gv(t),!0},image:function(t,e,n,i){var r=Ym(n,e),o=qm(n,e);pv(t,o);var a=new Image;new URL(n.src,window.location.href).origin!==window.location.origin&&(a.crossOrigin=""),a.onload=function(){if("cover"===n.fit){var e=r.width/r.height,o=e>1?a.width:a.height*e,s=e>1?a.width/e:a.height,u=.5*a.width-.5*o,l=.5*a.height-.5*s;t.drawImage(a,u,l,o,s,r.x,r.y,r.width,r.height)}else if("contain"===n.fit){var c=Math.min(r.width/a.width,r.height/a.height),h=c*a.width,d=c*a.height,f=r.x+.5*r.width-.5*h,p=r.y+.5*r.height-.5*d;t.drawImage(a,0,0,a.width,a.height,f,p,h,d)}else t.drawImage(a,0,0,a.width,a.height,r.x,r.y,r.width,r.height);gv(t),i()},a.src=n.src},text:function(t,e,n){var i=Ym(n,e),r=qm(n,e);pv(t,r);var o=Hm(n.fontSize,e),a=n.fontFamily||"sans-serif",s=n.fontWeight||"normal",u=n.textAlign||"left";return t.font="".concat(s," ").concat(o,"px ").concat(a),t.textAlign=u,t.fillText(n.text,i.x,i.y),gv(t),!0},line:function(t,e,n){var i=Ym(n,e),r=qm(n,e);pv(t,r),t.beginPath();var o={x:i.x,y:i.y},a={x:i.x+i.width,y:i.y+i.height};t.moveTo(o.x,o.y),t.lineTo(a.x,a.y);var s=Um({x:a.x-o.x,y:a.y-o.y}),u=.04*Math.min(e.width,e.height);if(-1!==n.lineDecoration.indexOf("arrow-begin")){var l=Vm(s,u),c=zm(o,l),h=Gm(o,2,c),d=Gm(o,-2,c);t.moveTo(h.x,h.y),t.lineTo(o.x,o.y),t.lineTo(d.x,d.y)}if(-1!==n.lineDecoration.indexOf("arrow-end")){var f=Vm(s,-u),p=zm(a,f),g=Gm(a,2,p),m=Gm(a,-2,p);t.moveTo(g.x,g.y),t.lineTo(a.x,a.y),t.lineTo(m.x,m.y)}return gv(t),!0},path:function(t,e,n){var i=qm(n,e);pv(t,i),t.beginPath();var r=n.points.map((function(t){return{x:Hm(t.x,e,1,"width"),y:Hm(t.y,e,1,"height")}}));t.moveTo(r[0].x,r[0].y);for(var o=r.length,a=1;a<o;a++)t.lineTo(r[a].x,r[a].y);return gv(t),!0}},vv=function(t){var e=document.createElement("canvas");return e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t,0,0),e},yv=["x","y","left","top","right","bottom","width","height"],bv=function(t){var e=Nu(t,2),n=e[0],i=e[1],r=i.points?{}:yv.reduce((function(t,e){var n;return t[e]="string"==typeof(n=i[e])&&/%/.test(n)?parseFloat(n)/100:n,t}),{});return[n,zu(zu({zIndex:0},i),r)]};"undefined"!=typeof window&&void 0!==window.document&&(HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(t,e,n){var i=this;setTimeout((function(){for(var r=i.toDataURL(e,n).split(",")[1],o=atob(r),a=o.length,s=new Uint8Array(a);a--;)s[a]=o.charCodeAt(a);t(new Blob([s],{type:e||"image/png"}))}))}}));var _v="undefined"!=typeof window&&void 0!==window.document,Ev=_v&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,xv=function(t){var e=t.addFilter,n=t.utils,i=n.Type,r=n.forin,o=n.getFileFromBlob,a=n.isFile,s=["crop","resize","filter","markup","output"],u=function(t){return null===t.aspectRatio&&0===t.rotation&&1===t.zoom&&t.center&&.5===t.center.x&&.5===t.center.y&&t.flip&&!1===t.flip.horizontal&&!1===t.flip.vertical};e("SHOULD_PREPARE_OUTPUT",(function(t,e){var n=e.query;return new Promise((function(t){t(!n("IS_ASYNC"))}))}));var l=function(t,e,n){return new Promise((function(i){if(!t("GET_ALLOW_IMAGE_TRANSFORM")||n.archived||!a(e)||!function(t){return/^image/.test(t.type)}(e))return i(!1);(function(t){return new Promise((function(e,n){var i=new Image;i.src=URL.createObjectURL(t);var r=function(){var t=i.naturalWidth,n=i.naturalHeight;t&&n&&(URL.revokeObjectURL(i.src),clearInterval(o),e({width:t,height:n}))};i.onerror=function(t){URL.revokeObjectURL(i.src),clearInterval(o),n(t)};var o=setInterval(r,1);r()}))})(e).then((function(){var n=t("GET_IMAGE_TRANSFORM_IMAGE_FILTER");if(n){var r=n(e);if(null==r)return handleRevert(!0);if("boolean"==typeof r)return i(r);if("function"==typeof r.then)return r.then(i)}i(!0)})).catch((function(t){i(!1)}))}))};return e("DID_CREATE_ITEM",(function(t,e){var n=e.query,i=e.dispatch;n("GET_ALLOW_IMAGE_TRANSFORM")&&t.extend("requestPrepare",(function(){return new Promise((function(e,n){i("REQUEST_PREPARE_OUTPUT",{query:t.id,item:t,success:e,failure:n},!0)}))}))})),e("PREPARE_OUTPUT",(function(t,e){var n=e.query,i=e.item;return new Promise((function(e){l(n,t,i).then((function(a){if(!a)return e(t);var l=[];n("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_ORIGINAL")&&l.push((function(){return new Promise((function(e){e({name:n("GET_IMAGE_TRANSFORM_VARIANTS_ORIGINAL_NAME"),file:t})}))})),n("GET_IMAGE_TRANSFORM_VARIANTS_INCLUDE_DEFAULT")&&l.push((function(t,e,i){return new Promise((function(r){t(e,i).then((function(t){return r({name:n("GET_IMAGE_TRANSFORM_VARIANTS_DEFAULT_NAME"),file:t})}))}))}));var c=n("GET_IMAGE_TRANSFORM_VARIANTS")||{};r(c,(function(t,e){var n,i=(n=e,function(t,e,i){return t(e,n?n(i):i)});l.push((function(e,n,r){return new Promise((function(o){i(e,n,r).then((function(e){return o({name:t,file:e})}))}))}))}));var h=n("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY"),d=n("GET_IMAGE_TRANSFORM_OUTPUT_QUALITY_MODE"),f=null===h?null:h/100,p=n("GET_IMAGE_TRANSFORM_OUTPUT_MIME_TYPE"),g=n("GET_IMAGE_TRANSFORM_CLIENT_TRANSFORMS")||s;i.setMetadata("output",{type:p,quality:f,client:g},!0);var m=function(t,e){return new Promise((function(i,r){var a=zu({},e);Object.keys(a).filter((function(t){return"exif"!==t})).forEach((function(t){-1===g.indexOf(t)&&delete a[t]}));var s=a.resize,l=a.exif,c=a.output,h=a.crop,f=a.filter,p=a.markup,m={image:{orientation:l?l.orientation:null},output:c&&(c.type||"number"==typeof c.quality||c.background)?{type:c.type,quality:"number"==typeof c.quality?100*c.quality:null,background:c.background||n("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR")||null}:void 0,size:s&&(s.size.width||s.size.height)?zu({mode:s.mode,upscale:s.upscale},s.size):void 0,crop:h&&!u(h)?zu({},h):void 0,markup:p&&p.length?p.map(bv):[],filter:f};if(m.output){var v=!!c.type&&c.type!==t.type,y=/\/jpe?g$/.test(t.type),b=null!==c.quality&&(y&&"always"===d);if(!!!(m.size||m.crop||m.filter||v||b))return i(t)}var _={beforeCreateBlob:n("GET_IMAGE_TRANSFORM_BEFORE_CREATE_BLOB"),afterCreateBlob:n("GET_IMAGE_TRANSFORM_AFTER_CREATE_BLOB"),canvasMemoryLimit:n("GET_IMAGE_TRANSFORM_CANVAS_MEMORY_LIMIT"),stripImageHead:n("GET_IMAGE_TRANSFORM_OUTPUT_STRIP_IMAGE_HEAD")};(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new Promise((function(i,r){if(!t||!wm(t))return r({status:"not an image file",file:t});var o=n.stripImageHead,a=n.beforeCreateBlob,s=n.afterCreateBlob,u=n.canvasMemoryLimit,l=e.crop,c=e.size,h=e.filter,d=e.markup,f=e.output,p=e.image&&e.image.orientation?Math.max(1,Math.min(8,e.image.orientation)):null,g=f&&f.quality,m=null===g?null:g/100,v=f&&f.type||null,y=f&&f.background||null,b=[];!c||"number"!=typeof c.width&&"number"!=typeof c.height||b.push({type:"resize",data:c}),h&&20===h.length&&b.push({type:"filter",data:h});var _=function(t){var e=s?s(t):t;Promise.resolve(e).then(i)},E=function(e,n){var i=vv(e),s=d.length?fv(i,d):i;Promise.resolve(s).then((function(e){jm(e,n,a).then((function(n){if(Pm(e),o)return _(n);lv(t).then((function(t){null!==t&&(n=new Blob([t,n.slice(20)],{type:n.type})),_(n)}))})).catch(r)}))};if(/svg/.test(t.type)&&null===v)return ov(t,l,d,{background:y}).then((function(t){i(cv(t,"image/svg+xml"))}));var x=URL.createObjectURL(t);dv(x).then((function(e){URL.revokeObjectURL(x);var n=Nm(e,p,l,{canvasMemoryLimit:u,background:y}),i={quality:m,type:v||t.type};if(!b.length)return E(n,i);var r=hv(sv);r.post({transforms:b,imageData:n},(function(t){E(av(t),i),r.terminate()}),[n.data.buffer])})).catch(r)}))})(t,m,_).then((function(e){var n=o(e,function(t,e){var n=function(t){return t.substr(0,t.lastIndexOf("."))||t}(t),i=e.split("/")[1],r=Dm[i]||i;return"".concat(n,".").concat(r)}(t.name,function(t){return/jpeg|png|svg\+xml/.test(t)?t:"image/jpeg"}(e.type)));i(n)})).catch(r)}))},v=l.map((function(e){return e(m,t,i.getMetadata())}));Promise.all(v).then((function(t){e(1===t.length&&null===t[0].name?t[0].file:t)}))}))}))})),{options:{allowImageTransform:[!0,i.BOOLEAN],imageTransformImageFilter:[null,i.FUNCTION],imageTransformOutputMimeType:[null,i.STRING],imageTransformOutputQuality:[null,i.INT],imageTransformOutputStripImageHead:[!0,i.BOOLEAN],imageTransformClientTransforms:[null,i.ARRAY],imageTransformOutputQualityMode:["always",i.STRING],imageTransformVariants:[null,i.OBJECT],imageTransformVariantsIncludeDefault:[!0,i.BOOLEAN],imageTransformVariantsDefaultName:[null,i.STRING],imageTransformVariantsIncludeOriginal:[!1,i.BOOLEAN],imageTransformVariantsOriginalName:["original_",i.STRING],imageTransformBeforeCreateBlob:[null,i.FUNCTION],imageTransformAfterCreateBlob:[null,i.FUNCTION],imageTransformCanvasMemoryLimit:[_v&&Ev?16777216:null,i.INT],imageTransformCanvasBackgroundColor:[null,i.STRING]}}};_v&&document.dispatchEvent(new CustomEvent("FilePond:pluginloaded",{detail:xv}));var Av=xv;fg(bg),fg(Eg),fg(Dg),fg(Bg),fg(Em),fg(Am),fg(Av);var Dv=function(t){t.data("fileUploadFormComponent",(function(t){var e,n=t.acceptedFileTypes,i=t.deleteUploadedFileUsing,r=t.getUploadedFileUrlUsing,o=t.imageCropAspectRatio,a=t.imagePreviewHeight,s=t.imageResizeTargetHeight,u=t.imageResizeTargetWidth,l=t.loadingIndicatorPosition,c=t.panelAspectRatio,h=t.panelLayout,d=t.placeholder,f=t.maxSize,p=t.minSize,g=t.removeUploadedFileButtonPosition,m=t.removeUploadedFileUsing,v=t.state,y=t.uploadButtonPosition,b=t.uploadProgressIndicatorPosition,_=t.uploadUsing;return{cachedFileKeys:{},files:[],pond:null,state:v,init:(e=Bu(_u().mark((function t(){var e,v,E,x,A,D=this;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=0,v=Object.entries(this.state);case 1:if(!(e<v.length)){t.next=15;break}if(E=Nu(v[e],2),x=E[0],!E[1].startsWith("livewire-file:")){t.next=5;break}return t.abrupt("continue",12);case 5:return t.next=7,r(x);case 7:if(A=t.sent){t.next=10;break}return t.abrupt("continue",12);case 10:this.files.push({source:A,options:{type:"local"}}),this.cachedFileKeys[A]=x;case 12:e++,t.next=1;break;case 15:this.pond=lg(this.$refs.input,zu(zu({acceptedFileTypes:n,credits:!1,files:this.files,imageCropAspectRatio:o,imagePreviewHeight:a,imageResizeTargetHeight:s,imageResizeTargetWidth:u},d&&{labelIdle:d}),{},{maxFileSize:f,minFileSize:p,styleButtonProcessItemPosition:y,styleButtonRemoveItemPosition:g,styleLoadIndicatorPosition:l,stylePanelAspectRatio:c,stylePanelLayout:h,styleProgressIndicatorPosition:b,server:{load:function(){var t=Bu(_u().mark((function t(e,n){var i,r;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e);case 2:return i=t.sent,t.next=5,i.blob();case 5:r=t.sent,n(r);case 7:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),process:function(){var t=Bu(_u().mark((function t(e,n,i,r,o,a){var s;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(t){return(t^crypto.getRandomValues(new Uint8Array(1))[0]&15>>t/4).toString(16)})),t.next=3,_(s,n,r,o,a);case 3:case"end":return t.stop()}}),t)})));return function(e,n,i,r,o,a){return t.apply(this,arguments)}}(),remove:function(){var t=Bu(_u().mark((function t(e,n){var r,o;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=null!==(r=D.cachedFileKeys[e])&&void 0!==r?r:null){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,i(o);case 5:n();case 6:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),revert:function(){var t=Bu(_u().mark((function t(e,n){return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,m(e);case 2:n();case 3:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}()}})),this.$watch("state",Bu(_u().mark((function t(){var e,n,i,o,a;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Object.values(D.state).length||!Object.values(D.pond.getFiles()).filter((function(t){return t.origin===sg.INPUT})).length){t.next=2;break}return t.abrupt("return");case 2:if(!Object.values(D.state).filter((function(t){return t.startsWith("livewire-file:")})).length){t.next=4;break}return t.abrupt("return");case 4:e=[],n=0,i=Object.keys(D.state);case 6:if(!(n<i.length)){t.next=18;break}return o=i[n],t.next=10,r(o);case 10:if(a=t.sent){t.next=13;break}return t.abrupt("continue",15);case 13:e.push({source:a,options:{type:"local"}}),D.cachedFileKeys[a]=o;case 15:n++,t.next=6;break;case 18:D.pond.files=e;case 19:case"end":return t.stop()}}),t)}))));case 17:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}}))},wv=function(t){t.data("keyValueFormComponent",(function(t){return{state:t.state,rows:[],init:function(){var t=this;this.updateRows(),this.rows.length<=0&&this.addRow(),this.$watch("state",(function(){t.updateRows()}))},addRow:function(){this.rows.push({key:"",value:""}),this.updateState()},deleteRow:function(t){this.rows.splice(t,1),this.rows.length<=0&&this.addRow(),this.updateState()},updateRows:function(){for(var t=[],e=0,n=Object.entries(null!==(i=this.state)&&void 0!==i?i:{});e<n.length;e++){var i,r=Nu(n[e],2),o=r[0],a=r[1];t.push({key:o,value:a})}this.rows=t},updateState:function(){var t={};this.rows.forEach((function(e){t[e.key]=e.value})),this.state=t}}}))},kv=function(){function t(e,n){Mu(this,t),this.file=e,this.directory=n,this.state="pending",this.id=null,this.href=null,this.name=null,this.percent=0}return Pu(t,[{key:"fullPath",get:function(){return this.directory?"".concat(this.directory,"/").concat(this.file.name):this.file.name}},{key:"isImage",value:function(){return["image/gif","image/png","image/jpg","image/jpeg"].indexOf(this.file.type)>-1}},{key:"saving",value:function(t){if("pending"!==this.state&&"saving"!==this.state)throw new Error("Unexpected transition from ".concat(this.state," to saving"));this.state="saving",this.percent=t}},{key:"saved",value:function(t){var e,n,i;if("pending"!==this.state&&"saving"!==this.state)throw new Error("Unexpected transition from ".concat(this.state," to saved"));this.state="saved",this.id=null!==(e=null==t?void 0:t.id)&&void 0!==e?e:null,this.href=null!==(n=null==t?void 0:t.href)&&void 0!==n?n:null,this.name=null!==(i=null==t?void 0:t.name)&&void 0!==i?i:null}},{key:"isPending",value:function(){return"pending"===this.state}},{key:"isSaving",value:function(){return"saving"===this.state}},{key:"isSaved",value:function(){return"saved"===this.state}}],[{key:"traverse",value:function(t,e){return Tv(t,e)}},{key:"from",value:function(e){var n,i=[],r=Wu(e);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(o instanceof File)i.push(new t(o));else{if(!(o instanceof t))throw new Error("Unexpected type");i.push(o)}}}catch(t){r.e(t)}finally{r.f()}return i}}]),t}();function Tv(t,e){return e&&function(t){return t.items&&Array.from(t.items).some((function(t){var e=t.webkitGetAsEntry&&t.webkitGetAsEntry();return e&&e.isDirectory}))}(t)?Ov("",function(t){return Array.from(t.items).map((function(t){return t.webkitGetAsEntry()})).filter((function(t){return null!=t}))}(t)):Promise.resolve(Cv(Array.from(t.files||[])).map((function(t){return new kv(t)})))}function Cv(t){return Array.from(t).filter((function(t){return!function(t){return t.name.startsWith(".")}(t)}))}function Sv(t){return new Promise((function(e,n){t.file(e,n)}))}function Iv(t){return new Promise((function(e,n){var i=[],r=t.createReader();!function t(){r.readEntries((function(n){n.length>0?(i.push.apply(i,Gu(n)),t()):e(i)}),n)}()}))}function Ov(t,e){return Rv.apply(this,arguments)}function Rv(){return(Rv=Bu(_u().mark((function t(e,n){var i,r,o,a,s;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=[],r=Wu(Cv(n)),t.prev=2,r.s();case 4:if((o=r.n()).done){t.next=28;break}if(!(a=o.value).isDirectory){t.next=22;break}return t.t0=i.push,t.t1=i,t.t2=Gu,t.t3=Ov,t.t4=a.fullPath,t.next=14,Iv(a);case 14:return t.t5=t.sent,t.next=17,(0,t.t3)(t.t4,t.t5);case 17:t.t6=t.sent,t.t7=(0,t.t2)(t.t6),t.t0.apply.call(t.t0,t.t1,t.t7),t.next=26;break;case 22:return t.next=24,Sv(a);case 24:s=t.sent,i.push(new kv(s,e));case 26:t.next=4;break;case 28:t.next=33;break;case 30:t.prev=30,t.t8=t.catch(2),r.e(t.t8);case 33:return t.prev=33,r.f(),t.finish(33);case 36:return t.abrupt("return",i);case 37:case"end":return t.stop()}}),t,null,[[2,30,33,36]])})))).apply(this,arguments)}var Mv=function(t){Du(i,t);var e,n=wu(i);function i(){return Mu(this,i),n.apply(this,arguments)}return Pu(i,[{key:"connectedCallback",value:function(){this.addEventListener("dragenter",Fv),this.addEventListener("dragover",Fv),this.addEventListener("dragleave",Bv),this.addEventListener("drop",Nv),this.addEventListener("paste",Vv),this.addEventListener("change",zv)}},{key:"disconnectedCallback",value:function(){this.removeEventListener("dragenter",Fv),this.removeEventListener("dragover",Fv),this.removeEventListener("dragleave",Bv),this.removeEventListener("drop",Nv),this.removeEventListener("paste",Vv),this.removeEventListener("change",zv)}},{key:"directory",get:function(){return this.hasAttribute("directory")},set:function(t){t?this.setAttribute("directory",""):this.removeAttribute("directory")}},{key:"attach",value:(e=Bu(_u().mark((function t(e){var n;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e instanceof DataTransfer)){t.next=6;break}return t.next=3,kv.traverse(e,this.directory);case 3:t.t0=t.sent,t.next=7;break;case 6:t.t0=kv.from(e);case 7:n=t.t0,this.dispatchEvent(new CustomEvent("file-attachment-accept",{bubbles:!0,cancelable:!0,detail:{attachments:n}}))&&n.length&&this.dispatchEvent(new CustomEvent("file-attachment-accepted",{bubbles:!0,detail:{attachments:n}}));case 10:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})}]),i}(Cu(HTMLElement));function Lv(t){return Array.from(t.types).indexOf("Files")>=0}var Pv=null;function Fv(t){var e=t.currentTarget;Pv&&clearTimeout(Pv),Pv=window.setTimeout((function(){return e.removeAttribute("hover")}),200);var n=t.dataTransfer;n&&Lv(n)&&(n.dropEffect="copy",e.setAttribute("hover",""),t.stopPropagation(),t.preventDefault())}function Bv(t){t.dataTransfer&&(t.dataTransfer.dropEffect="none"),t.currentTarget.removeAttribute("hover"),t.stopPropagation(),t.preventDefault()}function Nv(t){var e=t.currentTarget;if(e instanceof Mv){e.removeAttribute("hover");var n=t.dataTransfer;n&&Lv(n)&&(e.attach(n),t.stopPropagation(),t.preventDefault())}}var jv=/^image\/(gif|png|jpeg)$/;function Vv(t){if(t.clipboardData&&t.clipboardData.items){var e=t.currentTarget;if(e instanceof Mv){var n=function(t){var e,n=Wu(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;if(jv.test(i.type))return i.getAsFile()}}catch(t){n.e(t)}finally{n.f()}return null}(t.clipboardData.items);if(n){var i=[n];e.attach(i),t.preventDefault()}}}}function zv(t){var e=t.currentTarget;if(e instanceof Mv){var n=t.target;if(n instanceof HTMLInputElement){var i=e.getAttribute("input");if(!i||n.id===i){var r=n.files;r&&0!==r.length&&(e.attach(r),n.value="")}}}}window.customElements.get("file-attachment")||(window.FileAttachmentElement=Mv,window.customElements.define("file-attachment",Mv));var Uv=["[data-md-button]","md-header","md-bold","md-italic","md-quote","md-code","md-link","md-image","md-unordered-list","md-ordered-list","md-task-list","md-mention","md-ref","md-strikethrough"];function Gv(t){var e,n=[],i=Wu(t.querySelectorAll(Uv.join(", ")));try{for(i.s();!(e=i.n()).done;){var r=e.value;r.hidden||r.offsetWidth<=0&&r.offsetHeight<=0||r.closest("markdown-toolbar")===t&&n.push(r)}}catch(t){i.e(t)}finally{i.f()}return n}var Wv=new WeakMap,Hv=function(t){Du(n,t);var e=wu(n);function n(){var t;Mu(this,n);var i,r=function(){var e=Wv.get(Tu(t));e&&yy(Tu(t),e)};return(t=e.call(this)).addEventListener("keydown",(i=r,function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),i(t))})),t.addEventListener("click",r),t}return Pu(n,[{key:"connectedCallback",value:function(){this.hasAttribute("role")||this.setAttribute("role","button")}},{key:"click",value:function(){var t=Wv.get(this);t&&yy(this,t)}}]),n}(Cu(HTMLElement)),qv=function(t){Du(n,t);var e=wu(n);function n(){var t;Mu(this,n),t=e.call(this);var i=parseInt(t.getAttribute("level")||"3",10);if(i<1||i>6)return ku(t);var r="".concat("#".repeat(i)," ");return Wv.set(Tu(t),{prefix:r}),t}return Pu(n)}(Hv);window.customElements.get("md-header")||(window.MarkdownHeaderButtonElement=qv,window.customElements.define("md-header",qv));var $v=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"**",suffix:"**",trimFirst:!0}),t}return Pu(n,[{key:"connectedCallback",value:function(){xu(Ru(n.prototype),"connectedCallback",this).call(this),this.setAttribute("hotkey","b")}}]),n}(Hv);window.customElements.get("md-bold")||(window.MarkdownBoldButtonElement=$v,window.customElements.define("md-bold",$v));var Yv=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"_",suffix:"_",trimFirst:!0}),t}return Pu(n,[{key:"connectedCallback",value:function(){xu(Ru(n.prototype),"connectedCallback",this).call(this),this.setAttribute("hotkey","i")}}]),n}(Hv);window.customElements.get("md-italic")||(window.MarkdownItalicButtonElement=Yv,window.customElements.define("md-italic",Yv));var Xv=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"> ",multiline:!0,surroundWithNewlines:!0}),t}return Pu(n,[{key:"connectedCallback",value:function(){xu(Ru(n.prototype),"connectedCallback",this).call(this),this.setAttribute("hotkey","."),this.setAttribute("hotkey-requires-shift","true")}}]),n}(Hv);window.customElements.get("md-quote")||(window.MarkdownQuoteButtonElement=Xv,window.customElements.define("md-quote",Xv));var Kv=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"}),t}return Pu(n,[{key:"connectedCallback",value:function(){xu(Ru(n.prototype),"connectedCallback",this).call(this),this.setAttribute("hotkey","e")}}]),n}(Hv);window.customElements.get("md-code")||(window.MarkdownCodeButtonElement=Kv,window.customElements.define("md-code",Kv));var Zv=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"[",suffix:"](url)",replaceNext:"url",scanFor:"https?://"}),t}return Pu(n,[{key:"connectedCallback",value:function(){xu(Ru(n.prototype),"connectedCallback",this).call(this),this.setAttribute("hotkey","k")}}]),n}(Hv);window.customElements.get("md-link")||(window.MarkdownLinkButtonElement=Zv,window.customElements.define("md-link",Zv));var Jv=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"![",suffix:"](url)",replaceNext:"url",scanFor:"https?://"}),t}return Pu(n)}(Hv);window.customElements.get("md-image")||(window.MarkdownImageButtonElement=Jv,window.customElements.define("md-image",Jv));var Qv=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"- ",multiline:!0,surroundWithNewlines:!0}),t}return Pu(n,[{key:"connectedCallback",value:function(){xu(Ru(n.prototype),"connectedCallback",this).call(this),this.setAttribute("hotkey","8"),this.setAttribute("hotkey-requires-shift","true")}}]),n}(Hv);window.customElements.get("md-unordered-list")||(window.MarkdownUnorderedListButtonElement=Qv,window.customElements.define("md-unordered-list",Qv));var ty=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"1. ",multiline:!0,orderedList:!0}),t}return Pu(n,[{key:"connectedCallback",value:function(){xu(Ru(n.prototype),"connectedCallback",this).call(this),this.setAttribute("hotkey","7"),this.setAttribute("hotkey-requires-shift","true")}}]),n}(Hv);window.customElements.get("md-ordered-list")||(window.MarkdownOrderedListButtonElement=ty,window.customElements.define("md-ordered-list",ty));var ey=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"- [ ] ",multiline:!0,surroundWithNewlines:!0}),t}return Pu(n,[{key:"connectedCallback",value:function(){xu(Ru(n.prototype),"connectedCallback",this).call(this),this.setAttribute("hotkey","L")}}]),n}(Hv);window.customElements.get("md-task-list")||(window.MarkdownTaskListButtonElement=ey,window.customElements.define("md-task-list",ey));var ny=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"@",prefixSpace:!0}),t}return Pu(n)}(Hv);window.customElements.get("md-mention")||(window.MarkdownMentionButtonElement=ny,window.customElements.define("md-mention",ny));var iy=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"#",prefixSpace:!0}),t}return Pu(n)}(Hv);window.customElements.get("md-ref")||(window.MarkdownRefButtonElement=iy,window.customElements.define("md-ref",iy));var ry=function(t){Du(n,t);var e=wu(n);function n(){var t;return Mu(this,n),t=e.call(this),Wv.set(Tu(t),{prefix:"~~",suffix:"~~",trimFirst:!0}),t}return Pu(n)}(Hv);window.customElements.get("md-strikethrough")||(window.MarkdownStrikethroughButtonElement=ry,window.customElements.define("md-strikethrough",ry));var oy=navigator.userAgent.match(/Macintosh/)?"Meta":"Control",ay=function(t){Du(n,t);var e=wu(n);function n(){return Mu(this,n),e.call(this)}return Pu(n,[{key:"connectedCallback",value:function(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.addEventListener("keydown",uy);var t=cy.bind(null,this);this.field&&(this.field.addEventListener("keydown",t),ly.set(this,t)),this.setAttribute("tabindex","0"),this.addEventListener("focus",sy,{once:!0})}},{key:"disconnectedCallback",value:function(){var t=ly.get(this);t&&this.field&&(this.field.removeEventListener("keydown",t),ly.delete(this)),this.removeEventListener("keydown",uy)}},{key:"field",get:function(){var t=this.getAttribute("for");if(!t)return null;var e,n="getRootNode"in this?this.getRootNode():document;return(n instanceof Document||n instanceof ShadowRoot)&&(e=n.getElementById(t)),e instanceof HTMLTextAreaElement?e:null}}]),n}(Cu(HTMLElement));function sy(t){var e=t.target;if(e instanceof Element){e.removeAttribute("tabindex");var n,i="0",r=Wu(Gv(e));try{for(r.s();!(n=r.n()).done;){var o=n.value;o.setAttribute("tabindex",i),"0"===i&&(o.focus(),i="-1")}}catch(t){r.e(t)}finally{r.f()}}}function uy(t){var e=t.key;if("ArrowRight"===e||"ArrowLeft"===e||"Home"===e||"End"===e){var n=t.currentTarget;if(n instanceof HTMLElement){var i=Gv(n),r=i.indexOf(t.target),o=i.length;if(-1!==r){var a=0;"ArrowLeft"===e&&(a=r-1),"ArrowRight"===e&&(a=r+1),"End"===e&&(a=o-1),a<0&&(a=o-1),a>o-1&&(a=0);for(var s=0;s<o;s+=1)i[s].setAttribute("tabindex",s===a?"0":"-1");t.preventDefault(),i[a].focus()}}}}var ly=new WeakMap;function cy(t,e){if(e.metaKey&&"Meta"===oy||e.ctrlKey&&"Control"===oy){var n=function(t,e,n){var i,r,o=Wu(t.querySelectorAll("[hotkey]"));try{for(o.s();!(i=o.n()).done;){var a=i.value;if(a.getAttribute("hotkey")===e&&(!(r=a).hasAttribute("hotkey-requires-shift")||"false"===r.getAttribute("hotkey-requires-shift")||n))return a}}catch(t){o.e(t)}finally{o.f()}return null}(t,e.shiftKey?e.key.toUpperCase():e.key,e.shiftKey);n&&(n.click(),e.preventDefault())}}function hy(t){return t.trim().split("\n").length>1}function dy(t,e){return Array(e+1).join(t)}function fy(t,e){for(var n=e;t[n]&&null!=t[n-1]&&!t[n-1].match(/\s/);)n--;return n}function py(t,e,n){for(var i=e,r=n?/\n/:/\s/;t[i]&&!t[i].match(r);)i++;return i}window.customElements.get("markdown-toolbar")||(window.MarkdownToolbarElement=ay,window.customElements.define("markdown-toolbar",ay));var gy=null;function my(t,e){var n,i=t.value.slice(t.selectionStart,t.selectionEnd);n=e.orderedList?function(t){var e,n,i,r,o=/^\d+\.\s+/,a=t.selectionStart===t.selectionEnd,s=t.value.slice(t.selectionStart,t.selectionEnd),u=s,l=s.split("\n");if(a){var c=t.value.slice(0,t.selectionStart).split(/\n/);i=t.selectionStart-c[c.length-1].length,r=py(t.value,t.selectionStart,!0),u=t.value.slice(i,r)}var h=u.split("\n");if(h.every((function(t){return o.test(t)}))){if(s=(l=h.map((function(t){return t.replace(o,"")}))).join("\n"),a&&i&&r){var d=h[0].length-l[0].length;n=e=t.selectionStart-d,t.selectionStart=i,t.selectionEnd=r}}else{s=(l=function(t){var e,n,i,r=[];for(i=e=0,n=t.length;e<n;i=++e){var o=t[i];r.push("".concat(i+1,". ").concat(o))}return r}(l)).join("\n");var f=vy(t),p=f.newlinesToAppend,g=f.newlinesToPrepend;e=(n=t.selectionStart+p.length)+s.length,a&&(n=e),s=p+s+g}return{text:s,selectionStart:n,selectionEnd:e}}(t):e.multiline&&hy(i)?function(t,e){var n=e.prefix,i=e.suffix,r=e.surroundWithNewlines,o=t.value.slice(t.selectionStart,t.selectionEnd),a=t.selectionStart,s=t.selectionEnd,u=o.split("\n");if(u.every((function(t){return t.startsWith(n)&&t.endsWith(i)})))s=a+(o=u.map((function(t){return t.slice(n.length,t.length-i.length)})).join("\n")).length;else if(o=u.map((function(t){return n+t+i})).join("\n"),r){var l=vy(t),c=l.newlinesToAppend,h=l.newlinesToPrepend;s=(a+=c.length)+o.length,o=c+o+h}return{text:o,selectionStart:a,selectionEnd:s}}(t,e):function(t,e){var n=e.prefix,i=e.suffix,r=e.blockPrefix,o=e.blockSuffix,a=e.replaceNext,s=e.prefixSpace,u=e.scanFor,l=e.surroundWithNewlines,c=t.selectionStart,h=t.selectionEnd,d=t.value.slice(t.selectionStart,t.selectionEnd),f=hy(d)&&r.length>0?"".concat(r,"\n"):n,p=hy(d)&&o.length>0?"\n".concat(o):i;if(s){var g=t.value[t.selectionStart-1];0===t.selectionStart||null==g||g.match(/\s/)||(f=" ".concat(f))}d=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.selectionStart===t.selectionEnd)t.selectionStart=fy(t.value,t.selectionStart),t.selectionEnd=py(t.value,t.selectionEnd,i);else{var r=t.selectionStart-e.length,o=t.selectionEnd+n.length,a=t.value.slice(r,t.selectionStart)===e,s=t.value.slice(t.selectionEnd,o)===n;a&&s&&(t.selectionStart=r,t.selectionEnd=o)}return t.value.slice(t.selectionStart,t.selectionEnd)}(t,f,p,e.multiline);var m=t.selectionStart,v=t.selectionEnd,y=a.length>0&&p.indexOf(a)>-1&&d.length>0;if(l){var b=vy(t);f=b.newlinesToAppend+n,p+=b.newlinesToPrepend}if(d.startsWith(f)&&d.endsWith(p)){var _=d.slice(f.length,d.length-p.length);if(c===h){var E=c-f.length;E=Math.max(E,m),m=v=E=Math.min(E,m+_.length)}else v=m+_.length;return{text:_,selectionStart:m,selectionEnd:v}}if(y)return u.length>0&&d.match(u)?{text:f+(p=p.replace(a,d)),selectionStart:m=v=m+f.length,selectionEnd:v}:{text:f+d+p,selectionStart:m=m+f.length+d.length+p.indexOf(a),selectionEnd:v=m+a.length};var x=f+d+p;m=c+f.length,v=h+f.length;var A=d.match(/^\s*|\s*$/g);if(e.trimFirst&&A){var D=A[0]||"",w=A[1]||"";x=D+f+d.trim()+p+w,m+=D.length,v-=w.length}return{text:x,selectionStart:m,selectionEnd:v}}(t,e),function(t,e){var n=e.text,i=e.selectionStart,r=e.selectionEnd,o=t.selectionStart,a=t.value.slice(0,o),s=t.value.slice(t.selectionEnd);if(null===gy||!0===gy){t.contentEditable="true";try{gy=document.execCommand("insertText",!1,n)}catch(t){gy=!1}t.contentEditable="false"}if(gy&&!t.value.slice(0,t.selectionStart).endsWith(n)&&(gy=!1),!gy){try{document.execCommand("ms-beginUndoUnit")}catch(t){}t.value=a+n+s;try{document.execCommand("ms-endUndoUnit")}catch(t){}t.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))}null!=i&&null!=r?t.setSelectionRange(i,r):t.setSelectionRange(o,t.selectionEnd)}(t,n)}function vy(t){var e,n,i=t.value.slice(0,t.selectionStart),r=t.value.slice(t.selectionEnd),o=i.match(/\n*$/),a=r.match(/^\n*/),s=o?o[0].length:0,u=a?a[0].length:0;return i.match(/\S/)&&s<2&&(e=dy("\n",2-s)),r.match(/\S/)&&u<2&&(n=dy("\n",2-u)),null==e&&(e=""),null==n&&(n=""),{newlinesToAppend:e,newlinesToPrepend:n}}function yy(t,e){var n=t.closest("markdown-toolbar");if(n instanceof ay){var i=Object.assign(Object.assign({},{prefix:"",suffix:"",blockPrefix:"",blockSuffix:"",multiline:!1,replaceNext:"",prefixSpace:!1,scanFor:"",surroundWithNewlines:!1,orderedList:!1,trimFirst:!1}),e),r=n.field;r&&(r.focus(),my(r,i))}}var by={exports:{}},_y={exports:{}};function Ey(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}_y.exports={defaults:{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:Ey,changeDefaults:function(t){_y.exports.defaults=t}};var xy=/[&<>"']/,Ay=/[&<>"']/g,Dy=/[<>"']|&(?!#?\w+;)/,wy=/[<>"']|&(?!#?\w+;)/g,ky={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ty=function(t){return ky[t]};var Cy=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Sy(t){return t.replace(Cy,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var Iy=/(^|[^\[])\^/g;var Oy=/[^\w:]/g,Ry=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var My={},Ly=/^[^:]+:\/*[^/]*$/,Py=/^([^:]+:)[\s\S]*$/,Fy=/^([^:]+:\/*[^/]*)[\s\S]*$/;function By(t,e){My[" "+t]||(Ly.test(t)?My[" "+t]=t+"/":My[" "+t]=Ny(t,"/",!0));var n=-1===(t=My[" "+t]).indexOf(":");return"//"===e.substring(0,2)?n?e:t.replace(Py,"$1")+e:"/"===e.charAt(0)?n?e:t.replace(Fy,"$1")+e:t+e}function Ny(t,e,n){var i=t.length;if(0===i)return"";for(var r=0;r<i;){var o=t.charAt(i-r-1);if(o!==e||n){if(o===e||!n)break;r++}else r++}return t.substr(0,i-r)}var jy=function(t,e){if(e){if(xy.test(t))return t.replace(Ay,Ty)}else if(Dy.test(t))return t.replace(wy,Ty);return t},Vy=Sy,zy=function(t,e){t=t.source||t,e=e||"";var n={replace:function(e,i){return i=(i=i.source||i).replace(Iy,"$1"),t=t.replace(e,i),n},getRegex:function(){return new RegExp(t,e)}};return n},Uy=function(t,e,n){if(t){var i;try{i=decodeURIComponent(Sy(n)).replace(Oy,"").toLowerCase()}catch(t){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}e&&!Ry.test(n)&&(n=By(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n},Gy={exec:function(){}},Wy=function(t){for(var e,n,i=1;i<arguments.length;i++)for(n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},Hy=function(t,e){var n=t.replace(/\|/g,(function(t,e,n){for(var i=!1,r=e;--r>=0&&"\\"===n[r];)i=!i;return i?"|":" |"})).split(/ \|/),i=0;if(n[0].trim()||n.shift(),n[n.length-1].trim()||n.pop(),n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n},qy=Ny,$y=function(t,e){if(-1===t.indexOf(e[1]))return-1;for(var n=t.length,i=0,r=0;r<n;r++)if("\\"===t[r])r++;else if(t[r]===e[0])i++;else if(t[r]===e[1]&&--i<0)return r;return-1},Yy=function(t){t&&t.sanitize&&!t.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},Xy=function(t,e){if(e<1)return"";for(var n="";e>1;)1&e&&(n+=t),e>>=1,t+=t;return n+t},Ky=_y.exports.defaults,Zy=qy,Jy=Hy,Qy=jy,tb=$y;function eb(t,e,n,i){var r=e.href,o=e.title?Qy(e.title):null,a=t[1].replace(/\\([\[\]])/g,"$1");if("!"!==t[0].charAt(0)){i.state.inLink=!0;var s={type:"link",raw:n,href:r,title:o,text:a,tokens:i.inlineTokens(a,[])};return i.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:o,text:Qy(a)}}var nb=function(){function t(e){Mu(this,t),this.options=e||Ky}return Pu(t,[{key:"space",value:function(t){var e=this.rules.block.newline.exec(t);if(e)return e[0].length>1?{type:"space",raw:e[0]}:{raw:"\n"}}},{key:"code",value:function(t){var e=this.rules.block.code.exec(t);if(e){var n=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Zy(n,"\n")}}}},{key:"fences",value:function(t){var e=this.rules.block.fences.exec(t);if(e){var n=e[0],i=function(t,e){var n=t.match(/^(\s+)(?:```)/);if(null===n)return e;var i=n[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:Nu(e,1)[0].length>=i.length?t.slice(i.length):t})).join("\n")}(n,e[3]||"");return{type:"code",raw:n,lang:e[2]?e[2].trim():e[2],text:i}}}},{key:"heading",value:function(t){var e=this.rules.block.heading.exec(t);if(e){var n=e[2].trim();if(/#$/.test(n)){var i=Zy(n,"#");this.options.pedantic?n=i.trim():i&&!/ $/.test(i)||(n=i.trim())}var r={type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:[]};return this.lexer.inline(r.text,r.tokens),r}}},{key:"hr",value:function(t){var e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:e[0]}}},{key:"blockquote",value:function(t){var e=this.rules.block.blockquote.exec(t);if(e){var n=e[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:e[0],tokens:this.lexer.blockTokens(n,[]),text:n}}}},{key:"list",value:function(t){var e=this.rules.block.list.exec(t);if(e){var n,i,r,o,a,s,u,l,c,h,d=e[1].trim(),f=d.length>1,p={type:"list",raw:"",ordered:f,start:f?+d.slice(0,-1):"",loose:!1,items:[]};d=f?"\\d{1,9}\\".concat(d.slice(-1)):"\\".concat(d),this.options.pedantic&&(d=f?d:"[*+-]");for(var g=new RegExp("^( {0,3}".concat(d,")((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))"));t&&!this.rules.block.hr.test(t)&&(e=g.exec(t));){c=e[2].split("\n"),this.options.pedantic?(o=2,h=c[0].trimLeft()):(o=e[2].search(/[^ ]/),o=e[1].length+(o>4?1:o),h=c[0].slice(o-e[1].length)),s=!1,n=e[0],!c[0]&&/^ *$/.test(c[1])&&(n=e[1]+c.slice(0,2).join("\n")+"\n",p.loose=!0,c=[]);var m=new RegExp("^ {0,".concat(Math.min(3,o-1),"}(?:[*+-]|\\d{1,9}[.)])"));for(a=1;a<c.length;a++){if(l=c[a],this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  ")),m.test(l)){n=e[1]+c.slice(0,a).join("\n")+"\n";break}if(s){if(!(l.search(/[^ ]/)>=o)&&l.trim()){n=e[1]+c.slice(0,a).join("\n")+"\n";break}h+="\n"+l.slice(o)}else l.trim()||(s=!0),l.search(/[^ ]/)>=o?h+="\n"+l.slice(o):h+="\n"+l}p.loose||(u?p.loose=!0:/\n *\n *$/.test(n)&&(u=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(h))&&(r="[ ] "!==i[0],h=h.replace(/^\[[ xX]\] +/,"")),p.items.push({type:"list_item",raw:n,task:!!i,checked:r,loose:!1,text:h}),p.raw+=n,t=t.slice(n.length)}p.items[p.items.length-1].raw=n.trimRight(),p.items[p.items.length-1].text=h.trimRight(),p.raw=p.raw.trimRight();var v=p.items.length;for(a=0;a<v;a++)this.lexer.state.top=!1,p.items[a].tokens=this.lexer.blockTokens(p.items[a].text,[]),p.items[a].tokens.some((function(t){return"space"===t.type}))&&(p.loose=!0,p.items[a].loose=!0);return p}}},{key:"html",value:function(t){var e=this.rules.block.html.exec(t);if(e){var n={type:"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:e[0]};return this.options.sanitize&&(n.type="paragraph",n.text=this.options.sanitizer?this.options.sanitizer(e[0]):Qy(e[0]),n.tokens=[],this.lexer.inline(n.text,n.tokens)),n}}},{key:"def",value:function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{type:"def",tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}}},{key:"table",value:function(t){var e=this.rules.block.table.exec(t);if(e){var n={type:"table",header:Jy(e[1]).map((function(t){return{text:t}})),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(n.header.length===n.align.length){n.raw=e[0];var i,r,o,a,s=n.align.length;for(i=0;i<s;i++)/^ *-+: *$/.test(n.align[i])?n.align[i]="right":/^ *:-+: *$/.test(n.align[i])?n.align[i]="center":/^ *:-+ *$/.test(n.align[i])?n.align[i]="left":n.align[i]=null;for(s=n.rows.length,i=0;i<s;i++)n.rows[i]=Jy(n.rows[i],n.header.length).map((function(t){return{text:t}}));for(s=n.header.length,r=0;r<s;r++)n.header[r].tokens=[],this.lexer.inlineTokens(n.header[r].text,n.header[r].tokens);for(s=n.rows.length,r=0;r<s;r++)for(a=n.rows[r],o=0;o<a.length;o++)a[o].tokens=[],this.lexer.inlineTokens(a[o].text,a[o].tokens);return n}}}},{key:"lheading",value:function(t){var e=this.rules.block.lheading.exec(t);if(e){var n={type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}},{key:"paragraph",value:function(t){var e=this.rules.block.paragraph.exec(t);if(e){var n={type:"paragraph",raw:e[0],text:"\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}},{key:"text",value:function(t){var e=this.rules.block.text.exec(t);if(e){var n={type:"text",raw:e[0],text:e[0],tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}},{key:"escape",value:function(t){var e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:Qy(e[1])}}},{key:"tag",value:function(t){var e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&/^<a /i.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):Qy(e[0]):e[0]}}},{key:"link",value:function(t){var e=this.rules.inline.link.exec(t);if(e){var n=e[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;var i=Zy(n.slice(0,-1),"\\");if((n.length-i.length)%2==0)return}else{var r=tb(e[2],"()");if(r>-1){var o=(0===e[0].indexOf("!")?5:4)+e[1].length+r;e[2]=e[2].substring(0,r),e[0]=e[0].substring(0,o).trim(),e[3]=""}}var a=e[2],s="";if(this.options.pedantic){var u=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(a);u&&(a=u[1],s=u[3])}else s=e[3]?e[3].slice(1,-1):"";return a=a.trim(),/^</.test(a)&&(a=this.options.pedantic&&!/>$/.test(n)?a.slice(1):a.slice(1,-1)),eb(e,{href:a?a.replace(this.rules.inline._escapes,"$1"):a,title:s?s.replace(this.rules.inline._escapes,"$1"):s},e[0],this.lexer)}}},{key:"reflink",value:function(t,e){var n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){var i=(n[2]||n[1]).replace(/\s+/g," ");if(!(i=e[i.toLowerCase()])||!i.href){var r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return eb(n,i,n[0],this.lexer)}}},{key:"emStrong",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=this.rules.inline.emStrong.lDelim.exec(t);if(i&&(!i[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=i[1]||i[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){var o,a,s=i[0].length-1,u=s,l=0,c="*"===i[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,e=e.slice(-1*t.length+s);null!=(i=c.exec(e));)if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6])if(a=o.length,i[3]||i[4])u+=a;else if(!((i[5]||i[6])&&s%3)||(s+a)%3){if(!((u-=a)>0)){if(a=Math.min(a,a+u+l),Math.min(s,a)%2){var h=t.slice(1,s+i.index+a);return{type:"em",raw:t.slice(0,s+i.index+a+1),text:h,tokens:this.lexer.inlineTokens(h,[])}}var d=t.slice(2,s+i.index+a-1);return{type:"strong",raw:t.slice(0,s+i.index+a+1),text:d,tokens:this.lexer.inlineTokens(d,[])}}}else l+=a}}}},{key:"codespan",value:function(t){var e=this.rules.inline.code.exec(t);if(e){var n=e[2].replace(/\n/g," "),i=/[^ ]/.test(n),r=/^ /.test(n)&&/ $/.test(n);return i&&r&&(n=n.substring(1,n.length-1)),n=Qy(n,!0),{type:"codespan",raw:e[0],text:n}}}},{key:"br",value:function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}},{key:"del",value:function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2],[])}}},{key:"autolink",value:function(t,e){var n,i,r=this.rules.inline.autolink.exec(t);if(r)return i="@"===r[2]?"mailto:"+(n=Qy(this.options.mangle?e(r[1]):r[1])):n=Qy(r[1]),{type:"link",raw:r[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}},{key:"url",value:function(t,e){var n;if(n=this.rules.inline.url.exec(t)){var i,r;if("@"===n[2])r="mailto:"+(i=Qy(this.options.mangle?e(n[0]):n[0]));else{var o;do{o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(o!==n[0]);i=Qy(n[0]),r="www."===n[1]?"http://"+i:i}return{type:"link",raw:n[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}},{key:"inlineText",value:function(t,e){var n,i=this.rules.inline.text.exec(t);if(i)return n=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):Qy(i[0]):i[0]:Qy(this.options.smartypants?e(i[0]):i[0]),{type:"text",raw:i[0],text:n}}}]),t}(),ib=Gy,rb=zy,ob=Wy,ab={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)( [^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:ib,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};ab.def=rb(ab.def).replace("label",ab._label).replace("title",ab._title).getRegex(),ab.bullet=/(?:[*+-]|\d{1,9}[.)])/,ab.listItemStart=rb(/^( *)(bull) */).replace("bull",ab.bullet).getRegex(),ab.list=rb(ab.list).replace(/bull/g,ab.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ab.def.source+")").getRegex(),ab._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ab._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,ab.html=rb(ab.html,"i").replace("comment",ab._comment).replace("tag",ab._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ab.paragraph=rb(ab._paragraph).replace("hr",ab.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ab._tag).getRegex(),ab.blockquote=rb(ab.blockquote).replace("paragraph",ab.paragraph).getRegex(),ab.normal=ob({},ab),ab.gfm=ob({},ab.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),ab.gfm.table=rb(ab.gfm.table).replace("hr",ab.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ab._tag).getRegex(),ab.pedantic=ob({},ab.normal,{html:rb("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",ab._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ib,paragraph:rb(ab.normal._paragraph).replace("hr",ab.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",ab.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var sb={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ib,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:ib,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};sb.punctuation=rb(sb.punctuation).replace(/punctuation/g,sb._punctuation).getRegex(),sb.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,sb.escapedEmSt=/\\\*|\\_/g,sb._comment=rb(ab._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),sb.emStrong.lDelim=rb(sb.emStrong.lDelim).replace(/punct/g,sb._punctuation).getRegex(),sb.emStrong.rDelimAst=rb(sb.emStrong.rDelimAst,"g").replace(/punct/g,sb._punctuation).getRegex(),sb.emStrong.rDelimUnd=rb(sb.emStrong.rDelimUnd,"g").replace(/punct/g,sb._punctuation).getRegex(),sb._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,sb._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,sb._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,sb.autolink=rb(sb.autolink).replace("scheme",sb._scheme).replace("email",sb._email).getRegex(),sb._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,sb.tag=rb(sb.tag).replace("comment",sb._comment).replace("attribute",sb._attribute).getRegex(),sb._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,sb._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,sb._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,sb.link=rb(sb.link).replace("label",sb._label).replace("href",sb._href).replace("title",sb._title).getRegex(),sb.reflink=rb(sb.reflink).replace("label",sb._label).getRegex(),sb.reflinkSearch=rb(sb.reflinkSearch,"g").replace("reflink",sb.reflink).replace("nolink",sb.nolink).getRegex(),sb.normal=ob({},sb),sb.pedantic=ob({},sb.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:rb(/^!?\[(label)\]\((.*?)\)/).replace("label",sb._label).getRegex(),reflink:rb(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sb._label).getRegex()}),sb.gfm=ob({},sb.normal,{escape:rb(sb.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),sb.gfm.url=rb(sb.gfm.url,"i").replace("email",sb.gfm._extended_email).getRegex(),sb.breaks=ob({},sb.gfm,{br:rb(sb.br).replace("{2,}","*").getRegex(),text:rb(sb.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ub={block:ab,inline:sb},lb=nb,cb=_y.exports.defaults,hb=ub.block,db=ub.inline,fb=Xy;function pb(t){return t.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function gb(t){var e,n,i="",r=t.length;for(e=0;e<r;e++)n=t.charCodeAt(e),Math.random()>.5&&(n="x"+n.toString(16)),i+="&#"+n+";";return i}var mb=function(){function t(e){Mu(this,t),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||cb,this.options.tokenizer=this.options.tokenizer||new lb,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var n={block:hb.normal,inline:db.normal};this.options.pedantic?(n.block=hb.pedantic,n.inline=db.pedantic):this.options.gfm&&(n.block=hb.gfm,this.options.breaks?n.inline=db.breaks:n.inline=db.gfm),this.tokenizer.rules=n}return Pu(t,[{key:"lex",value:function(t){var e;for(t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    "),this.blockTokens(t,this.tokens);e=this.inlineQueue.shift();)this.inlineTokens(e.src,e.tokens);return this.tokens}},{key:"blockTokens",value:function(t){var e,n,i,r,o=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];for(this.options.pedantic&&(t=t.replace(/^ +$/gm,""));t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(n){return!!(e=n.call({lexer:o},t,a))&&(t=t.substring(e.raw.length),a.push(e),!0)}))))if(e=this.tokenizer.space(t))t=t.substring(e.raw.length),e.type&&a.push(e);else if(e=this.tokenizer.code(t))t=t.substring(e.raw.length),!(n=a[a.length-1])||"paragraph"!==n.type&&"text"!==n.type?a.push(e):(n.raw+="\n"+e.raw,n.text+="\n"+e.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(e=this.tokenizer.fences(t))t=t.substring(e.raw.length),a.push(e);else if(e=this.tokenizer.heading(t))t=t.substring(e.raw.length),a.push(e);else if(e=this.tokenizer.hr(t))t=t.substring(e.raw.length),a.push(e);else if(e=this.tokenizer.blockquote(t))t=t.substring(e.raw.length),a.push(e);else if(e=this.tokenizer.list(t))t=t.substring(e.raw.length),a.push(e);else if(e=this.tokenizer.html(t))t=t.substring(e.raw.length),a.push(e);else if(e=this.tokenizer.def(t))t=t.substring(e.raw.length),!(n=a[a.length-1])||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[e.tag]||(this.tokens.links[e.tag]={href:e.href,title:e.title}):(n.raw+="\n"+e.raw,n.text+="\n"+e.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(e=this.tokenizer.table(t))t=t.substring(e.raw.length),a.push(e);else if(e=this.tokenizer.lheading(t))t=t.substring(e.raw.length),a.push(e);else if(i=t,this.options.extensions&&this.options.extensions.startBlock&&function(){var e=1/0,n=t.slice(1),r=void 0;o.options.extensions.startBlock.forEach((function(t){"number"==typeof(r=t.call({lexer:this},n))&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}(),this.state.top&&(e=this.tokenizer.paragraph(i)))n=a[a.length-1],r&&"paragraph"===n.type?(n.raw+="\n"+e.raw,n.text+="\n"+e.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):a.push(e),r=i.length!==t.length,t=t.substring(e.raw.length);else if(e=this.tokenizer.text(t))t=t.substring(e.raw.length),(n=a[a.length-1])&&"text"===n.type?(n.raw+="\n"+e.raw,n.text+="\n"+e.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):a.push(e);else if(t){var s="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(s);break}throw new Error(s)}return this.state.top=!0,a}},{key:"inline",value:function(t,e){this.inlineQueue.push({src:t,tokens:e})}},{key:"inlineTokens",value:function(t){var e,n,i,r,o,a,s=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=t;if(this.tokens.links){var c=Object.keys(this.tokens.links);if(c.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(l));)c.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,r.index)+"["+fb("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,r.index)+"["+fb("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,r.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;t;)if(o||(a=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(e=n.call({lexer:s},t,u))&&(t=t.substring(e.raw.length),u.push(e),!0)}))))if(e=this.tokenizer.escape(t))t=t.substring(e.raw.length),u.push(e);else if(e=this.tokenizer.tag(t))t=t.substring(e.raw.length),(n=u[u.length-1])&&"text"===e.type&&"text"===n.type?(n.raw+=e.raw,n.text+=e.text):u.push(e);else if(e=this.tokenizer.link(t))t=t.substring(e.raw.length),u.push(e);else if(e=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(e.raw.length),(n=u[u.length-1])&&"text"===e.type&&"text"===n.type?(n.raw+=e.raw,n.text+=e.text):u.push(e);else if(e=this.tokenizer.emStrong(t,l,a))t=t.substring(e.raw.length),u.push(e);else if(e=this.tokenizer.codespan(t))t=t.substring(e.raw.length),u.push(e);else if(e=this.tokenizer.br(t))t=t.substring(e.raw.length),u.push(e);else if(e=this.tokenizer.del(t))t=t.substring(e.raw.length),u.push(e);else if(e=this.tokenizer.autolink(t,gb))t=t.substring(e.raw.length),u.push(e);else if(this.state.inLink||!(e=this.tokenizer.url(t,gb))){if(i=t,this.options.extensions&&this.options.extensions.startInline&&function(){var e=1/0,n=t.slice(1),r=void 0;s.options.extensions.startInline.forEach((function(t){"number"==typeof(r=t.call({lexer:this},n))&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}(),e=this.tokenizer.inlineText(i,pb))t=t.substring(e.raw.length),"_"!==e.raw.slice(-1)&&(a=e.raw.slice(-1)),o=!0,(n=u[u.length-1])&&"text"===n.type?(n.raw+=e.raw,n.text+=e.text):u.push(e);else if(t){var h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}throw new Error(h)}}else t=t.substring(e.raw.length),u.push(e);return u}}],[{key:"rules",get:function(){return{block:hb,inline:db}}},{key:"lex",value:function(e,n){return new t(n).lex(e)}},{key:"lexInline",value:function(e,n){return new t(n).inlineTokens(e)}}]),t}(),vb=_y.exports.defaults,yb=Uy,bb=jy,_b=function(){function t(e){Mu(this,t),this.options=e||vb}return Pu(t,[{key:"code",value:function(t,e,n){var i=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,i);null!=r&&r!==t&&(n=!0,t=r)}return t=t.replace(/\n$/,"")+"\n",i?'<pre><code class="'+this.options.langPrefix+bb(i,!0)+'">'+(n?t:bb(t,!0))+"</code></pre>\n":"<pre><code>"+(n?t:bb(t,!0))+"</code></pre>\n"}},{key:"blockquote",value:function(t){return"<blockquote>\n"+t+"</blockquote>\n"}},{key:"html",value:function(t){return t}},{key:"heading",value:function(t,e,n,i){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+i.slug(n)+'">'+t+"</h"+e+">\n":"<h"+e+">"+t+"</h"+e+">\n"}},{key:"hr",value:function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}},{key:"list",value:function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"</"+i+">\n"}},{key:"listitem",value:function(t){return"<li>"+t+"</li>\n"}},{key:"checkbox",value:function(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}},{key:"paragraph",value:function(t){return"<p>"+t+"</p>\n"}},{key:"table",value:function(t,e){return e&&(e="<tbody>"+e+"</tbody>"),"<table>\n<thead>\n"+t+"</thead>\n"+e+"</table>\n"}},{key:"tablerow",value:function(t){return"<tr>\n"+t+"</tr>\n"}},{key:"tablecell",value:function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"</"+n+">\n"}},{key:"strong",value:function(t){return"<strong>"+t+"</strong>"}},{key:"em",value:function(t){return"<em>"+t+"</em>"}},{key:"codespan",value:function(t){return"<code>"+t+"</code>"}},{key:"br",value:function(){return this.options.xhtml?"<br/>":"<br>"}},{key:"del",value:function(t){return"<del>"+t+"</del>"}},{key:"link",value:function(t,e,n){if(null===(t=yb(this.options.sanitize,this.options.baseUrl,t)))return n;var i='<a href="'+bb(t)+'"';return e&&(i+=' title="'+e+'"'),i+=">"+n+"</a>"}},{key:"image",value:function(t,e,n){if(null===(t=yb(this.options.sanitize,this.options.baseUrl,t)))return n;var i='<img src="'+t+'" alt="'+n+'"';return e&&(i+=' title="'+e+'"'),i+=this.options.xhtml?"/>":">"}},{key:"text",value:function(t){return t}}]),t}(),Eb=function(){function t(){Mu(this,t)}return Pu(t,[{key:"strong",value:function(t){return t}},{key:"em",value:function(t){return t}},{key:"codespan",value:function(t){return t}},{key:"del",value:function(t){return t}},{key:"html",value:function(t){return t}},{key:"text",value:function(t){return t}},{key:"link",value:function(t,e,n){return""+n}},{key:"image",value:function(t,e,n){return""+n}},{key:"br",value:function(){return""}}]),t}(),xb=function(){function t(){Mu(this,t),this.seen={}}return Pu(t,[{key:"serialize",value:function(t){return t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}},{key:"getNextSafeSlug",value:function(t,e){var n=t,i=0;if(this.seen.hasOwnProperty(n)){i=this.seen[t];do{n=t+"-"+ ++i}while(this.seen.hasOwnProperty(n))}return e||(this.seen[t]=i,this.seen[n]=0),n}},{key:"slug",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serialize(t);return this.getNextSafeSlug(n,e.dryrun)}}]),t}(),Ab=_b,Db=Eb,wb=xb,kb=_y.exports.defaults,Tb=Vy,Cb=function(){function t(e){Mu(this,t),this.options=e||kb,this.options.renderer=this.options.renderer||new Ab,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Db,this.slugger=new wb}return Pu(t,[{key:"parse",value:function(t){var e,n,i,r,o,a,s,u,l,c,h,d,f,p,g,m,v,y,b,_=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],E="",x=t.length;for(e=0;e<x;e++)if(c=t[e],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[c.type])||!1===(b=this.options.extensions.renderers[c.type].call({parser:this},c))&&["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type))switch(c.type){case"space":continue;case"hr":E+=this.renderer.hr();continue;case"heading":E+=this.renderer.heading(this.parseInline(c.tokens),c.depth,Tb(this.parseInline(c.tokens,this.textRenderer)),this.slugger);continue;case"code":E+=this.renderer.code(c.text,c.lang,c.escaped);continue;case"table":for(u="",s="",r=c.header.length,n=0;n<r;n++)s+=this.renderer.tablecell(this.parseInline(c.header[n].tokens),{header:!0,align:c.align[n]});for(u+=this.renderer.tablerow(s),l="",r=c.rows.length,n=0;n<r;n++){for(s="",o=(a=c.rows[n]).length,i=0;i<o;i++)s+=this.renderer.tablecell(this.parseInline(a[i].tokens),{header:!1,align:c.align[i]});l+=this.renderer.tablerow(s)}E+=this.renderer.table(u,l);continue;case"blockquote":l=this.parse(c.tokens),E+=this.renderer.blockquote(l);continue;case"list":for(h=c.ordered,d=c.start,f=c.loose,r=c.items.length,l="",n=0;n<r;n++)m=(g=c.items[n]).checked,v=g.task,p="",g.task&&(y=this.renderer.checkbox(m),f?g.tokens.length>0&&"paragraph"===g.tokens[0].type?(g.tokens[0].text=y+" "+g.tokens[0].text,g.tokens[0].tokens&&g.tokens[0].tokens.length>0&&"text"===g.tokens[0].tokens[0].type&&(g.tokens[0].tokens[0].text=y+" "+g.tokens[0].tokens[0].text)):g.tokens.unshift({type:"text",text:y}):p+=y),p+=this.parse(g.tokens,f),l+=this.renderer.listitem(p,v,m);E+=this.renderer.list(l,h,d);continue;case"html":E+=this.renderer.html(c.text);continue;case"paragraph":E+=this.renderer.paragraph(this.parseInline(c.tokens));continue;case"text":for(l=c.tokens?this.parseInline(c.tokens):c.text;e+1<x&&"text"===t[e+1].type;)l+="\n"+((c=t[++e]).tokens?this.parseInline(c.tokens):c.text);E+=_?this.renderer.paragraph(l):l;continue;default:var A='Token with "'+c.type+'" type was not found.';if(this.options.silent)return void console.error(A);throw new Error(A)}else E+=b||"";return E}},{key:"parseInline",value:function(t,e){e=e||this.renderer;var n,i,r,o="",a=t.length;for(n=0;n<a;n++)if(i=t[n],!(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type])||!1===(r=this.options.extensions.renderers[i.type].call({parser:this},i))&&["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type))switch(i.type){case"escape":case"text":o+=e.text(i.text);break;case"html":o+=e.html(i.text);break;case"link":o+=e.link(i.href,i.title,this.parseInline(i.tokens,e));break;case"image":o+=e.image(i.href,i.title,i.text);break;case"strong":o+=e.strong(this.parseInline(i.tokens,e));break;case"em":o+=e.em(this.parseInline(i.tokens,e));break;case"codespan":o+=e.codespan(i.text);break;case"br":o+=e.br();break;case"del":o+=e.del(this.parseInline(i.tokens,e));break;default:var s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return void console.error(s);throw new Error(s)}else o+=r||"";return o}}],[{key:"parse",value:function(e,n){return new t(n).parse(e)}},{key:"parseInline",value:function(e,n){return new t(n).parseInline(e)}}]),t}(),Sb=mb,Ib=Cb,Ob=nb,Rb=_b,Mb=Eb,Lb=xb,Pb=Wy,Fb=Yy,Bb=jy,Nb=_y.exports,jb=Nb.getDefaults,Vb=Nb.changeDefaults,zb=Nb.defaults;function Ub(t,e,n){if(null==t)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if("function"==typeof e&&(n=e,e=null),e=Pb({},Ub.defaults,e||{}),Fb(e),n){var i,r=e.highlight;try{i=Sb.lex(t,e)}catch(t){return n(t)}var o=function(t){var o;if(!t)try{e.walkTokens&&Ub.walkTokens(i,e.walkTokens),o=Ib.parse(i,e)}catch(e){t=e}return e.highlight=r,t?n(t):n(null,o)};if(!r||r.length<3)return o();if(delete e.highlight,!i.length)return o();var a=0;return Ub.walkTokens(i,(function(t){"code"===t.type&&(a++,setTimeout((function(){r(t.text,t.lang,(function(e,n){if(e)return o(e);null!=n&&n!==t.text&&(t.text=n,t.escaped=!0),0===--a&&o()}))}),0))})),void(0===a&&o())}try{var s=Sb.lex(t,e);return e.walkTokens&&Ub.walkTokens(s,e.walkTokens),Ib.parse(s,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+Bb(t.message+"",!0)+"</pre>";throw t}}Ub.options=Ub.setOptions=function(t){return Pb(Ub.defaults,t),Vb(Ub.defaults),Ub},Ub.getDefaults=jb,Ub.defaults=zb,Ub.use=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i,r=Pb.apply(void 0,[{}].concat(e)),o=Ub.defaults.extensions||{renderers:{},childTokens:{}};e.forEach((function(t){if(t.extensions&&(i=!0,t.extensions.forEach((function(t){if(!t.name)throw new Error("extension name required");if(t.renderer){var e=o.renderers?o.renderers[t.name]:null;o.renderers[t.name]=e?function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=t.renderer.apply(this,i);return!1===o&&(o=e.apply(this,i)),o}:t.renderer}if(t.tokenizer){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");o[t.level]?o[t.level].unshift(t.tokenizer):o[t.level]=[t.tokenizer],t.start&&("block"===t.level?o.startBlock?o.startBlock.push(t.start):o.startBlock=[t.start]:"inline"===t.level&&(o.startInline?o.startInline.push(t.start):o.startInline=[t.start]))}t.childTokens&&(o.childTokens[t.name]=t.childTokens)}))),t.renderer&&function(){var e=Ub.defaults.renderer||new Rb,n=function(n){var i=e[n];e[n]=function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=t.renderer[n].apply(e,o);return!1===s&&(s=i.apply(e,o)),s}};for(var i in t.renderer)n(i);r.renderer=e}(),t.tokenizer&&function(){var e=Ub.defaults.tokenizer||new Ob,n=function(n){var i=e[n];e[n]=function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];var s=t.tokenizer[n].apply(e,o);return!1===s&&(s=i.apply(e,o)),s}};for(var i in t.tokenizer)n(i);r.tokenizer=e}(),t.walkTokens){var e=Ub.defaults.walkTokens;r.walkTokens=function(n){t.walkTokens.call(this,n),e&&e.call(this,n)}}i&&(r.extensions=o),Ub.setOptions(r)}))},Ub.walkTokens=function(t,e){var n,i=Wu(t);try{var r=function(){var t=n.value;switch(e.call(Ub,t),t.type){case"table":var i,r=Wu(t.header);try{for(r.s();!(i=r.n()).done;){var o=i.value;Ub.walkTokens(o.tokens,e)}}catch(t){r.e(t)}finally{r.f()}var a,s=Wu(t.rows);try{for(s.s();!(a=s.n()).done;){var u,l=Wu(a.value);try{for(l.s();!(u=l.n()).done;){var c=u.value;Ub.walkTokens(c.tokens,e)}}catch(t){l.e(t)}finally{l.f()}}}catch(t){s.e(t)}finally{s.f()}break;case"list":Ub.walkTokens(t.items,e);break;default:Ub.defaults.extensions&&Ub.defaults.extensions.childTokens&&Ub.defaults.extensions.childTokens[t.type]?Ub.defaults.extensions.childTokens[t.type].forEach((function(n){Ub.walkTokens(t[n],e)})):t.tokens&&Ub.walkTokens(t.tokens,e)}};for(i.s();!(n=i.n()).done;)r()}catch(t){i.e(t)}finally{i.f()}},Ub.parseInline=function(t,e){if(null==t)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");e=Pb({},Ub.defaults,e||{}),Fb(e);try{var n=Sb.lexInline(t,e);return e.walkTokens&&Ub.walkTokens(n,e.walkTokens),Ib.parseInline(n,e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",e.silent)return"<p>An error occurred:</p><pre>"+Bb(t.message+"",!0)+"</pre>";throw t}},Ub.Parser=Ib,Ub.parser=Ib.parse,Ub.Renderer=Rb,Ub.TextRenderer=Mb,Ub.Lexer=Sb,Ub.lexer=Sb.lex,Ub.Tokenizer=Ob,Ub.Slugger=Lb,Ub.parse=Ub;var Gb=Ub,Wb=mb,Hb=Cb,qb=nb,$b=_b,Yb=Eb,Xb=xb;by.exports=Gb;by.exports.parse=Gb,by.exports.Parser=Hb,by.exports.parser=Hb.parse,by.exports.Renderer=$b,by.exports.TextRenderer=Yb,by.exports.Lexer=Wb,by.exports.lexer=Wb.lex,by.exports.Tokenizer=qb,by.exports.Slugger=Xb;var Kb=by.exports;function Zb(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}var Jb={space:/^\n+/,blockCode:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)(\n)(|[\s\S]*?\n)( {0,3}\1[~`]* *(?:\n+|$)|$)/,heading:/^#{1,6} [^\n]+(\n|$)/,lheading:/^[^\n]+\n {0,3}(=+|-+) *(\n+|$)/,hr:/^(([-_*]) *){3,}(\n+|$)/,list:/^( {0})((?:[*+-]|\d{1,9}\.)) [\s\S]+?(?:\n+(?! )(?!\1(?:[*+-]|\d{1,9}\.) )\n*|\s*$)/,blockquote:/^( {0,3}> ?([^\n]*)(?:\n|$))+/,html:/^ {0,3}(?:<(script|pre|style)[\s>][\s\S]*?(?:<\/\1>[^\n]*\n+|$)|<!--(?!-?>)[\s\S]*?-->[^\n]*(\n+|$)|<\/?(\w+)(?: +|\n|\/?>)[\s\S]*?(?:\n{2,}|$))/,paragraph:/^[^\n]+/},Qb={strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,inlineCode:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,link:/^!?\[([\s\S]+)\]\(\s*([\s\S]+)(?:\s+([\s\S]+))?\s*\)/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/},t_=function(t,e,n){return"<".concat(t,' class="mdhl-').concat(n,'">').concat(e,"</").concat(t,">")},e_={codeInFences:function(t,e){return t_("span",Zb(t),"codeInFences")},heading:function(t,e,n){return t_("b",n(t.text,e),t.type)},lheading:function(t,e,n){return t_("b",n(t.text,e),"heading")},paragraph:function(t,e,n){return t_("span",n(t.text,e),t.type)},list:function(t,e,n){var i=t.text.split("\n").map((function(t){var i=t.substr(0,1),r=t.substr(1),o=n(r,e);return"".concat(t_("span",i,"bullet")).concat(o)})).join("\n");return t_("span",i,"list")},fences:function(t,e){var n=Nu(t.cap,6),i=n[1],r=n[2],o=n[3],a=n[4],s=n[5],u=e.codeInFences(a,r);return"".concat(i).concat(Zb(r)).concat(o).concat(u).concat(s)},space:function(t){return t.text},text:function(t){return t.text},em:function(t){return t_("i",t.text,t.type)},strong:function(t){return t_("b",t.text,t.type)},defaultInlineRenderer:function(t){return t_("span",t.text,t.type)},defaultBlockRenderer:function(t){return t_("span",Zb(t.text),t.type)}};function n_(t,e){for(var n="";t;)if(!Object.keys(Qb).some((function(i){var r=Qb[i].exec(t);if(r){var o=r[0];t=t.substring(o.length);var a=Zb(o);return n+=(e[i]||e.defaultInlineRenderer)({type:i,text:a,cap:r},e,n_),!0}return!1})))throw new Error("Infinite loop on byte: "+t.charCodeAt(0));return n}function i_(t){var e=[];for(t=t.replace(/^ +$/gm,"");t;)if(!Object.keys(Jb).some((function(n){var i=Jb[n].exec(t);if(i){var r=i[0];return t=t.substring(r.length),e.push({text:r,type:n,cap:i}),!0}return!1})))throw new Error("Infinite loop on byte: "+t.charCodeAt(0));return e}function r_(t,e){return t.map((function(t){return(e[t.type]||e.defaultBlockRenderer)(t,e,n_)})).join("").replace(/\n/g,"<br/>")}var o_=function(t){t.data("markdownEditorFormComponent",(function(t){return{attachment:null,overlay:null,preview:"",state:t.state,tab:t.tab,init:function(){var t=this;null!==this.state&&this.render(),this.$watch("state",(function(){t.render()}))},render:function(){this.$refs.textarea.scrollHeight>0&&(this.$refs.overlay.style.height="150px",this.$refs.overlay.style.height=this.$refs.textarea.scrollHeight+"px"),this.overlay=null,this.overlay=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e_;return r_(i_(t),e)}(this.state),this.preview=null,this.preview=Kb(this.state)},checkForAutoInsertion:function(t){var e=this.$refs.textarea.value.split("\n"),n=this.$refs.textarea.value.substring(0,this.$refs.textarea.value.selectionStart).split("\n").length,i=e[n-2];if(i.match(/^(\*\s|-\s)|^(\d)+\./)){if(i.match(/^(\*\s)/))i.trim().length>1?e[n-1]="* ":delete e[n-2];else if(i.match(/^(-\s)/))i.trim().length>1?e[n-1]="- ":delete e[n-2];else{var r=i.match(/^(\d)+/)[0];i.trim().length>r.length+2?e[n-1]="".concat(parseInt(r)+1,". "):delete e[n-2]}this.state=e.join("\n"),this.render()}}}}))},a_=function(t){t.data("multiSelectFormComponent",(function(t){var e,n=t.getOptionLabelsUsing,i=t.getSearchResultsUsing,r=t.isAutofocused,o=t.options,a=t.state;return{focusedOptionIndex:null,isLoading:!1,isOpen:!1,labels:[],options:o,search:"",state:a,init:(e=Bu(_u().mark((function t(){var e=this;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r&&this.openListbox(),this.state||(this.state=[]),t.next=4,n();case 4:this.labels=t.sent,this.$watch("search",Bu(_u().mark((function t(){var n,r;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isOpen&&""!==e.search&&null!==e.search){t.next=4;break}return e.options=o,e.focusedOptionIndex=0,t.abrupt("return");case 4:if(!Object.keys(o).length){t.next=11;break}for(r in e.options={},n=e.search.trim().toLowerCase(),o)o[r].trim().toLowerCase().includes(n)&&(e.options[r]=o[r]);e.focusedOptionIndex=0,t.next=17;break;case 11:return e.isLoading=!0,t.next=14,i(e.search);case 14:e.options=t.sent,e.focusedOptionIndex=0,e.isLoading=!1;case 17:case"end":return t.stop()}}),t)})))),this.$watch("state",Bu(_u().mark((function t(){return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:e.labels=t.sent;case 3:case"end":return t.stop()}}),t)}))));case 7:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)}),clearState:function(){this.state=[],this.labels=[],this.closeListbox()},closeListbox:function(){this.isOpen=!1,this.focusedOptionIndex=null,this.search=""},evaluatePosition:function(){for(var t=window.innerHeight-this.$refs.button.offsetHeight,e=this.$refs.button;e;)t-=e.offsetTop,e=e.offsetParent;this.$refs.listbox.offsetHeight<=t?this.$refs.listbox.style.bottom="auto":this.$refs.listbox.style.bottom="".concat(this.$refs.button.offsetHeight,"px")},focusNextOption:function(){null!==this.focusedOptionIndex?this.focusedOptionIndex+1>=Object.keys(this.options).length||(this.focusedOptionIndex++,this.$refs.listboxOptionsList.children[this.focusedOptionIndex].scrollIntoView({block:"center"})):this.focusedOptionIndex=Object.keys(this.options).length-1},focusPreviousOption:function(){null!==this.focusedOptionIndex?this.focusedOptionIndex<=0||(this.focusedOptionIndex--,this.$refs.listboxOptionsList.children[this.focusedOptionIndex].scrollIntoView({block:"center"})):this.focusedOptionIndex=0},openListbox:function(){var t=this;this.focusedOptionIndex=0,this.isOpen=!0,this.$nextTick((function(){t.$refs.search.focus(),t.evaluatePosition(),t.$refs.listboxOptionsList.children[t.focusedOptionIndex].scrollIntoView({block:"center"})}))},selectOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.isOpen){var e=Object.keys(this.options)[null!=t?t:this.focusedOptionIndex];this.state.indexOf(e)<0?this.state.push(e):this.deselectOption(e),this.closeListbox()}else this.closeListbox()},deselectOption:function(t){this.state=this.state.filter((function(e){return e!==t}))},toggleListboxVisibility:function(){this.isOpen?this.closeListbox():this.openListbox()}}}))},s_=el(al());s_.default.config.blockAttributes.heading={tagName:"h2",terminal:!0,breakOnReturn:!0,group:!1},s_.default.config.blockAttributes.subHeading={tagName:"h3",terminal:!0,breakOnReturn:!0,group:!1};var u_=function(t){t.data("richEditorFormComponent",(function(t){return{state:t.state,init:function(){var t,e,n=this;null===(t=this.$refs.trix)||void 0===t||null===(e=t.editor)||void 0===e||e.loadHTML(this.state),this.$watch("state",(function(){var t,e;document.activeElement!==n.$refs.trix&&(null===(t=n.$refs.trix)||void 0===t||null===(e=t.editor)||void 0===e||e.loadHTML(n.state))}))}}}))},l_=function(t){t.data("selectFormComponent",(function(t){var e,n=t.getOptionLabelUsing,i=t.getSearchResultsUsing,r=t.isAutofocused,o=t.options,a=t.state;return{focusedOptionIndex:null,isLoading:!1,isOpen:!1,label:null,options:o,search:"",state:a,init:(e=Bu(_u().mark((function t(){var e=this;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r&&this.openListbox(),t.next=3,n();case 3:this.label=t.sent,this.$watch("search",Bu(_u().mark((function t(){var n,r;return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isOpen&&""!==e.search&&null!==e.search){t.next=4;break}return e.options=o,e.focusedOptionIndex=0,t.abrupt("return");case 4:if(!Object.keys(o).length){t.next=11;break}for(r in e.options={},n=e.search.trim().toLowerCase(),o)o[r].trim().toLowerCase().includes(n)&&(e.options[r]=o[r]);e.focusedOptionIndex=0,t.next=17;break;case 11:return e.isLoading=!0,t.next=14,i(e.search);case 14:e.options=t.sent,e.focusedOptionIndex=0,e.isLoading=!1;case 17:case"end":return t.stop()}}),t)})))),this.$watch("state",Bu(_u().mark((function t(){return _u().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:e.label=t.sent;case 3:case"end":return t.stop()}}),t)}))));case 6:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)}),clearState:function(){this.state=null,this.label=null,this.closeListbox()},closeListbox:function(){this.isOpen=!1,this.focusedOptionIndex=null,this.search=""},evaluatePosition:function(){for(var t=window.innerHeight-this.$refs.button.offsetHeight,e=this.$refs.button;e;)t-=e.offsetTop,e=e.offsetParent;this.$refs.listbox.offsetHeight<=t?this.$refs.listbox.style.bottom="auto":this.$refs.listbox.style.bottom="".concat(this.$refs.button.offsetHeight,"px")},focusNextOption:function(){null!==this.focusedOptionIndex?this.focusedOptionIndex+1>=Object.keys(this.options).length||(this.focusedOptionIndex++,this.$refs.listboxOptionsList.children[this.focusedOptionIndex].scrollIntoView({block:"center"})):this.focusedOptionIndex=Object.keys(this.options).length-1},focusPreviousOption:function(){null!==this.focusedOptionIndex?this.focusedOptionIndex<=0||(this.focusedOptionIndex--,this.$refs.listboxOptionsList.children[this.focusedOptionIndex].scrollIntoView({block:"center"})):this.focusedOptionIndex=0},openListbox:function(){var t=this;this.focusedOptionIndex=Object.keys(this.options).indexOf(this.state),this.focusedOptionIndex<0&&(this.focusedOptionIndex=0),this.isOpen=!0,this.$nextTick((function(){t.$refs.search.focus(),t.evaluatePosition(),t.$refs.listboxOptionsList.children[t.focusedOptionIndex].scrollIntoView({block:"center"})}))},selectOption:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.isOpen?(this.state=Object.keys(this.options)[null!=t?t:this.focusedOptionIndex],this.label=this.options[this.state],this.closeListbox()):this.closeListbox()},toggleListboxVisibility:function(){this.isOpen?this.closeListbox():this.openListbox()}}}))},c_=function(t){t.data("tagsInputFormComponent",(function(t){return{newTag:"",state:t.state,createTag:function(){this.newTag=this.newTag.trim(),""!==this.newTag&&(this.state.includes(this.newTag)||this.state.push(this.newTag),this.newTag="")},deleteTag:function(t){this.state=this.state.filter((function(e){return e!==t}))}}}))};function h_(t){return(h_="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})(t)}function d_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f_(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function p_(t,e,n){return e&&f_(t.prototype,e),n&&f_(t,n),t}function g_(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&&v_(t,e)}function m_(t){return(m_=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function v_(t,e){return(v_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function y_(t,e){if(null==t)return{};var n,i,r=function(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function b_(t,e){if(e&&("object"===$u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function __(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=m_(t);if(e){var r=m_(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return b_(this,n)}}function E_(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=m_(t)););return t}function x_(t,e,n){return(x_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=E_(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function A_(t,e,n,i){return A_="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,n,i){var r,o=E_(t,e);if(o){if((r=Object.getOwnPropertyDescriptor(o,e)).set)return r.set.call(i,n),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(i,e)){if(!r.writable)return!1;r.value=n,Object.defineProperty(i,e,r)}else!function(t,e,n){e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(i,e,n);return!0},A_(t,e,n,i)}function D_(t,e,n,i,r){if(!A_(t,e,n,i||t)&&r)throw new Error("failed to set property");return n}function w_(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var i,r,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(i=n.next()).done)&&(o.push(i.value),!e||o.length!==e);a=!0);}catch(t){s=!0,r=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return o}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return k_(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k_(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k_(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function T_(t){return"string"==typeof t||t instanceof String}var C_="NONE",S_="LEFT",I_="FORCE_LEFT",O_="RIGHT",R_="FORCE_RIGHT";function M_(t){switch(t){case S_:return I_;case O_:return R_;default:return t}}function L_(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function P_(t,e){if(e===t)return!0;var n,i=Array.isArray(e),r=Array.isArray(t);if(i&&r){if(e.length!=t.length)return!1;for(n=0;n<e.length;n++)if(!P_(e[n],t[n]))return!1;return!0}if(i!=r)return!1;if(e&&t&&"object"===h_(e)&&"object"===h_(t)){var o=e instanceof Date,a=t instanceof Date;if(o&&a)return e.getTime()==t.getTime();if(o!=a)return!1;var s=e instanceof RegExp,u=t instanceof RegExp;if(s&&u)return e.toString()==t.toString();if(s!=u)return!1;var l=Object.keys(e);for(n=0;n<l.length;n++)if(!Object.prototype.hasOwnProperty.call(t,l[n]))return!1;for(n=0;n<l.length;n++)if(!P_(t[l[n]],e[l[n]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}var F_=function(){function t(e,n,i,r){for(d_(this,t),this.value=e,this.cursorPos=n,this.oldValue=i,this.oldSelection=r;this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}return p_(t,[{key:"startChangePos",get:function(){return Math.min(this.cursorPos,this.oldSelection.start)}},{key:"insertedCount",get:function(){return this.cursorPos-this.startChangePos}},{key:"inserted",get:function(){return this.value.substr(this.startChangePos,this.insertedCount)}},{key:"removedCount",get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}},{key:"removed",get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)}},{key:"head",get:function(){return this.value.substring(0,this.startChangePos)}},{key:"tail",get:function(){return this.value.substring(this.startChangePos+this.insertedCount)}},{key:"removeDirection",get:function(){return!this.removedCount||this.insertedCount?C_:this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos?O_:S_}}]),t}(),B_=function(){function t(e){d_(this,t),Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}return p_(t,[{key:"aggregate",value:function(t){return this.rawInserted+=t.rawInserted,this.skip=this.skip||t.skip,this.inserted+=t.inserted,this.tailShift+=t.tailShift,this}},{key:"offset",get:function(){return this.tailShift+this.inserted.length}}]),t}(),N_=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0;d_(this,t),this.value=e,this.from=n,this.stop=i}return p_(t,[{key:"toString",value:function(){return this.value}},{key:"extend",value:function(t){this.value+=String(t)}},{key:"appendTo",value:function(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}},{key:"state",get:function(){return{value:this.value,from:this.from,stop:this.stop}},set:function(t){Object.assign(this,t)}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.value.length)return"";var e=this.value[0];return this.value=this.value.slice(1),e}}]),t}();function j_(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new j_.InputMask(t,e)}var V_=function(){function t(e){d_(this,t),this._value="",this._update(Object.assign({},t.DEFAULTS,e)),this.isInitialized=!0}return p_(t,[{key:"updateOptions",value:function(t){Object.keys(t).length&&this.withValueRefresh(this._update.bind(this,t))}},{key:"_update",value:function(t){Object.assign(this,t)}},{key:"state",get:function(){return{_value:this.value}},set:function(t){this._value=t._value}},{key:"reset",value:function(){this._value=""}},{key:"value",get:function(){return this._value},set:function(t){this.resolve(t)}},{key:"resolve",value:function(t){return this.reset(),this.append(t,{input:!0},""),this.doCommit(),this.value}},{key:"unmaskedValue",get:function(){return this.value},set:function(t){this.reset(),this.append(t,{},""),this.doCommit()}},{key:"typedValue",get:function(){return this.doParse(this.value)},set:function(t){this.value=this.doFormat(t)}},{key:"rawInputValue",get:function(){return this.extractInput(0,this.value.length,{raw:!0})},set:function(t){this.reset(),this.append(t,{raw:!0},""),this.doCommit()}},{key:"isComplete",get:function(){return!0}},{key:"nearestInputPos",value:function(t,e){return t}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(t,e)}},{key:"extractTail",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return new N_(this.extractInput(t,e),t)}},{key:"appendTail",value:function(t){return T_(t)&&(t=new N_(String(t))),t.appendTo(this)}},{key:"_appendCharRaw",value:function(t){return t?(this._value+=t,new B_({inserted:t,rawInserted:t})):new B_}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,i=this.state,r=this._appendCharRaw(this.doPrepare(t,e),e);if(r.inserted){var o,a=!1!==this.doValidate(e);if(a&&null!=n){var s=this.state;this.overwrite&&(o=n.state,n.shiftBefore(this.value.length));var u=this.appendTail(n);(a=u.rawInserted===n.toString())&&u.inserted&&(this.state=s)}a||(r=new B_,this.state=i,n&&o&&(n.state=o))}return r}},{key:"_appendPlaceholder",value:function(){return new B_}},{key:"append",value:function(t,e,n){if(!T_(t))throw new Error("value should be string");var i=new B_,r=T_(n)?new N_(String(n)):n;e&&e.tail&&(e._beforeTailState=this.state);for(var o=0;o<t.length;++o)i.aggregate(this._appendChar(t[o],e,r));return null!=r&&(i.tailShift+=this.appendTail(r).tailShift),i}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._value=this.value.slice(0,t)+this.value.slice(e),new B_}},{key:"withValueRefresh",value:function(t){if(this._refreshing||!this.isInitialized)return t();this._refreshing=!0;var e=this.rawInputValue,n=this.value,i=t();return this.rawInputValue=e,this.value&&this.value!==n&&0===n.indexOf(this.value)&&this.append(n.slice(this.value.length),{},""),delete this._refreshing,i}},{key:"runIsolated",value:function(t){if(this._isolated||!this.isInitialized)return t(this);this._isolated=!0;var e=this.state,n=t(this);return this.state=e,delete this._isolated,n}},{key:"doPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.prepare?this.prepare(t,this,e):t}},{key:"doValidate",value:function(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}},{key:"doCommit",value:function(){this.commit&&this.commit(this.value,this)}},{key:"doFormat",value:function(t){return this.format?this.format(t,this):t}},{key:"doParse",value:function(t){return this.parse?this.parse(t,this):t}},{key:"splice",value:function(t,e,n,i){var r=t+e,o=this.extractTail(r),a=this.nearestInputPos(t,i);return new B_({tailShift:a-t}).aggregate(this.remove(a)).aggregate(this.append(n,{input:!0},o))}}]),t}();function z_(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?j_.MaskedRegExp:T_(t)?j_.MaskedPattern:t instanceof Date||t===Date?j_.MaskedDate:t instanceof Number||"number"==typeof t||t===Number?j_.MaskedNumber:Array.isArray(t)||t===Array?j_.MaskedDynamic:j_.Masked&&t.prototype instanceof j_.Masked?t:t instanceof Function?j_.MaskedFunction:t instanceof j_.Masked?t.constructor:(console.warn("Mask not found for mask",t),j_.Masked)}function U_(t){if(j_.Masked&&t instanceof j_.Masked)return t;var e=(t=Object.assign({},t)).mask;if(j_.Masked&&e instanceof j_.Masked)return e;var n=z_(e);if(!n)throw new Error("Masked class is not found for provided mask, appropriate module needs to be import manually before creating mask.");return new n(t)}V_.DEFAULTS={format:function(t){return t},parse:function(t){return t}},j_.Masked=V_,j_.createMask=U_;var G_=["mask"],W_={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./},H_=function(){function t(e){d_(this,t);var n=e.mask,i=y_(e,G_);this.masked=U_({mask:n}),Object.assign(this,i)}return p_(t,[{key:"reset",value:function(){this._isFilled=!1,this.masked.reset()}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return 0===t&&e>=1?(this._isFilled=!1,this.masked.remove(t,e)):new B_}},{key:"value",get:function(){return this.masked.value||(this._isFilled&&!this.isOptional?this.placeholderChar:"")}},{key:"unmaskedValue",get:function(){return this.masked.unmaskedValue}},{key:"isComplete",get:function(){return Boolean(this.masked.value)||this.isOptional}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._isFilled)return new B_;var n=this.masked.state,i=this.masked._appendChar(t,e);return i.inserted&&!1===this.doValidate(e)&&(i.inserted=i.rawInserted="",this.masked.state=n),i.inserted||this.isOptional||this.lazy||e.input||(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this._isFilled=Boolean(i.inserted),i}},{key:"append",value:function(){var t;return(t=this.masked).append.apply(t,arguments)}},{key:"_appendPlaceholder",value:function(){var t=new B_;return this._isFilled||this.isOptional||(this._isFilled=!0,t.inserted=this.placeholderChar),t}},{key:"extractTail",value:function(){var t;return(t=this.masked).extractTail.apply(t,arguments)}},{key:"appendTail",value:function(){var t;return(t=this.masked).appendTail.apply(t,arguments)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0;return this.masked.extractInput(t,e,n)}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C_,n=0,i=this.value.length,r=Math.min(Math.max(t,n),i);switch(e){case S_:case I_:return this.isComplete?r:n;case O_:case R_:return this.isComplete?r:i;default:return r}}},{key:"doValidate",value:function(){var t,e;return(t=this.masked).doValidate.apply(t,arguments)&&(!this.parent||(e=this.parent).doValidate.apply(e,arguments))}},{key:"doCommit",value:function(){this.masked.doCommit()}},{key:"state",get:function(){return{masked:this.masked.state,_isFilled:this._isFilled}},set:function(t){this.masked.state=t.masked,this._isFilled=t._isFilled}}]),t}(),q_=function(){function t(e){d_(this,t),Object.assign(this,e),this._value=""}return p_(t,[{key:"value",get:function(){return this._value}},{key:"unmaskedValue",get:function(){return this.isUnmasking?this.value:""}},{key:"reset",value:function(){this._isRawInput=!1,this._value=""}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new B_}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C_,n=0,i=this._value.length;switch(e){case S_:case I_:return n;default:return i}}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.raw&&this._isRawInput&&this._value.slice(t,e)||""}},{key:"isComplete",get:function(){return!0}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new B_;if(this._value)return n;var i=this.char===t[0],r=i&&(this.isUnmasking||e.input||e.raw)&&!e.tail;return r&&(n.rawInserted=this.char),this._value=n.inserted=this.char,this._isRawInput=r&&(e.raw||e.input),n}},{key:"_appendPlaceholder",value:function(){var t=new B_;return this._value||(this._value=t.inserted=this.char),t}},{key:"extractTail",value:function(){return arguments.length>1&&void 0!==arguments[1]||this.value.length,new N_("")}},{key:"appendTail",value:function(t){return T_(t)&&(t=new N_(String(t))),t.appendTo(this)}},{key:"append",value:function(t,e,n){var i=this._appendChar(t,e);return null!=n&&(i.tailShift+=this.appendTail(n).tailShift),i}},{key:"doCommit",value:function(){}},{key:"state",get:function(){return{_value:this._value,_isRawInput:this._isRawInput}},set:function(t){Object.assign(this,t)}}]),t}(),$_=["chunks"],Y_=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;d_(this,t),this.chunks=e,this.from=n}return p_(t,[{key:"toString",value:function(){return this.chunks.map(String).join("")}},{key:"extend",value:function(e){if(String(e)){T_(e)&&(e=new N_(String(e)));var n=this.chunks[this.chunks.length-1],i=n&&(n.stop===e.stop||null==e.stop)&&e.from===n.from+n.toString().length;if(e instanceof N_)i?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof t){if(null==e.stop)for(var r;e.chunks.length&&null==e.chunks[0].stop;)(r=e.chunks.shift()).from+=e.from,this.extend(r);e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}}},{key:"appendTo",value:function(e){if(!(e instanceof j_.MaskedPattern))return new N_(this.toString()).appendTo(e);for(var n=new B_,i=0;i<this.chunks.length&&!n.skip;++i){var r=this.chunks[i],o=e._mapPosToBlock(e.value.length),a=r.stop,s=void 0;if(null!=a&&(!o||o.index<=a)&&((r instanceof t||e._stops.indexOf(a)>=0)&&n.aggregate(e._appendPlaceholder(a)),s=r instanceof t&&e._blocks[a]),s){var u=s.appendTail(r);u.skip=!1,n.aggregate(u),e._value+=u.inserted;var l=r.toString().slice(u.rawInserted.length);l&&n.aggregate(e.append(l,{tail:!0}))}else n.aggregate(e.append(r.toString(),{tail:!0}))}return n}},{key:"state",get:function(){return{chunks:this.chunks.map((function(t){return t.state})),from:this.from,stop:this.stop,blockIndex:this.blockIndex}},set:function(e){var n=e.chunks,i=y_(e,$_);Object.assign(this,i),this.chunks=n.map((function(e){var n="chunks"in e?new t:new N_;return n.state=e,n}))}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.chunks.length)return"";for(var e=t-this.from,n=0;n<this.chunks.length;){var i=this.chunks[n],r=i.shiftBefore(e);if(i.toString()){if(!r)break;++n}else this.chunks.splice(n,1);if(r)return r}return""}}]),t}(),X_=function(t){g_(n,t);var e=__(n);function n(){return d_(this,n),e.apply(this,arguments)}return p_(n,[{key:"_update",value:function(t){t.mask&&(t.validate=function(e){return e.search(t.mask)>=0}),x_(m_(n.prototype),"_update",this).call(this,t)}}]),n}(V_);j_.MaskedRegExp=X_;var K_=["_blocks"],Z_=function(t){g_(n,t);var e=__(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d_(this,n),t.definitions=Object.assign({},W_,t.definitions),e.call(this,Object.assign({},n.DEFAULTS,t))}return p_(n,[{key:"_update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.definitions=Object.assign({},this.definitions,t.definitions),x_(m_(n.prototype),"_update",this).call(this,t),this._rebuildMask()}},{key:"_rebuildMask",value:function(){var t=this,e=this.definitions;this._blocks=[],this._stops=[],this._maskedBlocks={};var i=this.mask;if(i&&e)for(var r=!1,o=!1,a=0;a<i.length;++a){if(this.blocks)if("continue"===function(){var e=i.slice(a),n=Object.keys(t.blocks).filter((function(t){return 0===e.indexOf(t)}));n.sort((function(t,e){return e.length-t.length}));var r=n[0];if(r){var o=U_(Object.assign({parent:t,lazy:t.lazy,placeholderChar:t.placeholderChar,overwrite:t.overwrite},t.blocks[r]));return o&&(t._blocks.push(o),t._maskedBlocks[r]||(t._maskedBlocks[r]=[]),t._maskedBlocks[r].push(t._blocks.length-1)),a+=r.length-1,"continue"}}())continue;var s=i[a],u=s in e;if(s!==n.STOP_CHAR)if("{"!==s&&"}"!==s)if("["!==s&&"]"!==s){if(s===n.ESCAPE_CHAR){if(++a,!(s=i[a]))break;u=!1}var l=u?new H_({parent:this,lazy:this.lazy,placeholderChar:this.placeholderChar,mask:e[s],isOptional:o}):new q_({char:s,isUnmasking:r});this._blocks.push(l)}else o=!o;else r=!r;else this._stops.push(this._blocks.length)}}},{key:"state",get:function(){return Object.assign({},x_(m_(n.prototype),"state",this),{_blocks:this._blocks.map((function(t){return t.state}))})},set:function(t){var e=t._blocks,i=y_(t,K_);this._blocks.forEach((function(t,n){return t.state=e[n]})),D_(m_(n.prototype),"state",i,this,!0)}},{key:"reset",value:function(){x_(m_(n.prototype),"reset",this).call(this),this._blocks.forEach((function(t){return t.reset()}))}},{key:"isComplete",get:function(){return this._blocks.every((function(t){return t.isComplete}))}},{key:"doCommit",value:function(){this._blocks.forEach((function(t){return t.doCommit()})),x_(m_(n.prototype),"doCommit",this).call(this)}},{key:"unmaskedValue",get:function(){return this._blocks.reduce((function(t,e){return t+e.unmaskedValue}),"")},set:function(t){D_(m_(n.prototype),"unmaskedValue",t,this,!0)}},{key:"value",get:function(){return this._blocks.reduce((function(t,e){return t+e.value}),"")},set:function(t){D_(m_(n.prototype),"value",t,this,!0)}},{key:"appendTail",value:function(t){return x_(m_(n.prototype),"appendTail",this).call(this,t).aggregate(this._appendPlaceholder())}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this._mapPosToBlock(this.value.length),i=new B_;if(!n)return i;for(var r=n.index;;++r){var o=this._blocks[r];if(!o)break;var a=o._appendChar(t,e),s=a.skip;if(i.aggregate(a),s||a.rawInserted)break}return i}},{key:"extractTail",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,i=new Y_;return e===n||this._forEachBlocksInRange(e,n,(function(e,n,r,o){var a=e.extractTail(r,o);a.stop=t._findStopBefore(n),a.from=t._blockStartPos(n),a instanceof Y_&&(a.blockIndex=n),i.extend(a)})),i}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t===e)return"";var i="";return this._forEachBlocksInRange(t,e,(function(t,e,r,o){i+=t.extractInput(r,o,n)})),i}},{key:"_findStopBefore",value:function(t){for(var e,n=0;n<this._stops.length;++n){var i=this._stops[n];if(!(i<=t))break;e=i}return e}},{key:"_appendPlaceholder",value:function(t){var e=this,n=new B_;if(this.lazy&&null==t)return n;var i=this._mapPosToBlock(this.value.length);if(!i)return n;var r=i.index,o=null!=t?t:this._blocks.length;return this._blocks.slice(r,o).forEach((function(i){if(!i.lazy||null!=t){var r=null!=i._blocks?[i._blocks.length]:[],o=i._appendPlaceholder.apply(i,r);e._value+=o.inserted,n.aggregate(o)}})),n}},{key:"_mapPosToBlock",value:function(t){for(var e="",n=0;n<this._blocks.length;++n){var i=this._blocks[n],r=e.length;if(t<=(e+=i.value).length)return{index:n,offset:t-r}}}},{key:"_blockStartPos",value:function(t){return this._blocks.slice(0,t).reduce((function(t,e){return t+e.value.length}),0)}},{key:"_forEachBlocksInRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0,i=this._mapPosToBlock(t);if(i){var r=this._mapPosToBlock(e),o=r&&i.index===r.index,a=i.offset,s=r&&o?r.offset:this._blocks[i.index].value.length;if(n(this._blocks[i.index],i.index,a,s),r&&!o){for(var u=i.index+1;u<r.index;++u)n(this._blocks[u],u,0,this._blocks[u].value.length);n(this._blocks[r.index],r.index,0,r.offset)}}}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,i=x_(m_(n.prototype),"remove",this).call(this,t,e);return this._forEachBlocksInRange(t,e,(function(t,e,n,r){i.aggregate(t.remove(n,r))})),i}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:C_,n=this._mapPosToBlock(t)||{index:0,offset:0},i=n.offset,r=n.index,o=this._blocks[r];if(!o)return t;var a=i;0!==a&&a<o.value.length&&(a=o.nearestInputPos(i,M_(e)));var s=a===o.value.length,u=0===a;if(!u&&!s)return this._blockStartPos(r)+a;var l=s?r+1:r;if(e===C_){if(l>0){var c=l-1,h=this._blocks[c],d=h.nearestInputPos(0,C_);if(!h.value.length||d!==h.value.length)return this._blockStartPos(l)}for(var f=l,p=f;p<this._blocks.length;++p){var g=this._blocks[p],m=g.nearestInputPos(0,C_);if(!g.value.length||m!==g.value.length)return this._blockStartPos(p)+m}for(var v=l-1;v>=0;--v){var y=this._blocks[v],b=y.nearestInputPos(0,C_);if(!y.value.length||b!==y.value.length)return this._blockStartPos(v)+y.value.length}return t}if(e===S_||e===I_){for(var _,E=l;E<this._blocks.length;++E)if(this._blocks[E].value){_=E;break}if(null!=_){var x=this._blocks[_],A=x.nearestInputPos(0,O_);if(0===A&&x.unmaskedValue.length)return this._blockStartPos(_)+A}for(var D,w=-1,k=l-1;k>=0;--k){var T=this._blocks[k],C=T.nearestInputPos(T.value.length,I_);if(T.value&&0===C||(D=k),0!==C){if(C!==T.value.length)return this._blockStartPos(k)+C;w=k;break}}if(e===S_)for(var S=w+1;S<=Math.min(l,this._blocks.length-1);++S){var I=this._blocks[S],O=I.nearestInputPos(0,C_),R=this._blockStartPos(S)+O;if(R>t)break;if(O!==I.value.length)return R}if(w>=0)return this._blockStartPos(w)+this._blocks[w].value.length;if(e===I_||this.lazy&&!this.extractInput()&&!J_(this._blocks[l]))return 0;if(null!=D)return this._blockStartPos(D);for(var M=l;M<this._blocks.length;++M){var L=this._blocks[M],P=L.nearestInputPos(0,C_);if(!L.value.length||P!==L.value.length)return this._blockStartPos(M)+P}return 0}if(e===O_||e===R_){for(var F,B,N=l;N<this._blocks.length;++N){var j=this._blocks[N],V=j.nearestInputPos(0,C_);if(V!==j.value.length){B=this._blockStartPos(N)+V,F=N;break}}if(null!=F&&null!=B){for(var z=F;z<this._blocks.length;++z){var U=this._blocks[z],G=U.nearestInputPos(0,R_);if(G!==U.value.length)return this._blockStartPos(z)+G}return e===R_?this.value.length:B}for(var W=Math.min(l,this._blocks.length-1);W>=0;--W){var H=this._blocks[W],q=H.nearestInputPos(H.value.length,S_);if(0!==q){var $=this._blockStartPos(W)+q;if($>=t)return $;break}}}return t}},{key:"maskedBlock",value:function(t){return this.maskedBlocks(t)[0]}},{key:"maskedBlocks",value:function(t){var e=this,n=this._maskedBlocks[t];return n?n.map((function(t){return e._blocks[t]})):[]}}]),n}(V_);function J_(t){if(!t)return!1;var e=t.value;return!e||t.nearestInputPos(0,C_)!==e.length}Z_.DEFAULTS={lazy:!0,placeholderChar:"_"},Z_.STOP_CHAR="`",Z_.ESCAPE_CHAR="\\",Z_.InputDefinition=H_,Z_.FixedDefinition=q_,j_.MaskedPattern=Z_;var Q_=function(t){g_(n,t);var e=__(n);function n(){return d_(this,n),e.apply(this,arguments)}return p_(n,[{key:"_matchFrom",get:function(){return this.maxLength-String(this.from).length}},{key:"_update",value:function(t){t=Object.assign({to:this.to||0,from:this.from||0},t);var e=String(t.to).length;null!=t.maxLength&&(e=Math.max(e,t.maxLength)),t.maxLength=e;for(var i=String(t.from).padStart(e,"0"),r=String(t.to).padStart(e,"0"),o=0;o<r.length&&r[o]===i[o];)++o;t.mask=r.slice(0,o).replace(/0/g,"\\0")+"0".repeat(e-o),x_(m_(n.prototype),"_update",this).call(this,t)}},{key:"isComplete",get:function(){return x_(m_(n.prototype),"isComplete",this)&&Boolean(this.value)}},{key:"boundaries",value:function(t){var e="",n="",i=w_(t.match(/^(\D*)(\d*)(\D*)/)||[],3),r=i[1],o=i[2];return o&&(e="0".repeat(r.length)+o,n="9".repeat(r.length)+o),[e=e.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9")]}},{key:"doPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=x_(m_(n.prototype),"doPrepare",this).call(this,t,e).replace(/\D/g,""),!this.autofix)return t;for(var i=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0"),o=this.value,a="",s=0;s<t.length;++s){var u=o+a+t[s],l=this.boundaries(u),c=w_(l,2),h=c[0],d=c[1];Number(d)<this.from?a+=i[u.length-1]:Number(h)>this.to?a+=r[u.length-1]:a+=t[s]}return a}},{key:"doValidate",value:function(){var t,e=this.value,i=e.search(/[^0]/);if(-1===i&&e.length<=this._matchFrom)return!0;for(var r=this.boundaries(e),o=w_(r,2),a=o[0],s=o[1],u=arguments.length,l=new Array(u),c=0;c<u;c++)l[c]=arguments[c];return this.from<=Number(s)&&Number(a)<=this.to&&(t=x_(m_(n.prototype),"doValidate",this)).call.apply(t,[this].concat(l))}}]),n}(Z_);j_.MaskedRange=Q_;var tE=function(t){g_(n,t);var e=__(n);function n(t){return d_(this,n),e.call(this,Object.assign({},n.DEFAULTS,t))}return p_(n,[{key:"_update",value:function(t){t.mask===Date&&delete t.mask,t.pattern&&(t.mask=t.pattern);var e=t.blocks;t.blocks=Object.assign({},n.GET_DEFAULT_BLOCKS()),t.min&&(t.blocks.Y.from=t.min.getFullYear()),t.max&&(t.blocks.Y.to=t.max.getFullYear()),t.min&&t.max&&t.blocks.Y.from===t.blocks.Y.to&&(t.blocks.m.from=t.min.getMonth()+1,t.blocks.m.to=t.max.getMonth()+1,t.blocks.m.from===t.blocks.m.to&&(t.blocks.d.from=t.min.getDate(),t.blocks.d.to=t.max.getDate())),Object.assign(t.blocks,e),Object.keys(t.blocks).forEach((function(e){var n=t.blocks[e];"autofix"in n||(n.autofix=t.autofix)})),x_(m_(n.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,e=this.date,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return(t=x_(m_(n.prototype),"doValidate",this)).call.apply(t,[this].concat(r))&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}},{key:"isDateExist",value:function(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}},{key:"date",get:function(){return this.typedValue},set:function(t){this.typedValue=t}},{key:"typedValue",get:function(){return this.isComplete?x_(m_(n.prototype),"typedValue",this):null},set:function(t){D_(m_(n.prototype),"typedValue",t,this,!0)}}]),n}(Z_);tE.DEFAULTS={pattern:"d{.}`m{.}`Y",format:function(t){return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:function(t){var e=w_(t.split("."),3),n=e[0],i=e[1],r=e[2];return new Date(r,i-1,n)}},tE.GET_DEFAULT_BLOCKS=function(){return{d:{mask:Q_,from:1,to:31,maxLength:2},m:{mask:Q_,from:1,to:12,maxLength:2},Y:{mask:Q_,from:1900,to:9999}}},j_.MaskedDate=tE;var eE=function(){function t(){d_(this,t)}return p_(t,[{key:"selectionStart",get:function(){var t;try{t=this._unsafeSelectionStart}catch(t){}return null!=t?t:this.value.length}},{key:"selectionEnd",get:function(){var t;try{t=this._unsafeSelectionEnd}catch(t){}return null!=t?t:this.value.length}},{key:"select",value:function(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch(t){}}},{key:"_unsafeSelect",value:function(t,e){}},{key:"isActive",get:function(){return!1}},{key:"bindEvents",value:function(t){}},{key:"unbindEvents",value:function(){}}]),t}();j_.MaskElement=eE;var nE=function(t){g_(n,t);var e=__(n);function n(t){var i;return d_(this,n),(i=e.call(this)).input=t,i._handlers={},i}return p_(n,[{key:"rootElement",get:function(){return this.input.getRootNode?this.input.getRootNode():document}},{key:"isActive",get:function(){return this.input===this.rootElement.activeElement}},{key:"_unsafeSelectionStart",get:function(){return this.input.selectionStart}},{key:"_unsafeSelectionEnd",get:function(){return this.input.selectionEnd}},{key:"_unsafeSelect",value:function(t,e){this.input.setSelectionRange(t,e)}},{key:"value",get:function(){return this.input.value},set:function(t){this.input.value=t}},{key:"bindEvents",value:function(t){var e=this;Object.keys(t).forEach((function(i){return e._toggleEventHandler(n.EVENTS_MAP[i],t[i])}))}},{key:"unbindEvents",value:function(){var t=this;Object.keys(this._handlers).forEach((function(e){return t._toggleEventHandler(e)}))}},{key:"_toggleEventHandler",value:function(t,e){this._handlers[t]&&(this.input.removeEventListener(t,this._handlers[t]),delete this._handlers[t]),e&&(this.input.addEventListener(t,e),this._handlers[t]=e)}}]),n}(eE);nE.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},j_.HTMLMaskElement=nE;var iE=function(t){g_(n,t);var e=__(n);function n(){return d_(this,n),e.apply(this,arguments)}return p_(n,[{key:"_unsafeSelectionStart",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection();return e&&e.anchorOffset}},{key:"_unsafeSelectionEnd",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection();return e&&this._unsafeSelectionStart+String(e).length}},{key:"_unsafeSelect",value:function(t,e){if(this.rootElement.createRange){var n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,t),n.setEnd(this.input.lastChild||this.input,e);var i=this.rootElement,r=i.getSelection&&i.getSelection();r&&(r.removeAllRanges(),r.addRange(n))}}},{key:"value",get:function(){return this.input.textContent},set:function(t){this.input.textContent=t}}]),n}(nE);j_.HTMLContenteditableMaskElement=iE;var rE=["mask"],oE=function(){function t(e,n){d_(this,t),this.el=e instanceof eE?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new iE(e):new nE(e),this.masked=U_(n),this._listeners={},this._value="",this._unmaskedValue="",this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}return p_(t,[{key:"mask",get:function(){return this.masked.mask},set:function(t){if(!this.maskEquals(t))if(t instanceof j_.Masked||this.masked.constructor!==z_(t)){var e=U_({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}else this.masked.updateOptions({mask:t})}},{key:"maskEquals",value:function(t){return null==t||t===this.masked.mask||t===Date&&this.masked instanceof tE}},{key:"value",get:function(){return this._value},set:function(t){this.masked.value=t,this.updateControl(),this.alignCursor()}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.masked.unmaskedValue=t,this.updateControl(),this.alignCursor()}},{key:"typedValue",get:function(){return this.masked.typedValue},set:function(t){this.masked.typedValue=t,this.updateControl(),this.alignCursor()}},{key:"_bindEvents",value:function(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}},{key:"_unbindEvents",value:function(){this.el&&this.el.unbindEvents()}},{key:"_fireEvent",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r=this._listeners[t];r&&r.forEach((function(t){return t.apply(void 0,n)}))}},{key:"selectionStart",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}},{key:"cursorPos",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}},{key:"_saveSelection",value:function(){this.value!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}},{key:"updateValue",value:function(){this.masked.value=this.el.value,this._value=this.masked.value}},{key:"updateControl",value:function(){var t=this.masked.unmaskedValue,e=this.masked.value,n=this.unmaskedValue!==t||this.value!==e;this._unmaskedValue=t,this._value=e,this.el.value!==e&&(this.el.value=e),n&&this._fireChangeEvents()}},{key:"updateOptions",value:function(t){var e=t.mask,n=y_(t,rE),i=!this.maskEquals(e),r=!P_(this.masked,n);i&&(this.mask=e),r&&this.masked.updateOptions(n),(i||r)&&this.updateControl()}},{key:"updateCursor",value:function(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}},{key:"_delayUpdateCursor",value:function(t){var e=this;this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout((function(){e.el&&(e.cursorPos=e._changingCursorPos,e._abortUpdateCursor())}),10)}},{key:"_fireChangeEvents",value:function(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}},{key:"_abortUpdateCursor",value:function(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}},{key:"alignCursor",value:function(){this.cursorPos=this.masked.nearestInputPos(this.cursorPos,S_)}},{key:"alignCursorFriendly",value:function(){this.selectionStart===this.cursorPos&&this.alignCursor()}},{key:"on",value:function(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}},{key:"off",value:function(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;var n=this._listeners[t].indexOf(e);return n>=0&&this._listeners[t].splice(n,1),this}},{key:"_onInput",value:function(t){if(this._inputEvent=t,this._abortUpdateCursor(),!this._selection)return this.updateValue();var e=new F_(this.el.value,this.cursorPos,this.value,this._selection),n=this.masked.rawInputValue,i=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection).offset,r=n===this.masked.rawInputValue?e.removeDirection:C_,o=this.masked.nearestInputPos(e.startChangePos+i,r);this.updateControl(),this.updateCursor(o),delete this._inputEvent}},{key:"_onChange",value:function(){this.value!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}},{key:"_onDrop",value:function(t){t.preventDefault(),t.stopPropagation()}},{key:"_onFocus",value:function(t){this.alignCursorFriendly()}},{key:"_onClick",value:function(t){this.alignCursorFriendly()}},{key:"destroy",value:function(){this._unbindEvents(),this._listeners.length=0,delete this.el}}]),t}();j_.InputMask=oE;var aE=function(t){g_(n,t);var e=__(n);function n(){return d_(this,n),e.apply(this,arguments)}return p_(n,[{key:"_update",value:function(t){t.enum&&(t.mask="*".repeat(t.enum[0].length)),x_(m_(n.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,e=this,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return this.enum.some((function(t){return t.indexOf(e.unmaskedValue)>=0}))&&(t=x_(m_(n.prototype),"doValidate",this)).call.apply(t,[this].concat(r))}}]),n}(Z_);j_.MaskedEnum=aE;var sE=function(t){g_(n,t);var e=__(n);function n(t){return d_(this,n),e.call(this,Object.assign({},n.DEFAULTS,t))}return p_(n,[{key:"_update",value:function(t){x_(m_(n.prototype),"_update",this).call(this,t),this._updateRegExps()}},{key:"_updateRegExps",value:function(){var t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+L_(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExpInput=new RegExp(t+"(0|([1-9]+\\d*))?"+e),this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(L_).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(L_(this.thousandsSeparator),"g")}},{key:"_removeThousandsSeparators",value:function(t){return t.replace(this._thousandsSeparatorRegExp,"")}},{key:"_insertThousandsSeparators",value:function(t){var e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}},{key:"doPrepare",value:function(t){for(var e,i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return(e=x_(m_(n.prototype),"doPrepare",this)).call.apply(e,[this,this._removeThousandsSeparators(t.replace(this._mapToRadixRegExp,this.radix))].concat(r))}},{key:"_separatorsCount",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++n,e&&(t+=this.thousandsSeparator.length));return n}},{key:"_separatorsCountFromSlice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._value;return this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,i=arguments.length>2?arguments[2]:void 0,r=this._adjustRangeWithSeparators(t,e),o=w_(r,2);return t=o[0],e=o[1],this._removeThousandsSeparators(x_(m_(n.prototype),"extractInput",this).call(this,t,e,i))}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.thousandsSeparator)return x_(m_(n.prototype),"_appendCharRaw",this).call(this,t,e);var i=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);var o=x_(m_(n.prototype),"_appendCharRaw",this).call(this,t,e);this._value=this._insertThousandsSeparators(this._value);var a=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(a);return o.tailShift+=(s-r)*this.thousandsSeparator.length,o.skip=!o.rawInserted&&t===this.thousandsSeparator,o}},{key:"_findSeparatorAround",value:function(t){if(this.thousandsSeparator){var e=t-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,e);if(n<=t)return n}return-1}},{key:"_adjustRangeWithSeparators",value:function(t,e){var n=this._findSeparatorAround(t);n>=0&&(t=n);var i=this._findSeparatorAround(e);return i>=0&&(e=i+this.thousandsSeparator.length),[t,e]}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=this._adjustRangeWithSeparators(t,e),i=w_(n,2);t=i[0],e=i[1];var r=this.value.slice(0,t),o=this.value.slice(e),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+o));var s=this._separatorsCountFromSlice(r);return new B_({tailShift:(s-a)*this.thousandsSeparator.length})}},{key:"nearestInputPos",value:function(t,e){if(!this.thousandsSeparator)return t;switch(e){case C_:case S_:case I_:var n=this._findSeparatorAround(t-1);if(n>=0){var i=n+this.thousandsSeparator.length;if(t<i||this.value.length<=i||e===I_)return n}break;case O_:case R_:var r=this._findSeparatorAround(t);if(r>=0)return r+this.thousandsSeparator.length}return t}},{key:"doValidate",value:function(t){var e=(t.input?this._numberRegExpInput:this._numberRegExp).test(this._removeThousandsSeparators(this.value));if(e){var i=this.number;e=e&&!isNaN(i)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return e&&x_(m_(n.prototype),"doValidate",this).call(this,t)}},{key:"doCommit",value:function(){if(this.value){var t=this.number,e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=String(e));var i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&(i=this._padFractionalZeros(i)),this._value=i}x_(m_(n.prototype),"doCommit",this).call(this)}},{key:"_normalizeZeros",value:function(t){var e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(function(t,e,n,i){return e+i})),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}},{key:"_padFractionalZeros",value:function(t){if(!t)return t;var e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}},{key:"unmaskedValue",get:function(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,".")},set:function(t){D_(m_(n.prototype),"unmaskedValue",t.replace(".",this.radix),this,!0)}},{key:"typedValue",get:function(){return Number(this.unmaskedValue)},set:function(t){D_(m_(n.prototype),"unmaskedValue",String(t),this,!0)}},{key:"number",get:function(){return this.typedValue},set:function(t){this.typedValue=t}},{key:"allowNegative",get:function(){return this.signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0}}]),n}(V_);sE.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,signed:!1,normalizeZeros:!0,padFractionalZeros:!1},j_.MaskedNumber=sE;var uE=function(t){g_(n,t);var e=__(n);function n(){return d_(this,n),e.apply(this,arguments)}return p_(n,[{key:"_update",value:function(t){t.mask&&(t.validate=t.mask),x_(m_(n.prototype),"_update",this).call(this,t)}}]),n}(V_);j_.MaskedFunction=uE;var lE=["compiledMasks","currentMaskRef","currentMask"],cE=function(t){g_(n,t);var e=__(n);function n(t){var i;return d_(this,n),(i=e.call(this,Object.assign({},n.DEFAULTS,t))).currentMask=null,i}return p_(n,[{key:"_update",value:function(t){x_(m_(n.prototype),"_update",this).call(this,t),"mask"in t&&(this.compiledMasks=Array.isArray(t.mask)?t.mask.map((function(t){return U_(t)})):[])}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this._applyDispatch(t,e);return this.currentMask&&n.aggregate(this.currentMask._appendChar(t,e)),n}},{key:"_applyDispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,i=this.rawInputValue,r=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:i,o=i.slice(r.length),a=this.currentMask,s=new B_,u=a&&a.state;if(this.currentMask=this.doDispatch(t,Object.assign({},e)),this.currentMask)if(this.currentMask!==a){if(this.currentMask.reset(),r){var l=this.currentMask.append(r,{raw:!0});s.tailShift=l.inserted.length-n.length}o&&(s.tailShift+=this.currentMask.append(o,{raw:!0,tail:!0}).tailShift)}else this.currentMask.state=u;return s}},{key:"_appendPlaceholder",value:function(){var t=this._applyDispatch.apply(this,arguments);return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}},{key:"doDispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.dispatch(t,this,e)}},{key:"doValidate",value:function(){for(var t,e,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return(t=x_(m_(n.prototype),"doValidate",this)).call.apply(t,[this].concat(r))&&(!this.currentMask||(e=this.currentMask).doValidate.apply(e,r))}},{key:"reset",value:function(){this.currentMask&&this.currentMask.reset(),this.compiledMasks.forEach((function(t){return t.reset()}))}},{key:"value",get:function(){return this.currentMask?this.currentMask.value:""},set:function(t){D_(m_(n.prototype),"value",t,this,!0)}},{key:"unmaskedValue",get:function(){return this.currentMask?this.currentMask.unmaskedValue:""},set:function(t){D_(m_(n.prototype),"unmaskedValue",t,this,!0)}},{key:"typedValue",get:function(){return this.currentMask?this.currentMask.typedValue:""},set:function(t){var e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}},{key:"isComplete",get:function(){return!!this.currentMask&&this.currentMask.isComplete}},{key:"remove",value:function(){var t,e=new B_;this.currentMask&&e.aggregate((t=this.currentMask).remove.apply(t,arguments)).aggregate(this._applyDispatch());return e}},{key:"state",get:function(){return Object.assign({},x_(m_(n.prototype),"state",this),{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((function(t){return t.state})),currentMaskRef:this.currentMask,currentMask:this.currentMask&&this.currentMask.state})},set:function(t){var e=t.compiledMasks,i=t.currentMaskRef,r=t.currentMask,o=y_(t,lE);this.compiledMasks.forEach((function(t,n){return t.state=e[n]})),null!=i&&(this.currentMask=i,this.currentMask.state=r),D_(m_(n.prototype),"state",o,this,!0)}},{key:"extractInput",value:function(){var t;return this.currentMask?(t=this.currentMask).extractInput.apply(t,arguments):""}},{key:"extractTail",value:function(){for(var t,e,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return this.currentMask?(t=this.currentMask).extractTail.apply(t,r):(e=x_(m_(n.prototype),"extractTail",this)).call.apply(e,[this].concat(r))}},{key:"doCommit",value:function(){this.currentMask&&this.currentMask.doCommit(),x_(m_(n.prototype),"doCommit",this).call(this)}},{key:"nearestInputPos",value:function(){for(var t,e,i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return this.currentMask?(t=this.currentMask).nearestInputPos.apply(t,r):(e=x_(m_(n.prototype),"nearestInputPos",this)).call.apply(e,[this].concat(r))}},{key:"overwrite",get:function(){return this.currentMask?this.currentMask.overwrite:x_(m_(n.prototype),"overwrite",this)},set:function(t){console.warn('"overwrite" option is not available in dynamic mask, use this option in siblings')}}]),n}(V_);cE.DEFAULTS={dispatch:function(t,e,n){if(e.compiledMasks.length){var i=e.rawInputValue,r=e.compiledMasks.map((function(e,r){return e.reset(),e.append(i,{raw:!0}),e.append(t,n),{weight:e.rawInputValue.length,index:r}}));return r.sort((function(t,e){return e.weight-t.weight})),e.compiledMasks[r[0].index]}}},j_.MaskedDynamic=cE;var hE={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function dE(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hE.MASKED,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:hE.MASKED,i=U_(t);return function(t){return i.runIsolated((function(i){return i[e]=t,i[n]}))}}j_.PIPE_TYPE=hE,j_.createPipe=dE,j_.pipe=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return dE.apply(void 0,n)(t)};try{globalThis.IMask=j_}catch(t){}var fE=function(t){t.data("textInputFormComponent",(function(t){var e=t.getMaskOptionsUsing;return{mask:null,state:t.state,init:function(){var t=this;if(e){var n;if(this.state)this.$el.value=null===(n=this.state)||void 0===n?void 0:n.valueOf();this.mask=j_(this.$el,e(j_)).on("accept",(function(){t.state=t.mask.unmaskedValue})),this.$watch("state",(function(){var e;t.mask.unmaskedValue=null===(e=t.state)||void 0===e?void 0:e.valueOf()}))}}}}))},pE=function(t){t.data("textareaFormComponent",(function(){return{init:function(){this.render()},render:function(){this.$el.scrollHeight>0&&(this.$el.style.height="150px",this.$el.style.height=this.$el.scrollHeight+"px")}}}))},gE=Object.create,mE=Object.defineProperty,vE=Object.getPrototypeOf,yE=Object.prototype.hasOwnProperty,bE=Object.getOwnPropertyNames,_E=Object.getOwnPropertyDescriptor,EE=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),xE=EE((t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],n=e.join(","),i="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,r=function(t,e,r){var o=Array.prototype.slice.apply(t.querySelectorAll(n));return e&&i.call(t,n)&&o.unshift(t),o=o.filter(r)},o=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return isNaN(e)?function(t){return"true"===t.contentEditable}(t)?0:"AUDIO"!==t.nodeName&&"VIDEO"!==t.nodeName&&"DETAILS"!==t.nodeName||null!==t.getAttribute("tabindex")?t.tabIndex:0:e},a=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},s=function(t){return"INPUT"===t.tagName},u=function(t){return function(t){return s(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e,n=t.form||t.ownerDocument,i=function(t){return n.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=i(window.CSS.escape(t.name));else try{e=i(t.name)}catch(t){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",t.message),!1}var r=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]}(e,t.form);return!r||r===t}(t)},l=function(t,e){return!(e.disabled||function(t){return s(t)&&"hidden"===t.type}(e)||function(t,e){if("hidden"===getComputedStyle(t).visibility)return!0;var n=i.call(t,"details>summary:first-of-type")?t.parentElement:t;if(i.call(n,"details:not([open]) *"))return!0;if(e&&"full"!==e){if("non-zero-area"===e){var r=t.getBoundingClientRect(),o=r.width,a=r.height;return 0===o&&0===a}}else for(;t;){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1}(e,t.displayCheck)||function(t){return"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some((function(t){return"SUMMARY"===t.tagName}))}(e)||function(t){if(s(t)||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||"BUTTON"===t.tagName)for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var n=0;n<e.children.length;n++){var i=e.children.item(n);if("LEGEND"===i.tagName)return!i.contains(t)}return!0}e=e.parentElement}return!1}(e))},c=function(t,e){return!(!l(t,e)||u(e)||o(e)<0)},h=e.concat("iframe").join(",");t.focusable=function(t,e){return r(t,(e=e||{}).includeContainer,l.bind(null,e))},t.isFocusable=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==i.call(t,h)&&l(e,t)},t.isTabbable=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return!1!==i.call(t,n)&&c(e,t)},t.tabbable=function(t,e){var n=[],i=[];r(t,(e=e||{}).includeContainer,c.bind(null,e)).forEach((function(t,e){var r=o(t);0===r?n.push(t):i.push({documentOrder:e,tabIndex:r,node:t})}));var s=i.sort(a).map((function(t){return t.node})).concat(n);return s}})),AE=EE((t=>{Object.defineProperty(t,"__esModule",{value:!0});var e=xE();function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var r,o=(r=[],{activateTrap:function(t){if(r.length>0){var e=r[r.length-1];e!==t&&e.pause()}var n=r.indexOf(t);-1===n||r.splice(n,1),r.push(t)},deactivateTrap:function(t){var e=r.indexOf(t);-1!==e&&r.splice(e,1),r.length>0&&r[r.length-1].unpause()}}),a=function(t){return setTimeout(t,0)},s=function(t,e){var n=-1;return t.every((function(t,i){return!e(t)||(n=i,!1)})),n},u=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return"function"==typeof t?t.apply(void 0,n):t};t.createFocusTrap=function(t,r){var l,c=document,h=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},r),d={containers:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},f=function(t,e,n){return t&&void 0!==t[e]?t[e]:h[n||e]},p=function(t){return d.containers.some((function(e){return e.contains(t)}))},g=function(t){var e=h[t];if(!e)return null;var n=e;if("string"==typeof e&&!(n=c.querySelector(e)))throw new Error("`".concat(t,"` refers to no known node"));if("function"==typeof e&&!(n=e()))throw new Error("`".concat(t,"` did not return a node"));return n},m=function(){var t;if(!1===f({},"initialFocus"))return!1;if(null!==g("initialFocus"))t=g("initialFocus");else if(p(c.activeElement))t=c.activeElement;else{var e=d.tabbableGroups[0];t=e&&e.firstTabbableNode||g("fallbackFocus")}if(!t)throw new Error("Your focus-trap needs to have at least one focusable element");return t},v=function(){if(d.tabbableGroups=d.containers.map((function(t){var n=e.tabbable(t);if(n.length>0)return{container:t,firstTabbableNode:n[0],lastTabbableNode:n[n.length-1]}})).filter((function(t){return!!t})),d.tabbableGroups.length<=0&&!g("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},y=function t(e){!1!==e&&e!==c.activeElement&&(e&&e.focus?(e.focus({preventScroll:!!h.preventScroll}),d.mostRecentlyFocusedNode=e,function(t){return t.tagName&&"input"===t.tagName.toLowerCase()&&"function"==typeof t.select}(e)&&e.select()):t(m()))},b=function(t){var e=g("setReturnFocus");return e||t},_=function(t){p(t.target)||(u(h.clickOutsideDeactivates,t)?l.deactivate({returnFocus:h.returnFocusOnDeactivate&&!e.isFocusable(t.target)}):u(h.allowOutsideClick,t)||t.preventDefault())},E=function(t){var e=p(t.target);e||t.target instanceof Document?e&&(d.mostRecentlyFocusedNode=t.target):(t.stopImmediatePropagation(),y(d.mostRecentlyFocusedNode||m()))},x=function(t){if(function(t){return"Escape"===t.key||"Esc"===t.key||27===t.keyCode}(t)&&!1!==u(h.escapeDeactivates))return t.preventDefault(),void l.deactivate();(function(t){return"Tab"===t.key||9===t.keyCode})(t)&&function(t){v();var e=null;if(d.tabbableGroups.length>0){var n=s(d.tabbableGroups,(function(e){return e.container.contains(t.target)}));if(n<0)e=t.shiftKey?d.tabbableGroups[d.tabbableGroups.length-1].lastTabbableNode:d.tabbableGroups[0].firstTabbableNode;else if(t.shiftKey){var i=s(d.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t.target===n}));if(i<0&&d.tabbableGroups[n].container===t.target&&(i=n),i>=0){var r=0===i?d.tabbableGroups.length-1:i-1;e=d.tabbableGroups[r].lastTabbableNode}}else{var o=s(d.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t.target===n}));if(o<0&&d.tabbableGroups[n].container===t.target&&(o=n),o>=0){var a=o===d.tabbableGroups.length-1?0:o+1;e=d.tabbableGroups[a].firstTabbableNode}}}else e=g("fallbackFocus");e&&(t.preventDefault(),y(e))}(t)},A=function(t){u(h.clickOutsideDeactivates,t)||p(t.target)||u(h.allowOutsideClick,t)||(t.preventDefault(),t.stopImmediatePropagation())},D=function(){if(d.active)return o.activateTrap(l),d.delayInitialFocusTimer=h.delayInitialFocus?a((function(){y(m())})):y(m()),c.addEventListener("focusin",E,!0),c.addEventListener("mousedown",_,{capture:!0,passive:!1}),c.addEventListener("touchstart",_,{capture:!0,passive:!1}),c.addEventListener("click",A,{capture:!0,passive:!1}),c.addEventListener("keydown",x,{capture:!0,passive:!1}),l},w=function(){if(d.active)return c.removeEventListener("focusin",E,!0),c.removeEventListener("mousedown",_,!0),c.removeEventListener("touchstart",_,!0),c.removeEventListener("click",A,!0),c.removeEventListener("keydown",x,!0),l};return(l={activate:function(t){if(d.active)return this;var e=f(t,"onActivate"),n=f(t,"onPostActivate"),i=f(t,"checkCanFocusTrap");i||v(),d.active=!0,d.paused=!1,d.nodeFocusedBeforeActivation=c.activeElement,e&&e();var r=function(){i&&v(),D(),n&&n()};return i?(i(d.containers.concat()).then(r,r),this):(r(),this)},deactivate:function(t){if(!d.active)return this;clearTimeout(d.delayInitialFocusTimer),d.delayInitialFocusTimer=void 0,w(),d.active=!1,d.paused=!1,o.deactivateTrap(l);var e=f(t,"onDeactivate"),n=f(t,"onPostDeactivate"),i=f(t,"checkCanReturnFocus");e&&e();var r=f(t,"returnFocus","returnFocusOnDeactivate"),s=function(){a((function(){r&&y(b(d.nodeFocusedBeforeActivation)),n&&n()}))};return r&&i?(i(b(d.nodeFocusedBeforeActivation)).then(s,s),this):(s(),this)},pause:function(){return d.paused||!d.active||(d.paused=!0,w()),this},unpause:function(){return d.paused&&d.active?(d.paused=!1,v(),D(),this):this},updateContainerElements:function(t){var e=[].concat(t).filter(Boolean);return d.containers=e.map((function(t){return"string"==typeof t?c.querySelector(t):t})),d.active&&v(),this}}).updateContainerElements(t),l}})),DE=(t=>((t,e,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of bE(e))yE.call(t,i)||"default"===i||mE(t,i,{get:()=>e[i],enumerable:!(n=_E(e,i))||n.enumerable});return t})((t=>mE(t,"__esModule",{value:!0}))(mE(null!=t?gE(vE(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t))(AE());function wE(t){let e=[];return kE(t,(t=>{let n=t.hasAttribute("aria-hidden");t.setAttribute("aria-hidden","true"),e.push((()=>n||t.removeAttribute("aria-hidden")))})),()=>{for(;e.length;)e.pop()()}}function kE(t,e){!t.isSameNode(document.body)&&t.parentNode&&Array.from(t.parentNode.children).forEach((n=>{n.isSameNode(t)||e(n),kE(t.parentNode,e)}))}var TE=function(t){t.directive("trap",t.skipDuringClone(((t,{expression:e,modifiers:n},{effect:i,evaluateLater:r})=>{let o=r(e),a=!1,s=(0,DE.createFocusTrap)(t,{escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>t}),u=()=>{},l=()=>{};i((()=>o((e=>{a!==e&&(e&&!a&&setTimeout((()=>{n.includes("inert")&&(u=wE(t)),n.includes("noscroll")&&(l=function(){let t=document.documentElement.style.overflow,e=document.documentElement.style.paddingRight,n=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${n}px`,()=>{document.documentElement.style.overflow=t,document.documentElement.style.paddingRight=e}}()),s.activate()})),!e&&a&&(u(),u=()=>{},l(),l=()=>{},s.deactivate()),a=!!e)}))))}),((t,{expression:e,modifiers:n},{evaluate:i})=>{n.includes("inert")&&i(e)&&wE(t)})))};pe.plugin((function(t){t.plugin(zl),t.plugin(Dv),t.plugin(wv),t.plugin(o_),t.plugin(a_),t.plugin(u_),t.plugin(l_),t.plugin(c_),t.plugin(fE),t.plugin(pE)})),pe.plugin(TE),pe.store("sidebar",{isOpen:!1,close:function(){this.isOpen=!1},open:function(){this.isOpen=!0}}),yu.defaults.font.family="'DM Sans', sans-serif",yu.defaults.backgroundColor="#737373",window.Alpine=pe,window.Chart=yu,pe.start()},173:()=>{},666:t=>{var e=function(t){"use strict";var e,n=Object.prototype,i=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var r=e&&e.prototype instanceof m?e:m,o=Object.create(r.prototype),a=new C(i||[]);return o._invoke=function(t,e,n){var i=h;return function(r,o){if(i===f)throw new Error("Generator is already running");if(i===p){if("throw"===r)throw o;return I()}for(n.method=r,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=f;var u=c(t,e,n);if("normal"===u.type){if(i=n.done?p:d,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=p,n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",g={};function m(){}function v(){}function y(){}var b={};u(b,o,(function(){return this}));var _=Object.getPrototypeOf,E=_&&_(_(S([])));E&&E!==n&&i.call(E,o)&&(b=E);var x=y.prototype=m.prototype=Object.create(b);function A(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function n(r,o,a,s){var u=c(t[r],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var r;this._invoke=function(t,i){function o(){return new e((function(e,r){n(t,i,e,r)}))}return r=r?r.then(o,o):o()}}function w(t,n){var i=t.iterator[n.method];if(i===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,w(t,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var r=c(i,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,g;var o=r.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:I}}function I(){return{value:e,done:!0}}return v.prototype=y,u(x,"constructor",y),u(y,"constructor",v),v.displayName=u(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,s,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},A(D.prototype),u(D.prototype,a,(function(){return this})),t.AsyncIterator=D,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var a=new D(l(e,n,i,r),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},A(x),u(x,s,"Generator"),u(x,o,(function(){return this})),u(x,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=S,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(i,r){return s.type="throw",s.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;T(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:S(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),g}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}},n={};function i(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,i),o.exports}i.m=e,i.amdO={},t=[],i.O=(e,n,r,o)=>{if(!n){var a=1/0;for(c=0;c<t.length;c++){for(var[n,r,o]=t[c],s=!0,u=0;u<n.length;u++)(!1&o||a>=o)&&Object.keys(i.O).every((t=>i.O[t](n[u])))?n.splice(u--,1):(s=!1,o<a&&(a=o));if(s){t.splice(c--,1);var l=r();void 0!==l&&(e=l)}}return e}o=o||0;for(var c=t.length;c>0&&t[c-1][2]>o;c--)t[c]=t[c-1];t[c]=[n,r,o]},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),(()=>{var t={260:0,143:0};i.O.j=e=>0===t[e];var e=(e,n)=>{var r,o,[a,s,u]=n,l=0;if(a.some((e=>0!==t[e]))){for(r in s)i.o(s,r)&&(i.m[r]=s[r]);if(u)var c=u(i)}for(e&&e(n);l<a.length;l++)o=a[l],i.o(t,o)&&t[o]&&t[o][0](),t[a[l]]=0;return i.O(c)},n=self.webpackChunkfilament=self.webpackChunkfilament||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),i.O(void 0,[143],(()=>i(351)));var r=i.O(void 0,[143],(()=>i(173)));r=i.O(r)})();
  //# sourceMappingURL=app.js.map