diff --git a/front/dist/assets/main.f303cf88.js b/front/dist/assets/main.9f2d27e6.js similarity index 97% rename from front/dist/assets/main.f303cf88.js rename to front/dist/assets/main.9f2d27e6.js index 5cee53d..960b265 100644 --- a/front/dist/assets/main.f303cf88.js +++ b/front/dist/assets/main.9f2d27e6.js @@ -51,7 +51,7 @@ function print() { __p += __j.call(arguments, '') } * @author RubaXa * @author owenm * @license MIT - */function Tue(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),t.push.apply(t,s)}return t}function Oy(o){for(var e=1;e=0)&&(t[a]=o[a]);return t}function Pxe(o,e){if(o==null)return{};var t=Dxe(o,e),s,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(o);for(a=0;a=0)&&(!Object.prototype.propertyIsEnumerable.call(o,s)||(t[s]=o[s]))}return t}var Mxe="1.15.0";function Fw(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var jw=Fw(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),tI=Fw(/Edge/i),Eue=Fw(/firefox/i),i6=Fw(/safari/i)&&!Fw(/chrome/i)&&!Fw(/android/i),t1e=Fw(/iP(ad|od|hone)/i),n1e=Fw(/chrome/i)&&Fw(/android/i),o1e={capture:!1,passive:!1};function hl(o,e,t){o.addEventListener(e,t,!jw&&o1e)}function La(o,e,t){o.removeEventListener(e,t,!jw&&o1e)}function rz(o,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),o)try{if(o.matches)return o.matches(e);if(o.msMatchesSelector)return o.msMatchesSelector(e);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(e)}catch{return!1}return!1}}function Rxe(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function iy(o,e,t,s){if(o){t=t||document;do{if(e!=null&&(e[0]===">"?o.parentNode===t&&rz(o,e):rz(o,e))||s&&o===t)return o;if(o===t)break}while(o=Rxe(o))}return null}var Aue=/\s+/g;function $1(o,e,t){if(o&&e)if(o.classList)o.classList[t?"add":"remove"](e);else{var s=(" "+o.className+" ").replace(Aue," ").replace(" "+e+" "," ");o.className=(s+(t?" "+e:"")).replace(Aue," ")}}function Vr(o,e,t){var s=o&&o.style;if(s){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(t=o.currentStyle),e===void 0?t:t[e];!(e in s)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),s[e]=t+(typeof t=="string"?"":"px")}}function OD(o,e){var t="";if(typeof o=="string")t=o;else do{var s=Vr(o,"transform");s&&s!=="none"&&(t=s+" "+t)}while(!e&&(o=o.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(t)}function s1e(o,e,t){if(o){var s=o.getElementsByTagName(e),a=0,l=s.length;if(t)for(;a=l:u=a<=l,!u)return s;if(s===hy())break;s=_C(s,!1)}return!1}function PD(o,e,t,s){for(var a=0,l=0,u=o.children;l2&&arguments[2]!==void 0?arguments[2]:{},a=s.evt,l=Pxe(s,Zxe);nI.pluginEvent.bind(Wr)(e,t,Oy({dragEl:zo,parentEl:ju,ghostEl:Ai,rootEl:eu,nextEl:tE,lastDownEl:TH,cloneEl:Su,cloneHidden:yC,dragStarted:qN,putSortable:Vh,activeSortable:Wr.active,originalEvent:a,oldIndex:hD,oldDraggableIndex:l6,newIndex:I1,newDraggableIndex:bC,hideGhostForTarget:f1e,unhideGhostForTarget:d1e,cloneNowHidden:function(){yC=!0},cloneNowShown:function(){yC=!1},dispatchSortableEvent:function(d){Rg({sortable:t,name:d,originalEvent:a})}},l))};function Rg(o){Qxe(Oy({putSortable:Vh,cloneEl:Su,targetEl:zo,rootEl:eu,oldIndex:hD,oldDraggableIndex:l6,newIndex:I1,newDraggableIndex:bC},o))}var zo,ju,Ai,eu,tE,TH,Su,yC,hD,I1,l6,bC,IZ,Vh,iD=!1,iz=!1,az=[],qT,wv,wne,_ne,Mue,Rue,qN,tD,c6,u6=!1,BZ=!1,EH,Rm,Sne=[],Boe=!1,lz=[],tV=typeof document<"u",LZ=t1e,$ue=tI||jw?"cssFloat":"float",Hxe=tV&&!n1e&&!t1e&&"draggable"in document.createElement("div"),l1e=function(){if(!!tV){if(jw)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),c1e=function(e,t){var s=Vr(e),a=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),l=PD(e,0,t),u=PD(e,1,t),d=l&&Vr(l),h=u&&Vr(u),b=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+yd(l).width,y=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+yd(u).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(l&&d.float&&d.float!=="none"){var C=d.float==="left"?"left":"right";return u&&(h.clear==="both"||h.clear===C)?"vertical":"horizontal"}return l&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||b>=a&&s[$ue]==="none"||u&&s[$ue]==="none"&&b+y>a)?"vertical":"horizontal"},zxe=function(e,t,s){var a=s?e.left:e.top,l=s?e.right:e.bottom,u=s?e.width:e.height,d=s?t.left:t.top,h=s?t.right:t.bottom,b=s?t.width:t.height;return a===d||l===h||a+u/2===d+b/2},Vxe=function(e,t){var s;return az.some(function(a){var l=a[F1].options.emptyInsertThreshold;if(!(!l||lre(a))){var u=yd(a),d=e>=u.left-l&&e<=u.right+l,h=t>=u.top-l&&t<=u.bottom+l;if(d&&h)return s=a}}),s},u1e=function(e){function t(l,u){return function(d,h,b,y){var C=d.options.group.name&&h.options.group.name&&d.options.group.name===h.options.group.name;if(l==null&&(u||C))return!0;if(l==null||l===!1)return!1;if(u&&l==="clone")return l;if(typeof l=="function")return t(l(d,h,b,y),u)(d,h,b,y);var E=(u?d:h).options.group.name;return l===!0||typeof l=="string"&&l===E||l.join&&l.indexOf(E)>-1}}var s={},a=e.group;(!a||xH(a)!="object")&&(a={name:a}),s.name=a.name,s.checkPull=t(a.pull,!0),s.checkPut=t(a.put),s.revertClone=a.revertClone,e.group=s},f1e=function(){!l1e&&Ai&&Vr(Ai,"display","none")},d1e=function(){!l1e&&Ai&&Vr(Ai,"display","")};tV&&!n1e&&document.addEventListener("click",function(o){if(iz)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),iz=!1,!1},!0);var GT=function(e){if(zo){e=e.touches?e.touches[0]:e;var t=Vxe(e.clientX,e.clientY);if(t){var s={};for(var a in e)e.hasOwnProperty(a)&&(s[a]=e[a]);s.target=s.rootEl=t,s.preventDefault=void 0,s.stopPropagation=void 0,t[F1]._onDragOver(s)}}},Wxe=function(e){zo&&zo.parentNode[F1]._isOutsideThisEl(e.target)};function Wr(o,e){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=e=zw({},e),o[F1]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return c1e(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(u,d){u.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Wr.supportPointer!==!1&&"PointerEvent"in window&&!i6,emptyInsertThreshold:5};nI.initializePlugins(this,o,t);for(var s in t)!(s in e)&&(e[s]=t[s]);u1e(e);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=e.forceFallback?!1:Hxe,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?hl(o,"pointerdown",this._onTapStart):(hl(o,"mousedown",this._onTapStart),hl(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(hl(o,"dragover",this),hl(o,"dragenter",this)),az.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),zw(this,Bxe())}Wr.prototype={constructor:Wr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(tD=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,zo):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var t=this,s=this.el,a=this.options,l=a.preventOnFilter,u=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,h=(d||e).target,b=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||h,y=a.filter;if(Jxe(s),!zo&&!(/mousedown|pointerdown/.test(u)&&e.button!==0||a.disabled)&&!b.isContentEditable&&!(!this.nativeDraggable&&i6&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=iy(h,a.draggable,s,!1),!(h&&h.animated)&&TH!==h)){if(hD=Lb(h),l6=Lb(h,a.draggable),typeof y=="function"){if(y.call(this,e,h,this)){Rg({sortable:t,rootEl:b,name:"filter",targetEl:h,toEl:s,fromEl:s}),Rp("filter",t,{evt:e}),l&&e.cancelable&&e.preventDefault();return}}else if(y&&(y=y.split(",").some(function(C){if(C=iy(b,C.trim(),s,!1),C)return Rg({sortable:t,rootEl:C,name:"filter",targetEl:h,fromEl:s,toEl:s}),Rp("filter",t,{evt:e}),!0}),y)){l&&e.cancelable&&e.preventDefault();return}a.handle&&!iy(b,a.handle,s,!1)||this._prepareDragStart(e,d,h)}}},_prepareDragStart:function(e,t,s){var a=this,l=a.el,u=a.options,d=l.ownerDocument,h;if(s&&!zo&&s.parentNode===l){var b=yd(s);if(eu=l,zo=s,ju=zo.parentNode,tE=zo.nextSibling,TH=s,IZ=u.group,Wr.dragged=zo,qT={target:zo,clientX:(t||e).clientX,clientY:(t||e).clientY},Mue=qT.clientX-b.left,Rue=qT.clientY-b.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,zo.style["will-change"]="all",h=function(){if(Rp("delayEnded",a,{evt:e}),Wr.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!Eue&&a.nativeDraggable&&(zo.draggable=!0),a._triggerDragStart(e,t),Rg({sortable:a,name:"choose",originalEvent:e}),$1(zo,u.chosenClass,!0)},u.ignore.split(",").forEach(function(y){s1e(zo,y.trim(),Cne)}),hl(d,"dragover",GT),hl(d,"mousemove",GT),hl(d,"touchmove",GT),hl(d,"mouseup",a._onDrop),hl(d,"touchend",a._onDrop),hl(d,"touchcancel",a._onDrop),Eue&&this.nativeDraggable&&(this.options.touchStartThreshold=4,zo.draggable=!0),Rp("delayStart",this,{evt:e}),u.delay&&(!u.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(tI||jw))){if(Wr.eventCanceled){this._onDrop();return}hl(d,"mouseup",a._disableDelayedDrag),hl(d,"touchend",a._disableDelayedDrag),hl(d,"touchcancel",a._disableDelayedDrag),hl(d,"mousemove",a._delayedDragTouchMoveHandler),hl(d,"touchmove",a._delayedDragTouchMoveHandler),u.supportPointer&&hl(d,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(h,u.delay)}else h()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){zo&&Cne(zo),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;La(e,"mouseup",this._disableDelayedDrag),La(e,"touchend",this._disableDelayedDrag),La(e,"touchcancel",this._disableDelayedDrag),La(e,"mousemove",this._delayedDragTouchMoveHandler),La(e,"touchmove",this._delayedDragTouchMoveHandler),La(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?hl(document,"pointermove",this._onTouchMove):t?hl(document,"touchmove",this._onTouchMove):hl(document,"mousemove",this._onTouchMove):(hl(zo,"dragend",this),hl(eu,"dragstart",this._onDragStart));try{document.selection?AH(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(iD=!1,eu&&zo){Rp("dragStarted",this,{evt:t}),this.nativeDraggable&&hl(document,"dragover",Wxe);var s=this.options;!e&&$1(zo,s.dragClass,!1),$1(zo,s.ghostClass,!0),Wr.active=this,e&&this._appendGhost(),Rg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(wv){this._lastX=wv.clientX,this._lastY=wv.clientY,f1e();for(var e=document.elementFromPoint(wv.clientX,wv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(wv.clientX,wv.clientY),e!==t);)t=e;if(zo.parentNode[F1]._isOutsideThisEl(e),t)do{if(t[F1]){var s=void 0;if(s=t[F1]._onDragOver({clientX:wv.clientX,clientY:wv.clientY,target:e,rootEl:t}),s&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);d1e()}},_onTouchMove:function(e){if(qT){var t=this.options,s=t.fallbackTolerance,a=t.fallbackOffset,l=e.touches?e.touches[0]:e,u=Ai&&OD(Ai,!0),d=Ai&&u&&u.a,h=Ai&&u&&u.d,b=LZ&&Rm&&Pue(Rm),y=(l.clientX-qT.clientX+a.x)/(d||1)+(b?b[0]-Sne[0]:0)/(d||1),C=(l.clientY-qT.clientY+a.y)/(h||1)+(b?b[1]-Sne[1]:0)/(h||1);if(!Wr.active&&!iD){if(s&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))=0&&(Rg({rootEl:ju,name:"add",toEl:ju,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"remove",toEl:ju,originalEvent:e}),Rg({rootEl:ju,name:"sort",toEl:ju,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:ju,originalEvent:e})),Vh&&Vh.save()):I1!==hD&&I1>=0&&(Rg({sortable:this,name:"update",toEl:ju,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:ju,originalEvent:e})),Wr.active&&((I1==null||I1===-1)&&(I1=hD,bC=l6),Rg({sortable:this,name:"end",toEl:ju,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Rp("nulling",this),eu=zo=ju=Ai=tE=Su=TH=yC=qT=wv=qN=I1=bC=hD=l6=tD=c6=Vh=IZ=Wr.dragged=Wr.ghost=Wr.clone=Wr.active=null,lz.forEach(function(e){e.checked=!0}),lz.length=wne=_ne=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":zo&&(this._onDragOver(e),Uxe(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,s=this.el.children,a=0,l=s.length,u=this.options;as.right+a||o.clientX<=s.right&&o.clientY>s.bottom&&o.clientX>=s.left:o.clientX>s.right&&o.clientY>s.top||o.clientX<=s.right&&o.clientY>s.bottom+a}function qxe(o,e,t,s,a,l,u,d){var h=s?o.clientY:o.clientX,b=s?t.height:t.width,y=s?t.top:t.left,C=s?t.bottom:t.right,E=!1;if(!u){if(d&&EHy+b*l/2:hC-EH)return-c6}else if(h>y+b*(1-a)/2&&hC-b*l/2)?h>y+b/2?1:-1:0}function Gxe(o){return Lb(zo){u[y]=null}),go(),t=u[e],t?t.p(h,b):(t=u[e]=l[e](h),t.c()),xe(t,1),t.m(s.parentNode,s))},i(h){a||(xe(t),a=!0)},o(h){Be(t),a=!1},d(h){u[e].d(h),h&&ke(s)}}}function sTe(o,e,t){let{$$slots:s={},$$scope:a}=e,{sortableClass:l=""}=e,{isTable:u=!1}=e,{sortableInstance:d}=e;const h=Fg();let b;W1(()=>{let E={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onUpdate(R){h("update",{source:R.oldIndex,target:R.newIndex})},onMove(R){}};t(3,d=Wr.create(b,E))});function y(E){Ro[E?"unshift":"push"](()=>{b=E,t(2,b)})}function C(E){Ro[E?"unshift":"push"](()=>{b=E,t(2,b)})}return o.$$set=E=>{"sortableClass"in E&&t(0,l=E.sortableClass),"isTable"in E&&t(1,u=E.isTable),"sortableInstance"in E&&t(3,d=E.sortableInstance),"$$scope"in E&&t(4,a=E.$$scope)},[l,u,b,d,a,s,y,C]}class oI extends uo{constructor(e){super(),co(this,e,sTe,oTe,lo,{sortableClass:0,isTable:1,sortableInstance:3})}}function Iue(o,e,t){const s=o.slice();return s[11]=e[t],s}function Bue(o){let e,t;return{c(){e=re("div"),t=Ht(o[1]),Z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&2&&Qn(t,s[1])},d(s){s&&ke(e)}}}function Lue(o){let e,t;return e=new oI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[rTe]},$$scope:{ctx:o}}}),e.$on("update",o[4]),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&16385&&(l.$$scope={dirty:a,ctx:s}),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Fue(o,e){let t,s,a,l;return s=new J6({props:{classes:"h-100",record:e[11],hasDelete:!0}}),s.$on("remove",e[3]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),a=Ze(),Z(t,"class","col mb-3"),this.first=t},m(u,d){Te(u,t,d),Kt(s,t,null),X(t,a),l=!0},p(u,d){e=u;const h={};d&1&&(h.record=e[11]),s.$set(h)},i(u){l||(xe(s.$$.fragment,u),l=!0)},o(u){Be(s.$$.fragment,u),l=!1},d(u){u&&ke(t),Jt(s)}}}function rTe(o){let e=[],t=new Map,s,a,l=o[0];const u=d=>d[11].id;for(let d=0;d0&&Lue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),h&&h.c(),l=Rs(),Z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Te(b,e,y),Te(b,t,y),Kt(s,t,null),Te(b,a,y),h&&h.m(b,y),Te(b,l,y),u=!0},p(b,[y]){b[1]?d?d.p(b,y):(d=Bue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null),b[0].length>0?h?(h.p(b,y),y&1&&xe(h,1)):(h=Lue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(mo(),Be(h,1,1,()=>{h=null}),go())},i(b){u||(xe(s.$$.fragment,b),xe(h),u=!0)},o(b){Be(s.$$.fragment,b),Be(h),u=!1},d(b){d&&d.d(b),b&&ke(e),b&&ke(t),Jt(s),b&&ke(a),h&&h.d(b),b&&ke(l)}}}function aTe(o,e,t){let s,a;const l=Ur("channel");let{record:u}=e,{field:d}=e,{graph:h}=e,{validationErrors:b}=e,y=l.schemas.filter($=>d.collections.includes($.name));function C($){$.preventDefault(),t(6,h.edges=h.edges.filter(Q=>!(Q.target===$.detail&&Q.field===d.name)),h)}function E($){t(6,h.edges=qD($.detail.source,$.detail.target,h.edges,d.name),h)}function R($){$.preventDefault(),t(6,h=K6(h,u,$.detail.records,d.name,$.detail.action))}return o.$$set=$=>{"record"in $&&t(7,u=$.record),"field"in $&&t(8,d=$.field),"graph"in $&&t(6,h=$.graph),"validationErrors"in $&&t(9,b=$.validationErrors)},o.$$.update=()=>{var $;o.$$.dirty&768&&t(1,s=Lm(b,d.name)),o.$$.dirty&448&&t(0,a=($=h.edges.filter(Q=>Q.field===d.name).map(Q=>h.records.find(F=>F.id==Q.target&&u.id==Q.source)).filter(Q=>!!(Q!=null&&Q.id)))!=null?$:[])},[a,s,y,C,E,R,h,u,d,b]}class lTe extends uo{constructor(e){super(),co(this,e,aTe,iTe,lo,{record:7,field:8,graph:6,validationErrors:9})}}function Que(o,e,t){const s=o.slice();return s[21]=e[t],s}function cTe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve,Re,Oe,ce,Xe,tt;u=new Fa({props:{icon:"pencil",width:12,height:12}});const ot=[hTe,dTe],V=[];function ut(Et,Cn){return Et[7]?0:1}b=ut(o),y=V[b]=ot[b](o),$=new Fa({props:{icon:"ellipsis"}});let Qe=!o[1]&&Zue(o),Bt=!o[2]&&Hue(o),Ct=o[8].type==="files"&&mTe(o),He=o[8].fields.filter(Vue),st=[];for(let Et=0;EtBe(st[Et],1,1,()=>{st[Et]=null});return{c(){e=re("div"),t=re("div"),s=re("small"),s.textContent=`${o[8].label}`,a=Ze(),l=re("button"),en(u.$$.fragment),d=Ze(),h=re("button"),y.c(),C=Ze(),E=re("div"),R=re("button"),en($.$$.fragment),Q=Ze(),F=re("div"),U=re("a"),K=Ht("Edit in new tab"),te=Ze(),ne=re("button"),ne.textContent="Remove",oe=Ze(),G=re("div"),Qe&&Qe.c(),we=Ze(),Bt&&Bt.c(),ve=Ze(),Re=re("div"),Ct&&Ct.c(),Oe=Ze();for(let Et=0;Et{V[je]=null}),go(),y=V[b],y||(y=V[b]=ot[b](Et),y.c()),xe(y,1),y.m(h,null)),(!ce||Cn&1&&L!==(L="/records/"+Et[0].id))&&Z(U,"href",L),Et[1]?Qe&&(mo(),Be(Qe,1,1,()=>{Qe=null}),go()):Qe?(Qe.p(Et,Cn),Cn&2&&xe(Qe,1)):(Qe=Zue(Et),Qe.c(),xe(Qe,1),Qe.m(G,we)),Et[2]?Bt&&(mo(),Be(Bt,1,1,()=>{Bt=null}),go()):Bt?(Bt.p(Et,Cn),Cn&4&&xe(Bt,1)):(Bt=Hue(Et),Bt.c(),xe(Bt,1),Bt.m(G,null)),Et[8].type==="files"&&Ct.p(Et,Cn),Cn&257){He=Et[8].fields.filter(Vue);let mt;for(mt=0;mt{u[y]=null}),go(),s=u[t],s?s.p(h,b):(s=u[t]=l[t](h),s.c()),xe(s,1),s.m(e,null))},i(h){a||(xe(s),a=!0)},o(h){Be(s),a=!1},d(h){h&&ke(e),u[t].d()}}}const Vue=o=>!(o.trashed||["tab"].includes(o.ui)||["id"].includes(o.name));function OTe(o,e,t){let s,a;const l=Ur("channel"),u=Fg();let{isFirst:d}=e,{isLast:h}=e,{toDelete:b=!1}=e,{record:y}=e,C,E,R=l.schemas.find(we=>we.name===y.schema);function $(we){we.preventDefault(),axios.get(l.lucentUrl+"/records/editInline/"+y.id).then(ve=>{t(0,y=ve.data),t(4,C=ve.data.record),t(5,E=ve.data.graph),t(6,s=!0)}).catch(ve=>{console.log(ve)})}function Q(we){we.preventDefault(),u("moveup")}function F(we){we.preventDefault(),u("movedn")}function U(we){we.preventDefault(),u("inlinesaved",we.detail),t(6,s=!1)}function K(we){we.preventDefault(),u("remove",y.id)}function L(we){we.preventDefault(),u("trash",y.id)}function te(we){we.preventDefault(),u("undoremove",y.id)}function ne(we){we.preventDefault(),t(6,s=!1)}W1(()=>{t(6,s=!1)});function oe(we){we.preventDefault(),axios.post(l.lucentUrl+"/records/status/trashed",[y]).then(ve=>{u("remove",y.id)}).catch(ve=>{console.log(ve)})}const G=we=>t(7,a=!a);return o.$$set=we=>{"isFirst"in we&&t(1,d=we.isFirst),"isLast"in we&&t(2,h=we.isLast),"toDelete"in we&&t(3,b=we.toDelete),"record"in we&&t(0,y=we.record)},t(6,s=!1),t(7,a=!1),[y,d,h,b,C,E,s,a,R,$,Q,F,U,K,L,te,ne,oe,G]}class yTe extends uo{constructor(e){super(),co(this,e,OTe,vTe,lo,{isFirst:1,isLast:2,toDelete:3,record:0})}}function m1e(o,{from:e,to:t},s={}){const a=getComputedStyle(o),l=a.transform==="none"?"":a.transform,[u,d]=a.transformOrigin.split(" ").map(parseFloat),h=e.left+e.width*u/t.width-(t.left+u),b=e.top+e.height*d/t.height-(t.top+d),{delay:y=0,duration:C=R=>Math.sqrt(R)*120,easing:E=Mpe}=s;return{delay:y,duration:Ub(C)?C(Math.sqrt(h*h+b*b)):C,easing:E,css:(R,$)=>{const Q=$*h,F=$*b,U=R+$*e.width/t.width,K=R+$*e.height/t.height;return`transform: ${l} translate(${Q}px, ${F}px) scale(${U}, ${K});`}}}function Wue(o,e,t){const s=o.slice();return s[18]=e[t],s[19]=e,s[20]=t,s}function Uue(o){let e,t;return{c(){e=re("div"),t=Ht(o[3]),Z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&8&&Qn(t,s[3])},d(s){s&&ke(e)}}}function Yue(o){let e=[],t=new Map,s,a,l=o[2];const u=d=>d[18].id;for(let d=0;der(s,"record",E)),s.$on("inlinesaved",e[5]),s.$on("moveup",R),s.$on("movedn",$),s.$on("remove",e[6]),s.$on("undoremove",e[8]),s.$on("trash",e[7]),u=new eI({props:{field:e[1],recordId:e[18].id,schemas:e[4]}}),u.$on("insert",e[9]),u.$on("save",e[9]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),l=Ze(),en(u.$$.fragment),d=Ze(),Z(t,"class","inline-card-wrapper"),this.first=t},m(F,U){Te(F,t,U),Kt(s,t,null),X(t,l),Kt(u,t,null),X(t,d),y=!0},p(F,U){e=F;const K={};U&4&&(K.isFirst=e[20]===0),U&4&&(K.isLast=e[20]+1===e[2].length),U&7&&(K.toDelete=e[0].edges.find(C)._isTrashed),!a&&U&4&&(a=!0,K.record=e[18],lr(()=>a=!1)),s.$set(K);const L={};U&2&&(L.field=e[1]),U&4&&(L.recordId=e[18].id),u.$set(L)},r(){h=t.getBoundingClientRect()},f(){Epe(t),b()},a(){b(),b=Tpe(t,h,m1e,{delay:250,duration:250,easing:Rpe})},i(F){y||(xe(s.$$.fragment,F),xe(u.$$.fragment,F),y=!0)},o(F){Be(s.$$.fragment,F),Be(u.$$.fragment,F),y=!1},d(F){F&&ke(t),Jt(s),Jt(u)}}}function wTe(o){let e,t,s,a,l,u,d=o[3]&&Uue(o);s=new eI({props:{field:o[1],recordId:null,schemas:o[4]}}),s.$on("insert",o[9]),s.$on("save",o[9]);let h=o[2].length>0&&Yue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),h&&h.c(),l=Rs(),Z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Te(b,e,y),Te(b,t,y),Kt(s,t,null),Te(b,a,y),h&&h.m(b,y),Te(b,l,y),u=!0},p(b,[y]){b[3]?d?d.p(b,y):(d=Uue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null);const C={};y&2&&(C.field=b[1]),s.$set(C),b[2].length>0?h?(h.p(b,y),y&4&&xe(h,1)):(h=Yue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(mo(),Be(h,1,1,()=>{h=null}),go())},i(b){u||(xe(s.$$.fragment,b),xe(h),u=!0)},o(b){Be(s.$$.fragment,b),Be(h),u=!1},d(b){d&&d.d(b),b&&ke(e),b&&ke(t),Jt(s),b&&ke(a),h&&h.d(b),b&&ke(l)}}}function _Te(o,e,t){let s,a;const l=Ur("channel");let{field:u}=e,{record:d}=e,{graph:h}=e,{validationErrors:b}=e,y=l.schemas.filter(ne=>u.collections.includes(ne.name));function C(ne){const oe=ne.detail.records[0];t(0,h.edges=h.edges.map(G=>G.source===oe.id?oe:G),h)}function E(ne){ne.preventDefault(),t(0,h.edges=h.edges.filter(oe=>!(oe.target===ne.detail&&oe.field===u.name)),h)}function R(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===u.name&&(oe._isTrashed=!0),oe)),h)}function $(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===u.name&&delete oe._isTrashed,oe)),h)}function Q(ne){var Oe;ne.preventDefault();const oe=ne.detail.records,G=(Oe=ne.detail.after)!=null?Oe:null,we=ne.detail.action;let ve=oe.map(ce=>({target:ce.id,source:d.id,sourceSchema:d.schema,targetSchema:ce.schema,field:u.name,rank:""})),Re=h.edges;if(we==="replace"&&(Re=Re.filter(ce=>ce.field!==u.name)),t(0,h.records=Lc.exports.uniqBy([...h.records,...oe],ce=>ce.id),h),t(0,h.edges=Lc.exports.uniqBy([...Re,...ve],ce=>ce.target+ce.field),h),!G)t(0,h.edges=Lc.exports.uniqBy([...ve,...Re],ce=>ce.target+ce.field),h);else{let ce=!1,Xe=Re.reduce((tt,ot)=>(ce?tt.after.push(ot):tt.before.push(ot),ce===!1&&ot.target===G&&(ce=!0),tt),{before:[],after:[]});t(0,h.edges=Lc.exports.uniqBy([...Xe.before,...ve,...Xe.after],tt=>tt.target+tt.field),h)}}function F(ne,oe,G){t(0,h.edges=qD(oe,G,h.edges,u.name),h)}const U=(ne,oe)=>oe.field===u.name&&oe.target===ne.id;function K(ne,oe,G,we){G[we]=ne,t(2,a),t(0,h),t(1,u),t(11,d)}const L=(ne,oe)=>F(oe,ne,ne-1),te=(ne,oe)=>F(oe,ne,ne+1);return o.$$set=ne=>{"field"in ne&&t(1,u=ne.field),"record"in ne&&t(11,d=ne.record),"graph"in ne&&t(0,h=ne.graph),"validationErrors"in ne&&t(12,b=ne.validationErrors)},o.$$.update=()=>{var ne;o.$$.dirty&4098&&t(3,s=Lm(b,u.name)),o.$$.dirty&2051&&t(2,a=(ne=h.edges.filter(oe=>oe.field===u.name).map(oe=>h.records.find(G=>G.id==oe.target&&d.id==oe.source)).filter(oe=>!!(oe!=null&&oe.id)))!=null?ne:[])},[h,u,a,s,y,C,E,R,$,Q,F,d,b,U,K,L,te]}class STe extends uo{constructor(e){super(),co(this,e,_Te,wTe,lo,{field:1,record:11,graph:0,validationErrors:12})}}function g1e(o,e,t=null){return t?o.reduce((s,a)=>(s.push(a),a.id===t&&s.push({meta:e,id:zle(),value:null}),s),[]):[{meta:e,id:zle(),value:null},...o]}function jue(o,e,t){const s=o.slice();return s[7]=e[t],s}function que(o){let e,t=o[1].fields,s=[];for(let a=0;at(2,s=!s),b=(y,C)=>d(C,y);return o.$$set=y=>{"blockId"in y&&t(0,a=y.blockId),"blockData"in y&&t(4,l=y.blockData),"blockSchema"in y&&t(1,u=y.blockSchema)},t(2,s=!1),[a,u,s,d,l,h,b]}class xTe extends uo{constructor(e){super(),co(this,e,kTe,CTe,lo,{blockId:0,blockData:4,blockSchema:1})}}function TTe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("input"),Z(t,"type","text"),Z(t,"id",s=o[0].id),Z(t,"class","form-control"),Z(t,"autocomplete","off"),Z(e,"class","mb-0")},m(u,d){Te(u,e,d),X(e,t),ar(t,o[0].value),a||(l=mn(t,"input",o[1]),a=!0)},p(u,[d]){d&1&&s!==(s=u[0].id)&&Z(t,"id",s),d&1&&t.value!==u[0].value&&ar(t,u[0].value)},i:fn,o:fn,d(u){u&&ke(e),a=!1,l()}}}function ETe(o,e,t){let{block:s}=e;function a(){s.value=this.value,t(0,s)}return o.$$set=l=>{"block"in l&&t(0,s=l.block)},[s,a]}class ATe extends uo{constructor(e){super(),co(this,e,ETe,TTe,lo,{block:0})}}function DTe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("textarea"),Z(t,"id",s=o[0].id),Z(t,"class","form-control svelte-1er4ovm"),Z(t,"autocomplete","off"),Z(e,"class","mb-0")},m(u,d){Te(u,e,d),X(e,t),ar(t,o[0].value),o[3](t),a||(l=[mn(t,"input",o[2]),mn(t,"input",p1e)],a=!0)},p(u,[d]){d&1&&s!==(s=u[0].id)&&Z(t,"id",s),d&1&&ar(t,u[0].value)},i:fn,o:fn,d(u){u&&ke(e),o[3](null),a=!1,vi(l)}}}function p1e(o){let e;o.target?e=o.target:e=o,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function PTe(o,e,t){let{block:s}=e,a;W1(()=>{p1e(a)});function l(){s.value=this.value,t(0,s)}function u(d){Ro[d?"unshift":"push"](()=>{a=d,t(1,a)})}return o.$$set=d=>{"block"in d&&t(0,s=d.block)},[s,a,l,u]}class MTe extends uo{constructor(e){super(),co(this,e,PTe,DTe,lo,{block:0})}}var b1e={exports:{}};(function(o){(function(){var e=function(n){if(n===null)return"null";if(n===void 0)return"undefined";var i=typeof n;return i==="object"&&(Array.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="Array")?"array":i==="object"&&(String.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="String")?"string":i},t=function(n){return["undefined","boolean","number","string","function","xml","null"].indexOf(n)!==-1},s=function(n,i){var c=Array.prototype.slice.call(n);return c.sort(i)},a=function(n,i){return l(function(c,m){return n.eq(i(c),i(m))})},l=function(n){return{eq:n}},u=l(function(n,i){return n===i}),d=u,h=function(n){return l(function(i,c){if(i.length!==c.length)return!1;for(var m=i.length,p=0;p{var m;return c(n,i.prototype)?!0:((m=n.constructor)===null||m===void 0?void 0:m.name)===i.name},$=n=>{const i=typeof n;return n===null?"null":i==="object"&&Array.isArray(n)?"array":i==="object"&&R(n,String,(c,m)=>m.isPrototypeOf(c))?"string":i},Q=n=>i=>$(i)===n,F=n=>i=>typeof i===n,U=n=>i=>n===i,K=(n,i)=>te(n)&&R(n,i,(c,m)=>E(c)===m),L=Q("string"),te=Q("object"),ne=n=>K(n,Object),oe=Q("array"),G=U(null),we=F("boolean"),ve=U(void 0),Re=n=>n==null,Oe=n=>!Re(n),ce=F("function"),Xe=F("number"),tt=(n,i)=>{if(oe(n)){for(let c=0,m=n.length;c{},V=(n,i)=>(...c)=>n(i.apply(null,c)),ut=(n,i)=>c=>n(i(c)),Qe=n=>()=>n,Bt=n=>n,Ct=(n,i)=>n===i;function He(n,...i){return(...c)=>{const m=i.concat(c);return n.apply(null,m)}}const st=n=>i=>!n(i),rn=n=>()=>{throw new Error(n)},Et=n=>n(),Cn=n=>{n()},je=Qe(!1),mt=Qe(!0);class he{constructor(i,c){this.tag=i,this.value=c}static some(i){return new he(!0,i)}static none(){return he.singletonNone}fold(i,c){return this.tag?c(this.value):i()}isSome(){return this.tag}isNone(){return!this.tag}map(i){return this.tag?he.some(i(this.value)):he.none()}bind(i){return this.tag?i(this.value):he.none()}exists(i){return this.tag&&i(this.value)}forall(i){return!this.tag||i(this.value)}filter(i){return!this.tag||i(this.value)?this:he.none()}getOr(i){return this.tag?this.value:i}or(i){return this.tag?this:i}getOrThunk(i){return this.tag?this.value:i()}orThunk(i){return this.tag?this:i()}getOrDie(i){if(this.tag)return this.value;throw new Error(i!=null?i:"Called getOrDie on None")}static from(i){return Oe(i)?he.some(i):he.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(i){this.tag&&i(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}he.singletonNone=new he(!1);const Zo=Array.prototype.slice,Kn=Array.prototype.indexOf,so=Array.prototype.push,Yo=(n,i)=>Kn.call(n,i),as=(n,i)=>{const c=Yo(n,i);return c===-1?he.none():he.some(c)},kt=(n,i)=>Yo(n,i)>-1,jt=(n,i)=>{for(let c=0,m=n.length;c{const c=n.length,m=new Array(c);for(let p=0;p{for(let c=0,m=n.length;c{for(let c=n.length-1;c>=0;c--){const m=n[c];i(m,c)}},bn=(n,i)=>{const c=[],m=[];for(let p=0,w=n.length;p{const c=[];for(let m=0,p=n.length;m(Gt(n,(m,p)=>{c=i(c,m,p)}),c),zn=(n,i,c)=>(Ne(n,(m,p)=>{c=i(c,m,p)}),c),ps=(n,i,c)=>{for(let m=0,p=n.length;mps(n,i,je),Ss=(n,i)=>{for(let c=0,m=n.length;c{const i=[];for(let c=0,m=n.length;cMr(pt(n,i)),tr=(n,i)=>{for(let c=0,m=n.length;c{const i=Zo.call(n,0);return i.reverse(),i},wa=(n,i)=>At(n,c=>!kt(i,c)),dr=(n,i)=>{const c={};for(let m=0,p=n.length;m{const c=Zo.call(n,0);return c.sort(i),c},qr=(n,i)=>i>=0&&iqr(n,0),Po=n=>qr(n,n.length-1),Rr=ce(Array.from)?Array.from:n=>Zo.call(n),Ls=(n,i)=>{for(let c=0;c{const c=[],m=ce(i)?p=>jt(c,w=>i(w,p)):p=>kt(c,p);for(let p=0,w=n.length;p{const c=bs(n);for(let m=0,p=c.length;mQi(n,(c,m)=>({k:m,v:i(c,m)})),Qi=(n,i)=>{const c={};return ln(n,(m,p)=>{const w=i(m,p);c[w.k]=w.v}),c},ze=n=>(i,c)=>{n[c]=i},et=(n,i,c,m)=>{ln(n,(p,w)=>{(i(p,w)?c:m)(p,w)})},Tt=(n,i)=>{const c={},m={};return et(n,i,ze(c),ze(m)),{t:c,f:m}},Wt=(n,i)=>{const c={};return et(n,i,ze(c),ot),c},Yn=(n,i)=>{const c=[];return ln(n,(m,p)=>{c.push(i(m,p))}),c},po=n=>Yn(n,Bt),wo=(n,i)=>un(n,i)?he.from(n[i]):he.none(),un=(n,i)=>_a.call(n,i),os=(n,i)=>un(n,i)&&n[i]!==void 0&&n[i]!==null,xo=(n,i,c=C)=>y(c).eq(n,i),fs=n=>{const i={};return Ne(n,c=>{i[c]={}}),bs(i)},kr=n=>n.length!==void 0,Lr=Array.isArray,Vs=n=>{if(Lr(n))return n;{const i=[];for(let c=0,m=n.length;c{if(!n)return!1;if(c=c||n,kr(n)){for(let m=0,p=n.length;m{const c=[];return Yr(n,(m,p)=>{c.push(i(m,p,n))}),c},Qa=(n,i)=>{const c=[];return Yr(n,(m,p)=>{(!i||i(m,p,n))&&c.push(m)}),c},Oi=(n,i)=>{if(n){for(let c=0,m=n.length;c{let p=ve(c)?n[0]:c;for(let w=0;w{for(let m=0,p=n.length;mn[n.length-1],Ut=n=>{let i=!1,c;return(...m)=>(i||(i=!0,c=n.apply(null,m)),c)},bo=(n,i,c,m)=>{const p=n.isiOS()&&/ipad/i.test(c)===!0,w=n.isiOS()&&!p,x=n.isiOS()||n.isAndroid(),M=x||m("(pointer:coarse)"),B=p||!w&&x&&m("(min-device-width:768px)"),q=w||x&&!B,ae=i.isSafari()&&n.isiOS()&&/safari/i.test(c)===!1,fe=!q&&!B&&!ae;return{isiPad:Qe(p),isiPhone:Qe(w),isTablet:Qe(B),isPhone:Qe(q),isTouch:Qe(M),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:Qe(ae),isDesktop:Qe(fe)}},Lo=(n,i)=>{for(let c=0;c{const c=Lo(n,i);if(!c)return{major:0,minor:0};const m=p=>Number(i.replace(c,"$"+p));return Xo(m(1),m(2))},ei=(n,i)=>{const c=String(i).toLowerCase();return n.length===0?lt():Go(n,c)},lt=()=>Xo(0,0),Xo=(n,i)=>({major:n,minor:i}),Ni={nu:Xo,detect:ei,unknown:lt},la=(n,i)=>Ls(i.brands,c=>{const m=c.brand.toLowerCase();return oo(n,p=>{var w;return m===((w=p.brand)===null||w===void 0?void 0:w.toLowerCase())}).map(p=>({current:p.name,version:Ni.nu(parseInt(c.version,10),0)}))}),ma=(n,i)=>{const c=String(i).toLowerCase();return oo(n,m=>m.search(c))},gr=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Fc=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Cc=(n,i)=>n.substring(i),nl=(n,i,c)=>i===""||n.length>=i.length&&n.substr(c,c+i.length)===i,ga=(n,i)=>Ar(n,i)?Cc(n,i.length):n,nr=(n,i,c=0,m)=>{const p=n.indexOf(i,c);return p!==-1?ve(m)?!0:p+i.length<=m:!1},Ar=(n,i)=>nl(n,i,0),Ki=(n,i)=>nl(n,i,n.length-i.length),gl=n=>i=>i.replace(n,""),kc=gl(/^\s+|\s+$/g),nu=gl(/^\s+/g),xu=gl(/\s+$/g),yr=n=>n.length>0,ol=n=>!yr(n),Tu=(n,i)=>i<=0?"":new Array(i+1).join(n),ou=(n,i=10)=>{const c=parseInt(n,i);return isNaN(c)?he.none():he.some(c)},Yl=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Aa=n=>i=>nr(i,n),Dr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:n=>nr(n,"edge/")&&nr(n,"chrome")&&nr(n,"safari")&&nr(n,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Yl],search:n=>nr(n,"chrome")&&!nr(n,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:n=>nr(n,"msie")||nr(n,"trident")},{name:"Opera",versionRegexes:[Yl,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Aa("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Aa("firefox")},{name:"Safari",versionRegexes:[Yl,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:n=>(nr(n,"safari")||nr(n,"mobile/"))&&nr(n,"applewebkit")}],Qm=[{name:"Windows",search:Aa("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:n=>nr(n,"iphone")||nr(n,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Aa("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Aa("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Aa("linux"),versionRegexes:[]},{name:"Solaris",search:Aa("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Aa("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Aa("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],xf={browsers:Qe(Dr),oses:Qe(Qm)},xr="Edge",Za="Chromium",ca="IE",Ji="Opera",Eu="Firefox",Qc="Safari",Ha=()=>Zc({current:void 0,version:Ni.unknown()}),Zc=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isEdge:m(xr),isChromium:m(Za),isIE:m(ca),isOpera:m(Ji),isFirefox:m(Eu),isSafari:m(Qc)}},xc={unknown:Ha,nu:Zc,edge:Qe(xr),chromium:Qe(Za),ie:Qe(ca),opera:Qe(Ji),firefox:Qe(Eu),safari:Qe(Qc)},Cd="Windows",Yf="iOS",Au="Android",Xl="Linux",Hc="macOS",Tf="Solaris",su="FreeBSD",kd="ChromeOS",De=()=>nt({current:void 0,version:Ni.unknown()}),nt=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isWindows:m(Cd),isiOS:m(Yf),isAndroid:m(Au),isMacOS:m(Hc),isLinux:m(Xl),isSolaris:m(Tf),isFreeBSD:m(su),isChromeOS:m(kd)}},bt={unknown:De,nu:nt,windows:Qe(Cd),ios:Qe(Yf),android:Qe(Au),linux:Qe(Xl),macos:Qe(Hc),solaris:Qe(Tf),freebsd:Qe(su),chromeos:Qe(kd)},On={detect:(n,i,c)=>{const m=xf.browsers(),p=xf.oses(),w=i.bind(B=>la(m,B)).orThunk(()=>gr(m,n)).fold(xc.unknown,xc.nu),x=Fc(p,n).fold(bt.unknown,bt.nu),M=bo(x,w,n,c);return{browser:w,os:x,deviceType:M}}},Mo=n=>window.matchMedia(n).matches;let $r=Ut(()=>On.detect(navigator.userAgent,he.from(navigator.userAgentData),Mo));const ys=()=>$r(),ls=navigator.userAgent,Di=ys(),js=Di.browser,Hi=Di.os,Du=Di.deviceType,xd=ls.indexOf("Windows Phone")!==-1,qn={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:js.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!js.isIE(),windowsPhone:xd,browser:{current:js.current,version:js.version,isChromium:js.isChromium,isEdge:js.isEdge,isFirefox:js.isFirefox,isIE:js.isIE,isOpera:js.isOpera,isSafari:js.isSafari},os:{current:Hi.current,version:Hi.version,isAndroid:Hi.isAndroid,isChromeOS:Hi.isChromeOS,isFreeBSD:Hi.isFreeBSD,isiOS:Hi.isiOS,isLinux:Hi.isLinux,isMacOS:Hi.isMacOS,isSolaris:Hi.isSolaris,isWindows:Hi.isWindows},deviceType:{isDesktop:Du.isDesktop,isiPad:Du.isiPad,isiPhone:Du.isiPhone,isPhone:Du.isPhone,isTablet:Du.isTablet,isTouch:Du.isTouch,isWebView:Du.isWebView}},Zm=/^\s*|\s*$/g,zi=n=>Re(n)?"":(""+n).replace(Zm,""),me=(n,i)=>i?i==="array"&&Lr(n)?!0:typeof n===i:n!==void 0,$e=(n,i,c={})=>{const m=L(n)?n.split(i||","):n||[];let p=m.length;for(;p--;)c[m[p]]={};return c},Ue=un,It=(n,...i)=>{for(let c=0;ci.call(m,p,w,c)===!1?!1:(Bn(p,i,c,m),!0)))},gn={trim:zi,isArray:Lr,is:me,toArray:Vs,makeMap:$e,each:Yr,map:Zi,grep:Qa,inArray:Oi,hasOwn:Ue,extend:It,walk:Bn,resolve:(n,i=window)=>{const c=n.split(".");for(let m=0,p=c.length;moe(n)?n:n===""?[]:Zi(n.split(i||","),zi),_addCacheSuffix:n=>{const i=qn.cacheSuffix;return i&&(n+=(n.indexOf("?")===-1?"?":"&")+i),n}},Gr=(n,i,c=Ct)=>n.exists(m=>c(m,i)),Ll=(n,i,c=Ct)=>ri(n,i,c).getOr(n.isNone()&&i.isNone()),ea=n=>{const i=[],c=m=>{i.push(m)};for(let m=0;mn.isSome()&&i.isSome()?he.some(c(n.getOrDie(),i.getOrDie())):he.none(),Ef=(n,i,c,m)=>n.isSome()&&i.isSome()&&c.isSome()?he.some(m(n.getOrDie(),i.getOrDie(),c.getOrDie())):he.none(),ks=(n,i)=>n?he.some(i):he.none(),ru=typeof window<"u"?window:Function("return this;")(),Pi=(n,i)=>{let c=i!=null?i:ru;for(let m=0;m{const c=n.split(".");return Pi(c,i)},Ii=(n,i)=>uc(n,i),Xf=(n,i)=>{const c=Ii(n,i);if(c==null)throw new Error(n+" not available on this browser");return c},pa=Object.getPrototypeOf,jf=n=>Xf("HTMLElement",n),pr=n=>{const i=uc("ownerDocument.defaultView",n);return te(n)&&(jf(i).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(pa(n).constructor.name))},Gu=8,Ku=9,Tc=11,qf=1,eh=3,ti=n=>n.dom.nodeName.toLowerCase(),ta=n=>n.dom.nodeType,za=n=>i=>ta(i)===n,Kb=n=>ta(n)===Gu||ti(n)==="#comment",Mi=n=>kl(n)&&pr(n.dom),kl=za(qf),sl=za(eh),Zg=za(Ku),Gf=za(Tc),Ec=n=>i=>kl(i)&&ti(i)===n,Af=(n,i,c)=>{if(L(c)||we(c)||Xe(c))n.setAttribute(i,c+"");else throw console.error("Invalid call to Attribute.set. Key ",i,":: Value ",c,":: Element ",n),new Error("Attribute value was not simple")},Pr=(n,i,c)=>{Af(n.dom,i,c)},Ju=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{Af(c,p,m)})},Fl=(n,i)=>{const c=n.dom.getAttribute(i);return c===null?void 0:c},Va=(n,i)=>he.from(Fl(n,i)),qi=(n,i)=>{const c=n.dom;return c&&c.hasAttribute?c.hasAttribute(i):!1},Vi=(n,i)=>{n.dom.removeAttribute(i)},fc=n=>{const i=n.dom.attributes;return i==null||i.length===0},Kf=n=>zn(n.dom.attributes,(i,c)=>(i[c.name]=c.value,i),{}),th=(n,i)=>{const c=Fl(n,i);return c===void 0||c===""?[]:c.split(" ")},Hg=(n,i,c)=>{const p=th(n,i).concat([c]);return Pr(n,i,p.join(" ")),!0},Hm=(n,i,c)=>{const m=At(th(n,i),p=>p!==c);return m.length>0?Pr(n,i,m.join(" ")):Vi(n,i),!1},Ql=n=>n.dom.classList!==void 0,zm=n=>th(n,"class"),rl=(n,i)=>Hg(n,"class",i),Df=(n,i)=>Hm(n,"class",i),jh=(n,i)=>kt(zm(n),i)?Df(n,i):rl(n,i),ef=(n,i)=>{Ql(n)?n.dom.classList.add(i):rl(n,i)},qh=n=>{(Ql(n)?n.dom.classList:zm(n)).length===0&&Vi(n,"class")},zc=(n,i)=>{Ql(n)?n.dom.classList.remove(i):Df(n,i),qh(n)},Gh=(n,i)=>{const c=Ql(n)?n.dom.classList.toggle(i):jh(n,i);return qh(n),c},Pf=(n,i)=>Ql(n)&&n.dom.classList.contains(i),zp=(n,i)=>{const m=(i||document).createElement("div");if(m.innerHTML=n,!m.hasChildNodes()||m.childNodes.length>1){const p="HTML does not have a single root node";throw console.error(p,n),new Error(p)}return jl(m.childNodes[0])},Vm=(n,i)=>{const m=(i||document).createElement(n);return jl(m)},Jf=(n,i)=>{const m=(i||document).createTextNode(n);return jl(m)},jl=n=>{if(n==null)throw new Error("Node cannot be null or undefined");return{dom:n}},Ke={fromHtml:zp,fromTag:Vm,fromText:Jf,fromDom:jl,fromPoint:(n,i,c)=>he.from(n.dom.elementFromPoint(i,c)).map(jl)},nh=(n,i)=>{const c=[],m=w=>(c.push(w),i(w));let p=i(n);do p=p.bind(m);while(p.isSome());return c},Pu=(n,i)=>{const c=n.dom;if(c.nodeType!==qf)return!1;{const m=c;if(m.matches!==void 0)return m.matches(i);if(m.msMatchesSelector!==void 0)return m.msMatchesSelector(i);if(m.webkitMatchesSelector!==void 0)return m.webkitMatchesSelector(i);if(m.mozMatchesSelector!==void 0)return m.mozMatchesSelector(i);throw new Error("Browser lacks native selectors")}},Vg=n=>n.nodeType!==qf&&n.nodeType!==Ku&&n.nodeType!==Tc||n.childElementCount===0,U1=(n,i)=>{const c=i===void 0?document:i.dom;return Vg(c)?[]:pt(c.querySelectorAll(n),Ke.fromDom)},Kh=(n,i)=>{const c=i===void 0?document:i.dom;return Vg(c)?he.none():he.from(c.querySelector(n)).map(Ke.fromDom)},vt=(n,i)=>n.dom===i.dom,cn=(n,i)=>{const c=n.dom,m=i.dom;return c===m?!1:c.contains(m)},an=n=>Ke.fromDom(n.dom.ownerDocument),Eo=n=>Zg(n)?n:an(n),or=n=>Ke.fromDom(Eo(n).dom.documentElement),Xr=n=>Ke.fromDom(Eo(n).dom.defaultView),fi=n=>he.from(n.dom.parentNode).map(Ke.fromDom),wi=n=>he.from(n.dom.parentElement).map(Ke.fromDom),oh=(n,i)=>{const c=ce(i)?i:je;let m=n.dom;const p=[];for(;m.parentNode!==null&&m.parentNode!==void 0;){const w=m.parentNode,x=Ke.fromDom(w);if(p.push(x),c(x)===!0)break;m=w}return p},Jb=n=>{const i=c=>At(c,m=>!vt(n,m));return fi(n).map(Da).map(i).getOr([])},Sa=n=>he.from(n.dom.previousSibling).map(Ke.fromDom),Td=n=>he.from(n.dom.nextSibling).map(Ke.fromDom),Wg=n=>Xs(nh(n,Sa)),il=n=>nh(n,Td),Da=n=>pt(n.dom.childNodes,Ke.fromDom),tf=(n,i)=>{const c=n.dom.childNodes;return he.from(c[i]).map(Ke.fromDom)},ii=n=>tf(n,0),Mu=n=>tf(n,n.dom.childNodes.length-1),dc=n=>n.dom.childNodes.length,Jh=n=>n.dom.hasChildNodes(),Y1=n=>{const i=n.dom.head;if(i==null)throw new Error("Head is not available yet");return Ke.fromDom(i)},sh=n=>Gf(n)&&Oe(n.dom.host),Ug=ce(Element.prototype.attachShadow)&&ce(Node.prototype.getRootNode),rh=Qe(Ug),ql=Ug?n=>Ke.fromDom(n.dom.getRootNode()):Eo,em=n=>sh(n)?n:Y1(Eo(n)),X1=n=>sh(n)?n:Ke.fromDom(Eo(n).dom.body),Wm=n=>{const i=ql(n);return sh(i)?he.some(i):he.none()},Yg=n=>Ke.fromDom(n.dom.host),tm=n=>{if(rh()&&Oe(n.target)){const i=Ke.fromDom(n.target);if(kl(i)&&ih(i)&&n.composed&&n.composedPath){const c=n.composedPath();if(c)return $o(c)}}return he.from(n.target)},ih=n=>Oe(n.dom.shadowRoot),Ed=n=>{const i=sl(n)?n.dom.parentNode:n.dom;if(i==null||i.ownerDocument===null)return!1;const c=i.ownerDocument;return Wm(Ke.fromDom(i)).fold(()=>c.body.contains(i),ut(Ed,Yg))};var ai=(n,i,c,m,p)=>n(c,m)?he.some(c):ce(p)&&p(c)?he.none():i(c,m,p);const di=(n,i,c)=>{let m=n.dom;const p=ce(c)?c:je;for(;m.parentNode;){m=m.parentNode;const w=Ke.fromDom(m);if(i(w))return he.some(w);if(p(w))break}return he.none()},Zl=(n,i,c)=>ai((p,w)=>w(p),di,n,i,c),Vp=(n,i)=>{const c=n.dom;return c.parentNode?ee(Ke.fromDom(c.parentNode),m=>!vt(n,m)&&i(m)):he.none()},ee=(n,i)=>{const c=p=>i(Ke.fromDom(p));return oo(n.dom.childNodes,c).map(Ke.fromDom)},ue=(n,i)=>{const c=m=>{for(let p=0;pdi(n,m=>Pu(m,i),c),Je=(n,i)=>Kh(i,n),at=(n,i,c)=>ai((p,w)=>Pu(p,w),Se,n,i,c),Dn=n=>at(n,"[contenteditable]"),wn=(n,i=!1)=>Ed(n)?n.dom.isContentEditable:Dn(n).fold(Qe(i),c=>Ko(c)==="true"),Ko=n=>n.dom.contentEditable,ss=n=>n.style!==void 0&&ce(n.style.getPropertyValue),vo=(n,i,c)=>{if(!L(c))throw console.error("Invalid call to CSS.set. Property ",i,":: Value ",c,":: Element ",n),new Error("CSS value must be a string: "+c);ss(n)&&n.style.setProperty(i,c)},Tr=(n,i)=>{ss(n)&&n.style.removeProperty(i)},Gl=(n,i,c)=>{const m=n.dom;vo(m,i,c)},ua=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{vo(c,p,m)})},Bi=(n,i)=>{const c=n.dom,p=window.getComputedStyle(c).getPropertyValue(i);return p===""&&!Ed(n)?Ru(c,i):p},Ru=(n,i)=>ss(n)?n.style.getPropertyValue(i):"",Pa=(n,i)=>{const c=n.dom,m=Ru(c,i);return he.from(m).filter(p=>p.length>0)},nm=n=>{const i={},c=n.dom;if(ss(c))for(let m=0;m{const c=n.dom;Tr(c,i),Gr(Va(n,"style").map(kc),"")&&Vi(n,"style")},Wi=n=>n.dom.offsetWidth,Ca=(n,i)=>{fi(n).each(m=>{m.dom.insertBefore(i.dom,n.dom)})},iu=(n,i)=>{Td(n).fold(()=>{fi(n).each(p=>{na(p,i)})},m=>{Ca(m,i)})},ah=(n,i)=>{ii(n).fold(()=>{na(n,i)},m=>{n.dom.insertBefore(i.dom,m.dom)})},na=(n,i)=>{n.dom.appendChild(i.dom)},e0=(n,i)=>{Ca(n,i),na(i,n)},Dv=(n,i)=>{Ne(i,(c,m)=>{const p=m===0?n:i[m-1];iu(p,c)})},ni=(n,i)=>{Ne(i,c=>{na(n,c)})},Ad=n=>{n.dom.textContent="",Ne(Da(n),i=>{wr(i)})},wr=n=>{const i=n.dom;i.parentNode!==null&&i.parentNode.removeChild(i)},Kl=n=>{const i=Da(n);i.length>0&&Dv(n,i),wr(n)},ed=(n,i)=>{const m=(i||document).createElement("div");return m.innerHTML=n,Da(Ke.fromDom(m))},lh=n=>pt(n,Ke.fromDom),Ae=n=>n.dom.innerHTML,Mf=(n,i)=>{const m=an(n).dom,p=Ke.fromDom(m.createDocumentFragment()),w=ed(i,m);ni(p,w),Ad(n),na(n,p)},Xg=n=>{const i=Ke.fromTag("div"),c=Ke.fromDom(n.dom.cloneNode(!0));return na(i,c),Ae(i)},$u=(n,i,c,m,p,w,x)=>({target:n,x:i,y:c,stop:m,prevent:p,kill:w,raw:x}),hi=n=>{const i=Ke.fromDom(tm(n).getOr(n.target)),c=()=>n.stopPropagation(),m=()=>n.preventDefault(),p=V(m,c);return $u(i,n.clientX,n.clientY,c,m,p,n)},Pv=(n,i)=>c=>{n(c)&&i(hi(c))},j1=(n,i,c,m,p)=>{const w=Pv(c,m);return n.dom.addEventListener(i,w,p),{unbind:He(td,n,i,w,p)}},t0=(n,i,c,m)=>j1(n,i,c,m,!1),td=(n,i,c,m)=>{n.dom.removeEventListener(i,c,m)},Ym=(n,i)=>({left:n,top:i,translate:(m,p)=>Ym(n+m,i+p)}),jg=Ym,Mv=n=>{const i=n.getBoundingClientRect();return jg(i.left,i.top)},Rf=(n,i)=>n!==void 0?n:i!==void 0?i:0,xy=n=>{const i=n.dom.ownerDocument,c=i.body,m=i.defaultView,p=i.documentElement;if(c===n.dom)return jg(c.offsetLeft,c.offsetTop);const w=Rf(m==null?void 0:m.pageYOffset,p.scrollTop),x=Rf(m==null?void 0:m.pageXOffset,p.scrollLeft),M=Rf(p.clientTop,c.clientTop),B=Rf(p.clientLeft,c.clientLeft);return Nu(n).translate(x-B,w-M)},Nu=n=>{const i=n.dom,m=i.ownerDocument.body;return m===i?jg(m.offsetLeft,m.offsetTop):Ed(n)?Mv(i):jg(0,0)},nf=n=>{const i=n!==void 0?n.dom:document,c=i.body.scrollLeft||i.documentElement.scrollLeft,m=i.body.scrollTop||i.documentElement.scrollTop;return jg(c,m)},n0=(n,i,c)=>{const p=(c!==void 0?c.dom:document).defaultView;p&&p.scrollTo(n,i)},o0=(n,i)=>{ys().browser.isSafari()&&ce(n.dom.scrollIntoViewIfNeeded)?n.dom.scrollIntoViewIfNeeded(!1):n.dom.scrollIntoView(i)},s0=n=>{const i=n===void 0?window:n;return ys().browser.isFirefox()?he.none():he.from(i.visualViewport)},q1=(n,i,c,m)=>({x:n,y:i,width:c,height:m,right:n+c,bottom:i+m}),nd=n=>{const i=n===void 0?window:n,c=i.document,m=nf(Ke.fromDom(c));return s0(i).fold(()=>{const p=i.document.documentElement,w=p.clientWidth,x=p.clientHeight;return q1(m.left,m.top,w,x)},p=>q1(Math.max(p.pageLeft,m.left),Math.max(p.pageTop,m.top),p.width,p.height))},r0=(n,i)=>At(Da(n),i),i0=(n,i)=>{let c=[];return Ne(Da(n),m=>{i(m)&&(c=c.concat([m])),c=c.concat(i0(m,i))}),c},pl=(n,i)=>U1(i,n),Ty=(n,i,c)=>Se(n,i,c).isSome();class _i{constructor(i,c){this.node=i,this.rootNode=c,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(i){return this.node=this.findSibling(this.node,"firstChild","nextSibling",i),this.node}prev(i){return this.node=this.findSibling(this.node,"lastChild","previousSibling",i),this.node}prev2(i){return this.node=this.findPreviousNode(this.node,i),this.node}findSibling(i,c,m,p){if(i){if(!p&&i[c])return i[c];if(i!==this.rootNode){let w=i[m];if(w)return w;for(let x=i.parentNode;x&&x!==this.rootNode;x=x.parentNode)if(w=x[m],w)return w}}}findPreviousNode(i,c){if(i){const m=i.previousSibling;if(this.rootNode&&m===this.rootNode)return;if(m){if(!c){for(let w=m.lastChild;w;w=w.lastChild)if(!w.lastChild)return w}return m}const p=i.parentNode;if(p&&p!==this.rootNode)return p}}}const fo=n=>i=>!!i&&i.nodeType===n,Dd=n=>!!n&&!Object.getPrototypeOf(n),Jn=fo(1),Ac=n=>{const i=n.toLowerCase();return c=>Oe(c)&&c.nodeName.toLowerCase()===i},$f=n=>{const i=n.map(c=>c.toLowerCase());return c=>{if(c&&c.nodeName){const m=c.nodeName.toLowerCase();return kt(i,m)}return!1}},ch=(n,i)=>{const c=i.toLowerCase().split(" ");return m=>{if(Jn(m)){const p=m.ownerDocument.defaultView;if(p)for(let w=0;wi=>Jn(i)&&i.hasAttribute(n),qg=(n,i)=>c=>Jn(c)&&c.getAttribute(n)===i,Pd=n=>Jn(n)&&n.hasAttribute("data-mce-bogus"),bl=n=>Jn(n)&&n.getAttribute("data-mce-bogus")==="all",Iu=n=>Jn(n)&&n.tagName==="TABLE",Wp=n=>i=>!!(Jn(i)&&(i.contentEditable===n||i.getAttribute("data-mce-contenteditable")===n)),G1=$f(["textarea","input"]),_n=fo(3),Xm=fo(4),Md=fo(7),uh=fo(8),of=fo(9),K1=fo(11),mi=Ac("br"),Ui=Ac("img"),ba=Wp("true"),Es=Wp("false"),Rd=$f(["td","th"]),xl=$f(["td","th","caption"]),sf=$f(["video","audio","object","embed"]),Wa=Ac("li"),ka=Ac("details"),Up=Ac("summary"),nn="\uFEFF",Kr="\xA0",a0=n=>n===nn,xa=n=>n.replace(/\uFEFF/g,""),Gg=((n,i)=>{const c=w=>{if(!n(w))throw new Error("Can only get "+i+" value of a "+i+" node");return m(w).getOr("")},m=w=>n(w)?he.from(w.dom.nodeValue):he.none();return{get:c,getOption:m,set:(w,x)=>{if(!n(w))throw new Error("Can only set raw "+i+" value of a "+i+" node");w.dom.nodeValue=x}}})(sl,"text"),Wc=n=>Gg.get(n),od=n=>Gg.getOption(n),sd=(n,i)=>Gg.set(n,i),Yp=["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"],Hl=["td","th"],Er=["thead","tbody","tfoot"],Ya=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],fh=["h1","h2","h3","h4","h5","h6"],Jl=["li","dd","dt"],l0=["ul","ol","dl"],jm=["pre","script","textarea","style"],J1=["pre"].concat(fh),Xa=n=>{let i;return c=>(i=i||dr(n,mt),un(i,ti(c)))},hc=Xa(Yp),xt=n=>ti(n)==="table",Dc=n=>kl(n)&&!hc(n),au=n=>kl(n)&&ti(n)==="br",mc=Xa(Ya),Bu=Xa(l0),ja=Xa(Jl),qa=Xa(Er),qm=Xa(Hl),lu=Xa(jm),c0=Xa(J1),Ho=n=>c0(n)||Dc(n),z=n=>{const i=[];let c=n.dom;for(;c;)i.push(Ke.fromDom(c)),c=c.lastChild;return i},j=n=>{const i=pl(n,"br"),c=At(z(n).slice(-1),au);i.length===c.length&&Ne(c,wr)},ye=()=>{const n=Ke.fromTag("br");return Pr(n,"data-mce-bogus","1"),n},Pe=n=>{Ad(n),na(n,ye())},ct=n=>{Mu(n).each(i=>{Sa(i).each(c=>{hc(n)&&au(i)&&hc(c)&&wr(i)})})},Ft=nn,Sn=a0,In=xa,Uo=Jn,ts=_n,Si=n=>(ts(n)&&(n=n.parentNode),Uo(n)&&n.hasAttribute("data-mce-caret")),sr=n=>ts(n)&&Sn(n.data),_r=n=>Si(n)||sr(n),Uc=n=>n.firstChild!==n.lastChild||!mi(n.firstChild),cu=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft),w=n.parentNode;if(i){const x=n.previousSibling;if(ts(x)){if(_r(x))return x;if(hr(x))return x.splitText(x.data.length-1)}w==null||w.insertBefore(p,n)}else{const x=n.nextSibling;if(ts(x)){if(_r(x))return x;if(hh(x))return x.splitText(1),x}n.nextSibling?w==null||w.insertBefore(p,n.nextSibling):w==null||w.appendChild(p)}return p},rf=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset())===Ft||n.isAtStart()&&sr(i.previousSibling):!1},Nf=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset()-1)===Ft||n.isAtEnd()&&sr(i.nextSibling):!1},dh=(n,i,c)=>{var m;const w=((m=i.ownerDocument)!==null&&m!==void 0?m:document).createElement(n);w.setAttribute("data-mce-caret",c?"before":"after"),w.setAttribute("data-mce-bogus","all"),w.appendChild(ye().dom);const x=i.parentNode;return c?x==null||x.insertBefore(w,i):i.nextSibling?x==null||x.insertBefore(w,i.nextSibling):x==null||x.appendChild(w),w},hh=n=>ts(n)&&n.data[0]===Ft,hr=n=>ts(n)&&n.data[n.data.length-1]===Ft,Gm=n=>{var i;const c=n.getElementsByTagName("br"),m=c[c.length-1];Pd(m)&&((i=m.parentNode)===null||i===void 0||i.removeChild(m))},Km=n=>n&&n.hasAttribute("data-mce-caret")?(Gm(n),n.removeAttribute("data-mce-caret"),n.removeAttribute("data-mce-bogus"),n.removeAttribute("style"),n.removeAttribute("data-mce-style"),n.removeAttribute("_moz_abspos"),n):null,oa=n=>Si(n.startContainer),uu=ba,Xp=Es,Jm=mi,Ps=_n,Fr=$f(["script","style","textarea"]),Ma=$f(["img","input","textarea","hr","iframe","video","audio","object","embed"]),gc=$f(["table"]),eb=_r,Tl=n=>eb(n)?!1:Ps(n)?!Fr(n.parentNode):Ma(n)||Jm(n)||gc(n)||fu(n),Gi=n=>Jn(n)&&n.getAttribute("unselectable")==="true",fu=n=>!Gi(n)&&Xp(n),If=(n,i)=>{for(let c=n.parentNode;c&&c!==i;c=c.parentNode){if(fu(c))return!1;if(uu(c))return!0}return!0},Jw=n=>fu(n)?!zn(Rr(n.getElementsByTagName("*")),(i,c)=>i||uu(c),!1):!1,om=n=>Ma(n)||Jw(n),Kg=(n,i)=>Tl(n)&&If(n,i),sm=/^[ \t\r\n]*$/,eg=n=>sm.test(n),Jg=n=>{for(const i of n)if(!a0(i))return!1;return!0},u0=n=>" \f \v".indexOf(n)!==-1,rm=n=>n===` + */function Tue(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(o);e&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),t.push.apply(t,s)}return t}function Oy(o){for(var e=1;e=0)&&(t[a]=o[a]);return t}function Pxe(o,e){if(o==null)return{};var t=Dxe(o,e),s,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(o);for(a=0;a=0)&&(!Object.prototype.propertyIsEnumerable.call(o,s)||(t[s]=o[s]))}return t}var Mxe="1.15.0";function Fw(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var jw=Fw(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),tI=Fw(/Edge/i),Eue=Fw(/firefox/i),i6=Fw(/safari/i)&&!Fw(/chrome/i)&&!Fw(/android/i),t1e=Fw(/iP(ad|od|hone)/i),n1e=Fw(/chrome/i)&&Fw(/android/i),o1e={capture:!1,passive:!1};function hl(o,e,t){o.addEventListener(e,t,!jw&&o1e)}function La(o,e,t){o.removeEventListener(e,t,!jw&&o1e)}function rz(o,e){if(!!e){if(e[0]===">"&&(e=e.substring(1)),o)try{if(o.matches)return o.matches(e);if(o.msMatchesSelector)return o.msMatchesSelector(e);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(e)}catch{return!1}return!1}}function Rxe(o){return o.host&&o!==document&&o.host.nodeType?o.host:o.parentNode}function iy(o,e,t,s){if(o){t=t||document;do{if(e!=null&&(e[0]===">"?o.parentNode===t&&rz(o,e):rz(o,e))||s&&o===t)return o;if(o===t)break}while(o=Rxe(o))}return null}var Aue=/\s+/g;function $1(o,e,t){if(o&&e)if(o.classList)o.classList[t?"add":"remove"](e);else{var s=(" "+o.className+" ").replace(Aue," ").replace(" "+e+" "," ");o.className=(s+(t?" "+e:"")).replace(Aue," ")}}function Vr(o,e,t){var s=o&&o.style;if(s){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(t=o.currentStyle),e===void 0?t:t[e];!(e in s)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),s[e]=t+(typeof t=="string"?"":"px")}}function OD(o,e){var t="";if(typeof o=="string")t=o;else do{var s=Vr(o,"transform");s&&s!=="none"&&(t=s+" "+t)}while(!e&&(o=o.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(t)}function s1e(o,e,t){if(o){var s=o.getElementsByTagName(e),a=0,l=s.length;if(t)for(;a=l:u=a<=l,!u)return s;if(s===hy())break;s=_C(s,!1)}return!1}function PD(o,e,t,s){for(var a=0,l=0,u=o.children;l2&&arguments[2]!==void 0?arguments[2]:{},a=s.evt,l=Pxe(s,Zxe);nI.pluginEvent.bind(Wr)(e,t,Oy({dragEl:zo,parentEl:ju,ghostEl:Ai,rootEl:eu,nextEl:tE,lastDownEl:TH,cloneEl:Su,cloneHidden:yC,dragStarted:qN,putSortable:Vh,activeSortable:Wr.active,originalEvent:a,oldIndex:hD,oldDraggableIndex:l6,newIndex:I1,newDraggableIndex:bC,hideGhostForTarget:f1e,unhideGhostForTarget:d1e,cloneNowHidden:function(){yC=!0},cloneNowShown:function(){yC=!1},dispatchSortableEvent:function(d){Rg({sortable:t,name:d,originalEvent:a})}},l))};function Rg(o){Qxe(Oy({putSortable:Vh,cloneEl:Su,targetEl:zo,rootEl:eu,oldIndex:hD,oldDraggableIndex:l6,newIndex:I1,newDraggableIndex:bC},o))}var zo,ju,Ai,eu,tE,TH,Su,yC,hD,I1,l6,bC,IZ,Vh,iD=!1,iz=!1,az=[],qT,wv,wne,_ne,Mue,Rue,qN,tD,c6,u6=!1,BZ=!1,EH,Rm,Sne=[],Boe=!1,lz=[],tV=typeof document<"u",LZ=t1e,$ue=tI||jw?"cssFloat":"float",Hxe=tV&&!n1e&&!t1e&&"draggable"in document.createElement("div"),l1e=function(){if(!!tV){if(jw)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),c1e=function(e,t){var s=Vr(e),a=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),l=PD(e,0,t),u=PD(e,1,t),d=l&&Vr(l),h=u&&Vr(u),b=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+yd(l).width,y=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+yd(u).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(l&&d.float&&d.float!=="none"){var C=d.float==="left"?"left":"right";return u&&(h.clear==="both"||h.clear===C)?"vertical":"horizontal"}return l&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||b>=a&&s[$ue]==="none"||u&&s[$ue]==="none"&&b+y>a)?"vertical":"horizontal"},zxe=function(e,t,s){var a=s?e.left:e.top,l=s?e.right:e.bottom,u=s?e.width:e.height,d=s?t.left:t.top,h=s?t.right:t.bottom,b=s?t.width:t.height;return a===d||l===h||a+u/2===d+b/2},Vxe=function(e,t){var s;return az.some(function(a){var l=a[F1].options.emptyInsertThreshold;if(!(!l||lre(a))){var u=yd(a),d=e>=u.left-l&&e<=u.right+l,h=t>=u.top-l&&t<=u.bottom+l;if(d&&h)return s=a}}),s},u1e=function(e){function t(l,u){return function(d,h,b,y){var C=d.options.group.name&&h.options.group.name&&d.options.group.name===h.options.group.name;if(l==null&&(u||C))return!0;if(l==null||l===!1)return!1;if(u&&l==="clone")return l;if(typeof l=="function")return t(l(d,h,b,y),u)(d,h,b,y);var E=(u?d:h).options.group.name;return l===!0||typeof l=="string"&&l===E||l.join&&l.indexOf(E)>-1}}var s={},a=e.group;(!a||xH(a)!="object")&&(a={name:a}),s.name=a.name,s.checkPull=t(a.pull,!0),s.checkPut=t(a.put),s.revertClone=a.revertClone,e.group=s},f1e=function(){!l1e&&Ai&&Vr(Ai,"display","none")},d1e=function(){!l1e&&Ai&&Vr(Ai,"display","")};tV&&!n1e&&document.addEventListener("click",function(o){if(iz)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),iz=!1,!1},!0);var GT=function(e){if(zo){e=e.touches?e.touches[0]:e;var t=Vxe(e.clientX,e.clientY);if(t){var s={};for(var a in e)e.hasOwnProperty(a)&&(s[a]=e[a]);s.target=s.rootEl=t,s.preventDefault=void 0,s.stopPropagation=void 0,t[F1]._onDragOver(s)}}},Wxe=function(e){zo&&zo.parentNode[F1]._isOutsideThisEl(e.target)};function Wr(o,e){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=e=zw({},e),o[F1]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return c1e(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(u,d){u.setData("Text",d.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Wr.supportPointer!==!1&&"PointerEvent"in window&&!i6,emptyInsertThreshold:5};nI.initializePlugins(this,o,t);for(var s in t)!(s in e)&&(e[s]=t[s]);u1e(e);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=e.forceFallback?!1:Hxe,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?hl(o,"pointerdown",this._onTapStart):(hl(o,"mousedown",this._onTapStart),hl(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(hl(o,"dragover",this),hl(o,"dragenter",this)),az.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),zw(this,Bxe())}Wr.prototype={constructor:Wr,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(tD=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,zo):this.options.direction},_onTapStart:function(e){if(!!e.cancelable){var t=this,s=this.el,a=this.options,l=a.preventOnFilter,u=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,h=(d||e).target,b=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||h,y=a.filter;if(Jxe(s),!zo&&!(/mousedown|pointerdown/.test(u)&&e.button!==0||a.disabled)&&!b.isContentEditable&&!(!this.nativeDraggable&&i6&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=iy(h,a.draggable,s,!1),!(h&&h.animated)&&TH!==h)){if(hD=Lb(h),l6=Lb(h,a.draggable),typeof y=="function"){if(y.call(this,e,h,this)){Rg({sortable:t,rootEl:b,name:"filter",targetEl:h,toEl:s,fromEl:s}),Rp("filter",t,{evt:e}),l&&e.cancelable&&e.preventDefault();return}}else if(y&&(y=y.split(",").some(function(C){if(C=iy(b,C.trim(),s,!1),C)return Rg({sortable:t,rootEl:C,name:"filter",targetEl:h,fromEl:s,toEl:s}),Rp("filter",t,{evt:e}),!0}),y)){l&&e.cancelable&&e.preventDefault();return}a.handle&&!iy(b,a.handle,s,!1)||this._prepareDragStart(e,d,h)}}},_prepareDragStart:function(e,t,s){var a=this,l=a.el,u=a.options,d=l.ownerDocument,h;if(s&&!zo&&s.parentNode===l){var b=yd(s);if(eu=l,zo=s,ju=zo.parentNode,tE=zo.nextSibling,TH=s,IZ=u.group,Wr.dragged=zo,qT={target:zo,clientX:(t||e).clientX,clientY:(t||e).clientY},Mue=qT.clientX-b.left,Rue=qT.clientY-b.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,zo.style["will-change"]="all",h=function(){if(Rp("delayEnded",a,{evt:e}),Wr.eventCanceled){a._onDrop();return}a._disableDelayedDragEvents(),!Eue&&a.nativeDraggable&&(zo.draggable=!0),a._triggerDragStart(e,t),Rg({sortable:a,name:"choose",originalEvent:e}),$1(zo,u.chosenClass,!0)},u.ignore.split(",").forEach(function(y){s1e(zo,y.trim(),Cne)}),hl(d,"dragover",GT),hl(d,"mousemove",GT),hl(d,"touchmove",GT),hl(d,"mouseup",a._onDrop),hl(d,"touchend",a._onDrop),hl(d,"touchcancel",a._onDrop),Eue&&this.nativeDraggable&&(this.options.touchStartThreshold=4,zo.draggable=!0),Rp("delayStart",this,{evt:e}),u.delay&&(!u.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(tI||jw))){if(Wr.eventCanceled){this._onDrop();return}hl(d,"mouseup",a._disableDelayedDrag),hl(d,"touchend",a._disableDelayedDrag),hl(d,"touchcancel",a._disableDelayedDrag),hl(d,"mousemove",a._delayedDragTouchMoveHandler),hl(d,"touchmove",a._delayedDragTouchMoveHandler),u.supportPointer&&hl(d,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(h,u.delay)}else h()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){zo&&Cne(zo),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;La(e,"mouseup",this._disableDelayedDrag),La(e,"touchend",this._disableDelayedDrag),La(e,"touchcancel",this._disableDelayedDrag),La(e,"mousemove",this._delayedDragTouchMoveHandler),La(e,"touchmove",this._delayedDragTouchMoveHandler),La(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?hl(document,"pointermove",this._onTouchMove):t?hl(document,"touchmove",this._onTouchMove):hl(document,"mousemove",this._onTouchMove):(hl(zo,"dragend",this),hl(eu,"dragstart",this._onDragStart));try{document.selection?AH(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(iD=!1,eu&&zo){Rp("dragStarted",this,{evt:t}),this.nativeDraggable&&hl(document,"dragover",Wxe);var s=this.options;!e&&$1(zo,s.dragClass,!1),$1(zo,s.ghostClass,!0),Wr.active=this,e&&this._appendGhost(),Rg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(wv){this._lastX=wv.clientX,this._lastY=wv.clientY,f1e();for(var e=document.elementFromPoint(wv.clientX,wv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(wv.clientX,wv.clientY),e!==t);)t=e;if(zo.parentNode[F1]._isOutsideThisEl(e),t)do{if(t[F1]){var s=void 0;if(s=t[F1]._onDragOver({clientX:wv.clientX,clientY:wv.clientY,target:e,rootEl:t}),s&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);d1e()}},_onTouchMove:function(e){if(qT){var t=this.options,s=t.fallbackTolerance,a=t.fallbackOffset,l=e.touches?e.touches[0]:e,u=Ai&&OD(Ai,!0),d=Ai&&u&&u.a,h=Ai&&u&&u.d,b=LZ&&Rm&&Pue(Rm),y=(l.clientX-qT.clientX+a.x)/(d||1)+(b?b[0]-Sne[0]:0)/(d||1),C=(l.clientY-qT.clientY+a.y)/(h||1)+(b?b[1]-Sne[1]:0)/(h||1);if(!Wr.active&&!iD){if(s&&Math.max(Math.abs(l.clientX-this._lastX),Math.abs(l.clientY-this._lastY))=0&&(Rg({rootEl:ju,name:"add",toEl:ju,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"remove",toEl:ju,originalEvent:e}),Rg({rootEl:ju,name:"sort",toEl:ju,fromEl:eu,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:ju,originalEvent:e})),Vh&&Vh.save()):I1!==hD&&I1>=0&&(Rg({sortable:this,name:"update",toEl:ju,originalEvent:e}),Rg({sortable:this,name:"sort",toEl:ju,originalEvent:e})),Wr.active&&((I1==null||I1===-1)&&(I1=hD,bC=l6),Rg({sortable:this,name:"end",toEl:ju,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){Rp("nulling",this),eu=zo=ju=Ai=tE=Su=TH=yC=qT=wv=qN=I1=bC=hD=l6=tD=c6=Vh=IZ=Wr.dragged=Wr.ghost=Wr.clone=Wr.active=null,lz.forEach(function(e){e.checked=!0}),lz.length=wne=_ne=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":zo&&(this._onDragOver(e),Uxe(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,s=this.el.children,a=0,l=s.length,u=this.options;as.right+a||o.clientX<=s.right&&o.clientY>s.bottom&&o.clientX>=s.left:o.clientX>s.right&&o.clientY>s.top||o.clientX<=s.right&&o.clientY>s.bottom+a}function qxe(o,e,t,s,a,l,u,d){var h=s?o.clientY:o.clientX,b=s?t.height:t.width,y=s?t.top:t.left,C=s?t.bottom:t.right,E=!1;if(!u){if(d&&EHy+b*l/2:hC-EH)return-c6}else if(h>y+b*(1-a)/2&&hC-b*l/2)?h>y+b/2?1:-1:0}function Gxe(o){return Lb(zo){u[y]=null}),go(),t=u[e],t?t.p(h,b):(t=u[e]=l[e](h),t.c()),xe(t,1),t.m(s.parentNode,s))},i(h){a||(xe(t),a=!0)},o(h){Be(t),a=!1},d(h){u[e].d(h),h&&ke(s)}}}function sTe(o,e,t){let{$$slots:s={},$$scope:a}=e,{sortableClass:l=""}=e,{isTable:u=!1}=e,{sortableInstance:d}=e;const h=Fg();let b;W1(()=>{let E={animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onUpdate(R){console.log(R),h("update",{source:R.oldIndex,target:R.newIndex})},onMove(R){}};t(3,d=Wr.create(b,E))});function y(E){Ro[E?"unshift":"push"](()=>{b=E,t(2,b)})}function C(E){Ro[E?"unshift":"push"](()=>{b=E,t(2,b)})}return o.$$set=E=>{"sortableClass"in E&&t(0,l=E.sortableClass),"isTable"in E&&t(1,u=E.isTable),"sortableInstance"in E&&t(3,d=E.sortableInstance),"$$scope"in E&&t(4,a=E.$$scope)},[l,u,b,d,a,s,y,C]}class oI extends uo{constructor(e){super(),co(this,e,sTe,oTe,lo,{sortableClass:0,isTable:1,sortableInstance:3})}}function Iue(o,e,t){const s=o.slice();return s[11]=e[t],s}function Bue(o){let e,t;return{c(){e=re("div"),t=Ht(o[1]),Z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&2&&Qn(t,s[1])},d(s){s&&ke(e)}}}function Lue(o){let e,t;return e=new oI({props:{sortableClass:"row row-cols-3 mt-3",$$slots:{default:[rTe]},$$scope:{ctx:o}}}),e.$on("update",o[4]),{c(){en(e.$$.fragment)},m(s,a){Kt(e,s,a),t=!0},p(s,a){const l={};a&16385&&(l.$$scope={dirty:a,ctx:s}),e.$set(l)},i(s){t||(xe(e.$$.fragment,s),t=!0)},o(s){Be(e.$$.fragment,s),t=!1},d(s){Jt(e,s)}}}function Fue(o,e){let t,s,a,l;return s=new J6({props:{classes:"h-100",record:e[11],hasDelete:!0}}),s.$on("remove",e[3]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),a=Ze(),Z(t,"class","col mb-3"),this.first=t},m(u,d){Te(u,t,d),Kt(s,t,null),X(t,a),l=!0},p(u,d){e=u;const h={};d&1&&(h.record=e[11]),s.$set(h)},i(u){l||(xe(s.$$.fragment,u),l=!0)},o(u){Be(s.$$.fragment,u),l=!1},d(u){u&&ke(t),Jt(s)}}}function rTe(o){let e=[],t=new Map,s,a,l=o[0];const u=d=>d[11].id;for(let d=0;d0&&Lue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),h&&h.c(),l=Rs(),Z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Te(b,e,y),Te(b,t,y),Kt(s,t,null),Te(b,a,y),h&&h.m(b,y),Te(b,l,y),u=!0},p(b,[y]){b[1]?d?d.p(b,y):(d=Bue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null),b[0].length>0?h?(h.p(b,y),y&1&&xe(h,1)):(h=Lue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(mo(),Be(h,1,1,()=>{h=null}),go())},i(b){u||(xe(s.$$.fragment,b),xe(h),u=!0)},o(b){Be(s.$$.fragment,b),Be(h),u=!1},d(b){d&&d.d(b),b&&ke(e),b&&ke(t),Jt(s),b&&ke(a),h&&h.d(b),b&&ke(l)}}}function aTe(o,e,t){let s,a;const l=Ur("channel");let{record:u}=e,{field:d}=e,{graph:h}=e,{validationErrors:b}=e,y=l.schemas.filter($=>d.collections.includes($.name));function C($){$.preventDefault(),t(6,h.edges=h.edges.filter(Q=>!(Q.target===$.detail&&Q.field===d.name)),h)}function E($){t(6,h.edges=qD($.detail.source,$.detail.target,h.edges,d.name),h)}function R($){$.preventDefault(),t(6,h=K6(h,u,$.detail.records,d.name,$.detail.action))}return o.$$set=$=>{"record"in $&&t(7,u=$.record),"field"in $&&t(8,d=$.field),"graph"in $&&t(6,h=$.graph),"validationErrors"in $&&t(9,b=$.validationErrors)},o.$$.update=()=>{var $;o.$$.dirty&768&&t(1,s=Lm(b,d.name)),o.$$.dirty&448&&t(0,a=($=h.edges.filter(Q=>Q.field===d.name).map(Q=>h.records.find(F=>F.id===Q.target&&u.id===Q.source)).filter(Q=>!!(Q!=null&&Q.id)))!=null?$:[])},[a,s,y,C,E,R,h,u,d,b]}class lTe extends uo{constructor(e){super(),co(this,e,aTe,iTe,lo,{record:7,field:8,graph:6,validationErrors:9})}}function Que(o,e,t){const s=o.slice();return s[21]=e[t],s}function cTe(o){let e,t,s,a,l,u,d,h,b,y,C,E,R,$,Q,F,U,K,L,te,ne,oe,G,we,ve,Re,Oe,ce,Xe,tt;u=new Fa({props:{icon:"pencil",width:12,height:12}});const ot=[hTe,dTe],V=[];function ut(Et,Cn){return Et[7]?0:1}b=ut(o),y=V[b]=ot[b](o),$=new Fa({props:{icon:"ellipsis"}});let Qe=!o[1]&&Zue(o),Bt=!o[2]&&Hue(o),Ct=o[8].type==="files"&&mTe(o),He=o[8].fields.filter(Vue),st=[];for(let Et=0;EtBe(st[Et],1,1,()=>{st[Et]=null});return{c(){e=re("div"),t=re("div"),s=re("small"),s.textContent=`${o[8].label}`,a=Ze(),l=re("button"),en(u.$$.fragment),d=Ze(),h=re("button"),y.c(),C=Ze(),E=re("div"),R=re("button"),en($.$$.fragment),Q=Ze(),F=re("div"),U=re("a"),K=Ht("Edit in new tab"),te=Ze(),ne=re("button"),ne.textContent="Remove",oe=Ze(),G=re("div"),Qe&&Qe.c(),we=Ze(),Bt&&Bt.c(),ve=Ze(),Re=re("div"),Ct&&Ct.c(),Oe=Ze();for(let Et=0;Et{V[je]=null}),go(),y=V[b],y||(y=V[b]=ot[b](Et),y.c()),xe(y,1),y.m(h,null)),(!ce||Cn&1&&L!==(L="/records/"+Et[0].id))&&Z(U,"href",L),Et[1]?Qe&&(mo(),Be(Qe,1,1,()=>{Qe=null}),go()):Qe?(Qe.p(Et,Cn),Cn&2&&xe(Qe,1)):(Qe=Zue(Et),Qe.c(),xe(Qe,1),Qe.m(G,we)),Et[2]?Bt&&(mo(),Be(Bt,1,1,()=>{Bt=null}),go()):Bt?(Bt.p(Et,Cn),Cn&4&&xe(Bt,1)):(Bt=Hue(Et),Bt.c(),xe(Bt,1),Bt.m(G,null)),Et[8].type==="files"&&Ct.p(Et,Cn),Cn&257){He=Et[8].fields.filter(Vue);let mt;for(mt=0;mt{u[y]=null}),go(),s=u[t],s?s.p(h,b):(s=u[t]=l[t](h),s.c()),xe(s,1),s.m(e,null))},i(h){a||(xe(s),a=!0)},o(h){Be(s),a=!1},d(h){h&&ke(e),u[t].d()}}}const Vue=o=>!(o.trashed||["tab"].includes(o.ui)||["id"].includes(o.name));function OTe(o,e,t){let s,a;const l=Ur("channel"),u=Fg();let{isFirst:d}=e,{isLast:h}=e,{toDelete:b=!1}=e,{record:y}=e,C,E,R=l.schemas.find(we=>we.name===y.schema);function $(we){we.preventDefault(),axios.get(l.lucentUrl+"/records/editInline/"+y.id).then(ve=>{t(0,y=ve.data),t(4,C=ve.data.record),t(5,E=ve.data.graph),t(6,s=!0)}).catch(ve=>{console.log(ve)})}function Q(we){we.preventDefault(),u("moveup")}function F(we){we.preventDefault(),u("movedn")}function U(we){we.preventDefault(),u("inlinesaved",we.detail),t(6,s=!1)}function K(we){we.preventDefault(),u("remove",y.id)}function L(we){we.preventDefault(),u("trash",y.id)}function te(we){we.preventDefault(),u("undoremove",y.id)}function ne(we){we.preventDefault(),t(6,s=!1)}W1(()=>{t(6,s=!1)});function oe(we){we.preventDefault(),axios.post(l.lucentUrl+"/records/status/trashed",[y]).then(ve=>{u("remove",y.id)}).catch(ve=>{console.log(ve)})}const G=we=>t(7,a=!a);return o.$$set=we=>{"isFirst"in we&&t(1,d=we.isFirst),"isLast"in we&&t(2,h=we.isLast),"toDelete"in we&&t(3,b=we.toDelete),"record"in we&&t(0,y=we.record)},t(6,s=!1),t(7,a=!1),[y,d,h,b,C,E,s,a,R,$,Q,F,U,K,L,te,ne,oe,G]}class yTe extends uo{constructor(e){super(),co(this,e,OTe,vTe,lo,{isFirst:1,isLast:2,toDelete:3,record:0})}}function m1e(o,{from:e,to:t},s={}){const a=getComputedStyle(o),l=a.transform==="none"?"":a.transform,[u,d]=a.transformOrigin.split(" ").map(parseFloat),h=e.left+e.width*u/t.width-(t.left+u),b=e.top+e.height*d/t.height-(t.top+d),{delay:y=0,duration:C=R=>Math.sqrt(R)*120,easing:E=Mpe}=s;return{delay:y,duration:Ub(C)?C(Math.sqrt(h*h+b*b)):C,easing:E,css:(R,$)=>{const Q=$*h,F=$*b,U=R+$*e.width/t.width,K=R+$*e.height/t.height;return`transform: ${l} translate(${Q}px, ${F}px) scale(${U}, ${K});`}}}function Wue(o,e,t){const s=o.slice();return s[18]=e[t],s[19]=e,s[20]=t,s}function Uue(o){let e,t;return{c(){e=re("div"),t=Ht(o[3]),Z(e,"class","invalid-feedback d-block mb-3")},m(s,a){Te(s,e,a),X(e,t)},p(s,a){a&8&&Qn(t,s[3])},d(s){s&&ke(e)}}}function Yue(o){let e=[],t=new Map,s,a,l=o[2];const u=d=>d[18].id;for(let d=0;der(s,"record",E)),s.$on("inlinesaved",e[5]),s.$on("moveup",R),s.$on("movedn",$),s.$on("remove",e[6]),s.$on("undoremove",e[8]),s.$on("trash",e[7]),u=new eI({props:{field:e[1],recordId:e[18].id,schemas:e[4]}}),u.$on("insert",e[9]),u.$on("save",e[9]),{key:o,first:null,c(){t=re("div"),en(s.$$.fragment),l=Ze(),en(u.$$.fragment),d=Ze(),Z(t,"class","inline-card-wrapper"),this.first=t},m(F,U){Te(F,t,U),Kt(s,t,null),X(t,l),Kt(u,t,null),X(t,d),y=!0},p(F,U){e=F;const K={};U&4&&(K.isFirst=e[20]===0),U&4&&(K.isLast=e[20]+1===e[2].length),U&7&&(K.toDelete=e[0].edges.find(C)._isTrashed),!a&&U&4&&(a=!0,K.record=e[18],lr(()=>a=!1)),s.$set(K);const L={};U&2&&(L.field=e[1]),U&4&&(L.recordId=e[18].id),u.$set(L)},r(){h=t.getBoundingClientRect()},f(){Epe(t),b()},a(){b(),b=Tpe(t,h,m1e,{delay:250,duration:250,easing:Rpe})},i(F){y||(xe(s.$$.fragment,F),xe(u.$$.fragment,F),y=!0)},o(F){Be(s.$$.fragment,F),Be(u.$$.fragment,F),y=!1},d(F){F&&ke(t),Jt(s),Jt(u)}}}function wTe(o){let e,t,s,a,l,u,d=o[3]&&Uue(o);s=new eI({props:{field:o[1],recordId:null,schemas:o[4]}}),s.$on("insert",o[9]),s.$on("save",o[9]);let h=o[2].length>0&&Yue(o);return{c(){d&&d.c(),e=Ze(),t=re("div"),en(s.$$.fragment),a=Ze(),h&&h.c(),l=Rs(),Z(t,"class","inline-card-wrapper")},m(b,y){d&&d.m(b,y),Te(b,e,y),Te(b,t,y),Kt(s,t,null),Te(b,a,y),h&&h.m(b,y),Te(b,l,y),u=!0},p(b,[y]){b[3]?d?d.p(b,y):(d=Uue(b),d.c(),d.m(e.parentNode,e)):d&&(d.d(1),d=null);const C={};y&2&&(C.field=b[1]),s.$set(C),b[2].length>0?h?(h.p(b,y),y&4&&xe(h,1)):(h=Yue(b),h.c(),xe(h,1),h.m(l.parentNode,l)):h&&(mo(),Be(h,1,1,()=>{h=null}),go())},i(b){u||(xe(s.$$.fragment,b),xe(h),u=!0)},o(b){Be(s.$$.fragment,b),Be(h),u=!1},d(b){d&&d.d(b),b&&ke(e),b&&ke(t),Jt(s),b&&ke(a),h&&h.d(b),b&&ke(l)}}}function _Te(o,e,t){let s,a;const l=Ur("channel");let{field:u}=e,{record:d}=e,{graph:h}=e,{validationErrors:b}=e,y=l.schemas.filter(ne=>u.collections.includes(ne.name));function C(ne){const oe=ne.detail.records[0];t(0,h.edges=h.edges.map(G=>G.source===oe.id?oe:G),h)}function E(ne){ne.preventDefault(),t(0,h.edges=h.edges.filter(oe=>!(oe.target===ne.detail&&oe.field===u.name)),h)}function R(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===u.name&&(oe._isTrashed=!0),oe)),h)}function $(ne){ne.preventDefault(),t(0,h.edges=h.edges.map(oe=>(oe.target===ne.detail&&oe.field===u.name&&delete oe._isTrashed,oe)),h)}function Q(ne){var Oe;ne.preventDefault();const oe=ne.detail.records,G=(Oe=ne.detail.after)!=null?Oe:null,we=ne.detail.action;let ve=oe.map(ce=>({target:ce.id,source:d.id,sourceSchema:d.schema,targetSchema:ce.schema,field:u.name,rank:""})),Re=h.edges;if(we==="replace"&&(Re=Re.filter(ce=>ce.field!==u.name)),t(0,h.records=Lc.exports.uniqBy([...h.records,...oe],ce=>ce.id),h),t(0,h.edges=Lc.exports.uniqBy([...Re,...ve],ce=>ce.target+ce.field),h),!G)t(0,h.edges=Lc.exports.uniqBy([...ve,...Re],ce=>ce.target+ce.field),h);else{let ce=!1,Xe=Re.reduce((tt,ot)=>(ce?tt.after.push(ot):tt.before.push(ot),ce===!1&&ot.target===G&&(ce=!0),tt),{before:[],after:[]});t(0,h.edges=Lc.exports.uniqBy([...Xe.before,...ve,...Xe.after],tt=>tt.target+tt.field),h)}}function F(ne,oe,G){t(0,h.edges=qD(oe,G,h.edges,u.name),h)}const U=(ne,oe)=>oe.field===u.name&&oe.target===ne.id;function K(ne,oe,G,we){G[we]=ne,t(2,a),t(0,h),t(1,u),t(11,d)}const L=(ne,oe)=>F(oe,ne,ne-1),te=(ne,oe)=>F(oe,ne,ne+1);return o.$$set=ne=>{"field"in ne&&t(1,u=ne.field),"record"in ne&&t(11,d=ne.record),"graph"in ne&&t(0,h=ne.graph),"validationErrors"in ne&&t(12,b=ne.validationErrors)},o.$$.update=()=>{var ne;o.$$.dirty&4098&&t(3,s=Lm(b,u.name)),o.$$.dirty&2051&&t(2,a=(ne=h.edges.filter(oe=>oe.field===u.name).map(oe=>h.records.find(G=>G.id==oe.target&&d.id==oe.source)).filter(oe=>!!(oe!=null&&oe.id)))!=null?ne:[])},[h,u,a,s,y,C,E,R,$,Q,F,d,b,U,K,L,te]}class STe extends uo{constructor(e){super(),co(this,e,_Te,wTe,lo,{field:1,record:11,graph:0,validationErrors:12})}}function g1e(o,e,t=null){return t?o.reduce((s,a)=>(s.push(a),a.id===t&&s.push({meta:e,id:zle(),value:null}),s),[]):[{meta:e,id:zle(),value:null},...o]}function jue(o,e,t){const s=o.slice();return s[7]=e[t],s}function que(o){let e,t=o[1].fields,s=[];for(let a=0;at(2,s=!s),b=(y,C)=>d(C,y);return o.$$set=y=>{"blockId"in y&&t(0,a=y.blockId),"blockData"in y&&t(4,l=y.blockData),"blockSchema"in y&&t(1,u=y.blockSchema)},t(2,s=!1),[a,u,s,d,l,h,b]}class xTe extends uo{constructor(e){super(),co(this,e,kTe,CTe,lo,{blockId:0,blockData:4,blockSchema:1})}}function TTe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("input"),Z(t,"type","text"),Z(t,"id",s=o[0].id),Z(t,"class","form-control"),Z(t,"autocomplete","off"),Z(e,"class","mb-0")},m(u,d){Te(u,e,d),X(e,t),ar(t,o[0].value),a||(l=mn(t,"input",o[1]),a=!0)},p(u,[d]){d&1&&s!==(s=u[0].id)&&Z(t,"id",s),d&1&&t.value!==u[0].value&&ar(t,u[0].value)},i:fn,o:fn,d(u){u&&ke(e),a=!1,l()}}}function ETe(o,e,t){let{block:s}=e;function a(){s.value=this.value,t(0,s)}return o.$$set=l=>{"block"in l&&t(0,s=l.block)},[s,a]}class ATe extends uo{constructor(e){super(),co(this,e,ETe,TTe,lo,{block:0})}}function DTe(o){let e,t,s,a,l;return{c(){e=re("div"),t=re("textarea"),Z(t,"id",s=o[0].id),Z(t,"class","form-control svelte-1er4ovm"),Z(t,"autocomplete","off"),Z(e,"class","mb-0")},m(u,d){Te(u,e,d),X(e,t),ar(t,o[0].value),o[3](t),a||(l=[mn(t,"input",o[2]),mn(t,"input",p1e)],a=!0)},p(u,[d]){d&1&&s!==(s=u[0].id)&&Z(t,"id",s),d&1&&ar(t,u[0].value)},i:fn,o:fn,d(u){u&&ke(e),o[3](null),a=!1,vi(l)}}}function p1e(o){let e;o.target?e=o.target:e=o,e.style.overflow="hidden",e.style.height="1px",e.style.height=+e.scrollHeight+"px"}function PTe(o,e,t){let{block:s}=e,a;W1(()=>{p1e(a)});function l(){s.value=this.value,t(0,s)}function u(d){Ro[d?"unshift":"push"](()=>{a=d,t(1,a)})}return o.$$set=d=>{"block"in d&&t(0,s=d.block)},[s,a,l,u]}class MTe extends uo{constructor(e){super(),co(this,e,PTe,DTe,lo,{block:0})}}var b1e={exports:{}};(function(o){(function(){var e=function(n){if(n===null)return"null";if(n===void 0)return"undefined";var i=typeof n;return i==="object"&&(Array.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="Array")?"array":i==="object"&&(String.prototype.isPrototypeOf(n)||n.constructor&&n.constructor.name==="String")?"string":i},t=function(n){return["undefined","boolean","number","string","function","xml","null"].indexOf(n)!==-1},s=function(n,i){var c=Array.prototype.slice.call(n);return c.sort(i)},a=function(n,i){return l(function(c,m){return n.eq(i(c),i(m))})},l=function(n){return{eq:n}},u=l(function(n,i){return n===i}),d=u,h=function(n){return l(function(i,c){if(i.length!==c.length)return!1;for(var m=i.length,p=0;p{var m;return c(n,i.prototype)?!0:((m=n.constructor)===null||m===void 0?void 0:m.name)===i.name},$=n=>{const i=typeof n;return n===null?"null":i==="object"&&Array.isArray(n)?"array":i==="object"&&R(n,String,(c,m)=>m.isPrototypeOf(c))?"string":i},Q=n=>i=>$(i)===n,F=n=>i=>typeof i===n,U=n=>i=>n===i,K=(n,i)=>te(n)&&R(n,i,(c,m)=>E(c)===m),L=Q("string"),te=Q("object"),ne=n=>K(n,Object),oe=Q("array"),G=U(null),we=F("boolean"),ve=U(void 0),Re=n=>n==null,Oe=n=>!Re(n),ce=F("function"),Xe=F("number"),tt=(n,i)=>{if(oe(n)){for(let c=0,m=n.length;c{},V=(n,i)=>(...c)=>n(i.apply(null,c)),ut=(n,i)=>c=>n(i(c)),Qe=n=>()=>n,Bt=n=>n,Ct=(n,i)=>n===i;function He(n,...i){return(...c)=>{const m=i.concat(c);return n.apply(null,m)}}const st=n=>i=>!n(i),rn=n=>()=>{throw new Error(n)},Et=n=>n(),Cn=n=>{n()},je=Qe(!1),mt=Qe(!0);class he{constructor(i,c){this.tag=i,this.value=c}static some(i){return new he(!0,i)}static none(){return he.singletonNone}fold(i,c){return this.tag?c(this.value):i()}isSome(){return this.tag}isNone(){return!this.tag}map(i){return this.tag?he.some(i(this.value)):he.none()}bind(i){return this.tag?i(this.value):he.none()}exists(i){return this.tag&&i(this.value)}forall(i){return!this.tag||i(this.value)}filter(i){return!this.tag||i(this.value)?this:he.none()}getOr(i){return this.tag?this.value:i}or(i){return this.tag?this:i}getOrThunk(i){return this.tag?this.value:i()}orThunk(i){return this.tag?this:i()}getOrDie(i){if(this.tag)return this.value;throw new Error(i!=null?i:"Called getOrDie on None")}static from(i){return Oe(i)?he.some(i):he.none()}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(i){this.tag&&i(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}he.singletonNone=new he(!1);const Zo=Array.prototype.slice,Kn=Array.prototype.indexOf,so=Array.prototype.push,Yo=(n,i)=>Kn.call(n,i),as=(n,i)=>{const c=Yo(n,i);return c===-1?he.none():he.some(c)},kt=(n,i)=>Yo(n,i)>-1,jt=(n,i)=>{for(let c=0,m=n.length;c{const c=n.length,m=new Array(c);for(let p=0;p{for(let c=0,m=n.length;c{for(let c=n.length-1;c>=0;c--){const m=n[c];i(m,c)}},bn=(n,i)=>{const c=[],m=[];for(let p=0,w=n.length;p{const c=[];for(let m=0,p=n.length;m(Gt(n,(m,p)=>{c=i(c,m,p)}),c),zn=(n,i,c)=>(Ne(n,(m,p)=>{c=i(c,m,p)}),c),ps=(n,i,c)=>{for(let m=0,p=n.length;mps(n,i,je),Ss=(n,i)=>{for(let c=0,m=n.length;c{const i=[];for(let c=0,m=n.length;cMr(pt(n,i)),tr=(n,i)=>{for(let c=0,m=n.length;c{const i=Zo.call(n,0);return i.reverse(),i},wa=(n,i)=>At(n,c=>!kt(i,c)),dr=(n,i)=>{const c={};for(let m=0,p=n.length;m{const c=Zo.call(n,0);return c.sort(i),c},qr=(n,i)=>i>=0&&iqr(n,0),Po=n=>qr(n,n.length-1),Rr=ce(Array.from)?Array.from:n=>Zo.call(n),Ls=(n,i)=>{for(let c=0;c{const c=[],m=ce(i)?p=>jt(c,w=>i(w,p)):p=>kt(c,p);for(let p=0,w=n.length;p{const c=bs(n);for(let m=0,p=c.length;mQi(n,(c,m)=>({k:m,v:i(c,m)})),Qi=(n,i)=>{const c={};return ln(n,(m,p)=>{const w=i(m,p);c[w.k]=w.v}),c},ze=n=>(i,c)=>{n[c]=i},et=(n,i,c,m)=>{ln(n,(p,w)=>{(i(p,w)?c:m)(p,w)})},Tt=(n,i)=>{const c={},m={};return et(n,i,ze(c),ze(m)),{t:c,f:m}},Wt=(n,i)=>{const c={};return et(n,i,ze(c),ot),c},Yn=(n,i)=>{const c=[];return ln(n,(m,p)=>{c.push(i(m,p))}),c},po=n=>Yn(n,Bt),wo=(n,i)=>un(n,i)?he.from(n[i]):he.none(),un=(n,i)=>_a.call(n,i),os=(n,i)=>un(n,i)&&n[i]!==void 0&&n[i]!==null,xo=(n,i,c=C)=>y(c).eq(n,i),fs=n=>{const i={};return Ne(n,c=>{i[c]={}}),bs(i)},kr=n=>n.length!==void 0,Lr=Array.isArray,Vs=n=>{if(Lr(n))return n;{const i=[];for(let c=0,m=n.length;c{if(!n)return!1;if(c=c||n,kr(n)){for(let m=0,p=n.length;m{const c=[];return Yr(n,(m,p)=>{c.push(i(m,p,n))}),c},Qa=(n,i)=>{const c=[];return Yr(n,(m,p)=>{(!i||i(m,p,n))&&c.push(m)}),c},Oi=(n,i)=>{if(n){for(let c=0,m=n.length;c{let p=ve(c)?n[0]:c;for(let w=0;w{for(let m=0,p=n.length;mn[n.length-1],Ut=n=>{let i=!1,c;return(...m)=>(i||(i=!0,c=n.apply(null,m)),c)},bo=(n,i,c,m)=>{const p=n.isiOS()&&/ipad/i.test(c)===!0,w=n.isiOS()&&!p,x=n.isiOS()||n.isAndroid(),M=x||m("(pointer:coarse)"),B=p||!w&&x&&m("(min-device-width:768px)"),q=w||x&&!B,ae=i.isSafari()&&n.isiOS()&&/safari/i.test(c)===!1,fe=!q&&!B&&!ae;return{isiPad:Qe(p),isiPhone:Qe(w),isTablet:Qe(B),isPhone:Qe(q),isTouch:Qe(M),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:Qe(ae),isDesktop:Qe(fe)}},Lo=(n,i)=>{for(let c=0;c{const c=Lo(n,i);if(!c)return{major:0,minor:0};const m=p=>Number(i.replace(c,"$"+p));return Xo(m(1),m(2))},ei=(n,i)=>{const c=String(i).toLowerCase();return n.length===0?lt():Go(n,c)},lt=()=>Xo(0,0),Xo=(n,i)=>({major:n,minor:i}),Ni={nu:Xo,detect:ei,unknown:lt},la=(n,i)=>Ls(i.brands,c=>{const m=c.brand.toLowerCase();return oo(n,p=>{var w;return m===((w=p.brand)===null||w===void 0?void 0:w.toLowerCase())}).map(p=>({current:p.name,version:Ni.nu(parseInt(c.version,10),0)}))}),ma=(n,i)=>{const c=String(i).toLowerCase();return oo(n,m=>m.search(c))},gr=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Fc=(n,i)=>ma(n,i).map(c=>{const m=Ni.detect(c.versionRegexes,i);return{current:c.name,version:m}}),Cc=(n,i)=>n.substring(i),nl=(n,i,c)=>i===""||n.length>=i.length&&n.substr(c,c+i.length)===i,ga=(n,i)=>Ar(n,i)?Cc(n,i.length):n,nr=(n,i,c=0,m)=>{const p=n.indexOf(i,c);return p!==-1?ve(m)?!0:p+i.length<=m:!1},Ar=(n,i)=>nl(n,i,0),Ki=(n,i)=>nl(n,i,n.length-i.length),gl=n=>i=>i.replace(n,""),kc=gl(/^\s+|\s+$/g),nu=gl(/^\s+/g),xu=gl(/\s+$/g),yr=n=>n.length>0,ol=n=>!yr(n),Tu=(n,i)=>i<=0?"":new Array(i+1).join(n),ou=(n,i=10)=>{const c=parseInt(n,i);return isNaN(c)?he.none():he.some(c)},Yl=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,Aa=n=>i=>nr(i,n),Dr=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:n=>nr(n,"edge/")&&nr(n,"chrome")&&nr(n,"safari")&&nr(n,"applewebkit")},{name:"Chromium",brand:"Chromium",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,Yl],search:n=>nr(n,"chrome")&&!nr(n,"chromeframe")},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:n=>nr(n,"msie")||nr(n,"trident")},{name:"Opera",versionRegexes:[Yl,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:Aa("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:Aa("firefox")},{name:"Safari",versionRegexes:[Yl,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:n=>(nr(n,"safari")||nr(n,"mobile/"))&&nr(n,"applewebkit")}],Qm=[{name:"Windows",search:Aa("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:n=>nr(n,"iphone")||nr(n,"ipad"),versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:Aa("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"macOS",search:Aa("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:Aa("linux"),versionRegexes:[]},{name:"Solaris",search:Aa("sunos"),versionRegexes:[]},{name:"FreeBSD",search:Aa("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:Aa("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],xf={browsers:Qe(Dr),oses:Qe(Qm)},xr="Edge",Za="Chromium",ca="IE",Ji="Opera",Eu="Firefox",Qc="Safari",Ha=()=>Zc({current:void 0,version:Ni.unknown()}),Zc=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isEdge:m(xr),isChromium:m(Za),isIE:m(ca),isOpera:m(Ji),isFirefox:m(Eu),isSafari:m(Qc)}},xc={unknown:Ha,nu:Zc,edge:Qe(xr),chromium:Qe(Za),ie:Qe(ca),opera:Qe(Ji),firefox:Qe(Eu),safari:Qe(Qc)},Cd="Windows",Yf="iOS",Au="Android",Xl="Linux",Hc="macOS",Tf="Solaris",su="FreeBSD",kd="ChromeOS",De=()=>nt({current:void 0,version:Ni.unknown()}),nt=n=>{const i=n.current,c=n.version,m=p=>()=>i===p;return{current:i,version:c,isWindows:m(Cd),isiOS:m(Yf),isAndroid:m(Au),isMacOS:m(Hc),isLinux:m(Xl),isSolaris:m(Tf),isFreeBSD:m(su),isChromeOS:m(kd)}},bt={unknown:De,nu:nt,windows:Qe(Cd),ios:Qe(Yf),android:Qe(Au),linux:Qe(Xl),macos:Qe(Hc),solaris:Qe(Tf),freebsd:Qe(su),chromeos:Qe(kd)},On={detect:(n,i,c)=>{const m=xf.browsers(),p=xf.oses(),w=i.bind(B=>la(m,B)).orThunk(()=>gr(m,n)).fold(xc.unknown,xc.nu),x=Fc(p,n).fold(bt.unknown,bt.nu),M=bo(x,w,n,c);return{browser:w,os:x,deviceType:M}}},Mo=n=>window.matchMedia(n).matches;let $r=Ut(()=>On.detect(navigator.userAgent,he.from(navigator.userAgentData),Mo));const ys=()=>$r(),ls=navigator.userAgent,Di=ys(),js=Di.browser,Hi=Di.os,Du=Di.deviceType,xd=ls.indexOf("Windows Phone")!==-1,qn={transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",documentMode:js.isIE()?document.documentMode||7:10,cacheSuffix:null,container:null,canHaveCSP:!js.isIE(),windowsPhone:xd,browser:{current:js.current,version:js.version,isChromium:js.isChromium,isEdge:js.isEdge,isFirefox:js.isFirefox,isIE:js.isIE,isOpera:js.isOpera,isSafari:js.isSafari},os:{current:Hi.current,version:Hi.version,isAndroid:Hi.isAndroid,isChromeOS:Hi.isChromeOS,isFreeBSD:Hi.isFreeBSD,isiOS:Hi.isiOS,isLinux:Hi.isLinux,isMacOS:Hi.isMacOS,isSolaris:Hi.isSolaris,isWindows:Hi.isWindows},deviceType:{isDesktop:Du.isDesktop,isiPad:Du.isiPad,isiPhone:Du.isiPhone,isPhone:Du.isPhone,isTablet:Du.isTablet,isTouch:Du.isTouch,isWebView:Du.isWebView}},Zm=/^\s*|\s*$/g,zi=n=>Re(n)?"":(""+n).replace(Zm,""),me=(n,i)=>i?i==="array"&&Lr(n)?!0:typeof n===i:n!==void 0,$e=(n,i,c={})=>{const m=L(n)?n.split(i||","):n||[];let p=m.length;for(;p--;)c[m[p]]={};return c},Ue=un,It=(n,...i)=>{for(let c=0;ci.call(m,p,w,c)===!1?!1:(Bn(p,i,c,m),!0)))},gn={trim:zi,isArray:Lr,is:me,toArray:Vs,makeMap:$e,each:Yr,map:Zi,grep:Qa,inArray:Oi,hasOwn:Ue,extend:It,walk:Bn,resolve:(n,i=window)=>{const c=n.split(".");for(let m=0,p=c.length;moe(n)?n:n===""?[]:Zi(n.split(i||","),zi),_addCacheSuffix:n=>{const i=qn.cacheSuffix;return i&&(n+=(n.indexOf("?")===-1?"?":"&")+i),n}},Gr=(n,i,c=Ct)=>n.exists(m=>c(m,i)),Ll=(n,i,c=Ct)=>ri(n,i,c).getOr(n.isNone()&&i.isNone()),ea=n=>{const i=[],c=m=>{i.push(m)};for(let m=0;mn.isSome()&&i.isSome()?he.some(c(n.getOrDie(),i.getOrDie())):he.none(),Ef=(n,i,c,m)=>n.isSome()&&i.isSome()&&c.isSome()?he.some(m(n.getOrDie(),i.getOrDie(),c.getOrDie())):he.none(),ks=(n,i)=>n?he.some(i):he.none(),ru=typeof window<"u"?window:Function("return this;")(),Pi=(n,i)=>{let c=i!=null?i:ru;for(let m=0;m{const c=n.split(".");return Pi(c,i)},Ii=(n,i)=>uc(n,i),Xf=(n,i)=>{const c=Ii(n,i);if(c==null)throw new Error(n+" not available on this browser");return c},pa=Object.getPrototypeOf,jf=n=>Xf("HTMLElement",n),pr=n=>{const i=uc("ownerDocument.defaultView",n);return te(n)&&(jf(i).prototype.isPrototypeOf(n)||/^HTML\w*Element$/.test(pa(n).constructor.name))},Gu=8,Ku=9,Tc=11,qf=1,eh=3,ti=n=>n.dom.nodeName.toLowerCase(),ta=n=>n.dom.nodeType,za=n=>i=>ta(i)===n,Kb=n=>ta(n)===Gu||ti(n)==="#comment",Mi=n=>kl(n)&&pr(n.dom),kl=za(qf),sl=za(eh),Zg=za(Ku),Gf=za(Tc),Ec=n=>i=>kl(i)&&ti(i)===n,Af=(n,i,c)=>{if(L(c)||we(c)||Xe(c))n.setAttribute(i,c+"");else throw console.error("Invalid call to Attribute.set. Key ",i,":: Value ",c,":: Element ",n),new Error("Attribute value was not simple")},Pr=(n,i,c)=>{Af(n.dom,i,c)},Ju=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{Af(c,p,m)})},Fl=(n,i)=>{const c=n.dom.getAttribute(i);return c===null?void 0:c},Va=(n,i)=>he.from(Fl(n,i)),qi=(n,i)=>{const c=n.dom;return c&&c.hasAttribute?c.hasAttribute(i):!1},Vi=(n,i)=>{n.dom.removeAttribute(i)},fc=n=>{const i=n.dom.attributes;return i==null||i.length===0},Kf=n=>zn(n.dom.attributes,(i,c)=>(i[c.name]=c.value,i),{}),th=(n,i)=>{const c=Fl(n,i);return c===void 0||c===""?[]:c.split(" ")},Hg=(n,i,c)=>{const p=th(n,i).concat([c]);return Pr(n,i,p.join(" ")),!0},Hm=(n,i,c)=>{const m=At(th(n,i),p=>p!==c);return m.length>0?Pr(n,i,m.join(" ")):Vi(n,i),!1},Ql=n=>n.dom.classList!==void 0,zm=n=>th(n,"class"),rl=(n,i)=>Hg(n,"class",i),Df=(n,i)=>Hm(n,"class",i),jh=(n,i)=>kt(zm(n),i)?Df(n,i):rl(n,i),ef=(n,i)=>{Ql(n)?n.dom.classList.add(i):rl(n,i)},qh=n=>{(Ql(n)?n.dom.classList:zm(n)).length===0&&Vi(n,"class")},zc=(n,i)=>{Ql(n)?n.dom.classList.remove(i):Df(n,i),qh(n)},Gh=(n,i)=>{const c=Ql(n)?n.dom.classList.toggle(i):jh(n,i);return qh(n),c},Pf=(n,i)=>Ql(n)&&n.dom.classList.contains(i),zp=(n,i)=>{const m=(i||document).createElement("div");if(m.innerHTML=n,!m.hasChildNodes()||m.childNodes.length>1){const p="HTML does not have a single root node";throw console.error(p,n),new Error(p)}return jl(m.childNodes[0])},Vm=(n,i)=>{const m=(i||document).createElement(n);return jl(m)},Jf=(n,i)=>{const m=(i||document).createTextNode(n);return jl(m)},jl=n=>{if(n==null)throw new Error("Node cannot be null or undefined");return{dom:n}},Ke={fromHtml:zp,fromTag:Vm,fromText:Jf,fromDom:jl,fromPoint:(n,i,c)=>he.from(n.dom.elementFromPoint(i,c)).map(jl)},nh=(n,i)=>{const c=[],m=w=>(c.push(w),i(w));let p=i(n);do p=p.bind(m);while(p.isSome());return c},Pu=(n,i)=>{const c=n.dom;if(c.nodeType!==qf)return!1;{const m=c;if(m.matches!==void 0)return m.matches(i);if(m.msMatchesSelector!==void 0)return m.msMatchesSelector(i);if(m.webkitMatchesSelector!==void 0)return m.webkitMatchesSelector(i);if(m.mozMatchesSelector!==void 0)return m.mozMatchesSelector(i);throw new Error("Browser lacks native selectors")}},Vg=n=>n.nodeType!==qf&&n.nodeType!==Ku&&n.nodeType!==Tc||n.childElementCount===0,U1=(n,i)=>{const c=i===void 0?document:i.dom;return Vg(c)?[]:pt(c.querySelectorAll(n),Ke.fromDom)},Kh=(n,i)=>{const c=i===void 0?document:i.dom;return Vg(c)?he.none():he.from(c.querySelector(n)).map(Ke.fromDom)},vt=(n,i)=>n.dom===i.dom,cn=(n,i)=>{const c=n.dom,m=i.dom;return c===m?!1:c.contains(m)},an=n=>Ke.fromDom(n.dom.ownerDocument),Eo=n=>Zg(n)?n:an(n),or=n=>Ke.fromDom(Eo(n).dom.documentElement),Xr=n=>Ke.fromDom(Eo(n).dom.defaultView),fi=n=>he.from(n.dom.parentNode).map(Ke.fromDom),wi=n=>he.from(n.dom.parentElement).map(Ke.fromDom),oh=(n,i)=>{const c=ce(i)?i:je;let m=n.dom;const p=[];for(;m.parentNode!==null&&m.parentNode!==void 0;){const w=m.parentNode,x=Ke.fromDom(w);if(p.push(x),c(x)===!0)break;m=w}return p},Jb=n=>{const i=c=>At(c,m=>!vt(n,m));return fi(n).map(Da).map(i).getOr([])},Sa=n=>he.from(n.dom.previousSibling).map(Ke.fromDom),Td=n=>he.from(n.dom.nextSibling).map(Ke.fromDom),Wg=n=>Xs(nh(n,Sa)),il=n=>nh(n,Td),Da=n=>pt(n.dom.childNodes,Ke.fromDom),tf=(n,i)=>{const c=n.dom.childNodes;return he.from(c[i]).map(Ke.fromDom)},ii=n=>tf(n,0),Mu=n=>tf(n,n.dom.childNodes.length-1),dc=n=>n.dom.childNodes.length,Jh=n=>n.dom.hasChildNodes(),Y1=n=>{const i=n.dom.head;if(i==null)throw new Error("Head is not available yet");return Ke.fromDom(i)},sh=n=>Gf(n)&&Oe(n.dom.host),Ug=ce(Element.prototype.attachShadow)&&ce(Node.prototype.getRootNode),rh=Qe(Ug),ql=Ug?n=>Ke.fromDom(n.dom.getRootNode()):Eo,em=n=>sh(n)?n:Y1(Eo(n)),X1=n=>sh(n)?n:Ke.fromDom(Eo(n).dom.body),Wm=n=>{const i=ql(n);return sh(i)?he.some(i):he.none()},Yg=n=>Ke.fromDom(n.dom.host),tm=n=>{if(rh()&&Oe(n.target)){const i=Ke.fromDom(n.target);if(kl(i)&&ih(i)&&n.composed&&n.composedPath){const c=n.composedPath();if(c)return $o(c)}}return he.from(n.target)},ih=n=>Oe(n.dom.shadowRoot),Ed=n=>{const i=sl(n)?n.dom.parentNode:n.dom;if(i==null||i.ownerDocument===null)return!1;const c=i.ownerDocument;return Wm(Ke.fromDom(i)).fold(()=>c.body.contains(i),ut(Ed,Yg))};var ai=(n,i,c,m,p)=>n(c,m)?he.some(c):ce(p)&&p(c)?he.none():i(c,m,p);const di=(n,i,c)=>{let m=n.dom;const p=ce(c)?c:je;for(;m.parentNode;){m=m.parentNode;const w=Ke.fromDom(m);if(i(w))return he.some(w);if(p(w))break}return he.none()},Zl=(n,i,c)=>ai((p,w)=>w(p),di,n,i,c),Vp=(n,i)=>{const c=n.dom;return c.parentNode?ee(Ke.fromDom(c.parentNode),m=>!vt(n,m)&&i(m)):he.none()},ee=(n,i)=>{const c=p=>i(Ke.fromDom(p));return oo(n.dom.childNodes,c).map(Ke.fromDom)},ue=(n,i)=>{const c=m=>{for(let p=0;pdi(n,m=>Pu(m,i),c),Je=(n,i)=>Kh(i,n),at=(n,i,c)=>ai((p,w)=>Pu(p,w),Se,n,i,c),Dn=n=>at(n,"[contenteditable]"),wn=(n,i=!1)=>Ed(n)?n.dom.isContentEditable:Dn(n).fold(Qe(i),c=>Ko(c)==="true"),Ko=n=>n.dom.contentEditable,ss=n=>n.style!==void 0&&ce(n.style.getPropertyValue),vo=(n,i,c)=>{if(!L(c))throw console.error("Invalid call to CSS.set. Property ",i,":: Value ",c,":: Element ",n),new Error("CSS value must be a string: "+c);ss(n)&&n.style.setProperty(i,c)},Tr=(n,i)=>{ss(n)&&n.style.removeProperty(i)},Gl=(n,i,c)=>{const m=n.dom;vo(m,i,c)},ua=(n,i)=>{const c=n.dom;ln(i,(m,p)=>{vo(c,p,m)})},Bi=(n,i)=>{const c=n.dom,p=window.getComputedStyle(c).getPropertyValue(i);return p===""&&!Ed(n)?Ru(c,i):p},Ru=(n,i)=>ss(n)?n.style.getPropertyValue(i):"",Pa=(n,i)=>{const c=n.dom,m=Ru(c,i);return he.from(m).filter(p=>p.length>0)},nm=n=>{const i={},c=n.dom;if(ss(c))for(let m=0;m{const c=n.dom;Tr(c,i),Gr(Va(n,"style").map(kc),"")&&Vi(n,"style")},Wi=n=>n.dom.offsetWidth,Ca=(n,i)=>{fi(n).each(m=>{m.dom.insertBefore(i.dom,n.dom)})},iu=(n,i)=>{Td(n).fold(()=>{fi(n).each(p=>{na(p,i)})},m=>{Ca(m,i)})},ah=(n,i)=>{ii(n).fold(()=>{na(n,i)},m=>{n.dom.insertBefore(i.dom,m.dom)})},na=(n,i)=>{n.dom.appendChild(i.dom)},e0=(n,i)=>{Ca(n,i),na(i,n)},Dv=(n,i)=>{Ne(i,(c,m)=>{const p=m===0?n:i[m-1];iu(p,c)})},ni=(n,i)=>{Ne(i,c=>{na(n,c)})},Ad=n=>{n.dom.textContent="",Ne(Da(n),i=>{wr(i)})},wr=n=>{const i=n.dom;i.parentNode!==null&&i.parentNode.removeChild(i)},Kl=n=>{const i=Da(n);i.length>0&&Dv(n,i),wr(n)},ed=(n,i)=>{const m=(i||document).createElement("div");return m.innerHTML=n,Da(Ke.fromDom(m))},lh=n=>pt(n,Ke.fromDom),Ae=n=>n.dom.innerHTML,Mf=(n,i)=>{const m=an(n).dom,p=Ke.fromDom(m.createDocumentFragment()),w=ed(i,m);ni(p,w),Ad(n),na(n,p)},Xg=n=>{const i=Ke.fromTag("div"),c=Ke.fromDom(n.dom.cloneNode(!0));return na(i,c),Ae(i)},$u=(n,i,c,m,p,w,x)=>({target:n,x:i,y:c,stop:m,prevent:p,kill:w,raw:x}),hi=n=>{const i=Ke.fromDom(tm(n).getOr(n.target)),c=()=>n.stopPropagation(),m=()=>n.preventDefault(),p=V(m,c);return $u(i,n.clientX,n.clientY,c,m,p,n)},Pv=(n,i)=>c=>{n(c)&&i(hi(c))},j1=(n,i,c,m,p)=>{const w=Pv(c,m);return n.dom.addEventListener(i,w,p),{unbind:He(td,n,i,w,p)}},t0=(n,i,c,m)=>j1(n,i,c,m,!1),td=(n,i,c,m)=>{n.dom.removeEventListener(i,c,m)},Ym=(n,i)=>({left:n,top:i,translate:(m,p)=>Ym(n+m,i+p)}),jg=Ym,Mv=n=>{const i=n.getBoundingClientRect();return jg(i.left,i.top)},Rf=(n,i)=>n!==void 0?n:i!==void 0?i:0,xy=n=>{const i=n.dom.ownerDocument,c=i.body,m=i.defaultView,p=i.documentElement;if(c===n.dom)return jg(c.offsetLeft,c.offsetTop);const w=Rf(m==null?void 0:m.pageYOffset,p.scrollTop),x=Rf(m==null?void 0:m.pageXOffset,p.scrollLeft),M=Rf(p.clientTop,c.clientTop),B=Rf(p.clientLeft,c.clientLeft);return Nu(n).translate(x-B,w-M)},Nu=n=>{const i=n.dom,m=i.ownerDocument.body;return m===i?jg(m.offsetLeft,m.offsetTop):Ed(n)?Mv(i):jg(0,0)},nf=n=>{const i=n!==void 0?n.dom:document,c=i.body.scrollLeft||i.documentElement.scrollLeft,m=i.body.scrollTop||i.documentElement.scrollTop;return jg(c,m)},n0=(n,i,c)=>{const p=(c!==void 0?c.dom:document).defaultView;p&&p.scrollTo(n,i)},o0=(n,i)=>{ys().browser.isSafari()&&ce(n.dom.scrollIntoViewIfNeeded)?n.dom.scrollIntoViewIfNeeded(!1):n.dom.scrollIntoView(i)},s0=n=>{const i=n===void 0?window:n;return ys().browser.isFirefox()?he.none():he.from(i.visualViewport)},q1=(n,i,c,m)=>({x:n,y:i,width:c,height:m,right:n+c,bottom:i+m}),nd=n=>{const i=n===void 0?window:n,c=i.document,m=nf(Ke.fromDom(c));return s0(i).fold(()=>{const p=i.document.documentElement,w=p.clientWidth,x=p.clientHeight;return q1(m.left,m.top,w,x)},p=>q1(Math.max(p.pageLeft,m.left),Math.max(p.pageTop,m.top),p.width,p.height))},r0=(n,i)=>At(Da(n),i),i0=(n,i)=>{let c=[];return Ne(Da(n),m=>{i(m)&&(c=c.concat([m])),c=c.concat(i0(m,i))}),c},pl=(n,i)=>U1(i,n),Ty=(n,i,c)=>Se(n,i,c).isSome();class _i{constructor(i,c){this.node=i,this.rootNode=c,this.current=this.current.bind(this),this.next=this.next.bind(this),this.prev=this.prev.bind(this),this.prev2=this.prev2.bind(this)}current(){return this.node}next(i){return this.node=this.findSibling(this.node,"firstChild","nextSibling",i),this.node}prev(i){return this.node=this.findSibling(this.node,"lastChild","previousSibling",i),this.node}prev2(i){return this.node=this.findPreviousNode(this.node,i),this.node}findSibling(i,c,m,p){if(i){if(!p&&i[c])return i[c];if(i!==this.rootNode){let w=i[m];if(w)return w;for(let x=i.parentNode;x&&x!==this.rootNode;x=x.parentNode)if(w=x[m],w)return w}}}findPreviousNode(i,c){if(i){const m=i.previousSibling;if(this.rootNode&&m===this.rootNode)return;if(m){if(!c){for(let w=m.lastChild;w;w=w.lastChild)if(!w.lastChild)return w}return m}const p=i.parentNode;if(p&&p!==this.rootNode)return p}}}const fo=n=>i=>!!i&&i.nodeType===n,Dd=n=>!!n&&!Object.getPrototypeOf(n),Jn=fo(1),Ac=n=>{const i=n.toLowerCase();return c=>Oe(c)&&c.nodeName.toLowerCase()===i},$f=n=>{const i=n.map(c=>c.toLowerCase());return c=>{if(c&&c.nodeName){const m=c.nodeName.toLowerCase();return kt(i,m)}return!1}},ch=(n,i)=>{const c=i.toLowerCase().split(" ");return m=>{if(Jn(m)){const p=m.ownerDocument.defaultView;if(p)for(let w=0;wi=>Jn(i)&&i.hasAttribute(n),qg=(n,i)=>c=>Jn(c)&&c.getAttribute(n)===i,Pd=n=>Jn(n)&&n.hasAttribute("data-mce-bogus"),bl=n=>Jn(n)&&n.getAttribute("data-mce-bogus")==="all",Iu=n=>Jn(n)&&n.tagName==="TABLE",Wp=n=>i=>!!(Jn(i)&&(i.contentEditable===n||i.getAttribute("data-mce-contenteditable")===n)),G1=$f(["textarea","input"]),_n=fo(3),Xm=fo(4),Md=fo(7),uh=fo(8),of=fo(9),K1=fo(11),mi=Ac("br"),Ui=Ac("img"),ba=Wp("true"),Es=Wp("false"),Rd=$f(["td","th"]),xl=$f(["td","th","caption"]),sf=$f(["video","audio","object","embed"]),Wa=Ac("li"),ka=Ac("details"),Up=Ac("summary"),nn="\uFEFF",Kr="\xA0",a0=n=>n===nn,xa=n=>n.replace(/\uFEFF/g,""),Gg=((n,i)=>{const c=w=>{if(!n(w))throw new Error("Can only get "+i+" value of a "+i+" node");return m(w).getOr("")},m=w=>n(w)?he.from(w.dom.nodeValue):he.none();return{get:c,getOption:m,set:(w,x)=>{if(!n(w))throw new Error("Can only set raw "+i+" value of a "+i+" node");w.dom.nodeValue=x}}})(sl,"text"),Wc=n=>Gg.get(n),od=n=>Gg.getOption(n),sd=(n,i)=>Gg.set(n,i),Yp=["article","aside","details","div","dt","figcaption","footer","form","fieldset","header","hgroup","html","main","nav","section","summary","body","p","dl","multicol","dd","figure","address","center","blockquote","h1","h2","h3","h4","h5","h6","listing","xmp","pre","plaintext","menu","dir","ul","ol","li","hr","table","tbody","thead","tfoot","th","tr","td","caption"],Hl=["td","th"],Er=["thead","tbody","tfoot"],Ya=["h1","h2","h3","h4","h5","h6","p","div","address","pre","form","blockquote","center","dir","fieldset","header","footer","article","section","hgroup","aside","nav","figure"],fh=["h1","h2","h3","h4","h5","h6"],Jl=["li","dd","dt"],l0=["ul","ol","dl"],jm=["pre","script","textarea","style"],J1=["pre"].concat(fh),Xa=n=>{let i;return c=>(i=i||dr(n,mt),un(i,ti(c)))},hc=Xa(Yp),xt=n=>ti(n)==="table",Dc=n=>kl(n)&&!hc(n),au=n=>kl(n)&&ti(n)==="br",mc=Xa(Ya),Bu=Xa(l0),ja=Xa(Jl),qa=Xa(Er),qm=Xa(Hl),lu=Xa(jm),c0=Xa(J1),Ho=n=>c0(n)||Dc(n),z=n=>{const i=[];let c=n.dom;for(;c;)i.push(Ke.fromDom(c)),c=c.lastChild;return i},j=n=>{const i=pl(n,"br"),c=At(z(n).slice(-1),au);i.length===c.length&&Ne(c,wr)},ye=()=>{const n=Ke.fromTag("br");return Pr(n,"data-mce-bogus","1"),n},Pe=n=>{Ad(n),na(n,ye())},ct=n=>{Mu(n).each(i=>{Sa(i).each(c=>{hc(n)&&au(i)&&hc(c)&&wr(i)})})},Ft=nn,Sn=a0,In=xa,Uo=Jn,ts=_n,Si=n=>(ts(n)&&(n=n.parentNode),Uo(n)&&n.hasAttribute("data-mce-caret")),sr=n=>ts(n)&&Sn(n.data),_r=n=>Si(n)||sr(n),Uc=n=>n.firstChild!==n.lastChild||!mi(n.firstChild),cu=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft),w=n.parentNode;if(i){const x=n.previousSibling;if(ts(x)){if(_r(x))return x;if(hr(x))return x.splitText(x.data.length-1)}w==null||w.insertBefore(p,n)}else{const x=n.nextSibling;if(ts(x)){if(_r(x))return x;if(hh(x))return x.splitText(1),x}n.nextSibling?w==null||w.insertBefore(p,n.nextSibling):w==null||w.appendChild(p)}return p},rf=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset())===Ft||n.isAtStart()&&sr(i.previousSibling):!1},Nf=n=>{const i=n.container();return _n(i)?i.data.charAt(n.offset()-1)===Ft||n.isAtEnd()&&sr(i.nextSibling):!1},dh=(n,i,c)=>{var m;const w=((m=i.ownerDocument)!==null&&m!==void 0?m:document).createElement(n);w.setAttribute("data-mce-caret",c?"before":"after"),w.setAttribute("data-mce-bogus","all"),w.appendChild(ye().dom);const x=i.parentNode;return c?x==null||x.insertBefore(w,i):i.nextSibling?x==null||x.insertBefore(w,i.nextSibling):x==null||x.appendChild(w),w},hh=n=>ts(n)&&n.data[0]===Ft,hr=n=>ts(n)&&n.data[n.data.length-1]===Ft,Gm=n=>{var i;const c=n.getElementsByTagName("br"),m=c[c.length-1];Pd(m)&&((i=m.parentNode)===null||i===void 0||i.removeChild(m))},Km=n=>n&&n.hasAttribute("data-mce-caret")?(Gm(n),n.removeAttribute("data-mce-caret"),n.removeAttribute("data-mce-bogus"),n.removeAttribute("style"),n.removeAttribute("data-mce-style"),n.removeAttribute("_moz_abspos"),n):null,oa=n=>Si(n.startContainer),uu=ba,Xp=Es,Jm=mi,Ps=_n,Fr=$f(["script","style","textarea"]),Ma=$f(["img","input","textarea","hr","iframe","video","audio","object","embed"]),gc=$f(["table"]),eb=_r,Tl=n=>eb(n)?!1:Ps(n)?!Fr(n.parentNode):Ma(n)||Jm(n)||gc(n)||fu(n),Gi=n=>Jn(n)&&n.getAttribute("unselectable")==="true",fu=n=>!Gi(n)&&Xp(n),If=(n,i)=>{for(let c=n.parentNode;c&&c!==i;c=c.parentNode){if(fu(c))return!1;if(uu(c))return!0}return!0},Jw=n=>fu(n)?!zn(Rr(n.getElementsByTagName("*")),(i,c)=>i||uu(c),!1):!1,om=n=>Ma(n)||Jw(n),Kg=(n,i)=>Tl(n)&&If(n,i),sm=/^[ \t\r\n]*$/,eg=n=>sm.test(n),Jg=n=>{for(const i of n)if(!a0(i))return!1;return!0},u0=n=>" \f \v".indexOf(n)!==-1,rm=n=>n===` `||n==="\r",Ra=(n,i)=>i=0?rm(n[i]):!1,mh=(n,i=4,c=!0,m=!0)=>{const p=Tu(" ",i),w=n.replace(/\t/g,p);return zn(w,(M,B)=>u0(B)||B===Kr?M.pcIsSpace||M.str===""&&c||M.str.length===w.length-1&&m||Ra(w,M.str.length+1)?{pcIsSpace:!1,str:M.str+Kr}:{pcIsSpace:!0,str:M.str+" "}:{pcIsSpace:rm(B),str:M.str+B},{pcIsSpace:!1,str:""}).str},$d=(n,i)=>{const c=Ke.fromDom(i),m=Ke.fromDom(n);return Ty(m,"pre,code",He(vt,c))},tg=(n,i)=>_n(n)&&eg(n.data)&&!$d(n,i),ng=n=>Jn(n)&&n.nodeName==="A"&&!n.hasAttribute("href")&&(n.hasAttribute("name")||n.hasAttribute("id")),im=(n,i)=>Tl(n)&&!tg(n,i)||ng(n)||af(n),af=Vc("data-mce-bookmark"),f0=Vc("data-mce-bogus"),tb=qg("data-mce-bogus","all"),e_=(n,i)=>{let c=0;if(im(n,n))return!1;{let m=n.firstChild;if(!m)return!0;const p=new _i(m,n);do{if(i){if(tb(m)){m=p.next(!0);continue}if(f0(m)){m=p.next();continue}}if(mi(m)){c++,m=p.next();continue}if(im(m,n))return!1;m=p.next()}while(m);return c<=1}},$a=(n,i=!0)=>e_(n.dom,i),ep="data-mce-block",og=n=>At(bs(n),i=>!/[A-Z]/.test(i)),du=n=>og(n).join(","),Bf=(n,i)=>Oe(i.querySelector(n))?(i.setAttribute(ep,"true"),i.getAttribute("data-mce-selected")==="inline-boundary"&&i.removeAttribute("data-mce-selected"),!0):(i.removeAttribute(ep),!1),sg=(n,i)=>{const c=du(n.getTransparentElements()),m=du(n.getBlockElements());return At(i.querySelectorAll(c),p=>Bf(m,p))},gh=(n,i)=>{var c;const m=i?"lastChild":"firstChild";for(let p=n[m];p;p=p[m])if($a(Ke.fromDom(p))){(c=p.parentNode)===null||c===void 0||c.removeChild(p);return}},Lu=(n,i)=>{const c=document.createRange(),m=n.parentNode;if(m){c.setStartBefore(n),c.setEndBefore(i);const p=c.extractContents();gh(p,!0),c.setStartAfter(i),c.setEndAfter(n);const w=c.extractContents();gh(w,!1),$a(Ke.fromDom(p))||m.insertBefore(p,n),$a(Ke.fromDom(i))||m.insertBefore(i,n),$a(Ke.fromDom(w))||m.insertBefore(w,n),m.removeChild(n)}},Nd=(n,i,c)=>{const m=n.getBlockElements(),p=Ke.fromDom(i),w=M=>ti(M)in m,x=M=>vt(M,p);Ne(lh(c),M=>{di(M,w,x).each(B=>{const q=r0(M,ae=>w(ae)&&!n.isValidChild(ti(B),ti(ae)));if(q.length>0){const ae=wi(B);Ne(q,fe=>{di(fe,w,x).each(be=>{Lu(be.dom,fe.dom)})}),ae.each(fe=>sg(n,fe.dom))}})})},rg=(n,i,c)=>{Ne([...c,...ig(n,i)?[i]:[]],m=>Ne(pl(Ke.fromDom(m),m.nodeName.toLowerCase()),p=>{Iv(n,p.dom)&&Kl(p)}))},d0=(n,i)=>{const c=sg(n,i);Nd(n,i,c),rg(n,i,c)},Rv=(n,i)=>{if(Nv(n,i)){const c=du(n.getBlockElements());Bf(c,i)}},$v=(n,i,c)=>{const m=w=>vt(w,Ke.fromDom(i)),p=oh(Ke.fromDom(c),m);qr(p,p.length-2).filter(kl).fold(()=>d0(n,i),w=>d0(n,w.dom))},ph=n=>n.hasAttribute(ep),tp=(n,i)=>un(n.getTransparentElements(),i),Nv=(n,i)=>Jn(i)&&tp(n,i.nodeName),ig=(n,i)=>Nv(n,i)&&ph(i),Iv=(n,i)=>Nv(n,i)&&!ph(i),rr=(n,i)=>i.type===1&&tp(n,i.name)&&L(i.attr(ep)),Ao=ys().browser,bh=n=>oo(n,kl),nb=n=>Ao.isFirefox()&&ti(n)==="table"?bh(Da(n)).filter(i=>ti(i)==="caption").bind(i=>bh(il(i)).map(c=>{const m=c.dom.offsetTop,p=i.dom.offsetTop,w=i.dom.offsetHeight;return m<=p?-w:0})).getOr(0):0,np=(n,i)=>n.children&&kt(n.children,i),WC=(n,i,c)=>{let m=0,p=0;const w=n.ownerDocument;if(c=c||n,i){if(c===n&&i.getBoundingClientRect&&Bi(Ke.fromDom(n),"position")==="static"){const M=i.getBoundingClientRect();return m=M.left+(w.documentElement.scrollLeft||n.scrollLeft)-w.documentElement.clientLeft,p=M.top+(w.documentElement.scrollTop||n.scrollTop)-w.documentElement.clientTop,{x:m,y:p}}let x=i;for(;x&&x!==c&&x.nodeType&&!np(x,c);){const M=x;m+=M.offsetLeft||0,p+=M.offsetTop||0,x=M.offsetParent}for(x=i.parentNode;x&&x!==c&&x.nodeType&&!np(x,c);)m-=x.scrollLeft||0,p-=x.scrollTop||0,x=x.parentNode;p+=nb(Ke.fromDom(i))}return{x:m,y:p}},Bv=(n,i={})=>{let c=0;const m={},p=Ke.fromDom(n),w=Eo(p),x=Me=>{i.referrerPolicy=Me},M=Me=>{i.contentCssCors=Me},B=Me=>{na(em(p),Me)},q=Me=>{const Ve=em(p);Je(Ve,"#"+Me).each(wr)},ae=Me=>wo(m,Me).getOrThunk(()=>({id:"mce-u"+c++,passed:[],failed:[],count:0})),fe=Me=>new Promise((Ve,gt)=>{let Ot;const wt=gn._addCacheSuffix(Me),Pt=ae(wt);m[wt]=Pt,Pt.count++;const hn=(Zt,yn)=>{Ne(Zt,Cn),Pt.status=yn,Pt.passed=[],Pt.failed=[],Ot&&(Ot.onload=null,Ot.onerror=null,Ot=null)},Hn=()=>hn(Pt.passed,2),$n=()=>hn(Pt.failed,3);if(Ve&&Pt.passed.push(Ve),gt&&Pt.failed.push(gt),Pt.status===1)return;if(Pt.status===2){Hn();return}if(Pt.status===3){$n();return}Pt.status=1;const Lt=Ke.fromTag("link",w.dom);Ju(Lt,{rel:"stylesheet",type:"text/css",id:Pt.id}),i.contentCssCors&&Pr(Lt,"crossOrigin","anonymous"),i.referrerPolicy&&Pr(Lt,"referrerpolicy",i.referrerPolicy),Ot=Lt.dom,Ot.onload=Hn,Ot.onerror=$n,B(Lt),Pr(Lt,"href",wt)}),be=Me=>Promise.allSettled(pt(Me,gt=>fe(gt).then(Qe(gt)))).then(gt=>{const Ot=bn(gt,wt=>wt.status==="fulfilled");return Ot.fail.length>0?Promise.reject(pt(Ot.fail,wt=>wt.reason)):pt(Ot.pass,wt=>wt.value)}),Le=Me=>{const Ve=gn._addCacheSuffix(Me);wo(m,Ve).each(gt=>{--gt.count===0&&(delete m[Ve],q(gt.id))})};return{load:fe,loadAll:be,unload:Le,unloadAll:Me=>{Ne(Me,Ve=>{Le(Ve)})},_setReferrerPolicy:x,_setContentCssCors:M}},Lv=(()=>{const n=new WeakMap;return{forElement:(c,m)=>{const w=ql(c).dom;return he.from(n.get(w)).getOrThunk(()=>{const x=Bv(w,m);return n.set(w,x),x})}}})(),ob=n=>n.nodeName.toLowerCase()==="span",Ey=(n,i)=>Oe(n)&&(im(n,i)||Dc(Ke.fromDom(n))),on=(n,i)=>{const c=new _i(n,i).prev(!1),m=new _i(n,i).next(!1),p=ve(c)||Ey(c,i),w=ve(m)||Ey(m,i);return p&&w},Id=n=>ob(n)&&n.getAttribute("data-mce-type")==="bookmark",t_=(n,i)=>_n(n)&&n.data.length>0&&on(n,i),h0=n=>Jn(n)?n.childNodes.length>0:!1,UC=n=>K1(n)||of(n),ag=(n,i,c)=>{var m;const p=c||i;if(Jn(i)&&Id(i))return i;const w=i.childNodes;for(let x=w.length-1;x>=0;x--)ag(n,w[x],p);if(Jn(i)){const x=i.childNodes;x.length===1&&Id(x[0])&&((m=i.parentNode)===null||m===void 0||m.insertBefore(x[0],i))}return!UC(i)&&!im(i,p)&&!h0(i)&&!t_(i,p)&&n.remove(i),i},Ay=gn.makeMap,am=/[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Bd=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,lg=/[<>&\"\']/g,Ci=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Ld={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"},Fd={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},hu={"<":"<",">":">","&":"&",""":'"',"'":"'"},Qs=n=>{const i=Ke.fromTag("div").dom;return i.innerHTML=n,i.textContent||i.innerText||n},jp=(n,i)=>{const c={};if(n){const m=n.split(",");i=i||10;for(let p=0;pn.replace(i?am:Bd,c=>Fd[c]||c),YC=n=>(""+n).replace(lg,i=>Fd[i]||i),m0=(n,i)=>n.replace(i?am:Bd,c=>c.length>1?"&#"+((c.charCodeAt(0)-55296)*1024+(c.charCodeAt(1)-56320)+65536)+";":Fd[c]||"&#"+c.charCodeAt(0)+";"),Fv=(n,i,c)=>{const m=c||vh;return n.replace(i?am:Bd,p=>Fd[p]||m[p]||p)},sp={encodeRaw:op,encodeAllRaw:YC,encodeNumeric:m0,encodeNamed:Fv,getEncodeFunc:(n,i)=>{const c=jp(i)||vh,m=(x,M)=>x.replace(M?am:Bd,B=>Fd[B]!==void 0?Fd[B]:c[B]!==void 0?c[B]:B.length>1?"&#"+((B.charCodeAt(0)-55296)*1024+(B.charCodeAt(1)-56320)+65536)+";":"&#"+B.charCodeAt(0)+";"),p=(x,M)=>Fv(x,M,c),w=Ay(n.replace(/\+/g,","));return w.named&&w.numeric?m:w.named?i?p:Fv:w.numeric?m0:op},decode:n=>n.replace(Ci,(i,c)=>c?(c.charAt(0).toLowerCase()==="x"?c=parseInt(c.substr(1),16):c=parseInt(c,10),c>65535?(c-=65536,String.fromCharCode(55296+(c>>10),56320+(c&1023))):Ld[c]||String.fromCharCode(c)):hu[i]||vh[i]||Qs(i))},Al=(n,i)=>(n=gn.trim(n),n?n.split(i||" "):[]),Dy=n=>new RegExp("^"+n.replace(/([?+*])/g,".$1")+"$"),io=n=>{const i=/^(~)?(.+)$/;return $s(Al(n,","),c=>{const m=i.exec(c);if(m){const p=m[1]==="~",w=p?"span":"div",x=m[2];return[{inline:p,cloneName:w,name:x}]}else return[]})},Py=n=>{let i,c,m,p;if(i="id accesskey class dir lang style tabindex title role",c="address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul",m="a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment",n!=="html4"){const w="a ins del canvas map";i+=" contenteditable contextmenu draggable dropzone hidden spellcheck translate",c+=" article aside details dialog figure main header footer hgroup section nav "+w,m+=" audio canvas command datalist mark meter output picture progress time wbr video ruby bdi keygen"}return n!=="html5-strict"&&(i+=" xml:lang",m=[m,"acronym applet basefont big font strike tt"].join(" "),c=[c,"center dir isindex noframes"].join(" "),p=[c,m].join(" ")),p=p||[c,m].join(" "),{globalAttributes:i,blockContent:c,phrasingContent:m,flowContent:p}},XC=n=>{const{globalAttributes:i,phrasingContent:c,flowContent:m}=Py(n),p={},w=(M,B="",q="")=>{const ae=Al(q),fe=Al(M);let be=fe.length;for(;be--;){const Le=Al([i,B].join(" "));p[fe[be]]={attributes:dr(Le,Qe({})),attributesOrder:Le,children:dr(ae,Qe({}))}}},x=(M,B)=>{const q=Al(M),ae=Al(B);let fe=q.length;for(;fe--;){const be=p[q[fe]];for(let Le=0,Ye=ae.length;Le{w(q,"",c)}),Ne(Al("center dir isindex noframes"),q=>{w(q,"",m)})),w("html","manifest","head body"),w("head","","base command link meta noscript script style title"),w("title hr noscript br"),w("base","href target"),w("link","href rel media hreflang type sizes hreflang"),w("meta","name http-equiv content charset"),w("style","media type scoped"),w("script","src async defer type charset"),w("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",m),w("dd div","",m),w("address dt caption","",n==="html4"?c:m),w("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn","",c),w("blockquote","cite",m),w("ol","reversed start type","li"),w("ul","","li"),w("li","value",m),w("dl","","dt dd"),w("a","href target rel media hreflang type",n==="html4"?c:m),w("q","cite",c),w("ins del","cite datetime",m),w("img","src sizes srcset alt usemap ismap width height"),w("iframe","src name width height",m),w("embed","src type width height"),w("object","data type typemustmatch name usemap form width height",[m,"param"].join(" ")),w("param","name value"),w("map","name",[m,"area"].join(" ")),w("area","alt coords shape href target rel media hreflang type"),w("table","border","caption colgroup thead tfoot tbody tr"+(n==="html4"?" col":"")),w("colgroup","span","col"),w("col","span"),w("tbody thead tfoot","","tr"),w("tr","","td th"),w("td","colspan rowspan headers",m),w("th","colspan rowspan headers scope abbr",m),w("form","accept-charset action autocomplete enctype method name novalidate target",m),w("fieldset","disabled form name",[m,"legend"].join(" ")),w("label","form for",c),w("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),w("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value",n==="html4"?m:c),w("select","disabled form multiple name required size","option optgroup"),w("optgroup","disabled label","option"),w("option","disabled label selected value"),w("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),w("menu","type label",[m,"li"].join(" ")),w("noscript","",m),n!=="html4"&&(w("wbr"),w("ruby","",[c,"rt rp"].join(" ")),w("figcaption","",m),w("mark rt rp summary bdi","",c),w("canvas","width height",m),w("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height buffered",[m,"track source"].join(" ")),w("audio","src crossorigin preload autoplay mediagroup loop muted controls buffered volume",[m,"track source"].join(" ")),w("picture","","img source"),w("source","src srcset type media sizes"),w("track","kind src srclang label default"),w("datalist","",[c,"option"].join(" ")),w("article section nav aside main header footer","",m),w("hgroup","","h1 h2 h3 h4 h5 h6"),w("figure","",[m,"figcaption"].join(" ")),w("time","datetime",c),w("dialog","open",m),w("command","type label icon disabled checked radiogroup command"),w("output","for form name",c),w("progress","value max",c),w("meter","value min max low high optimum",c),w("details","open",[m,"summary"].join(" ")),w("keygen","autofocus challenge disabled form keytype name")),n!=="html5-strict"&&(x("script","language xml:space"),x("style","xml:space"),x("object","declare classid code codebase codetype archive standby align border hspace vspace"),x("embed","align name hspace vspace"),x("param","valuetype type"),x("a","charset name rev shape coords"),x("br","clear"),x("applet","codebase archive code object alt name width height align hspace vspace"),x("img","name longdesc align border hspace vspace"),x("iframe","longdesc frameborder marginwidth marginheight scrolling align"),x("font basefont","size color face"),x("input","usemap align"),x("select"),x("textarea"),x("h1 h2 h3 h4 h5 h6 div p legend caption","align"),x("ul","type compact"),x("li","type"),x("ol dl menu dir","compact"),x("pre","width xml:space"),x("hr","align noshade size width"),x("isindex","prompt"),x("table","summary width frame rules cellspacing cellpadding align bgcolor"),x("col","width align char charoff valign"),x("colgroup","width align char charoff valign"),x("thead","align char charoff valign"),x("tr","align char charoff valign bgcolor"),x("th","axis align char charoff valign nowrap bgcolor width height"),x("form","accept"),x("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),x("tfoot","align char charoff valign"),x("tbody","align char charoff valign"),x("area","nohref"),x("body","background bgcolor text link vlink alink")),n!=="html4"&&(x("input button select textarea","autofocus"),x("input textarea","placeholder"),x("a","download"),x("link script img","crossorigin"),x("img","loading"),x("iframe","sandbox seamless allow allowfullscreen loading")),n!=="html4"&&Ne([p.video,p.audio],M=>{delete M.children.audio,delete M.children.video}),Ne(Al("a form meter progress dfn"),M=>{p[M]&&delete p[M].children[M]}),delete p.caption.children.table,delete p.script,p},My=n=>n==="-"?"remove":"add",lm=n=>{const i=/^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/;return $s(Al(n,","),c=>{const m=i.exec(c);if(m){const p=m[1],w=p?My(p):"replace",x=m[2],M=Al(m[3],"|");return[{operation:w,name:x,validChildren:M}]}else return[]})},lf=(n,i)=>{const c=/^([!\-])?(\w+[\\:]:\w+|[^=~<]+)?(?:([=~<])(.*))?$/,m=/[*?+]/,{attributes:p,attributesOrder:w}=i;return Ne(Al(n,"|"),x=>{const M=c.exec(x);if(M){const B={},q=M[1],ae=M[2].replace(/[\\:]:/g,":"),fe=M[3],be=M[4];if(q==="!"&&(i.attributesRequired=i.attributesRequired||[],i.attributesRequired.push(ae),B.required=!0),q==="-"){delete p[ae],w.splice(gn.inArray(w,ae),1);return}if(fe&&(fe==="="?(i.attributesDefault=i.attributesDefault||[],i.attributesDefault.push({name:ae,value:be}),B.defaultValue=be):fe==="~"?(i.attributesForced=i.attributesForced||[],i.attributesForced.push({name:ae,value:be}),B.forcedValue=be):fe==="<"&&(B.validValues=gn.makeMap(be,"?"))),m.test(ae)){const Le=B;i.attributePatterns=i.attributePatterns||[],Le.pattern=Dy(ae),i.attributePatterns.push(Le)}else p[ae]||w.push(ae),p[ae]=B}})},Oh=(n,i)=>{ln(n.attributes,(c,m)=>{i.attributes[m]=c}),i.attributesOrder.push(...n.attributesOrder)},rp=(n,i)=>{const c=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/;return $s(Al(i,","),m=>{const p=c.exec(m);if(p){const w=p[1],x=p[2],M=p[3],B=p[4],q=p[5],ae={attributes:{},attributesOrder:[]};if(n.each(fe=>Oh(fe,ae)),w==="#"?ae.paddEmpty=!0:w==="-"&&(ae.removeEmpty=!0),B==="!"&&(ae.removeEmptyAttrs=!0),q&&lf(q,ae),M&&(ae.outputName=x),x==="@")if(n.isNone())n=he.some(ae);else return[];return[M?{name:x,element:ae,aliasName:M}:{name:x,element:ae}]}else return[]})},yh={},g0=gn.makeMap,Lf=gn.each,ip=gn.extend,Ry=gn.explode,qp=(n,i={})=>{const c=g0(n," ",g0(n.toUpperCase()," "));return ip(c,i)},rd=n=>qp("td th li dt dd figcaption caption details summary",n.getTextBlockElements()),$y=(n,i)=>{if(n){const c={};return L(n)&&(n={"*":n}),Lf(n,(m,p)=>{c[p]=c[p.toUpperCase()]=i==="map"?g0(m,/[, ]/):Ry(m,/[, ]/)}),c}else return},wh=(n={})=>{var i;const c={},m={};let p=[];const w={},x={},M=(ho,Us,ci)=>{const Ja=n[ho];if(Ja)return g0(Ja,/[, ]/,g0(Ja.toUpperCase(),/[, ]/));{let Ei=yh[ho];return Ei||(Ei=qp(Us,ci),yh[ho]=Ei),Ei}},B=(i=n.schema)!==null&&i!==void 0?i:"html5",q=XC(B);n.verify_html===!1&&(n.valid_elements="*[*]");const ae=$y(n.valid_styles),fe=$y(n.invalid_styles,"map"),be=$y(n.valid_classes,"map"),Le=M("whitespace_elements","pre script noscript style textarea video audio iframe object code"),Ye=M("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),Me=M("void_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),Ve=M("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls allowfullscreen"),gt="td th iframe video audio object script code",Ot=M("non_empty_elements",gt+" pre",Me),wt=M("move_caret_before_on_enter_elements",gt+" table",Me),Pt=M("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside main nav figure"),hn=M("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup figcaption details summary",Pt),Hn=M("text_inline_elements","span strong b em i font s strike u var cite dfn code mark q sup sub samp"),$n=M("transparent_elements","a ins del canvas map");Lf("script noscript iframe noframes noembed title style textarea xmp plaintext".split(" "),ho=>{x[ho]=new RegExp("]*>","gi")});const Lt=ho=>{const Us=he.from(c["@"]),ci=/[*?+]/;Ne(rp(Us,ho!=null?ho:""),({name:Ja,element:Ei,aliasName:$c})=>{if($c&&(c[$c]=Ei),ci.test(Ja)){const Qh=Ei;Qh.pattern=Dy(Ja),p.push(Qh)}else c[Ja]=Ei})},Zt=ho=>{p=[],Ne(bs(c),Us=>{delete c[Us]}),Lt(ho)},yn=ho=>{delete yh.text_block_elements,delete yh.block_elements,Ne(io(ho!=null?ho:""),({inline:Us,name:ci,cloneName:Ja})=>{if(m[ci]=m[Ja],w[ci]=Ja,Ot[ci.toUpperCase()]={},Ot[ci]={},Us||(hn[ci.toUpperCase()]={},hn[ci]={}),!c[ci]){let Ei=c[Ja];Ei=ip({},Ei),delete Ei.removeEmptyAttrs,delete Ei.removeEmpty,c[ci]=Ei}ln(m,(Ei,$c)=>{Ei[Ja]&&(m[$c]=Ei=ip({},m[$c]),Ei[ci]=Ei[Ja])})})},yo=ho=>{Ne(lm(ho!=null?ho:""),({operation:Us,name:ci,validChildren:Ja})=>{const Ei=Us==="replace"?{"#comment":{}}:m[ci];Ne(Ja,$c=>{Us==="remove"?delete Ei[$c]:Ei[$c]={}}),m[ci]=Ei})},Do=ho=>{const Us=c[ho];if(Us)return Us;let ci=p.length;for(;ci--;){const Ja=p[ci];if(Ja.pattern.test(ho))return Ja}};n.valid_elements?(Zt(n.valid_elements),Lf(q,(ho,Us)=>{m[Us]=ho.children})):(Lf(q,(ho,Us)=>{c[Us]={attributes:ho.attributes,attributesOrder:ho.attributesOrder},m[Us]=ho.children}),Lf(Al("strong/b em/i"),ho=>{const Us=Al(ho,"/");c[Us[1]].outputName=Us[0]}),Lf(Hn,(ho,Us)=>{c[Us]&&(n.padd_empty_block_inline_children&&(c[Us].paddInEmptyBlock=!0),c[Us].removeEmpty=!0)}),Lf(Al("ol ul blockquote a table tbody"),ho=>{c[ho]&&(c[ho].removeEmpty=!0)}),Lf(Al("p h1 h2 h3 h4 h5 h6 th td pre div address caption li summary"),ho=>{c[ho]&&(c[ho].paddEmpty=!0)}),Lf(Al("span"),ho=>{c[ho].removeEmptyAttrs=!0})),yn(n.custom_elements),yo(n.valid_children),Lt(n.extended_valid_elements),yo("+ol[ul|ol],+ul[ul|ol]"),Lf({dd:"dl",dt:"dl",li:"ul ol",td:"tr",th:"tr",tr:"tbody thead tfoot",tbody:"table",thead:"table",tfoot:"table",legend:"fieldset",area:"map",param:"video audio object"},(ho,Us)=>{c[Us]&&(c[Us].parentsRequired=Al(ho))}),n.invalid_elements&&Lf(Ry(n.invalid_elements),ho=>{c[ho]&&delete c[ho]}),Do("span")||Lt("span[!data-mce-type|*]");const Cs=Qe(ae),Ws=Qe(fe),Ir=Qe(be),pi=Qe(Ve),fl=Qe(hn),Il=Qe(Pt),Oc=Qe(Hn),Pn=Qe(Object.seal(Me)),eo=Qe(Ye),Cr=Qe(Ot),Bs=Qe(wt),Co=Qe(Le),Mn=Qe($n),En=Qe(Object.seal(x)),jo=(ho,Us)=>{const ci=m[ho.toLowerCase()];return!!(ci&&ci[Us.toLowerCase()])},Ks=(ho,Us)=>{const ci=Do(ho);if(ci)if(Us){if(ci.attributes[Us])return!0;const Ja=ci.attributePatterns;if(Ja){let Ei=Ja.length;for(;Ei--;)if(Ja[Ei].pattern.test(Us))return!0}}else return!0;return!1},Jr=Qe(w);return{type:B,children:m,elements:c,getValidStyles:Cs,getValidClasses:Ir,getBlockElements:fl,getInvalidStyles:Ws,getVoidElements:Pn,getTextBlockElements:Il,getTextInlineElements:Oc,getBoolAttrs:pi,getElementRule:Do,getSelfClosingElements:eo,getNonEmptyElements:Cr,getMoveCaretBeforeOnEnterElements:Bs,getWhitespaceElements:Co,getTransparentElements:Mn,getSpecialElements:En,isValidChild:jo,isValid:Ks,getCustomElements:Jr,addValidElements:Lt,setValidElements:Zt,addCustomElements:yn,addValidChildren:yo}},Qv=(n={},i)=>{const c=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,m=/\s*([^:]+):\s*([^;]+);?/g,p=/\s+$/,w={};let x,M;const B=nn;i&&(x=i.getValidStyles(),M=i.getInvalidStyles());const q=(`\\" \\' \\; \\: ; : `+B).split(" ");for(let fe=0;fe{const be={};let Le=!1;const Ye=n.url_converter,Me=n.url_converter_scope||ae,Ve=(Lt,Zt,yn)=>{const yo=be[Lt+"-top"+Zt];if(!yo)return;const Do=be[Lt+"-right"+Zt];if(!Do)return;const Cs=be[Lt+"-bottom"+Zt];if(!Cs)return;const Ws=be[Lt+"-left"+Zt];if(!Ws)return;const Ir=[yo,Do,Cs,Ws];let pi=Ir.length-1;for(;pi--&&Ir[pi]===Ir[pi+1];);pi>-1&&yn||(be[Lt+Zt]=pi===-1?Ir[0]:Ir.join(" "),delete be[Lt+"-top"+Zt],delete be[Lt+"-right"+Zt],delete be[Lt+"-bottom"+Zt],delete be[Lt+"-left"+Zt])},gt=Lt=>{const Zt=be[Lt];if(!Zt)return;const yn=Zt.indexOf(",")>-1?[Zt]:Zt.split(" ");let yo=yn.length;for(;yo--;)if(yn[yo]!==yn[0])return!1;return be[Lt]=yn[0],!0},Ot=(Lt,Zt,yn,yo)=>{!gt(Zt)||!gt(yn)||!gt(yo)||(be[Lt]=be[Zt]+" "+be[yn]+" "+be[yo],delete be[Zt],delete be[yn],delete be[yo])},wt=Lt=>(Le=!0,w[Lt]),Pt=(Lt,Zt)=>(Le&&(Lt=Lt.replace(/\uFEFF[0-9]/g,yn=>w[yn])),Zt||(Lt=Lt.replace(/\\([\'\";:])/g,"$1")),Lt),hn=Lt=>String.fromCharCode(parseInt(Lt.slice(1),16)),Hn=Lt=>Lt.replace(/\\[0-9a-f]+/gi,hn),$n=(Lt,Zt,yn,yo,Do,Cs)=>{if(Do=Do||Cs,Do)return Do=Pt(Do),"'"+Do.replace(/\'/g,"\\'")+"'";if(Zt=Pt(Zt||yn||yo||""),!n.allow_script_urls){const Ws=Zt.replace(/[\s\r\n]+/g,"");if(/(java|vb)script:/i.test(Ws)||!n.allow_svg_data_urls&&/^data:image\/svg/i.test(Ws))return""}return Ye&&(Zt=Ye.call(Me,Zt,"style")),"url('"+Zt.replace(/\'/g,"\\'")+"')"};if(fe){fe=fe.replace(/[\u0000-\u001F]/g,""),fe=fe.replace(/\\[\"\';:\uFEFF]/g,wt).replace(/\"[^\"]+\"|\'[^\']+\'/g,Zt=>Zt.replace(/[;:]/g,wt));let Lt;for(;Lt=m.exec(fe);){m.lastIndex=Lt.index+Lt[0].length;let Zt=Lt[1].replace(p,"").toLowerCase(),yn=Lt[2].replace(p,"");if(Zt&&yn){if(Zt=Hn(Zt),yn=Hn(yn),Zt.indexOf(B)!==-1||Zt.indexOf('"')!==-1||!n.allow_script_urls&&(Zt==="behavior"||/expression\s*\(|\/\*|\*\//.test(yn)))continue;Zt==="font-weight"&&yn==="700"?yn="bold":(Zt==="color"||Zt==="background-color")&&(yn=yn.toLowerCase()),yn=yn.replace(c,$n),be[Zt]=Le?Pt(yn,!0):yn}}Ve("border","",!0),Ve("border","-width"),Ve("border","-color"),Ve("border","-style"),Ve("padding",""),Ve("margin",""),Ot("border","border-width","border-style","border-color"),be.border==="medium none"&&delete be.border,be["border-image"]==="none"&&delete be["border-image"]}return be},serialize:(fe,be)=>{let Le="";const Ye=(Ve,gt)=>{const Ot=gt[Ve];if(Ot)for(let wt=0,Pt=Ot.length;wt0?" ":"")+hn+": "+Hn+";")}},Me=(Ve,gt)=>{if(!M||!gt)return!0;let Ot=M["*"];return Ot&&Ot[Ve]?!1:(Ot=M[gt],!(Ot&&Ot[Ve]))};return be&&x?(Ye("*",x),Ye(be,x)):ln(fe,(Ve,gt)=>{Ve&&Me(gt,be)&&(Le+=(Le.length>0?" ":"")+gt+": "+Ve+";")}),Le}};return ae},n_={keyLocation:!0,layerX:!0,layerY:!0,returnValue:!0,webkitMovementX:!0,webkitMovementY:!0,keyIdentifier:!0,mozPressure:!0},Ny=n=>n instanceof Event||ce(n.initEvent),ap=n=>n.isDefaultPrevented===mt||n.isDefaultPrevented===je,Ff=n=>Re(n.preventDefault)||Ny(n),mu=(n,i)=>{const c=i!=null?i:{};for(const m in n)un(n_,m)||(c[m]=n[m]);return Oe(n.composedPath)&&(c.composedPath=()=>n.composedPath()),c},lp=(n,i,c,m)=>{var p;const w=mu(i,m);return w.type=n,Re(w.target)&&(w.target=(p=w.srcElement)!==null&&p!==void 0?p:c),Ff(i)&&(w.preventDefault=()=>{w.defaultPrevented=!0,w.isDefaultPrevented=mt,ce(i.preventDefault)&&i.preventDefault()},w.stopPropagation=()=>{w.cancelBubble=!0,w.isPropagationStopped=mt,ce(i.stopPropagation)&&i.stopPropagation()},w.stopImmediatePropagation=()=>{w.isImmediatePropagationStopped=mt,w.stopPropagation()},ap(w)||(w.isDefaultPrevented=w.defaultPrevented===!0?mt:je,w.isPropagationStopped=w.cancelBubble===!0?mt:je,w.isImmediatePropagationStopped=je)),w},Iy="mce-data-",o_=/^(?:mouse|contextmenu)|click/,p0=(n,i,c,m)=>{n.addEventListener(i,c,m||!1)},Yc=(n,i,c,m)=>{n.removeEventListener(i,c,m||!1)},b0=n=>Oe(n)&&o_.test(n.type),cf=(n,i)=>{const c=lp(n.type,n,document,i);if(b0(n)&&ve(n.pageX)&&!ve(n.clientX)){const m=c.target.ownerDocument||document,p=m.documentElement,w=m.body,x=c;x.pageX=n.clientX+(p&&p.scrollLeft||w&&w.scrollLeft||0)-(p&&p.clientLeft||w&&w.clientLeft||0),x.pageY=n.clientY+(p&&p.scrollTop||w&&w.scrollTop||0)-(p&&p.clientTop||w&&w.clientTop||0)}return c},cp=(n,i,c)=>{const m=n.document,p={type:"ready"};if(c.domLoaded){i(p);return}const w=()=>m.readyState==="complete"||m.readyState==="interactive"&&m.body,x=()=>{Yc(n,"DOMContentLoaded",x),Yc(n,"load",x),c.domLoaded||(c.domLoaded=!0,i(p)),n=null};w()?x():p0(n,"DOMContentLoaded",x),c.domLoaded||p0(n,"load",x)};class cm{constructor(){this.domLoaded=!1,this.events={},this.count=1,this.expando=Iy+(+new Date).toString(32),this.hasFocusIn="onfocusin"in document.documentElement,this.count=1}bind(i,c,m,p){const w=this;let x;const M=window,B=be=>{w.executeHandlers(cf(be||M.event),q)};if(!i||_n(i)||uh(i))return m;let q;i[w.expando]?q=i[w.expando]:(q=w.count++,i[w.expando]=q,w.events[q]={}),p=p||i;const ae=c.split(" ");let fe=ae.length;for(;fe--;){let be=ae[fe],Le=B,Ye=!1,Me=!1;if(be==="DOMContentLoaded"&&(be="ready"),w.domLoaded&&be==="ready"&&i.readyState==="complete"){m.call(p,cf({type:be}));continue}!w.hasFocusIn&&(be==="focusin"||be==="focusout")&&(Ye=!0,Me=be==="focusin"?"focus":"blur",Le=Ve=>{const gt=cf(Ve||M.event);gt.type=gt.type==="focus"?"focusin":"focusout",w.executeHandlers(gt,q)}),x=w.events[q][be],x?be==="ready"&&w.domLoaded?m(cf({type:be})):x.push({func:m,scope:p}):(w.events[q][be]=x=[{func:m,scope:p}],x.fakeName=Me,x.capture=Ye,x.nativeHandler=Le,be==="ready"?cp(i,Le,w):p0(i,Me||be,Le,Ye))}return i=x=null,m}unbind(i,c,m){if(!i||_n(i)||uh(i))return this;const p=i[this.expando];if(p){let w=this.events[p];if(c){const x=c.split(" ");let M=x.length;for(;M--;){const B=x[M],q=w[B];if(q){if(m){let ae=q.length;for(;ae--;)if(q[ae].func===m){const fe=q.nativeHandler,be=q.fakeName,Le=q.capture,Ye=q.slice(0,ae).concat(q.slice(ae+1));Ye.nativeHandler=fe,Ye.fakeName=be,Ye.capture=Le,w[B]=Ye}}(!m||q.length===0)&&(delete w[B],Yc(i,q.fakeName||B,q.nativeHandler,q.capture))}}}else ln(w,(x,M)=>{Yc(i,x.fakeName||M,x.nativeHandler,x.capture)}),w={};for(const x in w)if(un(w,x))return this;delete this.events[p];try{delete i[this.expando]}catch{i[this.expando]=null}}return this}fire(i,c,m){return this.dispatch(i,c,m)}dispatch(i,c,m){if(!i||_n(i)||uh(i))return this;const p=cf({type:c,target:i},m);do{const w=i[this.expando];w&&this.executeHandlers(p,w),i=i.parentNode||i.ownerDocument||i.defaultView||i.parentWindow}while(i&&!p.isPropagationStopped());return this}clean(i){if(!i||_n(i)||uh(i))return this;if(i[this.expando]&&this.unbind(i),i.getElementsByTagName||(i=i.document),i&&i.getElementsByTagName){this.unbind(i);const c=i.getElementsByTagName("*");let m=c.length;for(;m--;)i=c[m],i[this.expando]&&this.unbind(i)}return this}destroy(){this.events={}}cancel(i){return i&&(i.preventDefault(),i.stopImmediatePropagation()),!1}executeHandlers(i,c){const m=this.events[c],p=m&&m[i.type];if(p)for(let w=0,x=p.length;w{Re(c)||c===""?Vi(n,i):Pr(n,i,c)},v0=n=>n.replace(/[A-Z]/g,i=>"-"+i.toLowerCase()),sb=(n,i)=>{let c=0;if(n)for(let m=n.nodeType,p=n.previousSibling;p;p=p.previousSibling){const w=p.nodeType;i&&_n(p)&&(w===m||!p.data.length)||(c++,m=w)}return c},Ly=(n,i)=>{const c=Fl(i,"style"),m=n.serialize(n.parse(c),ti(i));up(i,Gp,m)},Fy=(n,i)=>Xe(n)?un(By,i)?n+"":n+"px":n,r_=(n,i,c)=>{const m=v0(i);Re(c)||c===""?Um(n,m):Gl(n,m,Fy(c,m))},jC=(n,i,c)=>{const m=i.keep_values,p={set:(x,M,B)=>{const q=Ke.fromDom(x);ce(i.url_converter)&&Oe(M)&&(M=i.url_converter.call(i.url_converter_scope||c(),String(M),B,x));const ae="data-mce-"+B;up(q,ae,M),up(q,B,M)},get:(x,M)=>{const B=Ke.fromDom(x);return Fl(B,"data-mce-"+M)||Fl(B,M)}},w={style:{set:(x,M)=>{const B=Ke.fromDom(x);m&&up(B,Gp,M),Vi(B,"style"),L(M)&&ua(B,n.parse(M))},get:x=>{const M=Ke.fromDom(x),B=Fl(M,Gp)||Fl(M,"style");return n.serialize(n.parse(B),ti(M))}}};return m&&(w.href=w.src=p),w},Qr=(n,i={})=>{const c={},m=window,p={};let w=0;const x=!0,M=!0,B=Lv.forElement(Ke.fromDom(n),{contentCssCors:i.contentCssCors,referrerPolicy:i.referrerPolicy}),q=[],ae=i.schema?i.schema:wh({}),fe=Qv({url_converter:i.url_converter,url_converter_scope:i.url_converter_scope},i.schema),be=i.ownEvents?new cm:cm.Event,Le=ae.getBlockElements(),Ye=Mt=>L(Mt)?un(Le,Mt):Jn(Mt)&&(un(Le,Mt.nodeName)||ig(ae,Mt)),Me=Mt=>Mt&&n&&L(Mt)?n.getElementById(Mt):Mt,Ve=Mt=>{const Rt=Me(Mt);return Oe(Rt)?Ke.fromDom(Rt):null},gt=(Mt,Rt,Rn="")=>{let xn;const Io=Ve(Mt);if(Oe(Io)&&kl(Io)){const br=Rw[Rt];br&&br.get?xn=br.get(Io.dom,Rt):xn=Fl(Io,Rt)}return Oe(xn)?xn:Rn},Ot=Mt=>{const Rt=Me(Mt);return Re(Rt)?[]:Rt.attributes},wt=(Mt,Rt,Rn)=>{eo(Mt,xn=>{if(Jn(xn)){const Io=Ke.fromDom(xn),br=Rn===""?null:Rn,ha=Fl(Io,Rt),Nc=Rw[Rt];Nc&&Nc.set?Nc.set(Io.dom,br,Rt):up(Io,Rt,br),ha!==br&&i.onSetAttrib&&i.onSetAttrib({attrElm:Io.dom,attrName:Rt,attrValue:br})}})},Pt=(Mt,Rt)=>Mt.cloneNode(Rt),hn=()=>i.root_element||n.body,Hn=Mt=>{const Rt=nd(Mt);return{x:Rt.x,y:Rt.y,w:Rt.width,h:Rt.height}},$n=(Mt,Rt)=>WC(n.body,Me(Mt),Rt),Lt=(Mt,Rt,Rn)=>{eo(Mt,xn=>{const Io=Ke.fromDom(xn);r_(Io,Rt,Rn),i.update_styles&&Ly(fe,Io)})},Zt=(Mt,Rt)=>{eo(Mt,Rn=>{const xn=Ke.fromDom(Rn);ln(Rt,(Io,br)=>{r_(xn,br,Io)}),i.update_styles&&Ly(fe,xn)})},yn=(Mt,Rt,Rn)=>{const xn=Me(Mt);if(!(Re(xn)||!Jn(xn)))return Rn?Bi(Ke.fromDom(xn),v0(Rt)):(Rt=Rt.replace(/-(\D)/g,(Io,br)=>br.toUpperCase()),Rt==="float"&&(Rt="cssFloat"),xn.style?xn.style[Rt]:void 0)},yo=Mt=>{const Rt=Me(Mt);if(!Rt)return{w:0,h:0};let Rn=yn(Rt,"width"),xn=yn(Rt,"height");return(!Rn||Rn.indexOf("px")===-1)&&(Rn="0"),(!xn||xn.indexOf("px")===-1)&&(xn="0"),{w:parseInt(Rn,10)||Rt.offsetWidth||Rt.clientWidth,h:parseInt(xn,10)||Rt.offsetHeight||Rt.clientHeight}},Do=Mt=>{const Rt=Me(Mt),Rn=$n(Rt),xn=yo(Rt);return{x:Rn.x,y:Rn.y,w:xn.w,h:xn.h}},Cs=(Mt,Rt)=>{if(!Mt)return!1;const Rn=oe(Mt)?Mt:[Mt];return jt(Rn,xn=>Pu(Ke.fromDom(xn),Rt))},Ws=(Mt,Rt,Rn,xn)=>{const Io=[];let br=Me(Mt);xn=xn===void 0;const ha=Rn||(hn().nodeName!=="BODY"?hn().parentNode:null);if(L(Rt))if(Rt==="*")Rt=Jn;else{const Nc=Rt;Rt=_u=>Cs(_u,Nc)}for(;br&&!(br===ha||Re(br.nodeType)||of(br)||K1(br));){if(!Rt||Rt(br))if(xn)Io.push(br);else return[br];br=br.parentNode}return xn?Io:null},Ir=(Mt,Rt,Rn)=>{const xn=Ws(Mt,Rt,Rn,!1);return xn&&xn.length>0?xn[0]:null},pi=(Mt,Rt,Rn)=>{let xn=Rt;if(Mt){L(Rt)&&(xn=Io=>Cs(Io,Rt));for(let Io=Mt[Rn];Io;Io=Io[Rn])if(ce(xn)&&xn(Io))return Io}return null},fl=(Mt,Rt)=>pi(Mt,Rt,"nextSibling"),Il=(Mt,Rt)=>pi(Mt,Rt,"previousSibling"),Oc=Mt=>ce(Mt.querySelectorAll),Pn=(Mt,Rt)=>{var Rn,xn;const Io=(xn=(Rn=Me(Rt))!==null&&Rn!==void 0?Rn:i.root_element)!==null&&xn!==void 0?xn:n;return Oc(Io)?Rr(Io.querySelectorAll(Mt)):[]},eo=function(Mt,Rt,Rn){const xn=Rn!=null?Rn:this;if(oe(Mt)){const Io=[];return Zv(Mt,(br,ha)=>{const Nc=Me(br);Nc&&Io.push(Rt.call(xn,Nc,ha))}),Io}else{const Io=Me(Mt);return Io?Rt.call(xn,Io):!1}},Cr=(Mt,Rt)=>{eo(Mt,Rn=>{ln(Rt,(xn,Io)=>{wt(Rn,Io,xn)})})},Bs=(Mt,Rt)=>{eo(Mt,Rn=>{const xn=Ke.fromDom(Rn);Mf(xn,Rt)})},Co=(Mt,Rt,Rn,xn,Io)=>eo(Mt,br=>{const ha=L(Rt)?n.createElement(Rt):Rt;return Oe(Rn)&&Cr(ha,Rn),xn&&(!L(xn)&&xn.nodeType?ha.appendChild(xn):L(xn)&&Bs(ha,xn)),Io?ha:br.appendChild(ha)}),Mn=(Mt,Rt,Rn)=>Co(n.createElement(Mt),Mt,Rt,Rn,!0),En=sp.decode,jo=sp.encodeAllRaw,Ks=(Mt,Rt,Rn="")=>{let xn="<"+Mt;for(const Io in Rt)os(Rt,Io)&&(xn+=" "+Io+'="'+jo(Rt[Io])+'"');return ol(Rn)&&un(ae.getVoidElements(),Mt)?xn+" />":xn+">"+Rn+""},Jr=Mt=>{const Rt=n.createElement("div"),Rn=n.createDocumentFragment();Rn.appendChild(Rt),Mt&&(Rt.innerHTML=Mt);let xn;for(;xn=Rt.firstChild;)Rn.appendChild(xn);return Rn.removeChild(Rt),Rn},ho=(Mt,Rt)=>eo(Mt,Rn=>{const xn=Ke.fromDom(Rn);return Rt&&Ne(Da(xn),Io=>{sl(Io)&&Io.dom.length===0?wr(Io):Ca(xn,Io)}),wr(xn),xn.dom}),Us=Mt=>eo(Mt,Rt=>{const Rn=Rt.attributes;for(let xn=Rn.length-1;xn>=0;xn--)Rt.removeAttributeNode(Rn.item(xn))}),ci=Mt=>fe.parse(Mt),Ja=(Mt,Rt)=>fe.serialize(Mt,Rt),Ei=Mt=>{if(E1!==Qr.DOM&&n===document){if(c[Mt])return;c[Mt]=!0}let Rt=n.getElementById("mceDefaultStyles");if(!Rt){Rt=n.createElement("style"),Rt.id="mceDefaultStyles",Rt.type="text/css";const Rn=n.head;Rn.firstChild?Rn.insertBefore(Rt,Rn.firstChild):Rn.appendChild(Rt)}Rt.styleSheet?Rt.styleSheet.cssText+=Mt:Rt.appendChild(n.createTextNode(Mt))},$c=Mt=>{Mt||(Mt=""),Ne(Mt.split(","),Rt=>{p[Rt]=!0,B.load(Rt).catch(ot)})},Qh=(Mt,Rt,Rn)=>{eo(Mt,xn=>{if(Jn(xn)){const Io=Ke.fromDom(xn),br=Rt.split(" ");Ne(br,ha=>{Oe(Rn)?(Rn?ef:zc)(Io,ha):Gh(Io,ha)})}})},qd=(Mt,Rt)=>{Qh(Mt,Rt,!0)},Dm=(Mt,Rt)=>{Qh(Mt,Rt,!1)},qO=(Mt,Rt)=>{const Rn=Ve(Mt),xn=Rt.split(" ");return Oe(Rn)&&tr(xn,Io=>Pf(Rn,Io))},Pw=Mt=>{eo(Mt,Rt=>Um(Ke.fromDom(Rt),"display"))},GO=Mt=>{eo(Mt,Rt=>Gl(Ke.fromDom(Rt),"display","none"))},KO=Mt=>{const Rt=Ve(Mt);return Oe(Rt)&&Gr(Pa(Rt,"display"),"none")},Z4=Mt=>(Mt||"mce_")+w++,H4=Mt=>{const Rt=Ve(Mt);return Oe(Rt)?Jn(Rt.dom)?Rt.dom.outerHTML:Xg(Rt):""},z4=(Mt,Rt)=>{eo(Mt,Rn=>{Jn(Rn)&&(Rn.outerHTML=Rt)})},FT=(Mt,Rt)=>{const Rn=Me(Rt);return eo(Mt,xn=>{const Io=Rn==null?void 0:Rn.parentNode,br=Rn==null?void 0:Rn.nextSibling;return Io&&(br?Io.insertBefore(xn,br):Io.appendChild(xn)),xn})},QT=(Mt,Rt,Rn)=>eo(Rt,xn=>{var Io;const br=oe(Rt)?Mt.cloneNode(!0):Mt;return Rn&&Zv(s_(xn.childNodes),ha=>{br.appendChild(ha)}),(Io=xn.parentNode)===null||Io===void 0||Io.replaceChild(br,xn),xn}),ZT=(Mt,Rt)=>{if(Mt.nodeName!==Rt.toUpperCase()){const Rn=Mn(Rt);return Zv(Ot(Mt),xn=>{wt(Rn,xn.nodeName,gt(Mt,xn.nodeName))}),QT(Rn,Mt,!0),Rn}else return Mt},cC=(Mt,Rt)=>{let Rn=Mt;for(;Rn;){let xn=Rt;for(;xn&&Rn!==xn;)xn=xn.parentNode;if(Rn===xn)break;Rn=Rn.parentNode}return!Rn&&Mt.ownerDocument?Mt.ownerDocument.documentElement:Rn},T1=Mt=>{if(Jn(Mt)){const Rt=Mt.nodeName.toLowerCase()==="a"&&!gt(Mt,"href")&>(Mt,"id");if(gt(Mt,"name")||gt(Mt,"data-mce-bookmark")||Rt)return!0}return!1},uC=(Mt,Rt,Rn)=>{let xn=0;if(T1(Mt))return!1;const Io=Mt.firstChild;if(Io){const br=new _i(Io,Mt),ha=ae?ae.getWhitespaceElements():{},Nc=Rt||(ae?ae.getNonEmptyElements():null);let _u=Io;do{if(Jn(_u)){const YT=_u.getAttribute("data-mce-bogus");if(YT){_u=br.next(YT==="all");continue}const XT=_u.nodeName.toLowerCase();if(Nc&&Nc[XT]){if(XT==="br"){xn++,_u=br.next();continue}return!1}if(T1(_u))return!1}if(uh(_u)||_n(_u)&&!eg(_u.data)&&(!(Rn!=null&&Rn.includeZwsp)||!Jg(_u.data))||_n(_u)&&_u.parentNode&&ha[_u.parentNode.nodeName]&&eg(_u.data))return!1;_u=br.next()}while(_u)}return xn<=1},Mw=()=>n.createRange(),vv=(Mt,Rt,Rn)=>{let xn=Mw(),Io,br;if(Mt&&Rt&&Mt.parentNode&&Rt.parentNode){const ha=Mt.parentNode;return xn.setStart(ha,sb(Mt)),xn.setEnd(Rt.parentNode,sb(Rt)),Io=xn.extractContents(),xn=Mw(),xn.setStart(Rt.parentNode,sb(Rt)+1),xn.setEnd(ha,sb(Mt)+1),br=xn.extractContents(),ha.insertBefore(ag(E1,Io),Mt),Rn?ha.insertBefore(Rn,Mt):ha.insertBefore(Rt,Mt),ha.insertBefore(ag(E1,br),Mt),ho(Mt),Rn||Rt}else return},HT=(Mt,Rt,Rn,xn)=>{if(oe(Mt)){let Io=Mt.length;const br=[];for(;Io--;)br[Io]=HT(Mt[Io],Rt,Rn,xn);return br}else return i.collect&&(Mt===n||Mt===m)&&q.push([Mt,Rt,Rn,xn]),be.bind(Mt,Rt,Rn,xn||E1)},zT=(Mt,Rt,Rn)=>{if(oe(Mt)){let xn=Mt.length;const Io=[];for(;xn--;)Io[xn]=zT(Mt[xn],Rt,Rn);return Io}else{if(q.length>0&&(Mt===n||Mt===m)){let xn=q.length;for(;xn--;){const[Io,br,ha]=q[xn];Mt===Io&&(!Rt||Rt===br)&&(!Rn||Rn===ha)&&be.unbind(Io,br,ha)}}return be.unbind(Mt,Rt,Rn)}},Ib=(Mt,Rt,Rn)=>be.dispatch(Mt,Rt,Rn),Ov=(Mt,Rt,Rn)=>be.dispatch(Mt,Rt,Rn),VT=Mt=>{if(Mt&&Jn(Mt)){const Rt=Mt.getAttribute("data-mce-contenteditable");return Rt&&Rt!=="inherit"?Rt:Mt.contentEditable!=="inherit"?Mt.contentEditable:null}else return null},E1={doc:n,settings:i,win:m,files:p,stdMode:x,boxModel:M,styleSheetLoader:B,boundEvents:q,styles:fe,schema:ae,events:be,isBlock:Ye,root:null,clone:Pt,getRoot:hn,getViewPort:Hn,getRect:Do,getSize:yo,getParent:Ir,getParents:Ws,get:Me,getNext:fl,getPrev:Il,select:Pn,is:Cs,add:Co,create:Mn,createHTML:Ks,createFragment:Jr,remove:ho,setStyle:Lt,getStyle:yn,setStyles:Zt,removeAllAttribs:Us,setAttrib:wt,setAttribs:Cr,getAttrib:gt,getPos:$n,parseStyle:ci,serializeStyle:Ja,addStyle:Ei,loadCSS:$c,addClass:qd,removeClass:Dm,hasClass:qO,toggleClass:Qh,show:Pw,hide:GO,isHidden:KO,uniqueId:Z4,setHTML:Bs,getOuterHTML:H4,setOuterHTML:z4,decode:En,encode:jo,insertAfter:FT,replace:QT,rename:ZT,findCommonAncestor:cC,run:eo,getAttribs:Ot,isEmpty:uC,createRng:Mw,nodeIndex:sb,split:vv,bind:HT,unbind:zT,fire:Ov,dispatch:Ib,getContentEditable:VT,getContentEditableParent:Mt=>{const Rt=hn();let Rn=null;for(let xn=Mt;xn&&xn!==Rt&&(Rn=VT(xn),Rn===null);xn=xn.parentNode);return Rn},isEditable:Mt=>{if(Oe(Mt)){const Rt=Jn(Mt)?Mt:Mt.parentElement;return Oe(Rt)&&wn(Ke.fromDom(Rt))}else return!1},destroy:()=>{if(q.length>0){let Mt=q.length;for(;Mt--;){const[Rt,Rn,xn]=q[Mt];be.unbind(Rt,Rn,xn)}}ln(p,(Mt,Rt)=>{B.unload(Rt),delete p[Rt]})},isChildOf:(Mt,Rt)=>Mt===Rt||Rt.contains(Mt),dumpRng:Mt=>"startContainer: "+Mt.startContainer.nodeName+", startOffset: "+Mt.startOffset+", endContainer: "+Mt.endContainer.nodeName+", endOffset: "+Mt.endOffset},Rw=jC(fe,i,Qe(E1));return E1};Qr.DOM=Qr(document),Qr.nodeIndex=sb;const Hv=Qr.DOM,Qy=0,Zy=1,O0=2,qC=3;class um{constructor(i={}){this.states={},this.queue=[],this.scriptLoadedCallbacks={},this.queueLoadedCallbacks=[],this.loading=!1,this.settings=i}_setReferrerPolicy(i){this.settings.referrerPolicy=i}loadScript(i){return new Promise((c,m)=>{const p=Hv;let w;const x=()=>{p.remove(q),w&&(w.onerror=w.onload=w=null)},M=()=>{x(),c()},B=()=>{x(),m("Failed to load script: "+i)},q=p.uniqueId();w=document.createElement("script"),w.id=q,w.type="text/javascript",w.src=gn._addCacheSuffix(i),this.settings.referrerPolicy&&p.setAttrib(w,"referrerpolicy",this.settings.referrerPolicy),w.onload=M,w.onerror=B,(document.getElementsByTagName("head")[0]||document.body).appendChild(w)})}isDone(i){return this.states[i]===O0}markDone(i){this.states[i]=O0}add(i){const c=this;return c.queue.push(i),c.states[i]===void 0&&(c.states[i]=Qy),new Promise((p,w)=>{c.scriptLoadedCallbacks[i]||(c.scriptLoadedCallbacks[i]=[]),c.scriptLoadedCallbacks[i].push({resolve:p,reject:w})})}load(i){return this.add(i)}remove(i){delete this.states[i],delete this.scriptLoadedCallbacks[i]}loadQueue(){const i=this.queue;return this.queue=[],this.loadScripts(i)}loadScripts(i){const c=this,m=(B,q)=>{wo(c.scriptLoadedCallbacks,q).each(ae=>{Ne(ae,fe=>fe[B](q))}),delete c.scriptLoadedCallbacks[q]},p=B=>{const q=At(B,ae=>ae.status==="rejected");return q.length>0?Promise.reject($s(q,({reason:ae})=>oe(ae)?ae:[ae])):Promise.resolve()},w=B=>Promise.allSettled(pt(B,q=>c.states[q]===O0?(m("resolve",q),Promise.resolve()):c.states[q]===qC?(m("reject",q),Promise.reject(q)):(c.states[q]=Zy,c.loadScript(q).then(()=>{c.states[q]=O0,m("resolve",q);const ae=c.queue;return ae.length>0?(c.queue=[],w(ae).then(p)):Promise.resolve()},()=>(c.states[q]=qC,m("reject",q),Promise.reject(q)))))),x=B=>(c.loading=!0,w(B).then(q=>{c.loading=!1;const ae=c.queueLoadedCallbacks.shift();return he.from(ae).each(Cn),p(q)})),M=fs(i);return c.loading?new Promise((B,q)=>{c.queueLoadedCallbacks.push(()=>{x(M).then(B,q)})}):x(M)}}um.ScriptLoader=new um;const Ga=n=>{let i=n;return{get:()=>i,set:p=>{i=p}}},y0=(n,i)=>{const c=n.indexOf(i);return c!==-1&&n.indexOf(i,c+1)>c},rb=n=>te(n)&&un(n,"raw"),i_=n=>oe(n)&&n.length>1,w0={},Hy=Ga("en"),Na=()=>wo(w0,Hy.get()),id={getData:()=>vs(w0,n=>({...n})),setCode:n=>{n&&Hy.set(n)},getCode:()=>Hy.get(),add:(n,i)=>{let c=w0[n];c||(w0[n]=c={});const m=pt(bs(i),p=>p.toLowerCase());ln(i,(p,w)=>{const x=w.toLowerCase();x!==w&&y0(m,x)?(un(i,x)||(c[x]=p),c[w]=p):c[x]=p})},translate:n=>{const i=Na().getOr({}),c=x=>ce(x)?Object.prototype.toString.call(x):m(x)?"":""+x,m=x=>x===""||x===null||x===void 0,p=x=>{const M=c(x);return un(i,M)?c(i[M]):wo(i,M.toLowerCase()).map(c).getOr(M)},w=x=>x.replace(/{context:\w+}$/,"");if(m(n))return"";if(rb(n))return c(n.raw);if(i_(n)){const x=n.slice(1),M=p(n[0]).replace(/\{([0-9]+)\}/g,(B,q)=>un(x,q)?c(x[q]):B);return w(M)}return w(p(n))},isRtl:()=>Na().bind(n=>wo(n,"_dir")).exists(n=>n==="rtl"),hasCode:n=>un(w0,n)},Ia=()=>{const n=[],i={},c={},m=[],p=(Me,Ve)=>{const gt=At(m,Ot=>Ot.name===Me&&Ot.state===Ve);Ne(gt,Ot=>Ot.resolve())},w=Me=>un(i,Me),x=Me=>un(c,Me),M=Me=>{if(c[Me])return c[Me].instance},B=(Me,Ve)=>{const gt=id.getCode(),Ot=","+(Ve||"")+",";!gt||Ve&&Ot.indexOf(","+gt+",")===-1||um.ScriptLoader.add(i[Me]+"/langs/"+gt+".js")},q=(Me,Ve)=>{Ia.languageLoad!==!1&&(w(Me)?B(Me,Ve):Ye(Me,"loaded").then(()=>B(Me,Ve)))},ae=(Me,Ve)=>(n.push(Ve),c[Me]={instance:Ve},p(Me,"added"),Ve),fe=Me=>{delete i[Me],delete c[Me]},be=(Me,Ve)=>L(Ve)?L(Me)?{prefix:"",resource:Ve,suffix:""}:{prefix:Me.prefix,resource:Ve,suffix:Me.suffix}:Ve,Le=(Me,Ve)=>{if(i[Me])return Promise.resolve();let gt=L(Ve)?Ve:Ve.prefix+Ve.resource+Ve.suffix;gt.indexOf("/")!==0&>.indexOf("://")===-1&&(gt=Ia.baseURL+"/"+gt),i[Me]=gt.substring(0,gt.lastIndexOf("/"));const Ot=()=>(p(Me,"loaded"),Promise.resolve());return c[Me]?Ot():um.ScriptLoader.add(gt).then(Ot)},Ye=(Me,Ve="added")=>Ve==="added"&&x(Me)||Ve==="loaded"&&w(Me)?Promise.resolve():new Promise(gt=>{m.push({name:Me,state:Ve,resolve:gt})});return{items:n,urls:i,lookup:c,get:M,requireLangPack:q,add:ae,remove:fe,createUrl:be,load:Le,waitFor:Ye}};Ia.languageLoad=!0,Ia.baseURL="",Ia.PluginManager=Ia(),Ia.ThemeManager=Ia(),Ia.ModelManager=Ia();const Ta=n=>{const i=Ga(he.none()),c=()=>i.get().each(n);return{clear:()=>{c(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:M=>{c(),i.set(he.some(M))}}},KC=n=>{const i=Ga(he.none()),c=()=>i.get().each(M=>clearInterval(M));return{clear:()=>{c(),i.set(he.none())},isSet:()=>i.get().isSome(),get:()=>i.get(),set:M=>{c(),i.set(he.some(setInterval(M,n)))}}},Sh=()=>{const n=Ta(ot);return{...n,on:c=>n.get().each(c)}},_0=(n,i)=>{let c=null;return{cancel:()=>{G(c)||(clearTimeout(c),c=null)},throttle:(...w)=>{G(c)&&(c=setTimeout(()=>{c=null,n.apply(null,w)},i))}}},zv=(n,i)=>{let c=null;const m=()=>{G(c)||(clearTimeout(c),c=null)};return{cancel:m,throttle:(...w)=>{m(),c=setTimeout(()=>{c=null,n.apply(null,w)},i)}}},ad=Qe("mce-annotation"),ff=Qe("data-mce-annotation"),Kp=Qe("data-mce-annotation-uid"),ib=Qe("data-mce-annotation-active"),S0=Qe("data-mce-annotation-classes"),C0=Qe("data-mce-annotation-attrs"),a_=n=>i=>vt(i,n),Vy=(n,i)=>{const c=n.selection.getRng(),m=Ke.fromDom(c.startContainer),p=Ke.fromDom(n.getBody()),w=i.fold(()=>"."+ad(),B=>`[${ff()}="${B}"]`),x=tf(m,c.startOffset).getOr(m);return at(x,w,a_(p)).bind(B=>Va(B,`${Kp()}`).bind(q=>Va(B,`${ff()}`).map(ae=>{const fe=c_(n,q);return{uid:q,name:ae,elements:fe}})))},JC=n=>kl(n)&&Pf(n,ad()),l_=(n,i)=>qi(n,"data-mce-bogus")||Ty(n,'[data-mce-bogus="all"]',a_(i)),c_=(n,i)=>{const c=Ke.fromDom(n.getBody()),m=pl(c,`[${Kp()}="${i}"]`);return At(m,p=>!l_(p,c))},Wy=(n,i)=>{const c=Ke.fromDom(n.getBody()),m=pl(c,`[${ff()}="${i}"]`),p={};return Ne(m,w=>{if(!l_(w,c)){const x=Fl(w,Kp()),M=wo(p,x).getOr([]);p[x]=M.concat([w])}}),p},u_=(n,i)=>{const c=Ga({}),m=()=>({listeners:[],previous:Sh()}),p=(fe,be)=>{w(fe,Le=>(be(Le),Le))},w=(fe,be)=>{const Le=c.get(),Ye=wo(Le,fe).getOrThunk(m),Me=be(Ye);Le[fe]=Me,c.set(Le)},x=(fe,be,Le)=>{p(fe,Ye=>{Ne(Ye.listeners,Me=>Me(!0,fe,{uid:be,nodes:pt(Le,Ve=>Ve.dom)}))})},M=fe=>{p(fe,be=>{Ne(be.listeners,Le=>Le(!1,fe))})},B=(fe,be)=>{Ne(c_(n,fe),Le=>{be?Pr(Le,ib(),"true"):Vi(Le,ib())})},q=zv(()=>{const fe=Ns(i.getNames());Ne(fe,be=>{w(be,Le=>{const Ye=Le.previous.get();return Vy(n,he.some(be)).fold(()=>{Ye.each(Me=>{M(be),Le.previous.clear(),B(Me,!1)})},({uid:Me,name:Ve,elements:gt})=>{Gr(Ye,Me)||(Ye.each(Ot=>B(Ot,!1)),x(Ve,Me,gt),Le.previous.set(Me),B(Me,!0))}),{previous:Le.previous,listeners:Le.listeners}})})},30);return n.on("remove",()=>{q.cancel()}),n.on("NodeChange",()=>{q.throttle()}),{addListener:(fe,be)=>{w(fe,Le=>({previous:Le.previous,listeners:Le.listeners.concat([be])}))}}},EE=(n,i)=>{const c=ff(),m=w=>he.from(w.attr(c)).bind(i.lookup),p=w=>{var x,M;w.attr(Kp(),null),w.attr(ff(),null),w.attr(ib(),null);const B=he.from(w.attr(C0())).map(be=>be.split(",")).getOr([]),q=he.from(w.attr(S0())).map(be=>be.split(",")).getOr([]);Ne(B,be=>w.attr(be,null));const ae=(M=(x=w.attr("class"))===null||x===void 0?void 0:x.split(" "))!==null&&M!==void 0?M:[],fe=wa(ae,[ad()].concat(q));w.attr("class",fe.length>0?fe.join(" "):null),w.attr(S0(),null),w.attr(C0(),null)};n.serializer.addTempAttr(ib()),n.serializer.addAttributeFilter(c,w=>{for(const x of w)m(x).each(M=>{M.persistent===!1&&(x.name==="span"?x.unwrap():p(x))})})},Vv=()=>{const n={};return{register:(p,w)=>{n[p]={name:p,settings:w}},lookup:p=>wo(n,p).map(w=>w.settings),getNames:()=>bs(n)}};let f_=0;const Li=n=>{const c=new Date().getTime(),m=Math.floor(Math.random()*1e9);return f_++,n+"_"+m+f_+String(c)},Wv=(n,i)=>{Ne(i,c=>{ef(n,c)})},Uy=(n,i)=>{Ne(i,c=>{zc(n,c)})},d_=(n,i)=>Ke.fromDom(n.dom.cloneNode(i)),ug=n=>d_(n,!1),pc=n=>d_(n,!0),gu=(n,i)=>{const c=Ke.fromTag(i),m=Kf(n);return Ju(c,m),c},h_=(n,i)=>{const c=gu(n,i);iu(n,c);const m=Da(n);return ni(c,m),wr(n),c},Yy=(n,i,c=je)=>{const m=new _i(n,i),p=w=>{let x;do x=m[w]();while(x&&!_n(x)&&!c(x));return he.from(x).filter(_n)};return{current:()=>he.from(m.current()).filter(_n),next:()=>p("next"),prev:()=>p("prev"),prev2:()=>p("prev2")}},fp=(n,i)=>{const c=i||(x=>n.isBlock(x)||mi(x)||Es(x)),m=(x,M,B,q)=>{if(_n(x)){const ae=q(x,M,x.data);if(ae!==-1)return he.some({container:x,offset:ae})}return B().bind(ae=>m(ae.container,ae.offset,B,q))};return{backwards:(x,M,B,q)=>{const ae=Yy(x,q!=null?q:n.getRoot(),c);return m(x,M,()=>ae.prev().map(fe=>({container:fe,offset:fe.length})),B).getOrNull()},forwards:(x,M,B,q)=>{const ae=Yy(x,q!=null?q:n.getRoot(),c);return m(x,M,()=>ae.next().map(fe=>({container:fe,offset:0})),B).getOrNull()}}},dp=Math.round,Jp=n=>n?{left:dp(n.left),top:dp(n.top),bottom:dp(n.bottom),right:dp(n.right),width:dp(n.width),height:dp(n.height)}:{left:0,top:0,bottom:0,right:0,width:0,height:0},e1=(n,i)=>(n=Jp(n),i||(n.left=n.left+n.width),n.right=n.left,n.width=0,n),fg=(n,i)=>n.left===i.left&&n.top===i.top&&n.bottom===i.bottom&&n.right===i.right,Uv=(n,i,c)=>n>=0&&n<=Math.min(i.height,c.height)/2,sa=(n,i)=>{const c=Math.min(i.height/2,n.height/2);return n.bottom-ci.bottom?!1:Uv(i.top-n.bottom,n,i)},df=(n,i)=>n.top>i.bottom?!0:n.bottomi>=n.left&&i<=n.right&&c>=n.top&&c<=n.bottom,ek=n=>zn(n,(i,c)=>i.fold(()=>he.some(c),m=>{const p=Math.min(c.left,m.left),w=Math.min(c.top,m.top),x=Math.max(c.right,m.right),M=Math.max(c.bottom,m.bottom);return he.some({top:w,right:x,bottom:M,left:p,width:x-p,height:M-w})}),he.none()),Xy=(n,i,c)=>{const m=Math.max(Math.min(i,n.left+n.width),n.left),p=Math.max(Math.min(c,n.top+n.height),n.top);return Math.sqrt((i-m)*(i-m)+(c-p)*(c-p))},tk=(n,i)=>Math.max(0,Math.min(n.bottom,i.bottom)-Math.max(n.top,i.top)),t1=(n,i,c)=>Math.min(Math.max(n,i),c),lb=n=>{const i=n.startContainer,c=n.startOffset;return i===n.endContainer&&i.hasChildNodes()&&n.endOffset===c+1?i.childNodes[c]:null},ld=(n,i)=>{if(Jn(n)&&n.hasChildNodes()){const c=n.childNodes,m=t1(i,0,c.length-1);return c[m]}else return n},jy=(n,i)=>{if(!(i<0&&Jn(n)&&n.hasChildNodes()))return ld(n,i)},m_=new RegExp("[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0963\u0981\u09BC\u09BE\u09C1-\u09C4\u09CD\u09D7\u09E2-\u09E3\u0A01-\u0A02\u0A3C\u0A41-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D\u0A51\u0A70-\u0A71\u0A75\u0A81-\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7-\u0AC8\u0ACD\u0AE2-\u0AE3\u0B01\u0B3C\u0B3E\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B57\u0B62-\u0B63\u0B82\u0BBE\u0BC0\u0BCD\u0BD7\u0C00\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C62-\u0C63\u0C81\u0CBC\u0CBF\u0CC2\u0CC6\u0CCC-\u0CCD\u0CD5-\u0CD6\u0CE2-\u0CE3\u0D01\u0D3E\u0D41-\u0D44\u0D4D\u0D57\u0D62-\u0D63\u0DCA\u0DCF\u0DD2-\u0DD4\u0DD6\u0DDF\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039-\u103A\u103D-\u103E\u1058-\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085-\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B4-\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193B\u1A17-\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80-\u1B81\u1BA2-\u1BA5\u1BA8-\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8-\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8-\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u200C-\u200D\u20D0-\u20DC\u20DD-\u20E0\u20E1\u20E2-\u20E4\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u302E-\u302F\u3099-\u309A\uA66F\uA670-\uA672\uA674-\uA67D\uA69E-\uA69F\uA6F0-\uA6F1\uA802\uA806\uA80B\uA825-\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9E5\uAA29-\uAA2E\uAA31-\uAA32\uAA35-\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7-\uAAB8\uAABE-\uAABF\uAAC1\uAAEC-\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFF9E-\uFF9F]"),g_=n=>L(n)&&n.charCodeAt(0)>=768&&m_.test(n),nk=(...n)=>i=>{for(let c=0;ci=>{for(let c=0;cn?n.createRange():Qr.DOM.createRng(),qs=n=>L(n)&&/[\r\n\t ]/.test(n),pu=n=>!!n.setStart&&!!n.setEnd,hg=n=>{const i=n.startContainer,c=n.startOffset;if(qs(n.toString())&&v_(i.parentNode)&&_n(i)){const m=i.data;if(qs(m[c-1])||qs(m[c+1]))return!0}return!1},Gy=n=>{const i=n.ownerDocument,c=cb(i),m=i.createTextNode(Kr),p=n.parentNode;p.insertBefore(m,n),c.setStart(m,0),c.setEnd(m,1);const w=Jp(c.getBoundingClientRect());return p.removeChild(m),w},Yi=n=>{const i=n.startContainer,c=n.endContainer,m=n.startOffset,p=n.endOffset;if(i===c&&_n(c)&&m===0&&p===1){const w=n.cloneRange();return w.setEndAfter(c),mg(w)}else return null},Ky=n=>n.left===0&&n.right===0&&n.top===0&&n.bottom===0,mg=n=>{var i;let c;const m=n.getClientRects();return m.length>0?c=Jp(m[0]):c=Jp(n.getBoundingClientRect()),!pu(n)&&dg(n)&&Ky(c)?Gy(n):Ky(c)&&pu(n)&&(i=Yi(n))!==null&&i!==void 0?i:c},Oa=(n,i)=>{const c=e1(n,i);return c.width=1,c.right=c.left+1,c},fm=n=>{const i=[],c=x=>{x.height!==0&&(i.length>0&&fg(x,i[i.length-1])||i.push(x))},m=(x,M)=>{const B=cb(x.ownerDocument);if(M0&&(B.setStart(x,M-1),B.setEnd(x,M),hg(B)||c(Oa(mg(B),!1))),M{const m=()=>(o1(n),i===0),p=()=>o1(n)?i>=n.data.length:i>=n.childNodes.length,w=()=>{const ae=cb(n.ownerDocument);return ae.setStart(n,i),ae.setEnd(n,i),ae},x=()=>(c||(c=fm(Vt(n,i))),c),M=()=>x().length>0,B=ae=>ae&&n===ae.container()&&i===ae.offset(),q=ae=>hf(n,ae?i-1:i);return{container:Qe(n),offset:Qe(i),toRange:w,getClientRects:x,isVisible:M,isAtStart:m,isAtEnd:p,isEqual:B,getNode:q}};Vt.fromRangeStart=n=>Vt(n.startContainer,n.startOffset),Vt.fromRangeEnd=n=>Vt(n.endContainer,n.endOffset),Vt.after=n=>Vt(n.parentNode,Yv(n)+1),Vt.before=n=>Vt(n.parentNode,Yv(n)),Vt.isAbove=(n,i)=>ri($o(i.getClientRects()),Po(n.getClientRects()),sa).getOr(!1),Vt.isBelow=(n,i)=>ri(Po(i.getClientRects()),$o(n.getClientRects()),df).getOr(!1),Vt.isAtStart=n=>n?n.isAtStart():!1,Vt.isAtEnd=n=>n?n.isAtEnd():!1,Vt.isTextPosition=n=>n?_n(n.container()):!1,Vt.isElementPosition=n=>!Vt.isTextPosition(n);const T0=(n,i)=>{_n(i)&&i.data.length===0&&n.remove(i)},Jy=(n,i,c)=>{i.insertNode(c),T0(n,c.previousSibling),T0(n,c.nextSibling)},E0=(n,i,c)=>{const m=he.from(c.firstChild),p=he.from(c.lastChild);i.insertNode(c),m.each(w=>T0(n,w.previousSibling)),p.each(w=>T0(n,w.nextSibling))},Ch=(n,i,c)=>{K1(c)?E0(n,i,c):Jy(n,i,c)},mf=_n,ub=Pd,Xv=Qr.nodeIndex,e2=n=>{const i=n.parentNode;return ub(i)?e2(i):i},jv=n=>n?Ge(n.childNodes,(i,c)=>(ub(c)&&c.nodeName!=="BR"?i=i.concat(jv(c)):i.push(c),i),[]):[],A0=(n,i)=>{let c=n;for(;(c=c.previousSibling)&&mf(c);)i+=c.data.length;return i},kh=n=>i=>n===i,cd=n=>{let i,c;i=jv(e2(n)),c=qe(i,kh(n),n),i=i.slice(0,c+1);const m=Ge(i,(p,w,x)=>(mf(w)&&mf(i[x-1])&&p++,p),0);return i=Qa(i,$f([n.nodeName])),c=qe(i,kh(n),n),c-m},Fu=n=>(mf(n)?"text()":n.nodeName.toLowerCase())+"["+cd(n)+"]",zl=(n,i,c)=>{const m=[];for(let p=i.parentNode;p&&p!==n&&!(c&&c(p));p=p.parentNode)m.push(p);return m},t2=(n,i)=>{let c=[],m=i.container(),p=i.offset(),w;if(mf(m))w=A0(m,p);else{const M=m.childNodes;p>=M.length?(w="after",p=M.length-1):w="before",m=M[p]}c.push(Fu(m));let x=zl(n,m);return x=Qa(x,st(Pd)),c=c.concat(Zi(x,M=>Fu(M))),c.reverse().join("/")+","+w},hp=(n,i,c)=>{let m=jv(n);return m=Qa(m,(p,w)=>!mf(p)||!mf(m[w-1])),m=Qa(m,$f([i])),m[c]},O_=(n,i)=>{let c=n,m=0;for(;mf(c);){const p=c.data.length;if(i>=m&&i<=m+p){n=c,i=i-m;break}if(!mf(c.nextSibling)){n=c,i=p;break}m+=p,c=c.nextSibling}return mf(n)&&i>n.data.length&&(i=n.data.length),Vt(n,i)},D0=(n,i)=>{if(!i)return null;const c=i.split(","),m=c[0].split("/"),p=c.length>1?c[1]:"before",w=Ge(m,(x,M)=>{const B=/([\w\-\(\)]+)\[([0-9]+)\]/.exec(M);return B?(B[1]==="text()"&&(B[1]="#text"),hp(x,B[1],parseInt(B[2],10))):null},n);if(!w)return null;if(!mf(w)&&w.parentNode){let x;return p==="after"?x=Xv(w)+1:x=Xv(w),Vt(w.parentNode,x)}return O_(w,parseInt(p,10))},s1=Es,n2=(n,i,c)=>{let m=n(i.data.slice(0,c)).length;for(let p=i.previousSibling;p&&_n(p);p=p.previousSibling)m+=n(p.data).length;return m},qv=(n,i,c,m,p)=>{const w=p?m.startContainer:m.endContainer;let x=p?m.startOffset:m.endOffset;const M=[],B=n.getRoot();if(_n(w))M.push(c?n2(i,w,x):x);else{let q=0;const ae=w.childNodes;x>=ae.length&&ae.length&&(q=1,x=Math.max(0,ae.length-1)),M.push(n.nodeIndex(ae[x],c)+q)}for(let q=w;q&&q!==B;q=q.parentNode)M.push(n.nodeIndex(q,c));return M},y_=(n,i,c,m)=>{const p=i.dom,w=qv(p,n,c,m,!0),x=i.isForward(),M=oa(m)?{isFakeCaret:!0}:{};if(i.isCollapsed())return{start:w,forward:x,...M};{const B=qv(p,n,c,m,!1);return{start:w,end:B,forward:x,...M}}},Gv=(n,i,c)=>{let m=0;return gn.each(n.select(i),p=>{if(p.getAttribute("data-mce-bogus")!=="all"){if(p===c)return!1;m++;return}}),m},o2=(n,i)=>{let c=i?n.startContainer:n.endContainer,m=i?n.startOffset:n.endOffset;if(Jn(c)&&c.nodeName==="TR"){const p=c.childNodes;c=p[Math.min(i?m:m-1,p.length-1)],c&&(m=i?0:c.childNodes.length,i?n.setStart(c,m):n.setEnd(c,m))}},vl=n=>(o2(n,!0),o2(n,!1),n),ec=(n,i)=>{if(Jn(n)&&(n=ld(n,i),s1(n)))return n;if(_r(n)){_n(n)&&Si(n)&&(n=n.parentNode);let c=n.previousSibling;if(s1(c)||(c=n.nextSibling,s1(c)))return c}},Qu=n=>ec(n.startContainer,n.startOffset)||ec(n.endContainer,n.endOffset),Zr=(n,i,c)=>{const m=c.getNode(),p=c.getRng();if(m.nodeName==="IMG"||s1(m)){const x=m.nodeName;return{name:x,index:Gv(c.dom,x,m)}}const w=Qu(p);if(w){const x=w.tagName;return{name:x,index:Gv(c.dom,x,w)}}return y_(n,c,i,p)},tc=n=>{const i=n.getRng();return{start:t2(n.dom.getRoot(),Vt.fromRangeStart(i)),end:t2(n.dom.getRoot(),Vt.fromRangeEnd(i)),forward:n.isForward()}},Vl=n=>({rng:n.getRng(),forward:n.isForward()}),dm=(n,i,c)=>{const m={"data-mce-type":"bookmark",id:i,style:"overflow:hidden;line-height:0px"};return c?n.create("span",m,""):n.create("span",m)},Sr=(n,i)=>{const c=n.dom;let m=n.getRng();const p=c.uniqueId(),w=n.isCollapsed(),x=n.getNode(),M=x.nodeName,B=n.isForward();if(M==="IMG")return{name:M,index:Gv(c,M,x)};const q=vl(m.cloneRange());if(!w){q.collapse(!1);const fe=dm(c,p+"_end",i);Ch(c,q,fe)}m=vl(m),m.collapse(!0);const ae=dm(c,p+"_start",i);return Ch(c,m,ae),n.moveToBookmark({id:p,keep:!0,forward:B}),{id:p,forward:B}},w_=(n,i,c=!1)=>i===2?Zr(In,c,n):i===3?tc(n):i?Vl(n):Sr(n,!1),bu=He(Zr,Bt,!0),Dl=n=>{const i=w=>w(n),c=Qe(n),m=()=>p,p={tag:!0,inner:n,fold:(w,x)=>x(n),isValue:mt,isError:je,map:w=>bc.value(w(n)),mapError:m,bind:i,exists:i,forall:i,getOr:c,or:m,getOrThunk:c,orThunk:m,getOrDie:c,each:w=>{w(n)},toOptional:()=>he.some(n)};return p},s2=n=>{const i=()=>c,c={tag:!1,inner:n,fold:(m,p)=>m(n),isValue:je,isError:mt,map:i,mapError:m=>bc.error(m(n)),bind:i,exists:je,forall:mt,getOr:Bt,or:Bt,getOrThunk:Et,orThunk:Et,getOrDie:rn(String(n)),each:ot,toOptional:he.none};return c},bc={value:Dl,error:s2,fromOption:(n,i)=>n.fold(()=>s2(i),Dl)},pg={generate:n=>{if(!oe(n))throw new Error("cases must be an array");if(n.length===0)throw new Error("there must be at least one case");const i=[],c={};return Ne(n,(m,p)=>{const w=bs(m);if(w.length!==1)throw new Error("one and only one name per case");const x=w[0],M=m[x];if(c[x]!==void 0)throw new Error("duplicate key detected:"+x);if(x==="cata")throw new Error("cannot have a case named cata (sorry)");if(!oe(M))throw new Error("case arguments must be an array");i.push(x),c[x]=(...B)=>{const q=B.length;if(q!==M.length)throw new Error("Wrong number of arguments to case "+x+". Expected "+M.length+" ("+M+"), got "+q);return{fold:(...fe)=>{if(fe.length!==n.length)throw new Error("Wrong number of arguments to fold. Expected "+n.length+", got "+fe.length);return fe[p].apply(null,B)},match:fe=>{const be=bs(fe);if(i.length!==be.length)throw new Error("Wrong number of arguments to match. Expected: "+i.join(",")+` Actual: `+be.join(","));if(!tr(i,Ye=>kt(be,Ye)))throw new Error("Not all branches were specified when using match. Specified: "+be.join(", ")+` Required: `+i.join(", "));return fe[x].apply(null,B)},log:fe=>{console.log(fe,{constructors:i,constructor:x,params:B})}}}}),c}};pg.generate([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);const ok=n=>{const i=[],c=[];return Ne(n,m=>{m.fold(p=>{i.push(p)},p=>{c.push(p)})}),{errors:i,values:c}},sk=n=>n.type==="inline-command"||n.type==="inline-format",r2=n=>n.type==="block-command"||n.type==="block-format",i2=n=>{const i=m=>bc.error({message:m,pattern:n}),c=(m,p,w)=>{if(n.format!==void 0){let x;if(oe(n.format)){if(!tr(n.format,L))return i(m+" pattern has non-string items in the `format` array");x=n.format}else if(L(n.format))x=[n.format];else return i(m+" pattern has non-string `format` parameter");return bc.value(p(x))}else return n.cmd!==void 0?L(n.cmd)?bc.value(w(n.cmd,n.value)):i(m+" pattern has non-string `cmd` parameter"):i(m+" pattern is missing both `format` and `cmd` parameters")};if(!te(n))return i("Raw pattern is not an object");if(!L(n.start))return i("Raw pattern is missing `start` parameter");if(n.end!==void 0){if(!L(n.end))return i("Inline pattern has non-string `end` parameter");if(n.start.length===0&&n.end.length===0)return i("Inline pattern has empty `start` and `end` parameters");let m=n.start,p=n.end;return p.length===0&&(p=m,m=""),c("Inline",w=>({type:"inline-format",start:m,end:p,format:w}),(w,x)=>({type:"inline-command",start:m,end:p,cmd:w,value:x}))}else return n.replacement!==void 0?L(n.replacement)?n.start.length===0?i("Replacement pattern has empty `start` parameter"):bc.value({type:"inline-command",start:"",end:n.start,cmd:"mceInsertContent",value:n.replacement}):i("Replacement pattern has non-string `replacement` parameter"):n.start.length===0?i("Block pattern has empty `start` parameter"):c("Block",m=>({type:"block-format",start:n.start,format:m[0]}),(m,p)=>({type:"block-command",start:n.start,cmd:m,value:p}))},hm=n=>At(n,r2),a2=n=>At(n,sk),r1=(n,i)=>({inlinePatterns:a2(n),blockPatterns:hm(n),dynamicPatternsLookup:i}),Ol=n=>{const i=ok(pt(n,i2));return Ne(i.errors,c=>console.error(c.message,c.pattern)),i.values},Pl=n=>i=>{const c=n(i);return Ol(c)},Tn=ys().deviceType,rk=Tn.isTouch(),nc=Qr.DOM,ik=n=>{const i=n.indexOf("=")>0?n.split(/[;,](?![^=;,]*(?:[;,]|$))/):n.split(",");return zn(i,(c,m)=>{const p=m.split("="),w=p[0],x=p.length>1?p[1]:w;return c[kc(w)]=kc(x),c},{})},l2=n=>K(n,RegExp),no=n=>i=>i.options.get(n),Pc=n=>L(n)||te(n),c2=(n,i="")=>c=>{const m=L(c);if(m)if(c.indexOf("=")!==-1){const p=ik(c);return{value:wo(p,n.id).getOr(i),valid:m}}else return{value:c,valid:m};else return{valid:!1,message:"Must be a string."}},fb=n=>{const i=n.options.register;i("id",{processor:"string",default:n.id}),i("selector",{processor:"string"}),i("target",{processor:"object"}),i("suffix",{processor:"string"}),i("cache_suffix",{processor:"string"}),i("base_url",{processor:"string"}),i("referrer_policy",{processor:"string",default:""}),i("language_load",{processor:"boolean",default:!0}),i("inline",{processor:"boolean",default:!1}),i("iframe_attrs",{processor:"object",default:{}}),i("doctype",{processor:"string",default:""}),i("document_base_url",{processor:"string",default:n.documentBaseUrl}),i("body_id",{processor:c2(n,"tinymce"),default:"tinymce"}),i("body_class",{processor:c2(n),default:""}),i("content_security_policy",{processor:"string",default:""}),i("br_in_pre",{processor:"boolean",default:!0}),i("forced_root_block",{processor:c=>{const m=L(c)&&yr(c);return m?{value:c,valid:m}:{valid:!1,message:"Must be a non-empty string."}},default:"p"}),i("forced_root_block_attrs",{processor:"object",default:{}}),i("newline_behavior",{processor:c=>{const m=kt(["block","linebreak","invert","default"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: block, linebreak, invert or default."}},default:"default"}),i("br_newline_selector",{processor:"string",default:".mce-toc h2,figcaption,caption"}),i("no_newline_selector",{processor:"string",default:""}),i("keep_styles",{processor:"boolean",default:!0}),i("end_container_on_empty_block",{processor:c=>we(c)?{valid:!0,value:c}:L(c)?{valid:!0,value:c}:{valid:!1,message:"Must be boolean or a string"},default:"blockquote"}),i("font_size_style_values",{processor:"string",default:"xx-small,x-small,small,medium,large,x-large,xx-large"}),i("font_size_legacy_values",{processor:"string",default:"xx-small,small,medium,large,x-large,xx-large,300%"}),i("font_size_classes",{processor:"string",default:""}),i("automatic_uploads",{processor:"boolean",default:!0}),i("images_reuse_filename",{processor:"boolean",default:!1}),i("images_replace_blob_uris",{processor:"boolean",default:!0}),i("icons",{processor:"string",default:""}),i("icons_url",{processor:"string",default:""}),i("images_upload_url",{processor:"string",default:""}),i("images_upload_base_path",{processor:"string",default:""}),i("images_upload_credentials",{processor:"boolean",default:!1}),i("images_upload_handler",{processor:"function"}),i("language",{processor:"string",default:"en"}),i("language_url",{processor:"string",default:""}),i("entity_encoding",{processor:"string",default:"named"}),i("indent",{processor:"boolean",default:!0}),i("indent_before",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_after",{processor:"string",default:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,details,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist"}),i("indent_use_margin",{processor:"boolean",default:!1}),i("indentation",{processor:"string",default:"40px"}),i("content_css",{processor:c=>{const m=c===!1||L(c)||tt(c,L);return m?L(c)?{value:pt(c.split(","),kc),valid:m}:oe(c)?{value:c,valid:m}:c===!1?{value:[],valid:m}:{value:c,valid:m}:{valid:!1,message:"Must be false, a string or an array of strings."}},default:M_(n)?[]:["default"]}),i("content_style",{processor:"string"}),i("content_css_cors",{processor:"boolean",default:!1}),i("font_css",{processor:c=>{const m=L(c)||tt(c,L);return m?{value:oe(c)?c:pt(c.split(","),kc),valid:m}:{valid:!1,message:"Must be a string or an array of strings."}},default:[]}),i("inline_boundaries",{processor:"boolean",default:!0}),i("inline_boundaries_selector",{processor:"string",default:"a[href],code,span.mce-annotation"}),i("object_resizing",{processor:c=>{const m=we(c)||L(c);return m?c===!1||Tn.isiPhone()||Tn.isiPad()?{value:"",valid:m}:{value:c===!0?"table,img,figure.image,div,video,iframe":c,valid:m}:{valid:!1,message:"Must be boolean or a string"}},default:!rk}),i("resize_img_proportional",{processor:"boolean",default:!0}),i("event_root",{processor:"object"}),i("service_message",{processor:"string"}),i("theme",{processor:c=>c===!1||L(c)||ce(c),default:"silver"}),i("theme_url",{processor:"string"}),i("formats",{processor:"object"}),i("format_empty_lines",{processor:"boolean",default:!1}),i("format_noneditable_selector",{processor:"string",default:""}),i("preview_styles",{processor:c=>{const m=c===!1||L(c);return m?{value:c===!1?"":c,valid:m}:{valid:!1,message:"Must be false or a string"}},default:"font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"}),i("custom_ui_selector",{processor:"string",default:""}),i("hidden_input",{processor:"boolean",default:!0}),i("submit_patch",{processor:"boolean",default:!0}),i("encoding",{processor:"string"}),i("add_form_submit_trigger",{processor:"boolean",default:!0}),i("add_unload_trigger",{processor:"boolean",default:!0}),i("custom_undo_redo_levels",{processor:"number",default:0}),i("disable_nodechange",{processor:"boolean",default:!1}),i("readonly",{processor:"boolean",default:!1}),i("editable_root",{processor:"boolean",default:!0}),i("plugins",{processor:"string[]",default:[]}),i("external_plugins",{processor:"object"}),i("forced_plugins",{processor:"string[]"}),i("model",{processor:"string",default:n.hasPlugin("rtc")?"plugin":"dom"}),i("model_url",{processor:"string"}),i("block_unsupported_drop",{processor:"boolean",default:!0}),i("visual",{processor:"boolean",default:!0}),i("visual_table_class",{processor:"string",default:"mce-item-table"}),i("visual_anchor_class",{processor:"string",default:"mce-item-anchor"}),i("iframe_aria_text",{processor:"string",default:"Rich Text Area. Press ALT-0 for help."}),i("setup",{processor:"function"}),i("init_instance_callback",{processor:"function"}),i("url_converter",{processor:"function",default:n.convertURL}),i("url_converter_scope",{processor:"object",default:n}),i("urlconverter_callback",{processor:"function"}),i("allow_conditional_comments",{processor:"boolean",default:!1}),i("allow_html_data_urls",{processor:"boolean",default:!1}),i("allow_svg_data_urls",{processor:"boolean"}),i("allow_html_in_named_anchor",{processor:"boolean",default:!1}),i("allow_script_urls",{processor:"boolean",default:!1}),i("allow_unsafe_link_target",{processor:"boolean",default:!1}),i("convert_fonts_to_spans",{processor:"boolean",default:!0,deprecated:!0}),i("fix_list_elements",{processor:"boolean",default:!1}),i("preserve_cdata",{processor:"boolean",default:!1}),i("remove_trailing_brs",{processor:"boolean",default:!0}),i("pad_empty_with_br",{processor:"boolean",default:!1}),i("inline_styles",{processor:"boolean",default:!0,deprecated:!0}),i("element_format",{processor:"string",default:"html"}),i("entities",{processor:"string"}),i("schema",{processor:"string",default:"html5"}),i("convert_urls",{processor:"boolean",default:!0}),i("relative_urls",{processor:"boolean",default:!0}),i("remove_script_host",{processor:"boolean",default:!0}),i("custom_elements",{processor:"string"}),i("extended_valid_elements",{processor:"string"}),i("invalid_elements",{processor:"string"}),i("invalid_styles",{processor:Pc}),i("valid_children",{processor:"string"}),i("valid_classes",{processor:Pc}),i("valid_elements",{processor:"string"}),i("valid_styles",{processor:Pc}),i("verify_html",{processor:"boolean",default:!0}),i("auto_focus",{processor:c=>L(c)||c===!0}),i("browser_spellcheck",{processor:"boolean",default:!1}),i("protect",{processor:"array"}),i("images_file_types",{processor:"string",default:"jpeg,jpg,jpe,jfi,jif,jfif,png,gif,bmp,webp"}),i("deprecation_warnings",{processor:"boolean",default:!0}),i("a11y_advanced_options",{processor:"boolean",default:!1}),i("api_key",{processor:"string"}),i("paste_block_drop",{processor:"boolean",default:!1}),i("paste_data_images",{processor:"boolean",default:!0}),i("paste_preprocess",{processor:"function"}),i("paste_postprocess",{processor:"function"}),i("paste_webkit_styles",{processor:"string",default:"none"}),i("paste_remove_styles_if_webkit",{processor:"boolean",default:!0}),i("paste_merge_formats",{processor:"boolean",default:!0}),i("smart_paste",{processor:"boolean",default:!0}),i("paste_as_text",{processor:"boolean",default:!1}),i("paste_tab_spaces",{processor:"number",default:4}),i("text_patterns",{processor:c=>tt(c,te)||c===!1?{value:Ol(c===!1?[]:c),valid:!0}:{valid:!1,message:"Must be an array of objects or false."},default:[{start:"*",end:"*",format:"italic"},{start:"**",end:"**",format:"bold"},{start:"#",format:"h1"},{start:"##",format:"h2"},{start:"###",format:"h3"},{start:"####",format:"h4"},{start:"#####",format:"h5"},{start:"######",format:"h6"},{start:"1. ",cmd:"InsertOrderedList"},{start:"* ",cmd:"InsertUnorderedList"},{start:"- ",cmd:"InsertUnorderedList"}]}),i("text_patterns_lookup",{processor:c=>ce(c)?{value:Pl(c),valid:!0}:{valid:!1,message:"Must be a single function"},default:c=>[]}),i("noneditable_class",{processor:"string",default:"mceNonEditable"}),i("editable_class",{processor:"string",default:"mceEditable"}),i("noneditable_regexp",{processor:c=>tt(c,l2)?{value:c,valid:!0}:l2(c)?{value:[c],valid:!0}:{valid:!1,message:"Must be a RegExp or an array of RegExp."},default:[]}),i("table_tab_navigation",{processor:"boolean",default:!0}),i("highlight_on_focus",{processor:"boolean",default:!1}),i("xss_sanitization",{processor:"boolean",default:!0}),i("details_initial_state",{processor:c=>{const m=kt(["inherited","collapsed","expanded"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("details_serialized_state",{processor:c=>{const m=kt(["inherited","collapsed","expanded"],c);return m?{value:c,valid:m}:{valid:!1,message:"Must be one of: inherited, collapsed, or expanded."}},default:"inherited"}),i("init_content_sync",{processor:"boolean",default:!1}),i("newdocument_content",{processor:"string",default:""}),n.on("ScriptsLoaded",()=>{i("directionality",{processor:"string",default:id.isRtl()?"rtl":void 0}),i("placeholder",{processor:"string",default:nc.getAttrib(n.getElement(),"placeholder")})})},gf=no("iframe_attrs"),Kv=no("doctype"),i1=no("document_base_url"),Qf=no("body_id"),al=no("body_class"),Qd=no("content_security_policy"),Zd=no("br_in_pre"),jc=no("forced_root_block"),db=no("forced_root_block_attrs"),u2=no("newline_behavior"),__=no("br_newline_selector"),f2=no("no_newline_selector"),xh=no("keep_styles"),jr=no("end_container_on_empty_block"),Jv=no("automatic_uploads"),ud=no("images_reuse_filename"),S_=no("images_replace_blob_uris"),C_=no("icons"),fa=no("icons_url"),ak=no("images_upload_url"),eO=no("images_upload_base_path"),tO=no("images_upload_credentials"),k_=no("images_upload_handler"),lk=no("content_css_cors"),hb=no("referrer_policy"),x_=no("language"),ck=no("language_url"),T_=no("indent_use_margin"),uk=no("indentation"),E_=no("content_css"),nO=no("content_style"),mp=no("font_css"),mb=no("directionality"),Xi=no("inline_boundaries_selector"),d2=no("object_resizing"),Mc=no("resize_img_proportional"),gb=no("placeholder"),ll=no("event_root"),A_=no("service_message"),mm=no("theme"),fk=no("theme_url"),oc=no("model"),pf=no("model_url"),P0=no("inline_boundaries"),dk=no("formats"),hk=no("preview_styles"),D_=no("format_empty_lines"),M0=no("format_noneditable_selector"),P_=no("custom_ui_selector"),M_=no("inline"),gp=no("hidden_input"),mk=no("submit_patch"),gk=no("add_form_submit_trigger"),pk=no("add_unload_trigger"),h2=no("custom_undo_redo_levels"),oO=no("disable_nodechange"),bg=no("readonly"),R_=no("editable_root"),$_=no("content_css_cors"),sO=no("plugins"),pb=no("external_plugins"),vg=no("block_unsupported_drop"),rO=no("visual"),iO=no("visual_table_class"),R0=no("visual_anchor_class"),N_=no("iframe_aria_text"),Th=no("setup"),$0=no("init_instance_callback"),I_=no("urlconverter_callback"),Eh=no("auto_focus"),pp=no("browser_spellcheck"),m2=no("protect"),B_=no("paste_block_drop"),aO=no("paste_data_images"),bk=no("paste_preprocess"),L_=no("paste_postprocess"),vk=no("newdocument_content"),Ok=no("paste_webkit_styles"),F_=no("paste_remove_styles_if_webkit"),Q_=no("paste_merge_formats"),Z_=no("smart_paste"),yk=no("paste_as_text"),wk=no("paste_tab_spaces"),_k=no("allow_html_data_urls"),H_=no("text_patterns"),g2=no("text_patterns_lookup"),p2=no("noneditable_class"),Sk=no("editable_class"),Ck=no("noneditable_regexp"),lO=no("preserve_cdata"),z_=no("highlight_on_focus"),cO=no("xss_sanitization"),N0=no("init_content_sync"),bb=n=>n.options.isSet("text_patterns_lookup"),uO=n=>gn.explode(n.options.get("font_size_style_values")),b2=n=>gn.explode(n.options.get("font_size_classes")),V_=n=>n.options.get("encoding")==="xml",v2=n=>gn.explode(n.options.get("images_file_types")),kk=no("table_tab_navigation"),fO=no("details_initial_state"),I0=no("details_serialized_state"),xk=Jn,dO=_n,bf=n=>{const i=n.parentNode;i&&i.removeChild(n)},hO=n=>{const i=In(n);return{count:n.length-i.length,text:i}},W_=n=>{let i;for(;(i=n.data.lastIndexOf(Ft))!==-1;)n.deleteData(i,1)},mO=(n,i)=>(yl(n),i),Tk=(n,i)=>{const c=hO(n.data.substr(0,i.offset())),m=hO(n.data.substr(i.offset()));return(c.text+m.text).length>0?(W_(n),Vt(n,i.offset()-c.count)):i},B0=(n,i)=>{const c=i.container(),m=as(Rr(c.childNodes),n).map(p=>pdO(n)&&i.container()===n?Tk(n,i):mO(n,i),Ek=(n,i)=>i.container()===n.parentNode?B0(n,i):mO(n,i),gO=(n,i)=>Vt.isTextPosition(i)?O2(n,i):Ek(n,i),yl=n=>{xk(n)&&_r(n)&&(Uc(n)?n.removeAttribute("data-mce-caret"):bf(n)),dO(n)&&(W_(n),n.data.length===0&&bf(n))},Ak=Es,vb=sf,Dk=Rd,Ob="*[contentEditable=false],video,audio,embed,object",y2=(n,i,c)=>{const m=e1(i.getBoundingClientRect(),c);let p,w;if(n.tagName==="BODY"){const M=n.ownerDocument.documentElement;p=n.scrollLeft||M.scrollLeft,w=n.scrollTop||M.scrollTop}else{const M=n.getBoundingClientRect();p=n.scrollLeft-M.left,w=n.scrollTop-M.top}m.left+=p,m.right+=p,m.top+=w,m.bottom+=w,m.width=1;let x=i.offsetWidth-i.clientWidth;return x>0&&(c&&(x*=-1),m.left+=x,m.right+=x),m},Pk=n=>{var i,c;const m=pl(Ke.fromDom(n),Ob);for(let p=0;p{const p=Sh();let w,x;const M=jc(n),B=n.dom,q=(Me,Ve)=>{let gt;if(ae(),Dk(Ve))return null;if(c(Ve)){const Ot=dh(M,Ve,Me),wt=y2(i,Ve,Me);B.setStyle(Ot,"top",wt.top),x=Ot;const Pt=B.create("div",{class:"mce-visual-caret","data-mce-bogus":"all"});B.setStyles(Pt,{...wt}),B.add(i,Pt),p.set({caret:Pt,element:Ve,before:Me}),Me&&B.addClass(Pt,"mce-visual-caret-before"),fe(),gt=Ve.ownerDocument.createRange(),gt.setStart(Ot,0),gt.setEnd(Ot,0)}else return x=cu(Ve,Me),gt=Ve.ownerDocument.createRange(),gm(x.nextSibling)?(gt.setStart(x,0),gt.setEnd(x,0)):(gt.setStart(x,1),gt.setEnd(x,1)),gt;return gt},ae=()=>{Pk(i),x&&(yl(x),x=null),p.on(Me=>{B.remove(Me.caret),p.clear()}),w&&(clearInterval(w),w=void 0)},fe=()=>{w=setInterval(()=>{p.on(Me=>{m()?B.toggleClass(Me.caret,"mce-visual-caret-hidden"):B.addClass(Me.caret,"mce-visual-caret-hidden")})},500)};return{show:q,hide:ae,getCss:()=>".mce-visual-caret {position: absolute;background-color: black;background-color: currentcolor;}.mce-visual-caret-hidden {display: none;}*[data-mce-caret] {position: absolute;left: -1000px;right: auto;top: 0;margin: 0;padding: 0;}",reposition:()=>{p.on(Me=>{const Ve=y2(i,Me.element,Me.before);B.setStyles(Me.caret,{...Ve})})},destroy:()=>clearInterval(w)}},L0=()=>qn.browser.isFirefox(),gm=n=>Ak(n)||vb(n),yb=n=>(gm(n)||Iu(n)&&L0())&&wi(Ke.fromDom(n)).exists(wn),vu=ba,a1=Es,U_=sf,Y_=ch("display","block table table-cell table-caption list-item"),w2=_r,_2=Si,S2=Jn,Rk=_n,F0=Tl,pO=n=>n>0,bp=n=>n<0,Q0=(n,i)=>{let c;for(;c=n(i);)if(!_2(c))return c;return null},Ah=(n,i,c,m,p)=>{const w=new _i(n,m),x=a1(n)||_2(n);let M;if(bp(i)){if(x&&(M=Q0(w.prev.bind(w),!0),c(M)))return M;for(;M=Q0(w.prev.bind(w),p);)if(c(M))return M}if(pO(i)){if(x&&(M=Q0(w.next.bind(w),!0),c(M)))return M;for(;M=Q0(w.next.bind(w),p);)if(c(M))return M}return null},$k=(n,i)=>{const c=p=>vu(p.dom),m=p=>p.dom===i;return di(Ke.fromDom(n),c,m).map(p=>p.dom).getOr(i)},pm=(n,i)=>{for(;n&&n!==i;){if(Y_(n))return n;n=n.parentNode}return null},Hd=(n,i,c)=>pm(n.container(),c)===pm(i.container(),c),wb=(n,i)=>{if(!i)return he.none();const c=i.container(),m=i.offset();return S2(c)?he.from(c.childNodes[m+n]):he.none()},C2=(n,i)=>{var c;const p=((c=i.ownerDocument)!==null&&c!==void 0?c:document).createRange();return n?(p.setStartBefore(i),p.setEndBefore(i)):(p.setStartAfter(i),p.setEndAfter(i)),p},_b=(n,i,c)=>pm(i,n)===pm(c,n),Og=(n,i,c)=>{const m=n?"previousSibling":"nextSibling";let p=c;for(;p&&p!==i;){let w=p[m];if(w&&w2(w)&&(w=w[m]),a1(w)||U_(w)){if(_b(i,w,p))return w;break}if(F0(w))break;p=p.parentNode}return null},S=He(C2,!0),A=He(C2,!1),H=(n,i,c)=>{let m;const p=He(Og,!0,i),w=He(Og,!1,i),x=c.startContainer,M=c.startOffset;if(Si(x)){const B=Rk(x)?x.parentNode:x,q=B.getAttribute("data-mce-caret");if(q==="before"&&(m=B.nextSibling,yb(m)))return S(m);if(q==="after"&&(m=B.previousSibling,yb(m)))return A(m)}if(!c.collapsed)return c;if(_n(x)){if(w2(x)){if(n===1){if(m=w(x),m)return S(m);if(m=p(x),m)return A(m)}if(n===-1){if(m=p(x),m)return A(m);if(m=w(x),m)return S(m)}return c}if(hr(x)&&M>=x.data.length-1)return n===1&&(m=w(x),m)?S(m):c;if(hh(x)&&M<=1)return n===-1&&(m=p(x),m)?A(m):c;if(M===x.data.length)return m=w(x),m?S(m):c;if(M===0)return m=p(x),m?A(m):c}return c},le=(n,i)=>wb(n?0:-1,i).filter(a1),Ce=(n,i,c)=>{const m=H(n,i,c);return n===-1?Vt.fromRangeStart(m):Vt.fromRangeEnd(m)},We=n=>he.from(n.getNode()).map(Ke.fromDom),ht=n=>he.from(n.getNode(!0)).map(Ke.fromDom),St=(n,i)=>{let c=i;for(;c=n(c);)if(c.isVisible())return c;return c},zt=(n,i)=>{const c=Hd(n,i);return!c&&mi(n.getNode())?!0:c};var vn;(function(n){n[n.Backwards=-1]="Backwards",n[n.Forwards=1]="Forwards"})(vn||(vn={}));const Zn=Es,Vn=_n,Fo=Jn,ms=mi,Is=Tl,Hr=om,Zs=Kg,gi=(n,i)=>{const c=[];let m=n;for(;m&&m!==i;)c.push(m),m=m.parentNode;return c},ki=(n,i)=>n.hasChildNodes()&&i{if(pO(n)){if(Is(i.previousSibling)&&!Vn(i.previousSibling))return Vt.before(i);if(Vn(i))return Vt(i,0)}if(bp(n)){if(Is(i.nextSibling)&&!Vn(i.nextSibling))return Vt.after(i);if(Vn(i))return Vt(i,i.data.length)}return bp(n)?ms(i)?Vt.before(i):Vt.after(i):Vt.before(i)},Zu=(n,i)=>{const c=i.nextSibling;return c&&Is(c)?Vn(c)?Vt(c,0):Vt.before(c):Zf(vn.Forwards,Vt.after(i),n)},Zf=(n,i,c)=>{let m,p,w,x;if(!Fo(c)||!i)return null;if(i.isEqual(Vt.after(c))&&c.lastChild){if(x=Vt.after(c.lastChild),bp(n)&&Is(c.lastChild)&&Fo(c.lastChild))return ms(c.lastChild)?Vt.before(c.lastChild):x}else x=i;const M=x.container();let B=x.offset();if(Vn(M)){if(bp(n)&&B>0)return Vt(M,--B);if(pO(n)&&B0&&(p=ki(M,B-1),Is(p)))return!Hr(p)&&(w=Ah(p,n,Zs,p),w)?Vn(w)?Vt(w,w.data.length):Vt.after(w):Vn(p)?Vt(p,p.data.length):Vt.before(p);if(pO(n)&&B({next:i=>Zf(vn.Forwards,i,n),prev:i=>Zf(vn.Backwards,i,n)}),bm=(n,i,c)=>{const m=n?Vt.before(c):Vt.after(c);return zd(n,i,m)},fd=n=>mi(n)?Vt.before(n):Vt.after(n),k2=n=>Vt.isTextPosition(n)?n.offset()===0:Tl(n.getNode()),yu=n=>{if(Vt.isTextPosition(n)){const i=n.container();return n.offset()===i.data.length}else return Tl(n.getNode(!0))},X_=(n,i)=>!Vt.isTextPosition(n)&&!Vt.isTextPosition(i)&&n.getNode()===i.getNode(!0),Z0=n=>!Vt.isTextPosition(n)&&mi(n.getNode()),H0=(n,i,c)=>n?!X_(i,c)&&!Z0(i)&&yu(i)&&k2(c):!X_(c,i)&&k2(i)&&yu(c),zd=(n,i,c)=>{const m=Ea(i);return he.from(n?m.next(c):m.prev(c))},Sb=(n,i,c)=>zd(n,i,c).bind(m=>Hd(c,m,i)&&H0(n,c,m)?zd(n,i,m):he.some(m)),Nk=(n,i,c,m)=>Sb(n,i,c).bind(p=>m(p)?Nk(n,i,p,m):he.some(p)),bO=(n,i)=>{const c=n?i.firstChild:i.lastChild;return _n(c)?he.some(Vt(c,n?0:c.data.length)):c?Tl(c)?he.some(n?Vt.before(c):fd(c)):bm(n,i,c):he.none()},Hf=He(zd,!0),Hu=He(zd,!1),cl=He(bO,!0),Vd=He(bO,!1),j_="_mce_caret",qc=n=>Jn(n)&&n.id===j_,Cb=(n,i)=>{let c=i;for(;c&&c!==n;){if(qc(c))return c;c=c.parentNode}return null},vO=n=>L(n.start),x2=n=>un(n,"rng"),Ik=n=>un(n,"id"),Bk=n=>un(n,"name"),l1=n=>gn.isArray(n.start),T2=n=>!Bk(n)&&we(n.forward)?n.forward:!0,yg=(n,i)=>(Jn(i)&&n.isBlock(i)&&!i.innerHTML&&(i.innerHTML='
'),i),rP=(n,i)=>{const c=he.from(D0(n.getRoot(),i.start)),m=he.from(D0(n.getRoot(),i.end));return ri(c,m,(p,w)=>{const x=n.createRng();return x.setStart(p.container(),p.offset()),x.setEnd(w.container(),w.offset()),{range:x,forward:T2(i)}})},Lk=(n,i)=>{var c;const p=((c=n.ownerDocument)!==null&&c!==void 0?c:document).createTextNode(Ft);n.appendChild(p),i.setStart(p,0),i.setEnd(p,0)},DE=n=>!n.hasChildNodes(),bI=(n,i)=>Vd(n).fold(je,c=>(i.setStart(c.container(),c.offset()),i.setEnd(c.container(),c.offset()),!0)),PE=(n,i,c)=>DE(i)&&Cb(n,i)?(Lk(i,c),!0):!1,ME=(n,i,c,m)=>{const p=c[i?"start":"end"],w=n.getRoot();if(p){let x=w,M=p[0];for(let B=p.length-1;x&&B>=1;B--){const q=x.childNodes;if(PE(w,x,m))return!0;if(p[B]>q.length-1)return PE(w,x,m)?!0:bI(x,m);x=q[p[B]]}_n(x)&&(M=Math.min(p[0],x.data.length)),Jn(x)&&(M=Math.min(p[0],x.childNodes.length)),i?m.setStart(x,M):m.setEnd(x,M)}return!0},Fk=n=>_n(n)&&n.data.length>0,Qk=(n,i,c)=>{const m=n.get(c.id+"_"+i),p=m==null?void 0:m.parentNode,w=c.keep;if(m&&p){let x,M;if(i==="start"?w?m.hasChildNodes()?(x=m.firstChild,M=1):Fk(m.nextSibling)?(x=m.nextSibling,M=0):Fk(m.previousSibling)?(x=m.previousSibling,M=m.previousSibling.data.length):(x=p,M=n.nodeIndex(m)+1):(x=p,M=n.nodeIndex(m)):w?m.hasChildNodes()?(x=m.firstChild,M=1):Fk(m.previousSibling)?(x=m.previousSibling,M=m.previousSibling.data.length):(x=p,M=n.nodeIndex(m)):(x=p,M=n.nodeIndex(m)),!w){const B=m.previousSibling,q=m.nextSibling;gn.each(gn.grep(m.childNodes),fe=>{_n(fe)&&(fe.data=fe.data.replace(/\uFEFF/g,""))});let ae;for(;ae=n.get(c.id+"_"+i);)n.remove(ae,!0);if(_n(q)&&_n(B)&&!qn.browser.isOpera()){const fe=B.data.length;B.appendData(q.data),n.remove(q),x=B,M=fe}}return he.some(Vt(x,M))}else return he.none()},Zk=(n,i)=>{const c=n.createRng();return ME(n,!0,i,c)&&ME(n,!1,i,c)?he.some({range:c,forward:T2(i)}):he.none()},RE=(n,i)=>{const c=Qk(n,"start",i),m=Qk(n,"end",i);return ri(c,m.or(c),(p,w)=>{const x=n.createRng();return x.setStart(yg(n,p.container()),p.offset()),x.setEnd(yg(n,w.container()),w.offset()),{range:x,forward:T2(i)}})},$E=(n,i)=>he.from(n.select(i.name)[i.index]).map(c=>{const m=n.createRng();return m.selectNode(c),{range:m,forward:!0}}),NE=(n,i)=>{const c=n.dom;if(i){if(l1(i))return Zk(c,i);if(vO(i))return rP(c,i);if(Ik(i))return RE(c,i);if(Bk(i))return $E(c,i);if(x2(i))return he.some({range:i.rng,forward:T2(i)})}return he.none()},iP=(n,i,c)=>w_(n,i,c),aP=(n,i)=>{NE(n,i).each(({range:c,forward:m})=>{n.setRng(c,m)})},Wd=n=>Jn(n)&&n.tagName==="SPAN"&&n.getAttribute("data-mce-type")==="bookmark",Gs=(n=>i=>n===i)(Kr),Dh=n=>n!==""&&` \f diff --git a/front/dist/manifest.json b/front/dist/manifest.json index dd0137e..03d7a6b 100644 --- a/front/dist/manifest.json +++ b/front/dist/manifest.json @@ -1,6 +1,6 @@ { "main.js": { - "file": "assets/main.f303cf88.js", + "file": "assets/main.9f2d27e6.js", "src": "main.js", "isEntry": true, "css": [ diff --git a/front/js/svelte/edges/sortEdges.js b/front/js/svelte/edges/sortEdges.js index ac52c35..282ec62 100644 --- a/front/js/svelte/edges/sortEdges.js +++ b/front/js/svelte/edges/sortEdges.js @@ -2,7 +2,7 @@ export function sortByField(from, to, edges, fieldName) { if (from === to) { return edges; } - let edgesTosort = edges?.filter((ed) => ed.field === fieldName && ed.depth === 1) ?? []; + let edgesTosort = edges?.filter((ed) => ed.field === fieldName && ed.depth === 1 ) ?? []; let remainingEdge = edges?.filter((ed) => !(ed.field === fieldName && ed.depth === 1)) ?? []; edgesTosort = array_move(edgesTosort,from, to); diff --git a/front/js/svelte/libs/Sortable.svelte b/front/js/svelte/libs/Sortable.svelte index e71cdc4..d3ef4fa 100644 --- a/front/js/svelte/libs/Sortable.svelte +++ b/front/js/svelte/libs/Sortable.svelte @@ -18,6 +18,7 @@ easing: "cubic-bezier(1, 0, 0, 1)", onUpdate: function (/**Event*/ evt) { // reorder(evt.oldIndex,evt.newIndex); + console.log(evt) dispatch("update", { source: evt.oldIndex, target: evt.newIndex, diff --git a/front/js/svelte/records/elements/Reference.svelte b/front/js/svelte/records/elements/Reference.svelte index 34f9a1a..9b7ac35 100644 --- a/front/js/svelte/records/elements/Reference.svelte +++ b/front/js/svelte/records/elements/Reference.svelte @@ -17,7 +17,7 @@ $: references = graph.edges .filter((edge) => edge.field === field.name) .map((edge) => { - return graph.records.find((increc) => increc.id == edge.target && record.id == edge.source); + return graph.records.find((increc) => increc.id === edge.target && record.id === edge.source); }).filter((rec) => (rec?.id ? true : false)) ?? []; let collections = channel.schemas.filter((aschema) => diff --git a/front/js/svelte/records/elements/ReferenceTable.svelte b/front/js/svelte/records/elements/ReferenceTable.svelte index 53c69d3..a8e0c2b 100644 --- a/front/js/svelte/records/elements/ReferenceTable.svelte +++ b/front/js/svelte/records/elements/ReferenceTable.svelte @@ -21,6 +21,7 @@ .map((edge) => { return graph.records.find((increc) => increc.id === edge.target && record.id === edge.source); }).filter((rec) => (rec?.id ? true : false)) ?? []; + let collections = channel.schemas.filter((aschema) => field.collections.includes(aschema.name) ); diff --git a/src/Commands/RemoveOrphanEdges.php b/src/Commands/RemoveOrphanEdges.php new file mode 100644 index 0000000..55c33eb --- /dev/null +++ b/src/Commands/RemoveOrphanEdges.php @@ -0,0 +1,40 @@ +findAll(); + + foreach ($edges as $edge){ + $source = $query->filter(["id" => $edge->source])->run()->records; + $target = $query->filter(["id" => $edge->target])->run()->records; + if($source->isEmpty() || $target->isEmpty()){ + $this->info("Edge is orphan"); + $edgeService->remove($edge); + } + + } + } + +} diff --git a/src/Edge/EdgeRepo.php b/src/Edge/EdgeRepo.php index 96be355..1c9d912 100644 --- a/src/Edge/EdgeRepo.php +++ b/src/Edge/EdgeRepo.php @@ -3,12 +3,16 @@ use Illuminate\Support\Facades\DB; use Lucent\LucentException; use PDOException; +use stdClass; class EdgeRepo { + public function __construct() + { + } - public static function insert(Edge $edge): void + public function insert(Edge $edge): void { try { DB::table("edges")->insert($edge->toDB()); @@ -21,7 +25,7 @@ class EdgeRepo } - public static function update(string $from, EdgeCollection $edges): void + public function update(string $from, EdgeCollection $edges): void { $edgesDB = collect($edges)->map(fn($e) => $e->toDB())->toArray(); DB::table("edges")->where("source", $from)->delete(); @@ -29,4 +33,36 @@ class EdgeRepo } + public function findAll(): EdgeCollection + { + $edges = DB::table("edges")->get(); + return new EdgeCollection(...$edges->map([$this, 'mapEdge'])->toArray()); + } + + public function mapEdge(stdClass $edge): Edge + { + + return new Edge( + source: $edge->source, + target: $edge->target, + sourceSchema: $edge->sourceSchema, + targetSchema: $edge->targetSchema, + field: $edge->field, + rank: $edge->rank, + depth: $edge->depth ?? 0 + ); + + } + + public function remove(Edge $edge): void + { + DB::table("edges") + ->where("source", $edge->source) + ->where("target", $edge->target) + ->where("sourceSchema", $edge->sourceSchema) + ->where("targetSchema", $edge->targetSchema) + ->where("field", $edge->field) + ->delete(); + } + } diff --git a/src/Edge/EdgeService.php b/src/Edge/EdgeService.php index fdac19b..39483af 100644 --- a/src/Edge/EdgeService.php +++ b/src/Edge/EdgeService.php @@ -4,12 +4,14 @@ use Lucent\LucentException; class EdgeService { - + public function __construct(public EdgeRepo $edgeRepo) + { + } /** * @throws LucentException */ - public static function create( + public function create( string $source, string $target, string $sourceSchema, @@ -29,9 +31,23 @@ class EdgeService field: $field, rank: $rank, ); - EdgeRepo::insert($edge); + $this->edgeRepo->insert($edge); return $edge; } + public function update(string $from, EdgeCollection $edges): void + { + $this->edgeRepo->update($from, $edges); + } + + public function findAll(): EdgeCollection + { + return $this->edgeRepo->findAll(); + } + + public function remove(Edge $edge): void + { + $this->edgeRepo->remove($edge); + } } diff --git a/src/LucentServiceProvider.php b/src/LucentServiceProvider.php index af259ab..d8c8221 100644 --- a/src/LucentServiceProvider.php +++ b/src/LucentServiceProvider.php @@ -10,6 +10,7 @@ use Lucent\Channel\ChannelService; use Lucent\Commands\CompileSchemas; use Lucent\Commands\LiveLink; use Lucent\Commands\RebuildThumbnails; +use Lucent\Commands\RemoveOrphanEdges; use Lucent\File\FileService; use Lucent\File\ImageService; use Lucent\Query\DatabaseGraph\DatabaseGraph; @@ -68,6 +69,7 @@ class LucentServiceProvider extends ServiceProvider CompileSchemas::class, RebuildThumbnails::class, LiveLink::class, + RemoveOrphanEdges::class, ]); } diff --git a/src/Record/RecordService.php b/src/Record/RecordService.php index e8575c7..0efcea5 100644 --- a/src/Record/RecordService.php +++ b/src/Record/RecordService.php @@ -7,7 +7,7 @@ use Lucent\Account\AuthService; use Lucent\Channel\ChannelService; use Lucent\Edge\Edge; use Lucent\Edge\EdgeCollection; -use Lucent\Edge\EdgeRepo; +use Lucent\Edge\EdgeService; use Lucent\File\FileService; use Lucent\Id\Id; use Lucent\LucentException; @@ -28,7 +28,8 @@ readonly class RecordService private Validator $recordValidator, private Query $query, private InputFormatter $inputFormatter, - private RecordRepo $recordRepo + private RecordRepo $recordRepo, + private EdgeService $edgeService ) { } @@ -66,7 +67,8 @@ readonly class RecordService $uniqueEdgesCollection = EdgeCollection::fromArray($uniqueEdges); if ($uploadResult->isDuplicate) { - EdgeRepo::update($uploadResult->duplicateId, $uniqueEdgesCollection); + + $this->edgeService->update($uploadResult->duplicateId, $uniqueEdgesCollection); return $uploadResult->duplicateId; } @@ -87,8 +89,8 @@ readonly class RecordService } RecordRepo::create($record); - EdgeRepo::update($record->id, $uniqueEdgesCollection); - $this->revisionService->create($record,$uniqueEdgesCollection); + $this->edgeService->update($record->id, $uniqueEdgesCollection); + $this->revisionService->create($record, $uniqueEdgesCollection); return $record->id; } @@ -150,10 +152,10 @@ readonly class RecordService RecordRepo::update($newRecord); if ($updateEdges) { - EdgeRepo::update($newRecord->id, $uniqueEdgesCollection); + $this->edgeService->update($newRecord->id, $uniqueEdgesCollection); } - $this->revisionService->create($newRecord,$uniqueEdgesCollection); + $this->revisionService->create($newRecord, $uniqueEdgesCollection); }