@dcrackel/hematournamentui 1.0.24 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -26987,7 +26987,7 @@ const iO = /* @__PURE__ */ lt(JA, [["render", rO]]), aO = {
|
|
|
26987
26987
|
},
|
|
26988
26988
|
methods: {
|
|
26989
26989
|
handleSubmit() {
|
|
26990
|
-
|
|
26990
|
+
this.setAllValidationStates(!1), this.tournament.name === "" && (this.validation.name = !0), this.tournament.coordinates === "" && (this.validation.address = !0), this.tournament.startDate === "" && (this.validation.startDate = !0), this.tournament.totalDays === "" && (this.validation.totalDays = !0), this.tournament.description === "" && (this.validation.description = !0), this.tournament.visibility === "" && (this.validation.visibility = !0), this.areAnyFieldsAreLeftInvalid || (this.$emit("update:tournament", this.tournament), this.$emit("update:step", 2));
|
|
26991
26991
|
},
|
|
26992
26992
|
setAllValidationStates(n) {
|
|
26993
26993
|
Object.keys(this.validation).forEach((e) => {
|
|
@@ -27005,7 +27005,7 @@ const iO = /* @__PURE__ */ lt(JA, [["render", rO]]), aO = {
|
|
|
27005
27005
|
}
|
|
27006
27006
|
},
|
|
27007
27007
|
computed: {
|
|
27008
|
-
|
|
27008
|
+
areAnyFieldsAreLeftInvalid() {
|
|
27009
27009
|
return Object.values(this.validation).every((n) => n);
|
|
27010
27010
|
}
|
|
27011
27011
|
}
|
|
@@ -27083,9 +27083,8 @@ function bO(n, e, t, r, i, a) {
|
|
|
27083
27083
|
}, null, 8, ["invalid"]),
|
|
27084
27084
|
he(c, {
|
|
27085
27085
|
setDate: i.tournament.startDate,
|
|
27086
|
-
"onUpdate:selectedDate": a.handleDateUpdate
|
|
27087
|
-
|
|
27088
|
-
}, null, 8, ["setDate", "onUpdate:selectedDate", "invalid"])
|
|
27086
|
+
"onUpdate:selectedDate": a.handleDateUpdate
|
|
27087
|
+
}, null, 8, ["setDate", "onUpdate:selectedDate"])
|
|
27089
27088
|
]),
|
|
27090
27089
|
ee("div", gO, [
|
|
27091
27090
|
he(o, {
|
|
@@ -180,4 +180,4 @@ img.ProseMirror-separator {
|
|
|
180
180
|
|
|
181
181
|
`);return!o||!a?!1:n.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();return s===void 0||r.nodeAt(s)?!1:n.commands.exitCode()}}},addInputRules(){return[jl({find:tD,type:this.type,getAttributes:n=>({language:n[1]})}),jl({find:nD,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Mt({key:new mn("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!t||!o)return!1;const{tr:a}=n.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(ve.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(t.replace(/\r\n?/g,`
|
|
182
182
|
`)),a.setMeta("paste",!0),n.dispatch(a),!0}}})]}}),iD=_t.create({name:"doc",topNode:!0,content:"block+"});function oD(n={}){return new Mt({view(e){return new aD(e,n)}})}class aD{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=a=>{this[i](a)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r;if(t){let s=e.nodeBefore,c=e.nodeAfter;if(s||c){let d=this.editorView.nodeDOM(this.cursorPos-(s?s.nodeSize:0));if(d){let u=d.getBoundingClientRect(),f=s?u.bottom:u.top;s&&c&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let s=this.editorView.coordsAtPos(this.cursorPos);r={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let o,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,a=-pageYOffset;else{let s=i.getBoundingClientRect();o=s.left-i.scrollLeft,a=s.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=of(this.editorView.state.doc,a,this.editorView.dragging.slice);s!=null&&(a=s)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const sD=mt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[oD(this.options)]}});class ze extends we{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return ze.valid(r)?new ze(r):we.near(r)}content(){return ie.empty}eq(e){return e instanceof ze&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ze(e.resolve(t.pos))}getBookmark(){return new cc(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!lD(e)||!cD(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&ze.valid(e))return e;let i=e.pos,o=null;for(let a=e.depth;;a--){let s=e.node(a);if(t>0?e.indexAfter(a)<s.childCount:e.index(a)>0){o=s.child(t>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=t;let c=e.doc.resolve(i);if(ze.valid(c))return c}for(;;){let a=t>0?o.firstChild:o.lastChild;if(!a){if(o.isAtom&&!o.isText&&!me.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=a,i+=t;let s=e.doc.resolve(i);if(ze.valid(s))return s}return null}}}ze.prototype.visible=!1,ze.findFrom=ze.findGapCursorFrom,we.jsonID("gapcursor",ze);class cc{constructor(e){this.pos=e}map(e){return new cc(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ze.valid(t)?new ze(t):we.near(t)}}function lD(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function cD(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function dD(){return new Mt({props:{decorations:hD,createSelectionBetween(n,e,t){return e.pos==t.pos&&ze.valid(t)?new ze(t):null},handleClick:fD,handleKeyDown:uD,handleDOMEvents:{beforeinput:pD}}})}const uD=Np({ArrowLeft:Sa("horiz",-1),ArrowRight:Sa("horiz",1),ArrowUp:Sa("vert",-1),ArrowDown:Sa("vert",1)});function Sa(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let a=r.selection,s=e>0?a.$to:a.$from,c=a.empty;if(a instanceof ve){if(!o.endOfTextblock(t)||s.depth==0)return!1;c=!1,s=r.doc.resolve(e>0?s.after():s.before())}let d=ze.findGapCursorFrom(s,e,c);return d?(i&&i(r.tr.setSelection(new ze(d))),!0):!1}}function fD(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!ze.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&me.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new ze(r))),!0)}function pD(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof ze))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=Q.empty;for(let a=r.length-1;a>=0;a--)i=Q.from(r[a].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new ie(i,0,0));return o.setSelection(ve.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function hD(n){if(!(n.selection instanceof ze))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Je.create(n.doc,[Ft.widget(n.selection.head,e,{key:"gapcursor"})])}const mD=mt.create({name:"gapCursor",addProseMirrorPlugins(){return[dD()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=ke(le(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),gD=_t.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Ge(this.options.HTMLAttributes,n)]},renderText(){return`
|
|
183
|
-
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const f=c.filter(p=>s.includes(p.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),yD=_t.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ge(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>jl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Da=200,rt=function(){};rt.prototype.append=function(e){return e.length?(e=rt.from(e),!this.length&&e||e.length<Da&&this.leafAppend(e)||this.length<Da&&e.leafPrepend(this)||this.appendInner(e)):this},rt.prototype.prepend=function(e){return e.length?rt.from(e).append(this):this},rt.prototype.appendInner=function(e){return new vD(this,e)},rt.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?rt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},rt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},rt.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},rt.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},rt.from=function(e){return e instanceof rt?e:e&&e.length?new Yh(e):rt.empty};var Yh=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,s){for(var c=o;c<a;c++)if(i(this.values[c],s+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,s){for(var c=o-1;c>=a;c--)if(i(this.values[c],s+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Da)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Da)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(rt);rt.empty=new Yh([]);var vD=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(rt);const bD=500;class nn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,s,c,d=[],u=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new xn(f.map));let h=f.step.map(i.slice(o)),m;h&&a.maybeStep(h).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],d.push(new xn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,c=new nn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:s}}addTransform(e,t,r,i){let o=[],a=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),p=new xn(e.mapping.maps[u],f,t),h;(h=c&&c.merge(p))&&(p=h,u?o.pop():s=s.slice(0,s.length-1)),o.push(p),t&&(a++,t=void 0),i||(c=p)}let d=a-r.depth;return d>kD&&(s=wD(s,d),a-=d),new nn(s.append(o),a)}remapping(e,t){let r=new Zr;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new nn(this.items.append(e.map(t=>new xn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach(p=>{p.selection&&s--},i);let c=t;this.items.forEach(p=>{let h=o.getMirror(--c);if(h==null)return;a=Math.min(a,h);let m=o.maps[h];if(p.step){let v=e.steps[h].invert(e.docs[h]),b=p.selection&&p.selection.map(o.slice(c+1,h));b&&s++,r.push(new xn(m,v,b))}else r.push(new xn(m))},i);let d=[];for(let p=t;p<a;p++)d.push(new xn(o.maps[p]));let u=this.items.slice(0,i).append(d).append(r),f=new nn(u,s);return f.emptyItemCount()>bD&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=e)i.push(a),a.selection&&o++;else if(a.step){let c=a.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=a.selection&&a.selection.map(t.slice(r));u&&o++;let f=new xn(d.invert(),c,u),p,h=i.length-1;(p=i.length&&i[h].merge(f))?i[h]=p:i.push(f)}}else a.map&&r--},this.items.length,0),new nn(rt.from(i.reverse()),o)}}nn.empty=new nn(rt.empty,0);function wD(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class xn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new xn(t.getMap().invert(),t,this.selection)}}}class or{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const kD=20;function xD(n,e,t,r){let i=t.getMeta(ar),o;if(i)return i.historyState;t.getMeta(TD)&&(n=new or(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(ar))return a.getMeta(ar).redo?new or(n.done.addTransform(t,void 0,r,Aa(e)),n.undone,Uh(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new or(n.done,n.undone.addTransform(t,void 0,r,Aa(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=s&&(n.prevTime<(t.time||0)-r.newGroupDelay||!CD(t,n.prevRanges)),d=a?dc(n.prevRanges,t.mapping):Uh(t.mapping.maps[t.steps.length-1]);return new or(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Aa(e)),nn.empty,d,t.time,s??n.prevComposition)}else return(o=t.getMeta("rebased"))?new or(n.done.rebased(t,o),n.undone.rebased(t,o),dc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new or(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),dc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function CD(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function Uh(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function dc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function jh(n,e,t,r){let i=Aa(e),o=ar.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let s=a.selection.resolve(a.transform.doc),c=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),d=new or(r?c:a.remaining,r?a.remaining:c,null,0,-1);t(a.transform.setSelection(s).setMeta(ar,{redo:r,historyState:d}).scrollIntoView())}let uc=!1,Wh=null;function Aa(n){let e=n.plugins;if(Wh!=e){uc=!1,Wh=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){uc=!0;break}}return uc}const ar=new mn("history"),TD=new mn("closeHistory");function MD(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Mt({key:ar,state:{init(){return new or(nn.empty,nn.empty,null,0,-1)},apply(e,t,r){return xD(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?qh:r=="historyRedo"?Kh:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const qh=(n,e)=>{let t=ar.getState(n);return!t||t.done.eventCount==0?!1:(e&&jh(t,n,e,!1),!0)},Kh=(n,e)=>{let t=ar.getState(n);return!t||t.undone.eventCount==0?!1:(e&&jh(t,n,e,!0),!0)},SD=mt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>qh(n,e),redo:()=>({state:n,dispatch:e})=>Kh(n,e)}},addProseMirrorPlugins(){return[MD(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),DD=_t.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Ge(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var a;if(o){const{$to:s}=i.selection,c=s.end();if(s.nodeAfter)s.nodeAfter.isTextblock?i.setSelection(ve.create(i.doc,s.pos+1)):s.nodeAfter.isBlock?i.setSelection(me.create(i.doc,s.pos)):i.setSelection(ve.create(i.doc,s.pos));else{const d=(a=s.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(i.insert(c,d),i.setSelection(ve.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[iM({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),AD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,ED=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,ND=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,OD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,_D=tn.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Or({find:AD,type:this.type}),Or({find:ND,type:this.type})]},addPasteRules(){return[_r({find:ED,type:this.type}),_r({find:OD,type:this.type})]}}),BD=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),PD=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Gh=tn.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=va(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Qh=/^(\d+)\.\s$/,ID=_t.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Ge(this.options.HTMLAttributes,t),0]:["ol",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(PD.name,this.editor.getAttributes(Gh.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=so({find:Qh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=so({find:Qh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Gh.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),RD=_t.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),VD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,$D=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,LD=tn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return Fl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[Or({find:VD,type:this.type})]},addPasteRules(){return[_r({find:$D,type:this.type})]}}),FD=_t.create({name:"text",group:"inline"}),zD=mt.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,a,s,c,d,u,f,p,h,m,v,b,x;const C=[];return this.options.blockquote!==!1&&C.push(US.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&C.push(GS.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&C.push(JS.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&C.push(eD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&C.push(rD.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&C.push(iD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&C.push(sD.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&C.push(mD.configure((s=this.options)===null||s===void 0?void 0:s.gapcursor)),this.options.hardBreak!==!1&&C.push(gD.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&C.push(yD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&C.push(SD.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&C.push(DD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&C.push(_D.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&C.push(BD.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&C.push(ID.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&C.push(RD.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&C.push(LD.configure((b=this.options)===null||b===void 0?void 0:b.strike)),this.options.text!==!1&&C.push(FD.configure((x=this.options)===null||x===void 0?void 0:x.text)),C}}),HD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,YD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,UD=tn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Or({find:HD,type:this.type})]},addPasteRules(){return[_r({find:YD,type:this.type})]}}),jD=mt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.every(t=>e.updateAttributes(t,{textAlign:n})):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.every(e=>n.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),WD={components:{EditorContent:zS,BaseButton:dr},props:{invalid:{type:Boolean,default:!1}},data(){return{}},setup(n,{emit:e}){const t=l.ref("");return{editor:HS({content:"",extensions:[zD,UD,jD.configure({types:["heading","paragraph"]})],editorProps:{attributes:{class:"focus:outline-none"}},onUpdate({editor:i}){t.value=i.getHTML(),e("update:editorContent",t.value)}}),editorContent:t}},methods:{}},qD={"data-testid":"editor-buttons",class:"w-full flex flex-row pl-2"},KD={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2"},GD={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-around"},QD={class:"w-1/3 flex flex-row justify-between pl-2"},JD={class:"my-4 my-2 p-4 rounded-xl h-40 bg-tertiary overflow-auto"};function XD(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton"),s=l.resolveComponent("editor-content");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border rounded-lg text-secondary text-sm p-4 w-full",t.invalid?"border-alarm":"border-dropdownSelect"])},[l.createElementVNode("div",qD,[l.createElementVNode("div",KD,[l.createVNode(a,{iconName:"fa-h1",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:1}),onClick:e[0]||(e[0]=c=>r.editor.chain().toggleHeading({level:1}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h2",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:2}),onClick:e[1]||(e[1]=c=>r.editor.chain().toggleHeading({level:2}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h3",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:3}),onClick:e[2]||(e[2]=c=>r.editor.chain().toggleHeading({level:3}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-paragraph",label:"",type:"editor",selected:r.editor&&r.editor.isActive("paragraph"),onClick:e[3]||(e[3]=c=>r.editor.chain().setParagraph().run())},null,8,["selected"])]),l.createElementVNode("div",GD,[l.createVNode(a,{selected:r.editor&&r.editor.isActive("bold"),iconName:"fa-bold",label:"",type:"editor",onClick:e[4]||(e[4]=c=>r.editor&&r.editor.chain().toggleBold().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("italic"),iconName:"fa-italic",label:"",type:"editor",onClick:e[5]||(e[5]=c=>r.editor&&r.editor.chain().toggleItalic().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("strike"),iconName:"fa-strikethrough",label:"",type:"editor",onClick:e[6]||(e[6]=c=>r.editor&&r.editor.chain().toggleStrike().run())},null,8,["selected"])]),l.createElementVNode("div",QD,[l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"left"}),iconName:"fa-align-left",label:"",type:"editor",onClick:e[7]||(e[7]=c=>r.editor.chain().setTextAlign("left").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"center"}),iconName:"fa-align-center",label:"",type:"editor",onClick:e[8]||(e[8]=c=>r.editor&&r.editor.chain().setTextAlign("center").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"right"}),iconName:"fa-align-right",label:"",type:"editor",onClick:e[9]||(e[9]=c=>r.editor&&r.editor.chain().setTextAlign("right").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"justify"}),iconName:"fa-align-justify",label:"",type:"editor",onClick:e[10]||(e[10]=c=>r.editor&&r.editor.chain().setTextAlign("justify").run())},null,8,["selected"])])]),l.createElementVNode("p",JD,[l.createVNode(s,{editor:r.editor,class:"focus:shadow-none focus:outline-none"},null,8,["editor"])])],2)}const Jh=He(WD,[["render",XD]]),ZD={name:"AddTournamentPageOne",components:{BaseText:Pn,BaseInput:bo,ImageCropper:Su,AddressAutocomplete:Mc,DatePicker:zd,TextBoxEditor:Jh,BaseRadioGroup:yc,BaseButton:dr},props:{},data(){return{tournament:{name:"",imageLink:"",address:"",coordinates:"",startDate:"",totalDays:1,description:"",visibility:"",externalLinks:Array},validation:{name:!1,imageLink:!1,address:!1,coordinates:!1,startDate:!1,totalDays:!1,description:!1,visibility:!1},visibilityItems:[{label:"Open",value:"open",description:"Viewable To Everyone"},{label:"Club",value:"club",description:"Viewable Only to Members of Your Club"},{label:"Private",value:"private",description:"Only Viewable by you"}]}},methods:{handleSubmit(){console.log("submitting form"),this.setAllValidationStates(!1),console.log(this.tournament),this.tournament.name===""&&(this.validation.name=!0),this.tournament.coordinates===""&&(this.validation.address=!0),this.tournament.startDate===""&&(this.validation.startDate=!0),this.tournament.totalDays===""&&(this.validation.totalDays=!0),this.tournament.description===""&&(this.validation.description=!0),this.tournament.visibility===""&&(this.validation.visibility=!0)},setAllValidationStates(n){Object.keys(this.validation).forEach(e=>{this.validation[e]=n})},handleAddressUpdate(n){this.tournament.address=n.address,this.tournament.coordinates=n.coordinates},handleDateUpdate(n){this.tournament.startDate=n},handleEditorUpdate(n){this.tournament.description=n}},computed:{isFormValid(){return Object.values(this.validation).every(n=>n)}}},eA={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},tA={class:"w-full flex flex-row justify-center"},nA={class:"w-full flex flex-row justify-center my-4"},rA={class:"w-full flex flex-row justify-center my-4"},iA={class:"w-full flex flex-row justify-center"},oA={class:"w-96"},aA={class:"flex flex-col mb-3"},sA={class:"flex flex-col mb-3"},lA={class:"flex flex-row mb-3"},cA={class:"w-3/4 mr-1"},dA={class:"w-1/4 ml-1"},uA={class:"flex flex-col mb-3"},fA={class:"flex flex-col pb-4"};function pA(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("ImageCropper"),c=l.resolveComponent("BaseInput"),d=l.resolveComponent("AddressAutocomplete"),u=l.resolveComponent("DatePicker"),f=l.resolveComponent("TextBoxEditor"),p=l.resolveComponent("BaseRadioGroup"),h=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",eA,[l.createElementVNode("div",tA,[l.createVNode(a,{"data-testid":"text-step",color:"quaternary",size:"sm",text:"Step 1 out of 2",weight:"normal"})]),l.createElementVNode("div",nA,[l.createVNode(a,{"data-testid":"text-add-tournamnet",color:"primaryHighlight",size:"2xl",text:"Add Tournament",weight:"normal"})]),l.createElementVNode("div",rA,[l.createVNode(s,{personID:1})]),l.createElementVNode("div",iA,[l.createElementVNode("section",oA,[l.createElementVNode("div",aA,[l.createVNode(a,{"data-testid":"text-tournament-name",color:"primary",size:"sm",text:"Tournament Name",weight:"normal",class:"mb-1",invalid:i.validation.name},null,8,["invalid"]),l.createVNode(c,{placeholder:"Enter Tournament Name",type:"formInput",value:i.tournament.name,invalid:i.validation.name,"onUpdate:value":e[0]||(e[0]=m=>i.tournament.name=m)},null,8,["value","invalid"])]),l.createElementVNode("div",sA,[l.createVNode(a,{"data-testid":"text-address",color:"primaryHighlight",size:"sm",text:"Address",weight:"normal",class:"mb-1",invalid:i.validation.address},null,8,["invalid"]),l.createVNode(d,{address:i.tournament.address,invalid:i.validation.address,"onUpdate:address":o.handleAddressUpdate},null,8,["address","invalid","onUpdate:address"])]),l.createElementVNode("div",lA,[l.createElementVNode("div",cA,[l.createVNode(a,{"data-testid":"text-start-date",color:"primaryHighlight",size:"sm",text:"Start Date",weight:"normal",class:"mb-1",invalid:i.validation.startDate},null,8,["invalid"]),l.createVNode(u,{setDate:i.tournament.startDate,"onUpdate:selectedDate":o.handleDateUpdate,invalid:i.validation.startDate},null,8,["setDate","onUpdate:selectedDate","invalid"])]),l.createElementVNode("div",dA,[l.createVNode(a,{"data-testid":"text-total-days",color:"primaryHighlight",size:"sm",text:"Total Days",weight:"normal",class:"mb-1",invalid:i.validation.totalDays},null,8,["invalid"]),l.createVNode(c,{placeholder:"1",type:"formInput",value:`${i.tournament.totalDays}`,invalid:i.validation.totalDays},null,8,["value","invalid"])])]),l.createElementVNode("div",uA,[l.createVNode(a,{"data-testid":"text-description",color:"primaryHighlight",size:"sm",text:"Description",weight:"normal",class:"mb-1",invalid:i.validation.description},null,8,["invalid"]),l.createVNode(f,{invalid:i.validation.description,"onUpdate:editorContent":o.handleEditorUpdate},null,8,["invalid","onUpdate:editorContent"])]),l.createElementVNode("div",fA,[l.createVNode(a,{"data-testid":"text-visibility",color:"primaryHighlight",size:"sm",text:"Tournament Visibility",weight:"normal",class:"mb-2",invalid:i.validation.visibility},null,8,["invalid"]),l.createVNode(p,{items:i.visibilityItems,invalid:i.validation.visibility,"onUpdate:value":e[1]||(e[1]=m=>i.tournament.visibility=m)},null,8,["items","invalid"])]),l.createElementVNode("div",null,[l.createVNode(h,{label:"Continue",type:"secondary",color:"neutral",size:"sm",onClick:e[2]||(e[2]=m=>o.handleSubmit()),class:"w-full"})])])])])}const hA=He(ZD,[["render",pA]]),mA={name:"AdminLeftMenu",components:{BaseButton:dr},props:{buttons:{type:Array,default:()=>[]}},methods:{handleButtonClick(n){this.$emit("button-click",n)}}},gA={class:"bg-secondary w-64 h-screen flex flex-col justify-between"},yA=l.createElementVNode("section",{class:"h-28 border-b border-neutral"},[l.createElementVNode("div",{class:"flex flex-col justify-center h-28"},[l.createElementVNode("div",{class:"ml-8"},[l.createElementVNode("img",{class:"w-32",src:"https://ferrotas.com/assets/ferrotas-white-small-720502db.png",alt:"logo"})])])],-1),vA={class:"flex flex-col p-2 h-full"},bA={class:"flex flex-col justify-end p-2 flex-grow"},wA={class:"border-t border-neutral pt-2"};function kA(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",gA,[yA,l.createElementVNode("section",vA,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.buttons,s=>(l.openBlock(),l.createBlock(a,{label:s.label,iconClass:"fa-solid fa-trophy text-white",type:"admin",hover:"admin",onClick:c=>o.handleButtonClick(s)},null,8,["label","onClick"]))),256))]),l.createElementVNode("section",bA,[l.createElementVNode("div",wA,[l.createVNode(a,{iconClass:"fa-solid fa-circle-user text-textSecondary",label:"Account",type:"adminSecondary",onClick:e[0]||(e[0]=s=>o.handleButtonClick(n.button))}),l.createVNode(a,{iconClass:"fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",label:"Log Out",type:"adminSecondary",onClick:e[1]||(e[1]=s=>o.handleButtonClick(n.button))})])])])}const xA=He(mA,[["render",kA]]);Pe.AddTournamentPageOne=hA,Pe.AddressAutocomplete=Mc,Pe.AdminLeftMenu=xA,Pe.BaseButton=dr,Pe.BaseIcon=Oa,Pe.BaseInput=bo,Pe.BaseRadioGroup=yc,Pe.BaseTag=vc,Pe.BaseText=Pn,Pe.Breadcrumb=bm,Pe.DatePicker=zd,Pe.DropDown=_a,Pe.FilterAndSortBar=xc,Pe.FilterUpcomingPast=Cc,Pe.GridContainer=dw,Pe.ImageCropper=Su,Pe.TextBoxEditor=Jh,Pe.TournamentCard=Hd,Pe.TournamentCardDetails=bc,Pe.TournamentCardHeader=kc,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
|
|
183
|
+
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const f=c.filter(p=>s.includes(p.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),yD=_t.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ge(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>jl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Da=200,rt=function(){};rt.prototype.append=function(e){return e.length?(e=rt.from(e),!this.length&&e||e.length<Da&&this.leafAppend(e)||this.length<Da&&e.leafPrepend(this)||this.appendInner(e)):this},rt.prototype.prepend=function(e){return e.length?rt.from(e).append(this):this},rt.prototype.appendInner=function(e){return new vD(this,e)},rt.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?rt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},rt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},rt.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},rt.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},rt.from=function(e){return e instanceof rt?e:e&&e.length?new Yh(e):rt.empty};var Yh=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,s){for(var c=o;c<a;c++)if(i(this.values[c],s+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,s){for(var c=o-1;c>=a;c--)if(i(this.values[c],s+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Da)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Da)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(rt);rt.empty=new Yh([]);var vD=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(rt);const bD=500;class nn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,s,c,d=[],u=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new xn(f.map));let h=f.step.map(i.slice(o)),m;h&&a.maybeStep(h).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],d.push(new xn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,c=new nn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:s}}addTransform(e,t,r,i){let o=[],a=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),p=new xn(e.mapping.maps[u],f,t),h;(h=c&&c.merge(p))&&(p=h,u?o.pop():s=s.slice(0,s.length-1)),o.push(p),t&&(a++,t=void 0),i||(c=p)}let d=a-r.depth;return d>kD&&(s=wD(s,d),a-=d),new nn(s.append(o),a)}remapping(e,t){let r=new Zr;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new nn(this.items.append(e.map(t=>new xn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach(p=>{p.selection&&s--},i);let c=t;this.items.forEach(p=>{let h=o.getMirror(--c);if(h==null)return;a=Math.min(a,h);let m=o.maps[h];if(p.step){let v=e.steps[h].invert(e.docs[h]),b=p.selection&&p.selection.map(o.slice(c+1,h));b&&s++,r.push(new xn(m,v,b))}else r.push(new xn(m))},i);let d=[];for(let p=t;p<a;p++)d.push(new xn(o.maps[p]));let u=this.items.slice(0,i).append(d).append(r),f=new nn(u,s);return f.emptyItemCount()>bD&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=e)i.push(a),a.selection&&o++;else if(a.step){let c=a.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=a.selection&&a.selection.map(t.slice(r));u&&o++;let f=new xn(d.invert(),c,u),p,h=i.length-1;(p=i.length&&i[h].merge(f))?i[h]=p:i.push(f)}}else a.map&&r--},this.items.length,0),new nn(rt.from(i.reverse()),o)}}nn.empty=new nn(rt.empty,0);function wD(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class xn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new xn(t.getMap().invert(),t,this.selection)}}}class or{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const kD=20;function xD(n,e,t,r){let i=t.getMeta(ar),o;if(i)return i.historyState;t.getMeta(TD)&&(n=new or(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(ar))return a.getMeta(ar).redo?new or(n.done.addTransform(t,void 0,r,Aa(e)),n.undone,Uh(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new or(n.done,n.undone.addTransform(t,void 0,r,Aa(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=s&&(n.prevTime<(t.time||0)-r.newGroupDelay||!CD(t,n.prevRanges)),d=a?dc(n.prevRanges,t.mapping):Uh(t.mapping.maps[t.steps.length-1]);return new or(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Aa(e)),nn.empty,d,t.time,s??n.prevComposition)}else return(o=t.getMeta("rebased"))?new or(n.done.rebased(t,o),n.undone.rebased(t,o),dc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new or(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),dc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function CD(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function Uh(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function dc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function jh(n,e,t,r){let i=Aa(e),o=ar.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let s=a.selection.resolve(a.transform.doc),c=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),d=new or(r?c:a.remaining,r?a.remaining:c,null,0,-1);t(a.transform.setSelection(s).setMeta(ar,{redo:r,historyState:d}).scrollIntoView())}let uc=!1,Wh=null;function Aa(n){let e=n.plugins;if(Wh!=e){uc=!1,Wh=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){uc=!0;break}}return uc}const ar=new mn("history"),TD=new mn("closeHistory");function MD(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Mt({key:ar,state:{init(){return new or(nn.empty,nn.empty,null,0,-1)},apply(e,t,r){return xD(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?qh:r=="historyRedo"?Kh:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const qh=(n,e)=>{let t=ar.getState(n);return!t||t.done.eventCount==0?!1:(e&&jh(t,n,e,!1),!0)},Kh=(n,e)=>{let t=ar.getState(n);return!t||t.undone.eventCount==0?!1:(e&&jh(t,n,e,!0),!0)},SD=mt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>qh(n,e),redo:()=>({state:n,dispatch:e})=>Kh(n,e)}},addProseMirrorPlugins(){return[MD(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),DD=_t.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Ge(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var a;if(o){const{$to:s}=i.selection,c=s.end();if(s.nodeAfter)s.nodeAfter.isTextblock?i.setSelection(ve.create(i.doc,s.pos+1)):s.nodeAfter.isBlock?i.setSelection(me.create(i.doc,s.pos)):i.setSelection(ve.create(i.doc,s.pos));else{const d=(a=s.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(i.insert(c,d),i.setSelection(ve.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[iM({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),AD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,ED=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,ND=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,OD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,_D=tn.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Or({find:AD,type:this.type}),Or({find:ND,type:this.type})]},addPasteRules(){return[_r({find:ED,type:this.type}),_r({find:OD,type:this.type})]}}),BD=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),PD=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Gh=tn.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=va(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Qh=/^(\d+)\.\s$/,ID=_t.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Ge(this.options.HTMLAttributes,t),0]:["ol",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(PD.name,this.editor.getAttributes(Gh.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=so({find:Qh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=so({find:Qh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Gh.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),RD=_t.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),VD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,$D=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,LD=tn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return Fl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[Or({find:VD,type:this.type})]},addPasteRules(){return[_r({find:$D,type:this.type})]}}),FD=_t.create({name:"text",group:"inline"}),zD=mt.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,a,s,c,d,u,f,p,h,m,v,b,x;const C=[];return this.options.blockquote!==!1&&C.push(US.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&C.push(GS.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&C.push(JS.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&C.push(eD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&C.push(rD.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&C.push(iD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&C.push(sD.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&C.push(mD.configure((s=this.options)===null||s===void 0?void 0:s.gapcursor)),this.options.hardBreak!==!1&&C.push(gD.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&C.push(yD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&C.push(SD.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&C.push(DD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&C.push(_D.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&C.push(BD.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&C.push(ID.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&C.push(RD.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&C.push(LD.configure((b=this.options)===null||b===void 0?void 0:b.strike)),this.options.text!==!1&&C.push(FD.configure((x=this.options)===null||x===void 0?void 0:x.text)),C}}),HD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,YD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,UD=tn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Or({find:HD,type:this.type})]},addPasteRules(){return[_r({find:YD,type:this.type})]}}),jD=mt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.every(t=>e.updateAttributes(t,{textAlign:n})):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.every(e=>n.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),WD={components:{EditorContent:zS,BaseButton:dr},props:{invalid:{type:Boolean,default:!1}},data(){return{}},setup(n,{emit:e}){const t=l.ref("");return{editor:HS({content:"",extensions:[zD,UD,jD.configure({types:["heading","paragraph"]})],editorProps:{attributes:{class:"focus:outline-none"}},onUpdate({editor:i}){t.value=i.getHTML(),e("update:editorContent",t.value)}}),editorContent:t}},methods:{}},qD={"data-testid":"editor-buttons",class:"w-full flex flex-row pl-2"},KD={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2"},GD={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-around"},QD={class:"w-1/3 flex flex-row justify-between pl-2"},JD={class:"my-4 my-2 p-4 rounded-xl h-40 bg-tertiary overflow-auto"};function XD(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton"),s=l.resolveComponent("editor-content");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border rounded-lg text-secondary text-sm p-4 w-full",t.invalid?"border-alarm":"border-dropdownSelect"])},[l.createElementVNode("div",qD,[l.createElementVNode("div",KD,[l.createVNode(a,{iconName:"fa-h1",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:1}),onClick:e[0]||(e[0]=c=>r.editor.chain().toggleHeading({level:1}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h2",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:2}),onClick:e[1]||(e[1]=c=>r.editor.chain().toggleHeading({level:2}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h3",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:3}),onClick:e[2]||(e[2]=c=>r.editor.chain().toggleHeading({level:3}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-paragraph",label:"",type:"editor",selected:r.editor&&r.editor.isActive("paragraph"),onClick:e[3]||(e[3]=c=>r.editor.chain().setParagraph().run())},null,8,["selected"])]),l.createElementVNode("div",GD,[l.createVNode(a,{selected:r.editor&&r.editor.isActive("bold"),iconName:"fa-bold",label:"",type:"editor",onClick:e[4]||(e[4]=c=>r.editor&&r.editor.chain().toggleBold().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("italic"),iconName:"fa-italic",label:"",type:"editor",onClick:e[5]||(e[5]=c=>r.editor&&r.editor.chain().toggleItalic().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("strike"),iconName:"fa-strikethrough",label:"",type:"editor",onClick:e[6]||(e[6]=c=>r.editor&&r.editor.chain().toggleStrike().run())},null,8,["selected"])]),l.createElementVNode("div",QD,[l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"left"}),iconName:"fa-align-left",label:"",type:"editor",onClick:e[7]||(e[7]=c=>r.editor.chain().setTextAlign("left").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"center"}),iconName:"fa-align-center",label:"",type:"editor",onClick:e[8]||(e[8]=c=>r.editor&&r.editor.chain().setTextAlign("center").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"right"}),iconName:"fa-align-right",label:"",type:"editor",onClick:e[9]||(e[9]=c=>r.editor&&r.editor.chain().setTextAlign("right").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"justify"}),iconName:"fa-align-justify",label:"",type:"editor",onClick:e[10]||(e[10]=c=>r.editor&&r.editor.chain().setTextAlign("justify").run())},null,8,["selected"])])]),l.createElementVNode("p",JD,[l.createVNode(s,{editor:r.editor,class:"focus:shadow-none focus:outline-none"},null,8,["editor"])])],2)}const Jh=He(WD,[["render",XD]]),ZD={name:"AddTournamentPageOne",components:{BaseText:Pn,BaseInput:bo,ImageCropper:Su,AddressAutocomplete:Mc,DatePicker:zd,TextBoxEditor:Jh,BaseRadioGroup:yc,BaseButton:dr},props:{},data(){return{tournament:{name:"",imageLink:"",address:"",coordinates:"",startDate:"",totalDays:1,description:"",visibility:"",externalLinks:Array},validation:{name:!1,imageLink:!1,address:!1,coordinates:!1,startDate:!1,totalDays:!1,description:!1,visibility:!1},visibilityItems:[{label:"Open",value:"open",description:"Viewable To Everyone"},{label:"Club",value:"club",description:"Viewable Only to Members of Your Club"},{label:"Private",value:"private",description:"Only Viewable by you"}]}},methods:{handleSubmit(){this.setAllValidationStates(!1),this.tournament.name===""&&(this.validation.name=!0),this.tournament.coordinates===""&&(this.validation.address=!0),this.tournament.startDate===""&&(this.validation.startDate=!0),this.tournament.totalDays===""&&(this.validation.totalDays=!0),this.tournament.description===""&&(this.validation.description=!0),this.tournament.visibility===""&&(this.validation.visibility=!0),this.areAnyFieldsAreLeftInvalid||(this.$emit("update:tournament",this.tournament),this.$emit("update:step",2))},setAllValidationStates(n){Object.keys(this.validation).forEach(e=>{this.validation[e]=n})},handleAddressUpdate(n){this.tournament.address=n.address,this.tournament.coordinates=n.coordinates},handleDateUpdate(n){this.tournament.startDate=n},handleEditorUpdate(n){this.tournament.description=n}},computed:{areAnyFieldsAreLeftInvalid(){return Object.values(this.validation).every(n=>n)}}},eA={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},tA={class:"w-full flex flex-row justify-center"},nA={class:"w-full flex flex-row justify-center my-4"},rA={class:"w-full flex flex-row justify-center my-4"},iA={class:"w-full flex flex-row justify-center"},oA={class:"w-96"},aA={class:"flex flex-col mb-3"},sA={class:"flex flex-col mb-3"},lA={class:"flex flex-row mb-3"},cA={class:"w-3/4 mr-1"},dA={class:"w-1/4 ml-1"},uA={class:"flex flex-col mb-3"},fA={class:"flex flex-col pb-4"};function pA(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("ImageCropper"),c=l.resolveComponent("BaseInput"),d=l.resolveComponent("AddressAutocomplete"),u=l.resolveComponent("DatePicker"),f=l.resolveComponent("TextBoxEditor"),p=l.resolveComponent("BaseRadioGroup"),h=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",eA,[l.createElementVNode("div",tA,[l.createVNode(a,{"data-testid":"text-step",color:"quaternary",size:"sm",text:"Step 1 out of 2",weight:"normal"})]),l.createElementVNode("div",nA,[l.createVNode(a,{"data-testid":"text-add-tournamnet",color:"primaryHighlight",size:"2xl",text:"Add Tournament",weight:"normal"})]),l.createElementVNode("div",rA,[l.createVNode(s,{personID:1})]),l.createElementVNode("div",iA,[l.createElementVNode("section",oA,[l.createElementVNode("div",aA,[l.createVNode(a,{"data-testid":"text-tournament-name",color:"primary",size:"sm",text:"Tournament Name",weight:"normal",class:"mb-1",invalid:i.validation.name},null,8,["invalid"]),l.createVNode(c,{placeholder:"Enter Tournament Name",type:"formInput",value:i.tournament.name,invalid:i.validation.name,"onUpdate:value":e[0]||(e[0]=m=>i.tournament.name=m)},null,8,["value","invalid"])]),l.createElementVNode("div",sA,[l.createVNode(a,{"data-testid":"text-address",color:"primaryHighlight",size:"sm",text:"Address",weight:"normal",class:"mb-1",invalid:i.validation.address},null,8,["invalid"]),l.createVNode(d,{address:i.tournament.address,invalid:i.validation.address,"onUpdate:address":o.handleAddressUpdate},null,8,["address","invalid","onUpdate:address"])]),l.createElementVNode("div",lA,[l.createElementVNode("div",cA,[l.createVNode(a,{"data-testid":"text-start-date",color:"primaryHighlight",size:"sm",text:"Start Date",weight:"normal",class:"mb-1",invalid:i.validation.startDate},null,8,["invalid"]),l.createVNode(u,{setDate:i.tournament.startDate,"onUpdate:selectedDate":o.handleDateUpdate},null,8,["setDate","onUpdate:selectedDate"])]),l.createElementVNode("div",dA,[l.createVNode(a,{"data-testid":"text-total-days",color:"primaryHighlight",size:"sm",text:"Total Days",weight:"normal",class:"mb-1",invalid:i.validation.totalDays},null,8,["invalid"]),l.createVNode(c,{placeholder:"1",type:"formInput",value:`${i.tournament.totalDays}`,invalid:i.validation.totalDays},null,8,["value","invalid"])])]),l.createElementVNode("div",uA,[l.createVNode(a,{"data-testid":"text-description",color:"primaryHighlight",size:"sm",text:"Description",weight:"normal",class:"mb-1",invalid:i.validation.description},null,8,["invalid"]),l.createVNode(f,{invalid:i.validation.description,"onUpdate:editorContent":o.handleEditorUpdate},null,8,["invalid","onUpdate:editorContent"])]),l.createElementVNode("div",fA,[l.createVNode(a,{"data-testid":"text-visibility",color:"primaryHighlight",size:"sm",text:"Tournament Visibility",weight:"normal",class:"mb-2",invalid:i.validation.visibility},null,8,["invalid"]),l.createVNode(p,{items:i.visibilityItems,invalid:i.validation.visibility,"onUpdate:value":e[1]||(e[1]=m=>i.tournament.visibility=m)},null,8,["items","invalid"])]),l.createElementVNode("div",null,[l.createVNode(h,{label:"Continue",type:"secondary",color:"neutral",size:"sm",onClick:e[2]||(e[2]=m=>o.handleSubmit()),class:"w-full"})])])])])}const hA=He(ZD,[["render",pA]]),mA={name:"AdminLeftMenu",components:{BaseButton:dr},props:{buttons:{type:Array,default:()=>[]}},methods:{handleButtonClick(n){this.$emit("button-click",n)}}},gA={class:"bg-secondary w-64 h-screen flex flex-col justify-between"},yA=l.createElementVNode("section",{class:"h-28 border-b border-neutral"},[l.createElementVNode("div",{class:"flex flex-col justify-center h-28"},[l.createElementVNode("div",{class:"ml-8"},[l.createElementVNode("img",{class:"w-32",src:"https://ferrotas.com/assets/ferrotas-white-small-720502db.png",alt:"logo"})])])],-1),vA={class:"flex flex-col p-2 h-full"},bA={class:"flex flex-col justify-end p-2 flex-grow"},wA={class:"border-t border-neutral pt-2"};function kA(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",gA,[yA,l.createElementVNode("section",vA,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.buttons,s=>(l.openBlock(),l.createBlock(a,{label:s.label,iconClass:"fa-solid fa-trophy text-white",type:"admin",hover:"admin",onClick:c=>o.handleButtonClick(s)},null,8,["label","onClick"]))),256))]),l.createElementVNode("section",bA,[l.createElementVNode("div",wA,[l.createVNode(a,{iconClass:"fa-solid fa-circle-user text-textSecondary",label:"Account",type:"adminSecondary",onClick:e[0]||(e[0]=s=>o.handleButtonClick(n.button))}),l.createVNode(a,{iconClass:"fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",label:"Log Out",type:"adminSecondary",onClick:e[1]||(e[1]=s=>o.handleButtonClick(n.button))})])])])}const xA=He(mA,[["render",kA]]);Pe.AddTournamentPageOne=hA,Pe.AddressAutocomplete=Mc,Pe.AdminLeftMenu=xA,Pe.BaseButton=dr,Pe.BaseIcon=Oa,Pe.BaseInput=bo,Pe.BaseRadioGroup=yc,Pe.BaseTag=vc,Pe.BaseText=Pn,Pe.Breadcrumb=bm,Pe.DatePicker=zd,Pe.DropDown=_a,Pe.FilterAndSortBar=xc,Pe.FilterUpcomingPast=Cc,Pe.GridContainer=dw,Pe.ImageCropper=Su,Pe.TextBoxEditor=Jh,Pe.TournamentCard=Hd,Pe.TournamentCardDetails=bc,Pe.TournamentCardHeader=kc,Object.defineProperty(Pe,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -101,9 +101,7 @@ export default {
|
|
|
101
101
|
},
|
|
102
102
|
methods: {
|
|
103
103
|
handleSubmit() {
|
|
104
|
-
console.log('submitting form');
|
|
105
104
|
this.setAllValidationStates(false);
|
|
106
|
-
console.log(this.tournament);
|
|
107
105
|
|
|
108
106
|
if (this.tournament.name === '') this.validation.name = true;
|
|
109
107
|
if (this.tournament.coordinates === '') this.validation.address = true;
|
|
@@ -112,6 +110,10 @@ export default {
|
|
|
112
110
|
if (this.tournament.description === '') this.validation.description = true;
|
|
113
111
|
if (this.tournament.visibility === '') this.validation.visibility = true;
|
|
114
112
|
|
|
113
|
+
if (!this.areAnyFieldsAreLeftInvalid) {
|
|
114
|
+
this.$emit('update:tournament', this.tournament);
|
|
115
|
+
this.$emit('update:step', 2);
|
|
116
|
+
}
|
|
115
117
|
},
|
|
116
118
|
setAllValidationStates(state) {
|
|
117
119
|
Object.keys(this.validation).forEach(key => {
|
|
@@ -130,7 +132,7 @@ export default {
|
|
|
130
132
|
}
|
|
131
133
|
},
|
|
132
134
|
computed: {
|
|
133
|
-
|
|
135
|
+
areAnyFieldsAreLeftInvalid() {
|
|
134
136
|
return Object.values(this.validation).every(v => v);
|
|
135
137
|
}
|
|
136
138
|
}
|