adminizer 4.3.0-build.112 → 4.3.0-build.113

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.
Files changed (57) hide show
  1. package/assets/add-DbQJd7Bm.js +1 -0
  2. package/assets/add-form-tDZGN7FP.js +1 -0
  3. package/assets/add-group-D5MrUNE1.js +1 -0
  4. package/assets/add-group-form-DMz0_Oo9.js +1 -0
  5. package/assets/{add-user-form-DrclnTOd.js → add-user-form-izlXhv2-.js} +1 -1
  6. package/assets/add-user-iCupTmGS.js +1 -0
  7. package/assets/app-layout-BmMzULcJ.js +1 -0
  8. package/assets/{app-shell-CHEYhVco.js → app-shell-C8Cnr5Hy.js} +1 -1
  9. package/assets/app-sidebar-HwvXNZzk.js +1 -0
  10. package/assets/app-sidebar-header-RRnKZeeU.js +1 -0
  11. package/assets/app.js +2 -2
  12. package/assets/{breadcrumbs-C439DWrC.js → breadcrumbs-DSMzNYiS.js} +1 -1
  13. package/assets/{catalog-CUj4KZ7i.js → catalog-CpDHgq8b.js} +5 -5
  14. package/assets/{dashboard-Bi5KeZu2.js → dashboard-C_EdlZvv.js} +1 -1
  15. package/assets/{date-picker-DbJ8nHp5.js → date-picker-kW3wZQr_.js} +1 -1
  16. package/assets/{del-modal-_b3CSNHb.js → del-modal-DyIWFflP.js} +1 -1
  17. package/assets/{field-renderer-CNZDdaEm.js → field-renderer-DBKkDhBG.js} +3 -3
  18. package/assets/form-J27uSTUj.js +1 -0
  19. package/assets/{form-CSw9kHpL.js → form-pf6uriQX.js} +1 -1
  20. package/assets/{geo-json-CadjdhwW.js → geo-json-YeWQOYnT.js} +1 -1
  21. package/assets/{home-BN7cR9SI.js → home-CO-50-T_.js} +2 -2
  22. package/assets/{icon-DM49pZW3.js → icon-DpkedrXG.js} +1 -1
  23. package/assets/{init-user-DNrB8Xt5.js → init-user-DaOvt0vG.js} +1 -1
  24. package/assets/{input-error--IOnWghB.js → input-error-CmXZF6xy.js} +1 -1
  25. package/assets/list-eG7X4aSC.js +1 -0
  26. package/assets/{list-table-CQDHdLv5.js → list-table-Bc_4C3bv.js} +3 -3
  27. package/assets/{login-6Xb8bcPq.js → login-DR6fvKtm.js} +1 -1
  28. package/assets/manifest.json +84 -84
  29. package/assets/{material-icon-BedgD2NE.js → material-icon-DwkE6wKL.js} +1 -1
  30. package/assets/{media-manager-BLKlHdIk.js → media-manager-Dl0AQjLB.js} +1 -1
  31. package/assets/{module-B4-7WkY5.js → module-C0dPDXsj.js} +1 -1
  32. package/assets/{nav-footer-BwkQkwow.js → nav-footer-B85HLj-j.js} +1 -1
  33. package/assets/{nav-main-9Eb_A0rf.js → nav-main-BqKm87JZ.js} +1 -1
  34. package/assets/nav-user-DuCZNsZX.js +1 -0
  35. package/assets/{notification-ma2x7vka.js → notification-BwG5Ug4o.js} +5 -5
  36. package/assets/{pagination-render-xsEktzA8.js → pagination-render-D9ogYx-T.js} +1 -1
  37. package/assets/{register-BIyjCy8M.js → register-hJD1ETdf.js} +1 -1
  38. package/assets/{tabs-BK_5wdPA.js → tabs-BhkFoerH.js} +1 -1
  39. package/assets/{theme-switcher-CKiJbMkh.js → theme-switcher-cgyA7_cO.js} +1 -1
  40. package/assets/{toast-editor-BZM5RHph.js → toast-editor-DwRk6WqT.js} +1 -1
  41. package/assets/{user-info-CcYdmjMZ.js → user-info-BGQvqBmO.js} +1 -1
  42. package/assets/{user-menu-content-DbUk8ZeY.js → user-menu-content-BDm88xaM.js} +1 -1
  43. package/assets/welcome-BwoI5hJ3.js +1 -0
  44. package/lib/catalog/Navigation.js +1 -0
  45. package/package.json +1 -1
  46. package/assets/add-CjiiZikQ.js +0 -1
  47. package/assets/add-form-M8eciH6Z.js +0 -1
  48. package/assets/add-group-7yAK6uFY.js +0 -1
  49. package/assets/add-group-form-BNmpvW8K.js +0 -1
  50. package/assets/add-user-NoYkTfZi.js +0 -1
  51. package/assets/app-layout-i2zN9Rn-.js +0 -1
  52. package/assets/app-sidebar-DeF8WNmW.js +0 -1
  53. package/assets/app-sidebar-header-DdM1EOrb.js +0 -1
  54. package/assets/form-DaaOc8Fa.js +0 -1
  55. package/assets/list-DCZIbKAJ.js +0 -1
  56. package/assets/nav-user-CRAfyE-x.js +0 -1
  57. package/assets/welcome-cWh1qnl_.js +0 -1
@@ -1,4 +1,4 @@
1
- import{ad as KZ,ae as JZ,j as kv}from"./app.js";import{e as Ro,r as Dl}from"./monaco-ICtx6xoc.js";import{k as YZ,b as XZ}from"./jsoneditor-D95dIAP2.js";import{g as ZZ}from"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";function Ar(r){this.content=r}Ar.prototype={constructor:Ar,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),a=n.content.slice();return i==-1?a.push(t||r,e):(a[i+1]=e,t&&(a[i]=t)),new Ar(a)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ar(t)},addToStart:function(r,e){return new Ar([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Ar(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),a=n.find(r);return i.splice(a==-1?i.length:a,0,e,t),new Ar(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Ar.from(r),r.size?new Ar(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Ar.from(r),r.size?new Ar(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Ar.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};Ar.from=function(r){if(r instanceof Ar)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Ar(e)};function Ky(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),a=e.child(n);if(i==a){t+=i.nodeSize;continue}if(!i.sameMarkup(a))return t;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)t++;return t}if(i.content.size||a.content.size){let o=Ky(i.content,a.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Jy(r,e,t,n){for(let i=r.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:t,b:n};let o=r.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){t-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:t,b:n};if(o.isText&&o.text!=s.text){let f=0,v=Math.min(o.text.length,s.text.length);for(;f<v&&o.text[o.text.length-f-1]==s.text[s.text.length-f-1];)f++,t--,n--;return{a:t,b:n}}if(o.content.size||s.content.size){let f=Jy(o.content,s.content,t-1,n-1);if(f)return f}t-=l,n-=l}}class Ne{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,a){for(let o=0,s=0;s<t;o++){let l=this.content[o],f=s+l.nodeSize;if(f>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let v=s+1;l.nodesBetween(Math.max(0,e-v),Math.min(l.content.size,t-v),n,i+v)}s=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let a="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let f=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&f||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=f},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Ne(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let a=0,o=0;o<t;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Ne(n,i)}cutByIndex(e,t){return e==t?Ne.empty:e==0&&t==this.content.length?this:new Ne(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),a=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new Ne(i,a)}addToStart(e){return new Ne([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ne(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Ky(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Jy(this,e,t,n)}findIndex(e){if(e==0)return Ll(0,e);if(e==this.size)return Ll(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),a=n+i.nodeSize;if(a>=e)return a==e?Ll(t+1,a):Ll(t,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Ne.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ne(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ne.empty;let t,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(t||(t=e.slice(0,i)),t[t.length-1]=a.withText(t[t.length-1].text+a.text)):t&&t.push(a)}return new Ne(t||e,n)}static from(e){if(!e)return Ne.empty;if(e instanceof Ne)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ne([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ne.empty=new Ne([],0);const xf={index:0,offset:0};function Ll(r,e){return xf.index=r,xf.offset=e,xf}function nu(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!nu(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!nu(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Pt=class hd{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))t||(t=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(a)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&nu(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return hd.none;if(e instanceof hd)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Pt.none=[];class iu extends Error{}class $e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Xy(this.content,e+this.openStart,t);return n&&new $e(n,this.openStart,this.openEnd)}removeBetween(e,t){return new $e(Yy(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return $e.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $e(Ne.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new $e(e,n,i)}}$e.empty=new $e(Ne.empty,0,0);function Yy(r,e,t){let{index:n,offset:i}=r.findIndex(e),a=r.maybeChild(n),{index:o,offset:s}=r.findIndex(t);if(i==e||a.isText){if(s!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,a.copy(Yy(a.content,e-i-1,t-i-1)))}function Xy(r,e,t,n){let{index:i,offset:a}=r.findIndex(e),o=r.maybeChild(i);if(a==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let s=Xy(o.content,e-a-1,t,o);return s&&r.replaceChild(i,o.copy(s))}function QZ(r,e,t){if(t.openStart>r.depth)throw new iu("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new iu("Inconsistent open depths");return Zy(r,e,t,0)}function Zy(r,e,t,n){let i=r.index(n),a=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Zy(r,e,t,n+1);return a.copy(a.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,s=o.content;return Va(o,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=eQ(t,r);return Va(a,eb(r,o,s,e,n))}else return Va(a,au(r,e,n))}function Qy(r,e){if(!e.type.compatibleContent(r.type))throw new iu("Cannot join "+e.type.name+" onto "+r.type.name)}function pd(r,e,t){let n=r.node(t);return Qy(n,e.node(t)),n}function za(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Ts(r,e,t,n){let i=(e||r).node(t),a=0,o=e?e.index(t):i.childCount;r&&(a=r.index(t),r.depth>t?a++:r.textOffset&&(za(r.nodeAfter,n),a++));for(let s=a;s<o;s++)za(i.child(s),n);e&&e.depth==t&&e.textOffset&&za(e.nodeBefore,n)}function Va(r,e){return r.type.checkContent(e),r.copy(e)}function eb(r,e,t,n,i){let a=r.depth>i&&pd(r,e,i+1),o=n.depth>i&&pd(t,n,i+1),s=[];return Ts(null,r,i,s),a&&o&&e.index(i)==t.index(i)?(Qy(a,o),za(Va(a,eb(r,e,t,n,i+1)),s)):(a&&za(Va(a,au(r,e,i+1)),s),Ts(e,t,i,s),o&&za(Va(o,au(t,n,i+1)),s)),Ts(n,null,i,s),new Ne(s)}function au(r,e,t){let n=[];if(Ts(null,r,t,n),r.depth>t){let i=pd(r,e,t+1);za(Va(i,au(r,e,t+1)),n)}return Ts(e,null,t,n),new Ne(n)}function eQ(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let a=t-1;a>=0;a--)i=e.node(a).copy(Ne.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class Os{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Pt.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ou(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,a=t;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),f=a-l;if(n.push(o,s,i+l),!f||(o=o.child(s),o.isText))break;a=f-1,i+=l+1}return new Os(t,n,a)}static resolveCached(e,t){let n=wv.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==t)return o}else wv.set(e,n=new tQ);let i=n.elts[n.i]=Os.resolve(e,t);return n.i=(n.i+1)%rQ,i}}class tQ{constructor(){this.elts=[],this.i=0}}const rQ=12,wv=new WeakMap;class ou{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const nQ=Object.create(null);let aa=class vd{constructor(e,t,n,i=Pt.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||Ne.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&nu(this.attrs,t||e.defaultAttrs||nQ)&&Pt.sameSet(this.marks,n||Pt.none)}copy(e=null){return e==this.content?this:new vd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new vd(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return $e.empty;let i=this.resolve(e),a=this.resolve(t),o=n?0:i.sharedDepth(t),s=i.start(o),f=i.node(o).content.cut(i.pos-s,a.pos-s);return new $e(f,i.depth-o,a.depth-o)}replace(e,t,n){return QZ(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return Os.resolveCached(this,e)}resolveNoCache(e){return Os.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),tb(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Ne.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Pt.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Pt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=Ne.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};aa.prototype.text=void 0;class su extends aa{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):tb(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new su(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new su(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function tb(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class ja{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new iQ(e,t);if(n.next==null)return ja.empty;let i=rb(n);n.next&&n.err("Unexpected trailing text");let a=fQ(cQ(i));return dQ(a,n),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let a=t;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return Ne.from(s.map(f=>f.createAndFill()));for(let f=0;f<o.next.length;f++){let{type:v,next:b}=o.next[f];if(!(v.isText||v.hasRequiredAttrs())&&i.indexOf(b)==-1){i.push(b);let T=a(b,s.concat(v));if(T)return T}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
1
+ import{ae as KZ,af as JZ,j as kv}from"./app.js";import{e as Ro,r as Dl}from"./monaco-ICtx6xoc.js";import{k as YZ,b as XZ}from"./jsoneditor-D95dIAP2.js";import{g as ZZ}from"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";function Ar(r){this.content=r}Ar.prototype={constructor:Ar,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var n=t&&t!=r?this.remove(t):this,i=n.find(r),a=n.content.slice();return i==-1?a.push(t||r,e):(a[i+1]=e,t&&(a[i]=t)),new Ar(a)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Ar(t)},addToStart:function(r,e){return new Ar([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Ar(t)},addBefore:function(r,e,t){var n=this.remove(e),i=n.content.slice(),a=n.find(r);return i.splice(a==-1?i.length:a,0,e,t),new Ar(i)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Ar.from(r),r.size?new Ar(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Ar.from(r),r.size?new Ar(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Ar.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}};Ar.from=function(r){if(r instanceof Ar)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Ar(e)};function Ky(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),a=e.child(n);if(i==a){t+=i.nodeSize;continue}if(!i.sameMarkup(a))return t;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)t++;return t}if(i.content.size||a.content.size){let o=Ky(i.content,a.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function Jy(r,e,t,n){for(let i=r.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:t,b:n};let o=r.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){t-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:t,b:n};if(o.isText&&o.text!=s.text){let f=0,v=Math.min(o.text.length,s.text.length);for(;f<v&&o.text[o.text.length-f-1]==s.text[s.text.length-f-1];)f++,t--,n--;return{a:t,b:n}}if(o.content.size||s.content.size){let f=Jy(o.content,s.content,t-1,n-1);if(f)return f}t-=l,n-=l}}class Ne{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,i=0,a){for(let o=0,s=0;s<t;o++){let l=this.content[o],f=s+l.nodeSize;if(f>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let v=s+1;l.nodesBetween(Math.max(0,e-v),Math.min(l.content.size,t-v),n,i+v)}s=f}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let a="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let f=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&f||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=f},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Ne(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let n=[],i=0;if(t>e)for(let a=0,o=0;o<t;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>t)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Ne(n,i)}cutByIndex(e,t){return e==t?Ne.empty:e==0&&t==this.content.length?this:new Ne(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),a=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new Ne(i,a)}addToStart(e){return new Ne([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ne(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let i=this.content[t];e(i,n,t),n+=i.nodeSize}}findDiffStart(e,t=0){return Ky(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Jy(this,e,t,n)}findIndex(e){if(e==0)return Ll(0,e);if(e==this.size)return Ll(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),a=n+i.nodeSize;if(a>=e)return a==e?Ll(t+1,a):Ll(t,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Ne.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ne(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ne.empty;let t,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(t||(t=e.slice(0,i)),t[t.length-1]=a.withText(t[t.length-1].text+a.text)):t&&t.push(a)}return new Ne(t||e,n)}static from(e){if(!e)return Ne.empty;if(e instanceof Ne)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ne([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ne.empty=new Ne([],0);const xf={index:0,offset:0};function Ll(r,e){return xf.index=r,xf.offset=e,xf}function nu(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let n=0;n<r.length;n++)if(!nu(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!nu(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Pt=class hd{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))t||(t=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(a)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&nu(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=n.create(t.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return hd.none;if(e instanceof hd)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Pt.none=[];class iu extends Error{}class $e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Xy(this.content,e+this.openStart,t);return n&&new $e(n,this.openStart,this.openEnd)}removeBetween(e,t){return new $e(Yy(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return $e.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $e(Ne.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new $e(e,n,i)}}$e.empty=new $e(Ne.empty,0,0);function Yy(r,e,t){let{index:n,offset:i}=r.findIndex(e),a=r.maybeChild(n),{index:o,offset:s}=r.findIndex(t);if(i==e||a.isText){if(s!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,a.copy(Yy(a.content,e-i-1,t-i-1)))}function Xy(r,e,t,n){let{index:i,offset:a}=r.findIndex(e),o=r.maybeChild(i);if(a==e||o.isText)return n&&!n.canReplace(i,i,t)?null:r.cut(0,e).append(t).append(r.cut(e));let s=Xy(o.content,e-a-1,t,o);return s&&r.replaceChild(i,o.copy(s))}function QZ(r,e,t){if(t.openStart>r.depth)throw new iu("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new iu("Inconsistent open depths");return Zy(r,e,t,0)}function Zy(r,e,t,n){let i=r.index(n),a=r.node(n);if(i==e.index(n)&&n<r.depth-t.openStart){let o=Zy(r,e,t,n+1);return a.copy(a.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==n&&e.depth==n){let o=r.parent,s=o.content;return Va(o,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=eQ(t,r);return Va(a,eb(r,o,s,e,n))}else return Va(a,au(r,e,n))}function Qy(r,e){if(!e.type.compatibleContent(r.type))throw new iu("Cannot join "+e.type.name+" onto "+r.type.name)}function pd(r,e,t){let n=r.node(t);return Qy(n,e.node(t)),n}function za(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Ts(r,e,t,n){let i=(e||r).node(t),a=0,o=e?e.index(t):i.childCount;r&&(a=r.index(t),r.depth>t?a++:r.textOffset&&(za(r.nodeAfter,n),a++));for(let s=a;s<o;s++)za(i.child(s),n);e&&e.depth==t&&e.textOffset&&za(e.nodeBefore,n)}function Va(r,e){return r.type.checkContent(e),r.copy(e)}function eb(r,e,t,n,i){let a=r.depth>i&&pd(r,e,i+1),o=n.depth>i&&pd(t,n,i+1),s=[];return Ts(null,r,i,s),a&&o&&e.index(i)==t.index(i)?(Qy(a,o),za(Va(a,eb(r,e,t,n,i+1)),s)):(a&&za(Va(a,au(r,e,i+1)),s),Ts(e,t,i,s),o&&za(Va(o,au(t,n,i+1)),s)),Ts(n,null,i,s),new Ne(s)}function au(r,e,t){let n=[];if(Ts(null,r,t,n),r.depth>t){let i=pd(r,e,t+1);za(Va(i,au(r,e,t+1)),n)}return Ts(e,null,t,n),new Ne(n)}function eQ(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let a=t-1;a>=0;a--)i=e.node(a).copy(Ne.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class Os{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Pt.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ou(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,a=t;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),f=a-l;if(n.push(o,s,i+l),!f||(o=o.child(s),o.isText))break;a=f-1,i+=l+1}return new Os(t,n,a)}static resolveCached(e,t){let n=wv.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==t)return o}else wv.set(e,n=new tQ);let i=n.elts[n.i]=Os.resolve(e,t);return n.i=(n.i+1)%rQ,i}}class tQ{constructor(){this.elts=[],this.i=0}}const rQ=12,wv=new WeakMap;class ou{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const nQ=Object.create(null);let aa=class vd{constructor(e,t,n,i=Pt.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||Ne.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,i=0){this.content.nodesBetween(e,t,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,i){return this.content.textBetween(e,t,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&nu(this.attrs,t||e.defaultAttrs||nQ)&&Pt.sameSet(this.marks,n||Pt.none)}copy(e=null){return e==this.content?this:new vd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new vd(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return $e.empty;let i=this.resolve(e),a=this.resolve(t),o=n?0:i.sharedDepth(t),s=i.start(o),f=i.node(o).content.cut(i.pos-s,a.pos-s);return new $e(f,i.depth-o,a.depth-o)}replace(e,t,n){return QZ(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let i=this.content.child(t-1);return{node:i,index:t-1,offset:n-i.nodeSize}}resolve(e){return Os.resolveCached(this,e)}resolveNoCache(e){return Os.resolve(this,e)}rangeHasMark(e,t,n){let i=!1;return t>e&&this.nodesBetween(e,t,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),tb(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Ne.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Pt.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Pt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=Ne.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};aa.prototype.text=void 0;class su extends aa{constructor(e,t,n,i){if(super(e,t,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):tb(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new su(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new su(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function tb(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class ja{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new iQ(e,t);if(n.next==null)return ja.empty;let i=rb(n);n.next&&n.err("Unexpected trailing text");let a=fQ(cQ(i));return dQ(a,n),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let i=this;for(let a=t;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!t||l.validEnd))return Ne.from(s.map(f=>f.createAndFill()));for(let f=0;f<o.next.length;f++){let{type:v,next:b}=o.next[f];if(!(v.isText||v.hasRequiredAttrs())&&i.indexOf(b)==-1){i.push(b);let T=a(b,s.concat(v));if(T)return T}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&t(n.next[i].next)}return t(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
2
2
  `)}}ja.empty=new ja(!0);class iQ{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function rb(r){let e=[];do e.push(aQ(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function aQ(r){let e=[];do e.push(oQ(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function oQ(r){let e=uQ(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=sQ(r,e);else break;return e}function Cv(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function sQ(r,e){let t=Cv(r),n=t;return r.eat(",")&&(r.next!="}"?n=Cv(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function lQ(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let a in t){let o=t[a];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function uQ(r){if(r.eat("(")){let e=rb(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=lQ(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function cQ(r){let e=[[]];return i(a(r,0),t()),e;function t(){return e.push([])-1}function n(o,s,l){let f={term:l,to:s};return e[o].push(f),f}function i(o,s){o.forEach(l=>l.to=s)}function a(o,s){if(o.type=="choice")return o.exprs.reduce((l,f)=>l.concat(a(f,s)),[]);if(o.type=="seq")for(let l=0;;l++){let f=a(o.exprs[l],s);if(l==o.exprs.length-1)return f;i(f,s=t())}else if(o.type=="star"){let l=t();return n(s,l),i(a(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();return i(a(o.expr,s),l),i(a(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(s)].concat(a(o.expr,s));if(o.type=="range"){let l=s;for(let f=0;f<o.min;f++){let v=t();i(a(o.expr,l),v),l=v}if(o.max==-1)i(a(o.expr,l),l);else for(let f=o.min;f<o.max;f++){let v=t();n(l,v),i(a(o.expr,l),v),l=v}return[n(l)]}else{if(o.type=="name")return[n(s,void 0,o.value)];throw new Error("Unknown expr type")}}}}function nb(r,e){return e-r}function Tv(r,e){let t=[];return n(e),t.sort(nb);function n(i){let a=r[i];if(a.length==1&&!a[0].term)return n(a[0].to);t.push(i);for(let o=0;o<a.length;o++){let{term:s,to:l}=a[o];!s&&t.indexOf(l)==-1&&n(l)}}}function fQ(r){let e=Object.create(null);return t(Tv(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:s,to:l})=>{if(!s)return;let f;for(let v=0;v<i.length;v++)i[v][0]==s&&(f=i[v][1]);Tv(r,l).forEach(v=>{f||i.push([s,f=[]]),f.indexOf(v)==-1&&f.push(v)})})});let a=e[n.join(",")]=new ja(n.indexOf(r.length-1)>-1);for(let o=0;o<i.length;o++){let s=i[o][1].sort(nb);a.next.push({type:i[o][0],next:e[s.join(",")]||t(s)})}return a}}function dQ(r,e){for(let t=0,n=[r];t<n.length;t++){let i=n[t],a=!i.validEnd,o=[];for(let s=0;s<i.next.length;s++){let{type:l,next:f}=i.next[s];o.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),n.indexOf(f)==-1&&n.push(f)}a&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ib(r){let e=Object.create(null);for(let t in r){let n=r[t];if(!n.hasDefault)return null;e[t]=n.default}return e}function ab(r,e){let t=Object.create(null);for(let n in r){let i=e&&e[n];if(i===void 0){let a=r[n];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+n)}t[n]=i}return t}function ob(r,e,t,n){for(let i in e)if(!(i in r))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in r){let a=r[i];a.validate&&a.validate(e[i])}}function sb(r,e){let t=Object.create(null);if(e)for(let n in e)t[n]=new pQ(r,n,e[n]);return t}let Sv=class lb{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=sb(e,n.attrs),this.defaultAttrs=ib(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ja.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:ab(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new aa(this,this.computeAttrs(e),Ne.from(t),Pt.setFrom(n))}createChecked(e=null,t,n){return t=Ne.from(t),this.checkContent(t),new aa(this,this.computeAttrs(e),t,Pt.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=Ne.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),a=i&&i.fillBefore(Ne.empty,!0);return a?new aa(this,e,t.append(a),Pt.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ob(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Pt.none:e}static compile(e,t){let n=Object.create(null);e.forEach((a,o)=>n[a]=new lb(a,t,o));let i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function hQ(r,e,t){let n=t.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${r}, got ${a}`)}}class pQ{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?hQ(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Lu{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=sb(e,i.attrs),this.excluded=null;let a=ib(this.attrs);this.instance=a?new Pt(this,a):null}create(e=null){return!e&&this.instance?this.instance:new Pt(this,ab(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((a,o)=>n[a]=new Lu(a,i++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ob(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class ub{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ar.from(e.nodes),t.marks=Ar.from(e.marks||{}),this.nodes=Sv.compile(this.spec.nodes,this),this.marks=Lu.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],o=a.spec.content||"",s=a.spec.marks;if(a.contentMatch=n[o]||(n[o]=ja.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=s=="_"?null:s?xv(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:xv(this,o.split(" "))}this.nodeFromJSON=i=>aa.fromJSON(this,i),this.markFromJSON=i=>Pt.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Sv){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,n,i)}text(e,t){let n=this.nodes.text;return new su(n,n.defaultAttrs,e,Pt.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function xv(r,e){let t=[];for(let n=0;n<e.length;n++){let i=e[n],a=r.marks[i],o=a;if(a)t.push(a);else for(let s in r.marks){let l=r.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function vQ(r){return r.tag!=null}function mQ(r){return r.style!=null}class Ga{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(vQ(i))this.tags.push(i);else if(mQ(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,t={}){let n=new Mv(this,t,!1);return n.addAll(e,Pt.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Mv(this,t,!0);return n.addAll(e,Pt.none,t.from,t.to),$e.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(bQ(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||t.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(e);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(e,t,n,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let o=this.styles[a],s=o.style;if(!(s.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let a=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let s=t[o];if((s.priority==null?50:s.priority)<a)break}t.splice(o,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(o=>{n(o=Av(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(o=>{n(o=Av(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ga(e,Ga.schemaRules(e)))}}const cb={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},gQ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},fb={ol:!0,ul:!0},Ns=1,md=2,Ss=4;function Ev(r,e,t){return e!=null?(e?Ns:0)|(e==="full"?md:0):r&&r.whitespace=="pre"?Ns|md:t&~Ss}class Rl{constructor(e,t,n,i,a,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=Pt.none,this.match=a||(o&Ss?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Ne.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ns)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let t=Ne.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Ne.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!cb.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Mv{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,a,o=Ev(null,t.preserveWhitespace,0)|(n?Ss:0);i?a=new Rl(i.type,i.attrs,Pt.none,!0,t.topMatch||i.type.contentMatch,o):n?a=new Rl(null,null,Pt.none,!0,null,o):a=new Rl(e.schema.topNodeType,null,Pt.none,!0,null,o),this.nodes=[a],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,a=i.options&md?"full":this.localPreserveWS||(i.options&Ns)>0;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)a!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
3
3
  `);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;fb.hasOwnProperty(o)&&this.parser.normalizeLists&&yQ(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:gQ.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let f,v=this.needsBlock;if(cb.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),f=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let b=l&&l.skip?t:this.readStyles(e,t);b&&this.addAll(e,b),f&&this.sync(a),this.needsBlock=v}else{let f=this.readStyles(e,t);f&&this.addElementByRule(e,l,f,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
4
  `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],o=n.getPropertyValue(a);if(o)for(let s=void 0;;){let l=this.parser.matchStyle(a,o,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(f=>!l.clearMark(f)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return t}addElementByRule(e,t,n,i){let a,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,t.attrs||null,n,t.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[t.mark];n=n.concat(l.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(s)&&this.open--}addAll(e,t,n,i){let a=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=i==null?null:e.childNodes[i];o!=s;o=o.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(o,t);this.findAtPoint(e,a)}findPlace(e,t,n){let i,a;for(let o=this.open,s=0;o>=0;o--){let l=this.nodes[o],f=l.findWrapping(e);if(f&&(!i||i.length>f.length+s)&&(i=f,a=l,!f.length))break;if(l.solid){if(n)break;s+=2}}if(!i)return null;this.sync(a);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(t=this.enterInner(a,null,t))}let i=this.findPlace(e,t,n);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let o=Pt.none;for(let s of i.concat(e.marks))(a.type?a.type.allowsMarkType(s.type):Ov(s.type,e.type))&&(o=s.addToSet(o));return a.content.push(e.mark(o)),!0}return!1}enter(e,t,n,i){let a=this.findPlace(e.create(t),n,!1);return a&&(a=this.enterInner(e,t,n,!0,i)),a}enterInner(e,t,n,i=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=Ev(e,a,o.options);o.options&Ss&&o.content.length==0&&(s|=Ss);let l=Pt.none;return n=n.filter(f=>(o.type?o.type.allowsMarkType(f.type):Ov(f.type,e))?(l=f.addToSet(l),!1):!0),this.nodes.push(new Rl(e,t,l,i,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Ns)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),o=(s,l)=>{for(;s>=0;s--){let f=t[s];if(f==""){if(s==t.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let v=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!v||v.name!=f&&!v.isInGroup(f))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function yQ(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&fb.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function bQ(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function Av(r){let e={};for(let t in r)e[t]=r[t];return e}function Ov(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let a=[],o=s=>{a.push(s);for(let l=0;l<s.edgeCount;l++){let{type:f,next:v}=s.edge(l);if(f==e||a.indexOf(v)<0&&o(v))return!0}};if(o(i.contentMatch))return!0}}class Zo{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Ef(t).createDocumentFragment());let i=n,a=[];return e.forEach(o=>{if(a.length||o.marks.length){let s=0,l=0;for(;s<a.length&&l<o.marks.length;){let f=o.marks[l];if(!this.marks[f.type.name]){l++;continue}if(!f.eq(a[s][0])||f.type.spec.spanning===!1)break;s++,l++}for(;s<a.length;)i=a.pop()[1];for(;l<o.marks.length;){let f=o.marks[l++],v=this.serializeMark(f,o.isInline,t);v&&(a.push([f,i]),i.appendChild(v.dom),i=v.contentDOM||v.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=Gl(Ef(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,t);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Gl(Ef(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Gl(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Zo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Nv(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return Nv(e.marks)}}function Nv(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Ef(r){return r.document||window.document}const Dv=new WeakMap;function kQ(r){let e=Dv.get(r);return e===void 0&&Dv.set(r,e=wQ(r)),e}function wQ(r){let e=null;function t(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)t(n[i]);else for(let i in n)t(n[i])}return t(r),e}function Gl(r,e,t,n){if(typeof e=="string")return{dom:r.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(a=kQ(n))&&a.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let s,l=t?r.createElementNS(t,i):r.createElement(i),f=e[1],v=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){v=2;for(let b in f)if(f[b]!=null){let T=b.indexOf(" ");T>0?l.setAttributeNS(b.slice(0,T),b.slice(T+1),f[b]):b=="style"&&l.style?l.style.cssText=f[b]:l.setAttribute(b,f[b])}}for(let b=v;b<e.length;b++){let T=e[b];if(T===0){if(b<e.length-1||b>v)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:x,contentDOM:E}=Gl(r,T,t,n);if(l.appendChild(x),E){if(s)throw new RangeError("Multiple content holes");s=E}}}return{dom:l,contentDOM:s}}const db=65535,hb=Math.pow(2,16);function CQ(r,e){return r+e*hb}function Lv(r){return r&db}function TQ(r){return(r-(r&db))/hb}const pb=1,vb=2,Kl=4,mb=8;class gd{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&mb)>0}get deletedBefore(){return(this.delInfo&(pb|Kl))>0}get deletedAfter(){return(this.delInfo&(vb|Kl))>0}get deletedAcross(){return(this.delInfo&Kl)>0}}class ln{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ln.empty)return ln.empty}recover(e){let t=0,n=Lv(e);if(!this.inverted)for(let i=0;i<n;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+t+TQ(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let i=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>e)break;let f=this.ranges[s+a],v=this.ranges[s+o],b=l+f;if(e<=b){let T=f?e==l?-1:e==b?1:t:t,x=l+i+(T<0?0:v);if(n)return x;let E=e==(t<0?l:b)?null:CQ(s/3,e-l),B=e==l?vb:e==b?pb:Kl;return(t<0?e!=l:e!=b)&&(B|=mb),new gd(x,B,E)}i+=v-f}return n?e+i:new gd(e+i,0,null)}touches(e,t){let n=0,i=Lv(t),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?n:0);if(l>e)break;let f=this.ranges[s+a],v=l+f;if(e<=v&&s==i*3)return!0;n+=this.ranges[s+o]-f}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?a:0),l=o+(this.inverted?0:a),f=this.ranges[i+t],v=this.ranges[i+n];e(s,s+f,l,l+v),a+=v-f}}invert(){return new ln(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ln.empty:new ln(e<0?[0,-e,0]:[0,0,e])}}ln.empty=new ln([]);class Ds{constructor(e,t,n=0,i=e?e.length:0){this.mirror=t,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Ds(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?n+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new Ds;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let i=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],s=o.mapResult(e,t);if(s.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return n?e:new gd(e,i,null)}}const Mf=Object.create(null);class Vr{getMap(){return ln.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Mf[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Mf)throw new RangeError("Duplicate use of step JSON ID "+e);return Mf[e]=t,t.prototype.jsonID=e,t}}class dr{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new dr(e,null)}static fail(e){return new dr(null,e)}static fromReplace(e,t,n,i){try{return dr.ok(e.replace(t,n,i))}catch(a){if(a instanceof iu)return dr.fail(a.message);throw a}}}function rh(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let a=r.child(i);a.content.size&&(a=a.copy(rh(a.content,e,a))),a.isInline&&(a=e(a,t,i)),n.push(a)}return Ne.fromArray(n)}class ra extends Vr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),a=new $e(rh(t.content,(o,s)=>!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return dr.fromReplace(e,this.from,this.to,a)}invert(){return new li(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new ra(t.pos,n.pos,this.mark)}merge(e){return e instanceof ra&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ra(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ra(t.from,t.to,e.markFromJSON(t.mark))}}Vr.jsonID("addMark",ra);class li extends Vr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new $e(rh(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return dr.fromReplace(e,this.from,this.to,n)}invert(){return new ra(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new li(t.pos,n.pos,this.mark)}merge(e){return e instanceof li&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new li(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new li(t.from,t.to,e.markFromJSON(t.mark))}}Vr.jsonID("removeMark",li);class na extends Vr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return dr.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return dr.fromReplace(e,this.pos,this.pos+1,new $e(Ne.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(n))return new na(this.pos,t.marks[i]);return new na(this.pos,this.mark)}}return new Ka(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new na(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new na(t.pos,e.markFromJSON(t.mark))}}Vr.jsonID("addNodeMark",na);class Ka extends Vr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return dr.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return dr.fromReplace(e,this.pos,this.pos+1,new $e(Ne.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new na(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ka(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Ka(t.pos,e.markFromJSON(t.mark))}}Vr.jsonID("removeNodeMark",Ka);class Hr extends Vr{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&yd(e,this.from,this.to)?dr.fail("Structure replace would overwrite content"):dr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ln([this.from,this.to-this.from,this.slice.size])}invert(e){return new Hr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Hr(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Hr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?$e.empty:new $e(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Hr(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?$e.empty:new $e(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Hr(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Hr(t.from,t.to,$e.fromJSON(e,t.slice),!!t.structure)}}Vr.jsonID("replace",Hr);class Tr extends Vr{constructor(e,t,n,i,a,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=i,this.slice=a,this.insert=o,this.structure=s}apply(e){if(this.structure&&(yd(e,this.from,this.gapFrom)||yd(e,this.gapTo,this.to)))return dr.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return dr.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?dr.fromReplace(e,this.from,this.to,n):dr.fail("Content does not fit in gap")}getMap(){return new ln([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Tr(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||i<t.pos||a>n.pos?null:new Tr(t.pos,n.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Tr(t.from,t.to,t.gapFrom,t.gapTo,$e.fromJSON(e,t.slice),t.insert,!!t.structure)}}Vr.jsonID("replaceAround",Tr);function yd(r,e,t){let n=r.resolve(e),i=t-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let o=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function SQ(r,e,t,n){let i=[],a=[],o,s;r.doc.nodesBetween(e,t,(l,f,v)=>{if(!l.isInline)return;let b=l.marks;if(!n.isInSet(b)&&v.type.allowsMarkType(n.type)){let T=Math.max(f,e),x=Math.min(f+l.nodeSize,t),E=n.addToSet(b);for(let B=0;B<b.length;B++)b[B].isInSet(E)||(o&&o.to==T&&o.mark.eq(b[B])?o.to=x:i.push(o=new li(T,x,b[B])));s&&s.to==T?s.to=x:a.push(s=new ra(T,x,n))}}),i.forEach(l=>r.step(l)),a.forEach(l=>r.step(l))}function xQ(r,e,t,n){let i=[],a=0;r.doc.nodesBetween(e,t,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(n instanceof Lu){let f=o.marks,v;for(;v=n.isInSet(f);)(l||(l=[])).push(v),f=v.removeFromSet(f)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let f=Math.min(s+o.nodeSize,t);for(let v=0;v<l.length;v++){let b=l[v],T;for(let x=0;x<i.length;x++){let E=i[x];E.step==a-1&&b.eq(i[x].style)&&(T=E)}T?(T.to=f,T.step=a):i.push({style:b,from:Math.max(s,e),to:f,step:a})}}}),i.forEach(o=>r.step(new li(o.from,o.to,o.style)))}function nh(r,e,t,n=t.contentMatch,i=!0){let a=r.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l<a.childCount;l++){let f=a.child(l),v=s+f.nodeSize,b=n.matchType(f.type);if(!b)o.push(new Hr(s,v,$e.empty));else{n=b;for(let T=0;T<f.marks.length;T++)t.allowsMarkType(f.marks[T].type)||r.step(new li(s,v,f.marks[T]));if(i&&f.isText&&t.whitespace!="pre"){let T,x=/\r?\n|\r/g,E;for(;T=x.exec(f.text);)E||(E=new $e(Ne.from(t.schema.text(" ",t.allowedMarks(f.marks))),0,0)),o.push(new Hr(s+T.index,s+T.index+T[0].length,E))}}s=v}if(!n.validEnd){let l=n.fillBefore(Ne.empty,!0);r.replace(s,s,new $e(l,0,0))}for(let l=o.length-1;l>=0;l--)r.step(o[l])}function EQ(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Ru(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),a=r.$from.index(n),o=r.$to.indexAfter(n);if(n<r.depth&&i.canReplace(a,o,t))return n;if(n==0||i.type.spec.isolating||!EQ(i,a,o))break}return null}function MQ(r,e,t){let{$from:n,$to:i,depth:a}=e,o=n.before(a+1),s=i.after(a+1),l=o,f=s,v=Ne.empty,b=0;for(let E=a,B=!1;E>t;E--)B||n.index(E)>0?(B=!0,v=Ne.from(n.node(E).copy(v)),b++):l--;let T=Ne.empty,x=0;for(let E=a,B=!1;E>t;E--)B||i.after(E+1)<i.end(E)?(B=!0,T=Ne.from(i.node(E).copy(T)),x++):f++;r.step(new Tr(l,f,o,s,new $e(v.append(T),b,x),v.size-b,!0))}function AQ(r,e,t=null,n=r){let i=OQ(r,e),a=i&&NQ(n,e);return a?i.map(Rv).concat({type:e,attrs:t}).concat(a.map(Rv)):null}function Rv(r){return{type:r,attrs:null}}function OQ(r,e){let{parent:t,startIndex:n,endIndex:i}=r,a=t.contentMatchAt(n).findWrapping(e);if(!a)return null;let o=a.length?a[0]:e;return t.canReplaceWith(n,i,o)?a:null}function NQ(r,e){let{parent:t,startIndex:n,endIndex:i}=r,a=t.child(n),o=e.contentMatch.findWrapping(a.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let f=n;l&&f<i;f++)l=l.matchType(t.child(f).type);return!l||!l.validEnd?null:o}function DQ(r,e,t){let n=Ne.empty;for(let o=t.length-1;o>=0;o--){if(n.size){let s=t[o].type.contentMatch.matchFragment(n);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Ne.from(t[o].type.create(t[o].attrs,n))}let i=e.start,a=e.end;r.step(new Tr(i,a,i,a,new $e(n,0,0),t.length,!0))}function LQ(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=r.steps.length;r.doc.nodesBetween(e,t,(o,s)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&RQ(r.doc,r.mapping.slice(a).map(s),n)){let f=null;if(n.schema.linebreakReplacement){let x=n.whitespace=="pre",E=!!n.contentMatch.matchType(n.schema.linebreakReplacement);x&&!E?f=!1:!x&&E&&(f=!0)}f===!1&&yb(r,o,s,a),nh(r,r.mapping.slice(a).map(s,1),n,void 0,f===null);let v=r.mapping.slice(a),b=v.map(s,1),T=v.map(s+o.nodeSize,1);return r.step(new Tr(b,T,b+1,T-1,new $e(Ne.from(n.create(l,null,o.marks)),0,0),1,!0)),f===!0&&gb(r,o,s,a),!1}})}function gb(r,e,t,n){e.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let l=r.mapping.slice(n).map(t+1+a+o.index);r.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function yb(r,e,t,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+a);r.replaceWith(o,o+1,e.type.schema.text(`
@@ -1 +1 @@
1
- import{j as a,br as i,bs as l,bt as o}from"./app.js";import{r as c}from"./monaco-ICtx6xoc.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";function m(){return c.useCallback(r=>{const t=r.trim().split(" ");if(t.length===0)return"";if(t.length===1)return t[0].charAt(0).toUpperCase();const s=t[0].charAt(0),n=t[t.length-1].charAt(0);return`${s}${n}`.toUpperCase()},[])}function f({user:e,showEmail:r=!1}){const t=m();return a.jsxs(a.Fragment,{children:[a.jsxs(i,{className:"h-8 w-8 overflow-hidden rounded-full",children:[a.jsx(l,{src:e.avatar,alt:e.login}),a.jsx(o,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:t(e.login)})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:e.login}),r&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]})]})}export{f as UserInfo};
1
+ import{j as a,bs as i,bt as l,bu as o}from"./app.js";import{r as c}from"./monaco-ICtx6xoc.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";function m(){return c.useCallback(r=>{const t=r.trim().split(" ");if(t.length===0)return"";if(t.length===1)return t[0].charAt(0).toUpperCase();const s=t[0].charAt(0),n=t[t.length-1].charAt(0);return`${s}${n}`.toUpperCase()},[])}function f({user:e,showEmail:r=!1}){const t=m();return a.jsxs(a.Fragment,{children:[a.jsxs(i,{className:"h-8 w-8 overflow-hidden rounded-full",children:[a.jsx(l,{src:e.avatar,alt:e.login}),a.jsx(o,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:t(e.login)})]}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:e.login}),r&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:e.email})]})]})}export{f as UserInfo};
@@ -1 +1 @@
1
- import{j as e,bu as n,aJ as a,aI as l,U as i,bv as m}from"./app.js";import{UserInfo as c}from"./user-info-CcYdmjMZ.js";import{r as p}from"./monaco-ICtx6xoc.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";function u(){return p.useCallback(()=>{document.body.style.removeProperty("pointer-events")},[])}function g({user:t,logout:r,logoutBtn:o}){const s=u();return e.jsxs(e.Fragment,{children:[e.jsx(n,{className:"p-0 font-normal",children:e.jsx("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:e.jsx(c,{user:t,showEmail:!0})})}),e.jsx(a,{}),e.jsx(l,{asChild:!0,children:e.jsxs(i,{className:"block w-full cursor-pointer",method:"get",href:r,as:"button",onClick:s,children:[e.jsx(m,{className:"mr-2"}),o]})})]})}export{g as UserMenuContent};
1
+ import{j as e,bv as n,aK as a,aJ as l,W as i,bw as m}from"./app.js";import{UserInfo as c}from"./user-info-BGQvqBmO.js";import{r as p}from"./monaco-ICtx6xoc.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";function u(){return p.useCallback(()=>{document.body.style.removeProperty("pointer-events")},[])}function w({user:t,logout:r,logoutBtn:o}){const s=u();return e.jsxs(e.Fragment,{children:[e.jsx(n,{className:"p-0 font-normal",children:e.jsx("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:e.jsx(c,{user:t,showEmail:!0})})}),e.jsx(a,{}),e.jsx(l,{asChild:!0,children:e.jsxs(i,{className:"block w-full cursor-pointer",method:"get",href:r,as:"button",onClick:s,children:[e.jsx(m,{className:"mr-2"}),o]})})]})}export{w as UserMenuContent};
@@ -0,0 +1 @@
1
+ import{u as o,j as t}from"./app.js";import{A as p}from"./app-layout-BmMzULcJ.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-C8Cnr5Hy.js";import"./app-sidebar-HwvXNZzk.js";import"./nav-main-BqKm87JZ.js";import"./material-icon-DwkE6wKL.js";import"./app-sidebar-header-RRnKZeeU.js";import"./breadcrumbs-DSMzNYiS.js";import"./nav-user-DuCZNsZX.js";import"./user-info-BGQvqBmO.js";import"./user-menu-content-BDm88xaM.js";import"./theme-switcher-cgyA7_cO.js";import"./icon-DpkedrXG.js";const i=[];function N(){const r=o();return t.jsx(p,{breadcrumbs:i,children:t.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[r.props.title&&t.jsx("div",{className:"text-3xl mb-8",children:r.props.title}),t.jsx("div",{className:"text-3xl mb-8",children:"Adminizer"}),r.props.text&&t.jsx("div",{dangerouslySetInnerHTML:{__html:r.props.text}})]})})}export{N as default};
@@ -327,6 +327,7 @@ class NavigationGroup extends AbstractGroup {
327
327
  targetBlank: data.targetBlank,
328
328
  visible: data.visible,
329
329
  parentId: parentId,
330
+ isNavigation: true,
330
331
  sortOrder: sortOrder ?? (await storage.findElementsByParentId(parentId, null)).length,
331
332
  icon: this.icon,
332
333
  type: this.type
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "adminizer",
3
3
  "type": "module",
4
- "version": "4.3.0-build.112",
4
+ "version": "4.3.0-build.113",
5
5
  "main": "index.js",
6
6
  "exports": {
7
7
  ".": "./index.js",
@@ -1 +0,0 @@
1
- import{u as t,j as o}from"./app.js";import{A as m}from"./app-layout-i2zN9Rn-.js";import p from"./add-form-M8eciH6Z.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-CHEYhVco.js";import"./app-sidebar-DeF8WNmW.js";import"./nav-main-9Eb_A0rf.js";import"./material-icon-BedgD2NE.js";import"./app-sidebar-header-DdM1EOrb.js";import"./breadcrumbs-C439DWrC.js";import"./nav-user-CRAfyE-x.js";import"./user-info-CcYdmjMZ.js";import"./user-menu-content-DbUk8ZeY.js";import"./theme-switcher-CKiJbMkh.js";import"./icon-DM49pZW3.js";import"./field-renderer-CNZDdaEm.js";import"./dynamic-controls-BOYmRX_z.js";import"./input-error--IOnWghB.js";const i=[];function k(){const r=t();return o.jsx(m,{breadcrumbs:i,children:o.jsx(p,{page:r,catalog:!1})})}export{k as default};
@@ -1 +0,0 @@
1
- import{V,bw as C,j as s,B as F,U as z,aD as A,bx as R,L as I,by as $,f as P,a as U,l as D,H as J,J as H,K,aE as q,M as G,g as Q}from"./app.js";import{r as u}from"./monaco-ICtx6xoc.js";import{Icon as _}from"./icon-DM49pZW3.js";import{F as M}from"./field-renderer-CNZDdaEm.js";import T from"./input-error--IOnWghB.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";import"./dynamic-controls-BOYmRX_z.js";var S=new Map,k=new WeakMap,B=0,X=void 0;function Y(e){return e?(k.has(e)||(B+=1,k.set(e,B.toString())),k.get(e)):"0"}function Z(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?Y(e.root):e[t]}`).toString()}function W(e){const t=Z(e);let a=S.get(t);if(!a){const i=new Map;let d;const c=new IntersectionObserver(o=>{o.forEach(n=>{var l;const g=n.isIntersecting&&d.some(p=>n.intersectionRatio>=p);e.trackVisibility&&typeof n.isVisible>"u"&&(n.isVisible=g),(l=i.get(n.target))==null||l.forEach(p=>{p(g,n)})})},e);d=c.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),a={id:t,observer:c,elements:i},S.set(t,a)}return a}function ee(e,t,a={},i=X){if(typeof window.IntersectionObserver>"u"&&i!==void 0){const l=e.getBoundingClientRect();return t(i,{isIntersecting:i,target:e,intersectionRatio:typeof a.threshold=="number"?a.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:d,observer:c,elements:o}=W(a),n=o.get(e)||[];return o.has(e)||o.set(e,n),n.push(t),c.observe(e),function(){n.splice(n.indexOf(t),1),n.length===0&&(o.delete(e),c.unobserve(e)),o.size===0&&(c.disconnect(),S.delete(d))}}function se({threshold:e,delay:t,trackVisibility:a,rootMargin:i,root:d,triggerOnce:c,skip:o,initialInView:n,fallbackInView:l,onChange:g}={}){var p;const[v,E]=u.useState(null),m=u.useRef(g),[b,x]=u.useState({inView:!!n,entry:void 0});m.current=g,u.useEffect(()=>{if(o||!v)return;let f;return f=ee(v,(N,r)=>{x({inView:N,entry:r}),m.current&&m.current(N,r),r.isIntersecting&&c&&f&&(f(),f=void 0)},{root:d,rootMargin:i,threshold:e,trackVisibility:a,delay:t},l),()=>{f&&f()}},[Array.isArray(e)?e.toString():e,v,d,i,c,o,a,l,t]);const w=(p=b.entry)==null?void 0:p.target,y=u.useRef(void 0);!v&&w&&!c&&!o&&y.current!==w&&(y.current=w,x({inView:!!n,entry:void 0}));const h=[E,b.inView,b.entry];return h.ref=h[0],h.inView=h[1],h.entry=h[2],h}const L=u.memo(({field:e})=>s.jsxs("div",{className:"flex gap-3",children:[s.jsx(U,{htmlFor:`${e.type}-${e.name}`,children:e.label}),e.tooltip&&s.jsx(J,{children:s.jsxs(H,{children:[s.jsx(K,{onClick:t=>t.preventDefault(),children:s.jsx(_,{iconNode:q,className:"text-primary w-5 h-5 cursor-pointer"})}),s.jsx(G,{align:"center",side:"top",className:"z-[1002]",children:s.jsx("p",{children:e.tooltip})})]})})]})),re=u.memo(({field:e,value:t,onChange:a,processing:i,notFound:d,search:c})=>{const[o,n]=se({triggerOnce:!0,rootMargin:"100px 0px"});return s.jsx("div",{ref:o,className:"grid gap-4 w-full",children:n?s.jsx(M,{field:e,value:t,onChange:a,notFound:d,search:c,processing:i}):s.jsx(D,{className:"w-full h-[250px] rounded-sm"})})}),pe=({page:e,catalog:t,callback:a,openNewWindow:i,openNewWindowLabel:d,isNavigation:c})=>{const{fields:o,btnBack:n,view:l,notFound:g}=e.props,{data:p,setData:v,post:E,processing:m,transform:b}=V({...Object.fromEntries(o.map(r=>[r.name,r.value??void 0])),jsonPopupCatalog:t}),[x,w]=u.useState(!1),[y,h]=u.useState(i??!1);u.useEffect(()=>(h(i??!1),C(),v({...Object.fromEntries(o.map(r=>[r.name,r.value??void 0])),jsonPopupCatalog:t}),()=>C()),[o,t,i]);const f=u.useCallback((r,j)=>{v(r,j)},[]),N=async r=>{if(r.preventDefault(),t){w(!0);const j=await Q.post(e.props.postLink,p);j.status===200&&a&&(c?a(j.data.record,y):a(j.data.record))}else{const j=localStorage.getItem("backUrl");b(O=>({...O,redirectUrl:j??""})),E(e.props.postLink,{onSuccess:()=>{localStorage.setItem("backUrl","")}})}};return s.jsxs("div",{className:"p-4 w-full",children:[!t&&s.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[s.jsx(F,{className:"w-fit",asChild:!0,children:s.jsxs(z,{href:n.link,preserveScroll:!0,children:[s.jsx(_,{iconNode:A}),n.title]})}),s.jsxs(F,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:x||m||e.props.view||R(),children:[x||m&&s.jsx(I,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]}),s.jsx("form",{id:"addUserForm",onSubmit:N,className:l?"cursor-not-allowed":"",children:s.jsxs("div",{className:`grid lg:grid-cols-[1fr_150px] gap-4 max-w-[1144px] pb-8 ${t?"lg:grid-cols-[1fr_200px]":"lg:grid-cols-[1fr_150px]"}`,children:[s.jsx("div",{className:"flex flex-col gap-10",children:o.map(r=>s.jsx("div",{className:`grid gap-4 w-full ${l?"pointer-events-none":""}`,children:r.type==="markdown"||r.type==="table"||r.type==="jsonEditor"||r.type==="codeEditor"||r.type==="geoJson"?s.jsxs(s.Fragment,{children:[s.jsx(L,{field:r}),s.jsx(T,{message:$(`${r.type}-${r.name}`)}),s.jsx(re,{field:r,value:p[r.name],onChange:f,processing:x||m||l,notFound:g,search:e.props.search})]}):s.jsxs(s.Fragment,{children:[s.jsx(L,{field:r}),s.jsx(T,{message:$(`${r.type}-${r.name}`)}),s.jsx(M,{field:r,value:p[r.name],onChange:f,processing:x||m||l,notFound:g,search:e.props.search})]})},r.name))}),s.jsxs("div",{className:`p-4 rounded-md h-fit sticky shadow ${t?"top-0 grid gap-4":"top-[84px] hidden lg:block"}`,children:[c&&s.jsxs("div",{className:"flex gap-4 items-center",children:[s.jsx(P,{id:"targetBlank",checked:y,onCheckedChange:r=>h(!!r),className:"cursor-pointer size-5"}),s.jsx(U,{htmlFor:"targetBlank",children:d})]}),s.jsxs(F,{variant:"green",type:"submit",className:"w-fit",disabled:x||m||e.props.view||R(),children:[(x||m)&&s.jsx(I,{className:"h-4 w-4 animate-spin"}),e.props.btnSave.title]})]})]})})]})};export{L as LabelRenderer,re as LazyField,pe as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./app.js";import{A as o}from"./app-layout-i2zN9Rn-.js";import t from"./add-group-form-BNmpvW8K.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-CHEYhVco.js";import"./app-sidebar-DeF8WNmW.js";import"./nav-main-9Eb_A0rf.js";import"./material-icon-BedgD2NE.js";import"./app-sidebar-header-DdM1EOrb.js";import"./breadcrumbs-C439DWrC.js";import"./nav-user-CRAfyE-x.js";import"./user-info-CcYdmjMZ.js";import"./user-menu-content-DbUk8ZeY.js";import"./theme-switcher-CKiJbMkh.js";import"./icon-DM49pZW3.js";const m=[];function E(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{E as default};
@@ -1 +0,0 @@
1
- import{u as B,V as M,j as e,B as T,U as O,aD as U,L as q,a as x,I as y,f as z,H,J as P,K as S,aE as A,M as G}from"./app.js";import{Icon as I}from"./icon-DM49pZW3.js";import{r as h}from"./monaco-ICtx6xoc.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./handsontable-PVakPtJV.js";const E=h.memo(({field:s,disabled:d,value:c,onCheckedChange:i,tooltip:n})=>{const m=h.useCallback(l=>{i(s.name,l)},[s.name,i]);return e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(z,{id:s.name,className:"cursor-pointer size-5",disabled:d,checked:c,onCheckedChange:m}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(x,{className:"cursor-pointer",htmlFor:s.name,children:s.label}),n&&e.jsx(H,{children:e.jsxs(P,{children:[e.jsx(S,{onClick:l=>l.preventDefault(),children:e.jsx(I,{iconNode:A,className:"text-primary w-5 h-5 cursor-pointer"})}),e.jsx(G,{align:"center",side:"top",children:e.jsx("p",{children:s.tooltip})})]})})]})]})});function Q(){var u,j,g,b,v,f,N,k,C,w,F;const s=B(),{fields:d,groupedTokens:c,users:i}=s.props,{data:n,setData:m,clearErrors:l,post:L,processing:o}=M({...Object.fromEntries(d.map(a=>[a.name,a.value])),...Object.fromEntries(i.map(a=>[a.name,a.value])),...Object.fromEntries(c.flatMap(a=>a.fields.map(t=>[t.name,t.value])))}),r=a=>s.props.fields.find(t=>t.name===a),p=h.useCallback((a,t)=>{l(),m(a,t)},[]),D=a=>{a.preventDefault(),L(s.props.postLink)};return e.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[e.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[e.jsx(T,{className:"mb-3 w-fit",asChild:!0,children:e.jsxs(O,{href:s.props.btnBack.link,children:[e.jsx(I,{iconNode:U}),s.props.btnBack.title]})}),e.jsxs(T,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:o||s.props.view,children:[o&&e.jsx(q,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),e.jsx("form",{id:"addUserForm",onSubmit:D,className:`${s.props.view?"cursor-not-allowed":""}`,children:e.jsxs("div",{className:"flex flex-col gap-6 max-w-[1144px]",children:[e.jsx("h2",{className:"font-bold text-xl",children:s.props.head}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(x,{htmlFor:(u=r("name"))==null?void 0:u.name,children:(j=r("name"))==null?void 0:j.label}),e.jsx(y,{id:(g=r("name"))==null?void 0:g.name,type:"text",required:!0,tabIndex:1,autoComplete:(b=r("name"))==null?void 0:b.name,value:n.name,onChange:a=>p("name",a.target.value),disabled:o||s.props.view,placeholder:(v=r("name"))==null?void 0:v.label})]}),e.jsxs("div",{className:"grid gap-4",children:[e.jsx(x,{htmlFor:(f=r("description"))==null?void 0:f.name,children:(N=r("description"))==null?void 0:N.label}),e.jsx(y,{id:(k=r("description"))==null?void 0:k.name,type:"text",required:!0,tabIndex:1,autoComplete:(C=r("description"))==null?void 0:C.name,value:n.description,onChange:a=>p("description",a.target.value),disabled:o||s.props.view,placeholder:(w=r("description"))==null?void 0:w.label})]}),s.props.users.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"font-bold text-xl",children:s.props.userHead}),s.props.users.map(a=>e.jsx(E,{field:a,disabled:o||s.props.view,value:n[a.name],onCheckedChange:p},a.name))]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 gap-4",children:((F=s.props.groupedTokens)==null?void 0:F.length)>0&&s.props.groupedTokens.map(a=>e.jsxs("div",{className:"grid gap-4 content-start justify-between",children:[e.jsx("h2",{className:"font-bold text-xl mt-3",children:a.header}),a.fields.map(t=>e.jsx(E,{field:t,disabled:o||s.props.view,value:n[t.name],onCheckedChange:p,tooltip:!0},t.name))]},a.header))})]})})]})}export{Q as default};
@@ -1 +0,0 @@
1
- import{j as r}from"./app.js";import{A as o}from"./app-layout-i2zN9Rn-.js";import t from"./add-user-form-DrclnTOd.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-CHEYhVco.js";import"./app-sidebar-DeF8WNmW.js";import"./nav-main-9Eb_A0rf.js";import"./material-icon-BedgD2NE.js";import"./app-sidebar-header-DdM1EOrb.js";import"./breadcrumbs-C439DWrC.js";import"./nav-user-CRAfyE-x.js";import"./user-info-CcYdmjMZ.js";import"./user-menu-content-DbUk8ZeY.js";import"./theme-switcher-CKiJbMkh.js";import"./icon-DM49pZW3.js";import"./input-error--IOnWghB.js";const m=[];function F(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{F as default};
@@ -1 +0,0 @@
1
- import{u as i,j as r,R as p,ac as m}from"./app.js";import d from"./app-shell-CHEYhVco.js";import{AppSidebar as n}from"./app-sidebar-DeF8WNmW.js";import{A as x,N as c}from"./app-sidebar-header-DdM1EOrb.js";import{r as o}from"./monaco-ICtx6xoc.js";const j=o.memo(({children:e,breadcrumbs:s=[],className:t})=>{const a=i();return r.jsxs(d,{variant:"sidebar",children:[r.jsx(p,{title:a.props.title}),r.jsx(n,{}),r.jsxs(m,{className:t,children:[r.jsx(x,{breadcrumbs:s}),e]})]})}),S=o.memo(({children:e,className:s,breadcrumbs:t,...a})=>r.jsx(c,{children:r.jsx(j,{breadcrumbs:t,className:s,...a,children:e})}));export{S as A};
@@ -1 +0,0 @@
1
- import{u as N,j as s,aL as b,aM as g,aN as i,aO as c,aP as f,aQ as v,aR as k,aS as d,B as C,aT as M,aU as w,aV as _,aW as y,aX as B,aY as x,U as n,aZ as T,a_ as p,a$ as t,C as o,b0 as h,b1 as j,b2 as m,b3 as u,b4 as R,b5 as U}from"./app.js";import{NavMain as $}from"./nav-main-9Eb_A0rf.js";import l from"./material-icon-BedgD2NE.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";function F(){const r=N();return s.jsxs(b,{collapsible:"icon",variant:"inset",children:[s.jsx(g,{children:s.jsx(i,{children:s.jsxs(c,{children:[s.jsx(f,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:s.jsxs(v,{children:[s.jsx(k,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:s.jsx(d,{asChild:!0,children:s.jsx(C,{variant:"ghost",asChild:!0,className:`w-full ${r.props.section?"":"pointer-events-none"}`,children:s.jsxs("div",{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:r.props.brand}),r.props.section&&s.jsx(M,{className:"ml-auto group-data-[state=collapsed]:hidden"})]})})})}),r.props.section&&s.jsx(w,{side:"right",className:"z-[1003]",children:r.props.section.map(a=>s.jsx("div",{children:a.subItems?s.jsxs(_,{children:[s.jsxs(y,{className:"flex gap-2 items-center cursor-pointer",children:[s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}),s.jsx(B,{children:a.subItems.map(e=>s.jsx(x,{children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id)},e.id))})]}):s.jsx(x,{children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})]})}),s.jsx(T,{className:"px-2 py-0 block md:hidden",children:s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:"rocket_launch",className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:r.props.brand}),r.props.section&&s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),r.props.section&&s.jsx(h,{children:s.jsx(j,{children:r.props.section&&r.props.section.map(a=>a.subItems?s.jsx(i,{children:s.jsx(p,{asChild:!0,className:"group/collapsible-sub",children:s.jsxs(c,{children:[s.jsx(t,{asChild:!0,children:s.jsxs(d,{children:[s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:a.title}),s.jsx(o,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),s.jsx(h,{children:s.jsx(j,{children:a.subItems.map(e=>s.jsx(m,{children:s.jsx(u,{asChild:!0,children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}):s.jsxs(n,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(l,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]})})},e.id))})})]})})},a.id):s.jsx(m,{children:s.jsx(u,{asChild:!0,children:a.type==="blank"?s.jsxs("a",{href:a.link,target:"_blank",className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]}):s.jsxs(n,{href:a.link,className:"flex gap-2 items-center",children:[a.icon&&s.jsx(l,{name:a.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:a.title})]})})},a.id))})})]})})})})]},r.props.brand)})}),s.jsx(R,{children:s.jsx($,{items:r.props.menu})}),s.jsx(U,{children:s.jsx("div",{className:"text-center opacity-70",children:r.props.showVersion&&"v.4.3.0"})})]})}export{F as AppSidebar};
@@ -1 +0,0 @@
1
- import{u as P,j as e,g as f,aG as O,p as z,B as $,aH as _,s as H,v as J,aI as F,J as G,K,Z as U,M as V,r as Y,aJ as Z,U as q,L as T,aK as Q}from"./app.js";import{Breadcrumbs as W}from"./breadcrumbs-C439DWrC.js";import{NavUser as X}from"./nav-user-CRAfyE-x.js";import{ThemeSwitcher as ee}from"./theme-switcher-CKiJbMkh.js";import{r as n}from"./monaco-ICtx6xoc.js";import te from"./material-icon-BedgD2NE.js";const k=n.createContext(void 0),de=({children:i})=>{const[x,u]=n.useState([]),[b,p]=n.useState([]),[w,l]=n.useState([]),[S,v]=n.useState(!1),[r,c]=n.useState([]),N=P(),[M,j]=n.useState({}),d=[...b,...w],m=async()=>{try{const t=await f.get(`${window.routePrefix}/api/notifications`,{params:{unreadOnly:!0,limit:4}});u(t.data)}catch(t){console.error("Error fetching bell notifications:",t)}},h=async()=>{try{const t=await f.post(`${window.routePrefix}/notifications`);j(t.data)}catch(t){console.log(t)}},y=async()=>{await m()},g=async()=>{try{const t=await f.get(`${window.routePrefix}/api/notifications/get-classes`);c(t.data)}catch(t){console.error("Error fetching tabs:",t)}},C=async(t,s)=>{try{if(!t){await E(s);return}const a=await f.post(`${window.routePrefix}/api/notifications/search`,{s:t,notificationClass:s});l(a.data)}catch(a){console.error("Error searching notifications:",a)}},E=async t=>{v(!0);try{const s=`${window.routePrefix}/api/notifications/${t}`,a=await f.get(s,{params:{limit:20,skip:0,unreadOnly:!1}});return p([]),l(a.data),a.data}catch(s){return console.error("Error fetching all notifications:",s),[]}finally{v(!1)}},D=async(t,s)=>{try{const a=`${window.routePrefix}/api/notifications/${t}`,o=await f.get(a,{params:{limit:20,skip:s,unreadOnly:!1}});return l(B=>[...B,...o.data]),o.data}catch(a){return console.error("Error paginating notifications:",a),[]}};n.useEffect(()=>{if(!N.props.notifications)return;h(),m();const t=new EventSource(`${window.routePrefix}/api/notifications/stream`);return t.addEventListener("connected",s=>{const a=JSON.parse(s.data);console.log("Connected event:",a),g()}),t.addEventListener("notification",s=>{const a=JSON.parse(s.data);p(o=>[a,...o]),u(o=>[a,...o].slice(0,4))}),t.onerror=()=>{console.error("SSE connection error")},()=>t.close()},[]);const I=async(t,s)=>{try{await f.put(`${window.routePrefix}/api/notifications/${t}/${s}/read`,{}),p(a=>a.map(o=>o.id===s?{...o,read:!0}:o)),l(a=>a.map(o=>o.id===s?{...o,read:!0}:o)),u([])}catch(a){console.error("Error marking as read:",a)}},L=async()=>{try{await f.put(`${window.routePrefix}/api/notifications/read-all`),p(t=>t.map(s=>({...s,read:!0}))),l(t=>t.map(s=>({...s,read:!0}))),await m()}catch(t){console.error("Error marking all as read:",t)}},R=x.filter(t=>!t.read).length;return e.jsx(k.Provider,{value:{bellNotifications:x,allNotifications:d,unreadCount:R,getTabs:g,tabs:r,search:C,markAsRead:I,markAllAsRead:L,getLocale:h,messages:M,fetchAllNotifications:E,paginateNotifications:D,loading:S,refreshBellNotifications:y},children:i})},A=()=>{const i=n.useContext(k);if(i===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return i};function ae(){const{bellNotifications:i,markAsRead:x,unreadCount:u,refreshBellNotifications:b,messages:p}=A(),[w,l]=n.useState(!1),S=async(r,c)=>{l(!0);try{await x(r,c),await b()}catch(N){console.error("Error marking as read:",N)}finally{l(!1)}},v=r=>{const c=new Date,N=new Date(r),M=c.getTime()-N.getTime(),j=Math.floor(M/1e3),d=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(j<60)return d.format(-j,"second");const m=Math.floor(j/60);if(m<60)return d.format(-m,"minute");const h=Math.floor(m/60);if(h<24)return d.format(-h,"hour");const y=Math.floor(h/24);if(y<30)return d.format(-y,"day");const g=Math.floor(y/30);if(g<12)return d.format(-g,"month");const C=Math.floor(g/12);return d.format(-C,"year")};return e.jsxs(O,{children:[e.jsx(z,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:e.jsxs($,{variant:"ghost",className:"relative",children:[e.jsx(_,{}),u>0&&e.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),e.jsxs(H,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:r=>r.preventDefault(),children:[e.jsx(J,{className:`${w?"opacity-50 pointer-events-none":""}`,children:i.length===0?e.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No notifications"}):i.map(r=>e.jsxs("div",{children:[e.jsx(F,{asChild:!0,className:"cursor-pointer",onSelect:c=>{c.preventDefault(),Y.visit(`${window.routePrefix}/notifications?type=${r.notificationClass}`)},children:e.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[r.icon?e.jsx(te,{name:r.icon.icon,style:{color:r.icon.iconColor},className:"!text-[32px]"}):e.jsx("div",{}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:r.title}),e.jsx("span",{className:"truncate",children:r.message})]}),e.jsxs("div",{className:"col-start-2 flex justify-between flex-nowrap items-center",children:[e.jsx("div",{className:"flex flex-nowrap gap-2 items-center",children:e.jsx("div",{children:v(r.createdAt)})}),e.jsxs(G,{children:[e.jsx(K,{asChild:!0,children:e.jsx($,{variant:"ghost",size:"icon",className:"size-4",onClick:c=>{c.stopPropagation(),S(r.notificationClass,r.id)},children:e.jsx(U,{className:"text-primary"})})}),e.jsx(V,{side:"left",className:"z-[1003]",children:e.jsx("p",{children:p["Make read"]})})]})]})]})}),e.jsx(Z,{})]},r.id))}),e.jsx($,{variant:"secondary",asChild:!0,children:e.jsxs(q,{href:`${window.routePrefix}/notifications?type=general`,className:`w-full ${w?"opacity-50 pointer-events-none":""}`,children:[p["View All"],w&&e.jsx(T,{className:"h-4 w-4 animate-spin"})]})})]})]})}function se({breadcrumbs:i=[]}){const{tabs:x}=A(),u=P();return e.jsx("header",{className:"border-sidebar-border/50 flex h-16 shrink-0 items-center gap-2 border-b px-6 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 md:px-4",children:e.jsxs("div",{className:"flex justify-between w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"-ml-1"}),e.jsx(W,{breadcrumbs:i})]}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(ee,{}),u.props.notifications&&(x.length>0?e.jsx(ae,{}):e.jsx("div",{className:"w-[40px] flex-none flex justify-center",children:e.jsx(T,{className:"size-4 animate-spin"})})),e.jsx(X,{})]})]})})}const fe=Object.freeze(Object.defineProperty({__proto__:null,AppSidebarHeader:se},Symbol.toStringTag,{value:"Module"}));export{se as A,de as N,fe as a,A as u};
@@ -1 +0,0 @@
1
- import{j as r}from"./app.js";import{A as o}from"./app-layout-i2zN9Rn-.js";import t from"./form-CSw9kHpL.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-CHEYhVco.js";import"./app-sidebar-DeF8WNmW.js";import"./nav-main-9Eb_A0rf.js";import"./material-icon-BedgD2NE.js";import"./app-sidebar-header-DdM1EOrb.js";import"./breadcrumbs-C439DWrC.js";import"./nav-user-CRAfyE-x.js";import"./user-info-CcYdmjMZ.js";import"./user-menu-content-DbUk8ZeY.js";import"./theme-switcher-CKiJbMkh.js";import"./icon-DM49pZW3.js";import"./add-form-M8eciH6Z.js";import"./field-renderer-CNZDdaEm.js";import"./dynamic-controls-BOYmRX_z.js";import"./input-error--IOnWghB.js";const m=[];function g(){return r.jsx(o,{breadcrumbs:m,children:r.jsx(t,{})})}export{g as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./app.js";import{A as r}from"./app-layout-i2zN9Rn-.js";import t from"./list-table-CQDHdLv5.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-CHEYhVco.js";import"./app-sidebar-DeF8WNmW.js";import"./nav-main-9Eb_A0rf.js";import"./material-icon-BedgD2NE.js";import"./app-sidebar-header-DdM1EOrb.js";import"./breadcrumbs-C439DWrC.js";import"./nav-user-CRAfyE-x.js";import"./user-info-CcYdmjMZ.js";import"./user-menu-content-DbUk8ZeY.js";import"./theme-switcher-CKiJbMkh.js";import"./icon-DM49pZW3.js";import"./del-modal-_b3CSNHb.js";import"./pagination-render-xsEktzA8.js";const m=[],E=()=>o.jsx(r,{breadcrumbs:m,className:"overflow-auto h-[calc(100svh-16px)]",children:o.jsx(t,{})});export{E as default};
@@ -1 +0,0 @@
1
- import{u as a,bm as i,bn as u,j as e,aN as d,aO as l,aG as m,p,aS as c,aT as b,s as g}from"./app.js";import{UserInfo as x}from"./user-info-CcYdmjMZ.js";import{UserMenuContent as j}from"./user-menu-content-DbUk8ZeY.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";function D(){const{auth:s,logout:r,logoutBtn:o}=a().props,{state:n}=i(),t=u();return e.jsx(d,{children:e.jsx(l,{children:e.jsxs(m,{children:[e.jsx(p,{asChild:!0,children:e.jsxs(c,{size:"lg",className:"text-sidebar-accent-foreground data-[state=open]:bg-sidebar-accent group focus-visible:ring-0 cursor-pointer",children:[e.jsx(x,{user:s.user}),e.jsx(b,{className:"ml-auto size-4"})]})}),e.jsx(g,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg z-[1002]",align:"end",side:t?"bottom":n==="collapsed"?"left":"bottom",children:e.jsx(j,{user:s.user,logout:r,logoutBtn:o})})]})})})}export{D as NavUser};
@@ -1 +0,0 @@
1
- import{u as o,j as t}from"./app.js";import{A as p}from"./app-layout-i2zN9Rn-.js";import"./jsoneditor-D95dIAP2.js";import"./vendor-wzZzN_Jv.js";import"./monaco-ICtx6xoc.js";import"./handsontable-PVakPtJV.js";import"./app-shell-CHEYhVco.js";import"./app-sidebar-DeF8WNmW.js";import"./nav-main-9Eb_A0rf.js";import"./material-icon-BedgD2NE.js";import"./app-sidebar-header-DdM1EOrb.js";import"./breadcrumbs-C439DWrC.js";import"./nav-user-CRAfyE-x.js";import"./user-info-CcYdmjMZ.js";import"./user-menu-content-DbUk8ZeY.js";import"./theme-switcher-CKiJbMkh.js";import"./icon-DM49pZW3.js";const i=[];function N(){const r=o();return t.jsx(p,{breadcrumbs:i,children:t.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[r.props.title&&t.jsx("div",{className:"text-3xl mb-8",children:r.props.title}),t.jsx("div",{className:"text-3xl mb-8",children:"Adminizer"}),r.props.text&&t.jsx("div",{dangerouslySetInnerHTML:{__html:r.props.text}})]})})}export{N as default};