adminizer 4.1.0-commit.3bf605e → 4.1.0-commit.d8a06d3

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 (173) hide show
  1. package/assets/{VanillaJSONEditor-FUe77pIA.js → VanillaJSONEditor-D-Lx670g.js} +1 -1
  2. package/assets/add-BP_u3Tjl.js +1 -0
  3. package/assets/add-form-nffmiYTh.js +1 -0
  4. package/assets/add-group-D4vcHlm-.js +1 -0
  5. package/assets/{add-group-form-dzadPSfL.js → add-group-form-gNJW11-q.js} +1 -1
  6. package/assets/add-user-DWh3Nas0.js +1 -0
  7. package/assets/add-user-form-BJ0FsZYJ.js +1 -0
  8. package/assets/{app-DMmad2-f.css → app-WTooYWC3.css} +1 -1
  9. package/assets/{app-layout-D1m9Kvxq.js → app-layout-DYsRFUuP.js} +1 -1
  10. package/assets/{app-shell-BWMRMkHM.js → app-shell-Dd9Eknik.js} +1 -1
  11. package/assets/app-sidebar-BOmu6-Sl.js +1 -0
  12. package/assets/{app-sidebar-header-DLAFi13E.js → app-sidebar-header-CoXSzWxk.js} +1 -1
  13. package/assets/app.js +2 -2
  14. package/assets/{breadcrumbs-CQNon4Vl.js → breadcrumbs-BmAq4fHT.js} +1 -1
  15. package/assets/{button-CQ9t1kLz.js → button-C9B_5Jf_.js} +1 -1
  16. package/assets/{checkbox-W0nGAXIj.js → checkbox-Fg27sL_1.js} +1 -1
  17. package/assets/{compiler-runtime-tM4jBQ-T.js → compiler-runtime-hB6dAw2d.js} +1 -1
  18. package/assets/dashboard-BACj996r.js +3 -0
  19. package/assets/dashboard-BOltB2Hq.css +1 -0
  20. package/assets/{date-picker-B__dVVqj.js → date-picker-DI1cCO7K.js} +1 -1
  21. package/assets/{dropdown-menu-SEBnEIiL.js → dropdown-menu-Bhj17ENm.js} +1 -1
  22. package/assets/{field-renderer-CapylJU9.js → field-renderer-DVHZF6HS.js} +3 -3
  23. package/assets/form-BgWdwvz1.js +1 -0
  24. package/assets/form-DgtErfln.js +1 -0
  25. package/assets/{geo-json-CwteYDGB.js → geo-json-BjiyTtMu.js} +1 -1
  26. package/assets/{handsontable-BCnjOpBr.js → handsontable-4mjU_b0n.js} +1 -1
  27. package/assets/home-CHntBHJa.js +2 -0
  28. package/assets/{icon-Bz9BMaD0.js → icon-Dt0vBgDO.js} +1 -1
  29. package/assets/index-B8BS9wMC.js +1 -0
  30. package/assets/{index-DEk3sC8d.js → index-BKCgnGj_.js} +1 -1
  31. package/assets/{index-C0SL3SHw.js → index-BykbU6Ee.js} +1 -1
  32. package/assets/index-CaJgc5EZ.js +1 -0
  33. package/assets/{index-BcE9FUM6.js → index-Cgp8OfuI.js} +1 -1
  34. package/assets/{index-DTRTjOmh.js → index-Cw5o84pO.js} +1 -1
  35. package/assets/{init-user-D9mW-g14.js → init-user-JfCKJ5Ce.js} +1 -1
  36. package/assets/{input-DF7Ue23C.js → input-CvRbIbk4.js} +1 -1
  37. package/assets/{input-error-BBygona6.js → input-error-DMK7cAt7.js} +1 -1
  38. package/assets/{label-Z506NKsW.js → label-CSLFe9Bz.js} +1 -1
  39. package/assets/list-B2Oa5O_Q.js +1 -0
  40. package/assets/{list-table-DB1sEQLF.js → list-table-DA9MhywL.js} +5 -5
  41. package/assets/{login-DrGaTWhY.js → login-DQwGtdis.js} +1 -1
  42. package/assets/manifest.json +491 -470
  43. package/assets/{material-icon-CItZiB53.js → material-icon-BJg8o_fs.js} +1 -1
  44. package/assets/module-DWXp59Vg.js +1 -0
  45. package/assets/{monaco-editor-DqAqwxw4.js → monaco-editor-CJs0_GlD.js} +1 -1
  46. package/assets/{multi-select-oabtVhUP.js → multi-select-BvRpAW8r.js} +1 -1
  47. package/assets/{nav-footer-CM-yHiRs.js → nav-footer-Bs4dmN1d.js} +1 -1
  48. package/assets/{nav-main-Q3xofGRT.js → nav-main-Bq3IMk4C.js} +1 -1
  49. package/assets/{nav-user-Ds8i0Pa2.js → nav-user-CbB22J5O.js} +1 -1
  50. package/assets/{pagination-render-B57pOpFy.js → pagination-render-DuXDDbC_.js} +1 -1
  51. package/assets/{popover-I249Gg2O.js → popover-DtoGI2b1.js} +1 -1
  52. package/assets/{register-C9FQIDtS.js → register-BSogVF0h.js} +1 -1
  53. package/assets/{select-D1N8zRPY.js → select-BWepUw-9.js} +1 -1
  54. package/assets/{sidebar-4D-sX2l4.js → sidebar-CAHsHdjM.js} +2 -2
  55. package/assets/skeleton-COOcAA8f.js +1 -0
  56. package/assets/{sonner-Dzckw3U3.js → sonner-BI0IFOQN.js} +1 -1
  57. package/assets/{toast-editor-FbrFd1ft.js → toast-editor-CMK7QtF1.js} +1 -1
  58. package/assets/{tooltip-D2ehgLlB.js → tooltip-DHwpLKOI.js} +1 -1
  59. package/assets/{use-appearance-Co6mO0dV.js → use-appearance-DRfIqTgw.js} +1 -1
  60. package/assets/{use-window-size-B8l6Bpkf.js → use-window-size-h0Sh_NvX.js} +1 -1
  61. package/assets/{user-info-DBYoAJYJ.js → user-info-DFrmpJ4y.js} +1 -1
  62. package/assets/{user-menu-content-qkvdkUVd.js → user-menu-content-DPXQdERj.js} +1 -1
  63. package/assets/welcome-B4WCIXKf.js +1 -0
  64. package/controllers/add.js +2 -2
  65. package/controllers/addGroup.js +2 -4
  66. package/controllers/addUser.js +4 -6
  67. package/controllers/catalog/Catalog.js +2 -2
  68. package/controllers/catalog/FrontentCatalogAdapter.js +1 -2
  69. package/controllers/ckeditorUpload.js +2 -3
  70. package/controllers/dashboard.js +16 -2
  71. package/controllers/edit.js +2 -3
  72. package/controllers/editGroup.js +2 -4
  73. package/controllers/editUser.js +3 -5
  74. package/controllers/form.js +2 -3
  75. package/controllers/getAllWidgets.js +3 -3
  76. package/controllers/initUser.js +1 -2
  77. package/controllers/list.js +4 -4
  78. package/controllers/login.js +31 -15
  79. package/controllers/media-manager/mediaManagerAdapter.js +1 -2
  80. package/controllers/media-manager/mediaManagerApi.js +2 -2
  81. package/controllers/navigation/edit.js +1 -1
  82. package/controllers/processInstallFinalize.js +2 -2
  83. package/controllers/processInstallStep.d.ts +0 -1
  84. package/controllers/processInstallStep.js +122 -132
  85. package/controllers/register.js +1 -4
  86. package/controllers/remove.js +2 -2
  87. package/controllers/timezones.js +1 -1
  88. package/controllers/view.js +2 -2
  89. package/controllers/welcome.js +1 -1
  90. package/controllers/widgets/Action.js +2 -2
  91. package/controllers/widgets/Custom.js +2 -2
  92. package/controllers/widgets/Info.js +2 -2
  93. package/controllers/widgets/switch.js +2 -2
  94. package/controllers/widgetsDB.js +5 -5
  95. package/helpers/accessRightsHelper.d.ts +3 -2
  96. package/helpers/accessRightsHelper.js +1 -1
  97. package/helpers/configHelper.js +2 -1
  98. package/helpers/fieldsHelper.d.ts +1 -1
  99. package/helpers/inertiaActionsHelper.js +1 -1
  100. package/helpers/inertiaAddHelper.d.ts +1 -1
  101. package/helpers/inertiaAddHelper.js +2 -0
  102. package/helpers/inertiaFromHelper.js +2 -0
  103. package/helpers/inertiaGroupHelper.d.ts +4 -2
  104. package/helpers/inertiaGroupHelper.js +1 -1
  105. package/helpers/inertiaListHelper.js +5 -5
  106. package/helpers/inertiaMenuHelper.js +1 -1
  107. package/helpers/inertiaUserHelper.d.ts +7 -1
  108. package/helpers/inertiaUserHelper.js +5 -1
  109. package/index.d.ts +7 -0
  110. package/index.js +7 -0
  111. package/interfaces/adminpanelConfig.d.ts +6 -2
  112. package/interfaces/global.d.ts +5 -26
  113. package/lib/Adminizer.d.ts +2 -0
  114. package/lib/Adminizer.js +17 -1
  115. package/lib/catalog/AbstractCatalog.js +0 -1
  116. package/lib/catalog/Navigation.js +6 -6
  117. package/lib/datatable/NodeTable.js +0 -3
  118. package/lib/inertia/inertiaAdapter.js +0 -1
  119. package/lib/installStepper/installStepper.js +5 -5
  120. package/lib/media-manager/AbstractMediaManager.d.ts +2 -2
  121. package/lib/media-manager/AbstractMediaManager.js +1 -1
  122. package/lib/v4/DataAccessor.d.ts +2 -1
  123. package/lib/v4/DataAccessor.js +2 -2
  124. package/lib/v4/POWCaptcha.js +0 -1
  125. package/lib/v4/PolicyManager.js +0 -1
  126. package/lib/v4/helper/jwt.d.ts +10 -0
  127. package/lib/v4/helper/jwt.js +18 -0
  128. package/lib/v4/model/AbstractModel.js +0 -2
  129. package/lib/v4/model/ModelHandler.js +0 -1
  130. package/lib/v4/model/adapter/sequelize.d.ts +3 -2
  131. package/lib/v4/model/adapter/sequelize.js +250 -58
  132. package/lib/v4/model/adapter/waterline.js +0 -1
  133. package/lib/widgets/abstractAction.d.ts +1 -1
  134. package/lib/widgets/abstractCustom.d.ts +27 -12
  135. package/lib/widgets/abstractCustom.js +8 -2
  136. package/lib/widgets/abstractInfo.d.ts +1 -1
  137. package/lib/widgets/abstractInfo.js +1 -1
  138. package/lib/widgets/abstractLink.d.ts +1 -0
  139. package/lib/widgets/abstractSwitch.d.ts +1 -1
  140. package/lib/widgets/abstractWidgetBase.d.ts +1 -1
  141. package/lib/widgets/widgetHandler.d.ts +20 -3
  142. package/lib/widgets/widgetHandler.js +25 -25
  143. package/models/GroupAP.d.ts +8 -0
  144. package/models/MediaManagerAP.d.ts +16 -0
  145. package/models/MediaManagerAssociationsAP.d.ts +10 -0
  146. package/models/MediaManagerMetaAP.d.ts +8 -0
  147. package/models/NavigationAP.d.ts +5 -0
  148. package/models/UserAP.d.ts +25 -2
  149. package/models/UserAP.js +2 -2
  150. package/package.json +17 -10
  151. package/policies/checkAuth.js +4 -3
  152. package/policies/setLocale.js +2 -2
  153. package/system/Router.js +14 -14
  154. package/system/bindAuthorization.js +4 -5
  155. package/system/bindInertia.js +9 -9
  156. package/system/bindInstallStepper.js +1 -1
  157. package/system/bindReqFunctions.js +16 -0
  158. package/translations/ru.json +17 -8
  159. package/assets/add-ZITr43GJ.js +0 -1
  160. package/assets/add-form-CYOfr0Ef.js +0 -1
  161. package/assets/add-group-B332wN8K.js +0 -1
  162. package/assets/add-user-TC-mYdsB.js +0 -1
  163. package/assets/add-user-form-y2f_1_lM.js +0 -1
  164. package/assets/app-sidebar-BCtaEFGb.js +0 -1
  165. package/assets/dashboard-BR602KhL.js +0 -1
  166. package/assets/form-DOUNk3o2.js +0 -1
  167. package/assets/form-lOKv4Qbw.js +0 -1
  168. package/assets/home-Ch6QfTIt.js +0 -2
  169. package/assets/index-Cdb9ACvz.js +0 -1
  170. package/assets/index-K81GbF6O.js +0 -1
  171. package/assets/list-Qyd7ecQH.js +0 -1
  172. package/assets/module-DBaykv8l.js +0 -1
  173. package/assets/welcome-D2adQ8EU.js +0 -1
@@ -1,4 +1,4 @@
1
- import{g as KZ,W as No,r as Cf,j as bv}from"./app.js";import{c as JZ}from"./compiler-runtime-tM4jBQ-T.js";import{k as YZ,b as XZ}from"./index-Vcq4gwWv.js";import{u as ZZ}from"./use-window-size-B8l6Bpkf.js";import{u as QZ}from"./use-appearance-Co6mO0dV.js";function Or(r){this.content=r}Or.prototype={constructor:Or,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 Or(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 Or(t)},addToStart:function(r,e){return new Or([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Or(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 Or(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=Or.from(r),r.size?new Or(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Or.from(r),r.size?new Or(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Or.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}};Or.from=function(r){if(r instanceof Or)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Or(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,p=Math.min(o.text.length,s.text.length);for(;f<p&&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 Oe{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 p=s+1;l.nodesBetween(Math.max(0,e-p),Math.min(l.content.size,t-p),n,i+p)}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 Oe(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 Oe(n,i)}cutByIndex(e,t){return e==t?Oe.empty:e==0&&t==this.content.length?this:new Oe(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 Oe(i,a)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(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,t=-1){if(e==0)return Al(0,e);if(e==this.size)return Al(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let a=this.child(n),o=i+a.nodeSize;if(o>=e)return o==e||t>0?Al(n+1,o):Al(n,i);i=o}}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 Oe.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.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 Oe(t||e,n)}static from(e){if(!e)return Oe.empty;if(e instanceof Oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Oe.empty=new Oe([],0);const Tf={index:0,offset:0};function Al(r,e){return Tf.index=r,Tf.offset=e,Tf}function Zl(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(!Zl(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!Zl(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Pt=class fd{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&&Zl(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 fd.none;if(e instanceof fd)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Pt.none=[];class Ql extends Error{}class Ue{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 Ue(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Ue(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 Ue.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 Ue(Oe.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 Ue(e,n,i)}}Ue.empty=new Ue(Oe.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 r.cut(0,e).append(t).append(r.cut(e));let s=Xy(o.content,e-a-1,t);return s&&r.replaceChild(i,o.copy(s))}function eQ(r,e,t){if(t.openStart>r.depth)throw new Ql("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Ql("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 Ha(o,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=tQ(t,r);return Ha(a,eb(r,o,s,e,n))}else return Ha(a,eu(r,e,n))}function Qy(r,e){if(!e.type.compatibleContent(r.type))throw new Ql("Cannot join "+e.type.name+" onto "+r.type.name)}function dd(r,e,t){let n=r.node(t);return Qy(n,e.node(t)),n}function qa(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 ws(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&&(qa(r.nodeAfter,n),a++));for(let s=a;s<o;s++)qa(i.child(s),n);e&&e.depth==t&&e.textOffset&&qa(e.nodeBefore,n)}function Ha(r,e){return r.type.checkContent(e),r.copy(e)}function eb(r,e,t,n,i){let a=r.depth>i&&dd(r,e,i+1),o=n.depth>i&&dd(t,n,i+1),s=[];return ws(null,r,i,s),a&&o&&e.index(i)==t.index(i)?(Qy(a,o),qa(Ha(a,eb(r,e,t,n,i+1)),s)):(a&&qa(Ha(a,eu(r,e,i+1)),s),ws(e,t,i,s),o&&qa(Ha(o,eu(t,n,i+1)),s)),ws(n,null,i,s),new Oe(s)}function eu(r,e,t){let n=[];if(ws(null,r,t,n),r.depth>t){let i=dd(r,e,t+1);qa(Ha(i,eu(r,e,t+1)),n)}return ws(e,null,t,n),new Oe(n)}function tQ(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(Oe.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class Es{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 tu(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 Es(t,n,a)}static resolveCached(e,t){let n=kv.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 kv.set(e,n=new rQ);let i=n.elts[n.i]=Es.resolve(e,t);return n.i=(n.i+1)%nQ,i}}class rQ{constructor(){this.elts=[],this.i=0}}const nQ=12,kv=new WeakMap;class tu{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 iQ=Object.create(null);let ra=class hd{constructor(e,t,n,i=Pt.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||Oe.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&&Zl(this.attrs,t||e.defaultAttrs||iQ)&&Pt.sameSet(this.marks,n||Pt.none)}copy(e=null){return e==this.content?this:new hd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new hd(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 Ue.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 Ue(f,i.depth-o,a.depth-o)}replace(e,t,n){return eQ(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 Es.resolveCached(this,e)}resolveNoCache(e){return Es.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=Oe.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=Oe.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};ra.prototype.text=void 0;class ru extends ra{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 ru(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ru(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 Ua{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new aQ(e,t);if(n.next==null)return Ua.empty;let i=rb(n);n.next&&n.err("Unexpected trailing text");let a=dQ(fQ(i));return hQ(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 Oe.from(s.map(f=>f.createAndFill()));for(let f=0;f<o.next.length;f++){let{type:p,next:k}=o.next[f];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(k)==-1){i.push(k);let T=a(k,s.concat(p));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{e as KZ,W as No,r as Cf,j as bv}from"./app.js";import{c as JZ}from"./compiler-runtime-hB6dAw2d.js";import{k as YZ,b as XZ}from"./index-Vcq4gwWv.js";import{u as ZZ}from"./use-window-size-h0Sh_NvX.js";import{u as QZ}from"./use-appearance-DRfIqTgw.js";function Or(r){this.content=r}Or.prototype={constructor:Or,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 Or(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 Or(t)},addToStart:function(r,e){return new Or([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Or(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 Or(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=Or.from(r),r.size?new Or(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Or.from(r),r.size?new Or(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Or.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}};Or.from=function(r){if(r instanceof Or)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Or(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,p=Math.min(o.text.length,s.text.length);for(;f<p&&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 Oe{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 p=s+1;l.nodesBetween(Math.max(0,e-p),Math.min(l.content.size,t-p),n,i+p)}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 Oe(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 Oe(n,i)}cutByIndex(e,t){return e==t?Oe.empty:e==0&&t==this.content.length?this:new Oe(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 Oe(i,a)}addToStart(e){return new Oe([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Oe(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,t=-1){if(e==0)return Al(0,e);if(e==this.size)return Al(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,i=0;;n++){let a=this.child(n),o=i+a.nodeSize;if(o>=e)return o==e||t>0?Al(n+1,o):Al(n,i);i=o}}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 Oe.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Oe(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Oe.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 Oe(t||e,n)}static from(e){if(!e)return Oe.empty;if(e instanceof Oe)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Oe([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Oe.empty=new Oe([],0);const Tf={index:0,offset:0};function Al(r,e){return Tf.index=r,Tf.offset=e,Tf}function Zl(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(!Zl(r[n],e[n]))return!1}else{for(let n in r)if(!(n in e)||!Zl(r[n],e[n]))return!1;for(let n in e)if(!(n in r))return!1}return!0}let Pt=class fd{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&&Zl(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 fd.none;if(e instanceof fd)return[e];let t=e.slice();return t.sort((n,i)=>n.type.rank-i.type.rank),t}};Pt.none=[];class Ql extends Error{}class Ue{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 Ue(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Ue(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 Ue.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 Ue(Oe.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 Ue(e,n,i)}}Ue.empty=new Ue(Oe.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 r.cut(0,e).append(t).append(r.cut(e));let s=Xy(o.content,e-a-1,t);return s&&r.replaceChild(i,o.copy(s))}function eQ(r,e,t){if(t.openStart>r.depth)throw new Ql("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Ql("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 Ha(o,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=tQ(t,r);return Ha(a,eb(r,o,s,e,n))}else return Ha(a,eu(r,e,n))}function Qy(r,e){if(!e.type.compatibleContent(r.type))throw new Ql("Cannot join "+e.type.name+" onto "+r.type.name)}function dd(r,e,t){let n=r.node(t);return Qy(n,e.node(t)),n}function qa(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 ws(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&&(qa(r.nodeAfter,n),a++));for(let s=a;s<o;s++)qa(i.child(s),n);e&&e.depth==t&&e.textOffset&&qa(e.nodeBefore,n)}function Ha(r,e){return r.type.checkContent(e),r.copy(e)}function eb(r,e,t,n,i){let a=r.depth>i&&dd(r,e,i+1),o=n.depth>i&&dd(t,n,i+1),s=[];return ws(null,r,i,s),a&&o&&e.index(i)==t.index(i)?(Qy(a,o),qa(Ha(a,eb(r,e,t,n,i+1)),s)):(a&&qa(Ha(a,eu(r,e,i+1)),s),ws(e,t,i,s),o&&qa(Ha(o,eu(t,n,i+1)),s)),ws(n,null,i,s),new Oe(s)}function eu(r,e,t){let n=[];if(ws(null,r,t,n),r.depth>t){let i=dd(r,e,t+1);qa(Ha(i,eu(r,e,t+1)),n)}return ws(e,null,t,n),new Oe(n)}function tQ(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(Oe.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class Es{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 tu(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 Es(t,n,a)}static resolveCached(e,t){let n=kv.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 kv.set(e,n=new rQ);let i=n.elts[n.i]=Es.resolve(e,t);return n.i=(n.i+1)%nQ,i}}class rQ{constructor(){this.elts=[],this.i=0}}const nQ=12,kv=new WeakMap;class tu{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 iQ=Object.create(null);let ra=class hd{constructor(e,t,n,i=Pt.none){this.type=e,this.attrs=t,this.marks=i,this.content=n||Oe.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&&Zl(this.attrs,t||e.defaultAttrs||iQ)&&Pt.sameSet(this.marks,n||Pt.none)}copy(e=null){return e==this.content?this:new hd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new hd(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 Ue.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 Ue(f,i.depth-o,a.depth-o)}replace(e,t,n){return eQ(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 Es.resolveCached(this,e)}resolveNoCache(e){return Es.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=Oe.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=Oe.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};ra.prototype.text=void 0;class ru extends ra{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 ru(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ru(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 Ua{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new aQ(e,t);if(n.next==null)return Ua.empty;let i=rb(n);n.next&&n.err("Unexpected trailing text");let a=dQ(fQ(i));return hQ(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 Oe.from(s.map(f=>f.createAndFill()));for(let f=0;f<o.next.length;f++){let{type:p,next:k}=o.next[f];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(k)==-1){i.push(k);let T=a(k,s.concat(p));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
  `)}}Ua.empty=new Ua(!0);class aQ{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(oQ(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function oQ(r){let e=[];do e.push(sQ(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function sQ(r){let e=cQ(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=lQ(r,e);else break;return e}function wv(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function lQ(r,e){let t=wv(r),n=t;return r.eat(",")&&(r.next!="}"?n=wv(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function uQ(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 cQ(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=uQ(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 fQ(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 p=t();i(a(o.expr,l),p),l=p}if(o.max==-1)i(a(o.expr,l),l);else for(let f=o.min;f<o.max;f++){let p=t();n(l,p),i(a(o.expr,l),p),l=p}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 Cv(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 dQ(r){let e=Object.create(null);return t(Cv(r,0));function t(n){let i=[];n.forEach(o=>{r[o].forEach(({term:s,to:l})=>{if(!s)return;let f;for(let p=0;p<i.length;p++)i[p][0]==s&&(f=i[p][1]);Cv(r,l).forEach(p=>{f||i.push([s,f=[]]),f.indexOf(p)==-1&&f.push(p)})})});let a=e[n.join(",")]=new Ua(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 hQ(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 vQ(r,n,e[n]);return t}let Tv=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==Ua.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 ra(this,this.computeAttrs(e),Oe.from(t),Pt.setFrom(n))}createChecked(e=null,t,n){return t=Oe.from(t),this.checkContent(t),new ra(this,this.computeAttrs(e),t,Pt.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=Oe.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(Oe.empty,!0);return a?new ra(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 pQ(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 vQ{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?pQ(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class Mu{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 Mu(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=Or.from(e.nodes),t.marks=Or.from(e.marks||{}),this.nodes=Tv.compile(this.spec.nodes,this),this.marks=Mu.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]=Ua.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?Sv(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==""?[]:Sv(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),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 Tv){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 ru(n,n.defaultAttrs,e,Pt.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return ra.fromJSON(this,e)}markFromJSON(e){return Pt.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Sv(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 mQ(r){return r.tag!=null}function gQ(r){return r.style!=null}class $a{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(mQ(i))this.tags.push(i);else if(gQ(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 Ev(this,t,!1);return n.addAll(e,Pt.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ev(this,t,!0);return n.addAll(e,Pt.none,t.from,t.to),Ue.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(kQ(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=Mv(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=Mv(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new $a(e,$a.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},yQ={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},fb={ol:!0,ul:!0},Ms=1,pd=2,zl=4;function xv(r,e,t){return e!=null?(e?Ms:0)|(e==="full"?pd:0):r&&r.whitespace=="pre"?Ms|pd:t&-5}class Ol{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&zl?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Oe.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&Ms)){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=Oe.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Oe.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 Ev{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=xv(null,t.preserveWhitespace,0)|(n?zl:0);i?a=new Ol(i.type,i.attrs,Pt.none,!0,t.topMatch||i.type.contentMatch,o):n?a=new Ol(null,null,Pt.none,!0,null,o):a=new Ol(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&pd?"full":this.localPreserveWS||(i.options&Ms)>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&&bQ(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:yQ.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,p=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 k=l&&l.skip?t:this.readStyles(e,t);k&&this.addAll(e,k),f&&this.sync(a),this.needsBlock=p}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):Av(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=xv(e,a,o.options);o.options&zl&&o.content.length==0&&(s|=zl);let l=Pt.none;return n=n.filter(f=>(o.type?o.type.allowsMarkType(f.type):Av(f.type,e))?(l=f.addToSet(l),!1):!0),this.nodes.push(new Ol(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|=Ms)}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 p=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!p||p.name!=f&&!p.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 bQ(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 kQ(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function Mv(r){let e={};for(let t in r)e[t]=r[t];return e}function Av(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:p}=s.edge(l);if(f==e||a.indexOf(p)<0&&o(p))return!0}};if(o(i.contentMatch))return!0}}class Jo{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=Sf(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++],p=this.serializeMark(f,o.isInline,t);p&&(a.push([f,i]),i.appendChild(p.dom),i=p.contentDOM||p.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:i}=Vl(Sf(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&&Vl(Sf(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Vl(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Jo(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Ov(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return Ov(e.marks)}}function Ov(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function Sf(r){return r.document||window.document}const Nv=new WeakMap;function wQ(r){let e=Nv.get(r);return e===void 0&&Nv.set(r,e=CQ(r)),e}function CQ(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 Vl(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=wQ(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],p=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){p=2;for(let k in f)if(f[k]!=null){let T=k.indexOf(" ");T>0?l.setAttributeNS(k.slice(0,T),k.slice(T+1),f[k]):l.setAttribute(k,f[k])}}for(let k=p;k<e.length;k++){let T=e[k];if(T===0){if(k<e.length-1||k>p)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}=Vl(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 TQ(r,e){return r+e*hb}function Dv(r){return r&db}function SQ(r){return(r-(r&db))/hb}const pb=1,vb=2,Ul=4,mb=8;class vd{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|Ul))>0}get deletedAfter(){return(this.delInfo&(vb|Ul))>0}get deletedAcross(){return(this.delInfo&Ul)>0}}class un{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&un.empty)return un.empty}recover(e){let t=0,n=Dv(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+SQ(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],p=this.ranges[s+o],k=l+f;if(e<=k){let T=f?e==l?-1:e==k?1:t:t,x=l+i+(T<0?0:p);if(n)return x;let E=e==(t<0?l:k)?null:TQ(s/3,e-l),P=e==l?vb:e==k?pb:Ul;return(t<0?e!=l:e!=k)&&(P|=mb),new vd(x,P,E)}i+=p-f}return n?e+i:new vd(e+i,0,null)}touches(e,t){let n=0,i=Dv(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],p=l+f;if(e<=p&&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],p=this.ranges[i+n];e(s,s+f,l,l+p),a+=p-f}}invert(){return new un(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?un.empty:new un(e<0?[0,-e,0]:[0,0,e])}}un.empty=new un([]);class As{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 As(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 As;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 vd(e,i,null)}}const xf=Object.create(null);class Ur{getMap(){return un.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=xf[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 xf)throw new RangeError("Duplicate use of step JSON ID "+e);return xf[e]=t,t.prototype.jsonID=e,t}}class hr{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new hr(e,null)}static fail(e){return new hr(null,e)}static fromReplace(e,t,n,i){try{return hr.ok(e.replace(t,n,i))}catch(a){if(a instanceof Ql)return hr.fail(a.message);throw a}}}function eh(r,e,t){let n=[];for(let i=0;i<r.childCount;i++){let a=r.child(i);a.content.size&&(a=a.copy(eh(a.content,e,a))),a.isInline&&(a=e(a,t,i)),n.push(a)}return Oe.fromArray(n)}class Qi extends Ur{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 Ue(eh(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 hr.fromReplace(e,this.from,this.to,a)}invert(){return new oi(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 Qi(t.pos,n.pos,this.mark)}merge(e){return e instanceof Qi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Qi(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 Qi(t.from,t.to,e.markFromJSON(t.mark))}}Ur.jsonID("addMark",Qi);class oi extends Ur{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 Ue(eh(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return hr.fromReplace(e,this.from,this.to,n)}invert(){return new Qi(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 oi(t.pos,n.pos,this.mark)}merge(e){return e instanceof oi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new oi(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 oi(t.from,t.to,e.markFromJSON(t.mark))}}Ur.jsonID("removeMark",oi);class ea extends Ur{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return hr.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return hr.fromReplace(e,this.pos,this.pos+1,new Ue(Oe.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 ea(this.pos,t.marks[i]);return new ea(this.pos,this.mark)}}return new Wa(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ea(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 ea(t.pos,e.markFromJSON(t.mark))}}Ur.jsonID("addNodeMark",ea);class Wa extends Ur{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return hr.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return hr.fromReplace(e,this.pos,this.pos+1,new Ue(Oe.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new ea(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Wa(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 Wa(t.pos,e.markFromJSON(t.mark))}}Ur.jsonID("removeNodeMark",Wa);class _r extends Ur{constructor(e,t,n,i=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=i}apply(e){return this.structure&&md(e,this.from,this.to)?hr.fail("Structure replace would overwrite content"):hr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new un([this.from,this.to-this.from,this.slice.size])}invert(e){return new _r(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 _r(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof _r)||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?Ue.empty:new Ue(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new _r(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?Ue.empty:new Ue(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new _r(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 _r(t.from,t.to,Ue.fromJSON(e,t.slice),!!t.structure)}}Ur.jsonID("replace",_r);class Sr extends Ur{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&&(md(e,this.from,this.gapFrom)||md(e,this.gapTo,this.to)))return hr.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return hr.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?hr.fromReplace(e,this.from,this.to,n):hr.fail("Content does not fit in gap")}getMap(){return new un([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 Sr(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 Sr(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 Sr(t.from,t.to,t.gapFrom,t.gapTo,Ue.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ur.jsonID("replaceAround",Sr);function md(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 xQ(r,e,t,n){let i=[],a=[],o,s;r.doc.nodesBetween(e,t,(l,f,p)=>{if(!l.isInline)return;let k=l.marks;if(!n.isInSet(k)&&p.type.allowsMarkType(n.type)){let T=Math.max(f,e),x=Math.min(f+l.nodeSize,t),E=n.addToSet(k);for(let P=0;P<k.length;P++)k[P].isInSet(E)||(o&&o.to==T&&o.mark.eq(k[P])?o.to=x:i.push(o=new oi(T,x,k[P])));s&&s.to==T?s.to=x:a.push(s=new Qi(T,x,n))}}),i.forEach(l=>r.step(l)),a.forEach(l=>r.step(l))}function EQ(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 Mu){let f=o.marks,p;for(;p=n.isInSet(f);)(l||(l=[])).push(p),f=p.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 p=0;p<l.length;p++){let k=l[p],T;for(let x=0;x<i.length;x++){let E=i[x];E.step==a-1&&k.eq(i[x].style)&&(T=E)}T?(T.to=f,T.step=a):i.push({style:k,from:Math.max(s,e),to:f,step:a})}}}),i.forEach(o=>r.step(new oi(o.from,o.to,o.style)))}function th(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),p=s+f.nodeSize,k=n.matchType(f.type);if(!k)o.push(new _r(s,p,Ue.empty));else{n=k;for(let T=0;T<f.marks.length;T++)t.allowsMarkType(f.marks[T].type)||r.step(new oi(s,p,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 Ue(Oe.from(t.schema.text(" ",t.allowedMarks(f.marks))),0,0)),o.push(new _r(s+T.index,s+T.index+T[0].length,E))}}s=p}if(!n.validEnd){let l=n.fillBefore(Oe.empty,!0);r.replace(s,s,new Ue(l,0,0))}for(let l=o.length-1;l>=0;l--)r.step(o[l])}function MQ(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function Au(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||!MQ(i,a,o))break}return null}function AQ(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,p=Oe.empty,k=0;for(let E=a,P=!1;E>t;E--)P||n.index(E)>0?(P=!0,p=Oe.from(n.node(E).copy(p)),k++):l--;let T=Oe.empty,x=0;for(let E=a,P=!1;E>t;E--)P||i.after(E+1)<i.end(E)?(P=!0,T=Oe.from(i.node(E).copy(T)),x++):f++;r.step(new Sr(l,f,o,s,new Ue(p.append(T),k,x),p.size-k,!0))}function OQ(r,e,t=null,n=r){let i=NQ(r,e),a=i&&DQ(n,e);return a?i.map(Lv).concat({type:e,attrs:t}).concat(a.map(Lv)):null}function Lv(r){return{type:r,attrs:null}}function NQ(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 DQ(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 LQ(r,e,t){let n=Oe.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=Oe.from(t[o].type.create(t[o].attrs,n))}let i=e.start,a=e.end;r.step(new Sr(i,a,i,a,new Ue(n,0,0),t.length,!0))}function RQ(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)&&IQ(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),th(r,r.mapping.slice(a).map(s,1),n,void 0,f===null);let p=r.mapping.slice(a),k=p.map(s,1),T=p.map(s+o.nodeSize,1);return r.step(new Sr(k,T,k+1,T-1,new Ue(Oe.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{r as i,j as u}from"./app.js";import{c as j}from"./compiler-runtime-tM4jBQ-T.js";import{d as S,A as K,c as C,a as W,u as J,R as Q,P as Z,D as ee,C as te,e as oe}from"./index-Cdb9ACvz.js";import{u as H,a as re}from"./index-DrWfGwtf.js";import{c as ne}from"./index-D5ir9iUV.js";import{P as $}from"./index-BC0yfOHo.js";import{P as se}from"./index-K81GbF6O.js";import{R as ae}from"./index-BcE9FUM6.js";import{c as ie}from"./utils-DjqsqOe8.js";var[D,$e]=ne("Tooltip",[S]),O=S(),G="TooltipProvider",le=700,A="tooltip.open",[ce,k]=D(G),F=o=>{const{__scopeTooltip:e,delayDuration:t=le,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=i.useRef(!0),p=i.useRef(!1),a=i.useRef(0);return i.useEffect(()=>{const d=a.current;return()=>window.clearTimeout(d)},[]),u.jsx(ce,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:i.useCallback(()=>{window.clearTimeout(a.current),l.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:p,onPointerInTransitChange:i.useCallback(d=>{p.current=d},[]),disableHoverableContent:n,children:s})};F.displayName=G;var R="Tooltip",[ue,_]=D(R),z=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:p}=o,a=k(R,o.__scopeTooltip),d=O(e),[c,v]=i.useState(null),x=W(),f=i.useRef(0),m=l??a.disableHoverableContent,T=p??a.delayDuration,h=i.useRef(!1),[g,y]=J({prop:r,defaultProp:n??!1,onChange:I=>{I?(a.onOpen(),document.dispatchEvent(new CustomEvent(A))):a.onClose(),s==null||s(I)},caller:R}),w=i.useMemo(()=>g?h.current?"delayed-open":"instant-open":"closed",[g]),P=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,h.current=!1,y(!0)},[y]),E=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y(!1)},[y]),N=i.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{h.current=!0,y(!0),f.current=0},T)},[T,y]);return i.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),u.jsx(Q,{...d,children:u.jsx(ue,{scope:e,contentId:x,open:g,stateAttribute:w,trigger:c,onTriggerChange:v,onTriggerEnter:i.useCallback(()=>{a.isOpenDelayedRef.current?N():P()},[a.isOpenDelayedRef,N,P]),onTriggerLeave:i.useCallback(()=>{m?E():(window.clearTimeout(f.current),f.current=0)},[E,m]),onOpen:P,onClose:E,disableHoverableContent:m,children:t})})};z.displayName=R;var L="TooltipTrigger",B=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(L,t),s=k(L,t),l=O(t),p=i.useRef(null),a=H(e,p,n.onTriggerChange),d=i.useRef(!1),c=i.useRef(!1),v=i.useCallback(()=>d.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),u.jsx(K,{asChild:!0,...l,children:u.jsx(se.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:a,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!c.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),c.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),c.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),d.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{d.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});B.displayName=L;var M="TooltipPortal",[pe,de]=D(M,{forceMount:void 0}),U=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(M,e);return u.jsx(pe,{scope:e,forceMount:t,children:u.jsx($,{present:t||s.open,children:u.jsx(Z,{asChild:!0,container:n,children:r})})})};U.displayName=M;var b="TooltipContent",V=i.forwardRef((o,e)=>{const t=de(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return u.jsx($,{present:r||l.open,children:l.disableHoverableContent?u.jsx(Y,{side:n,...s,ref:e}):u.jsx(fe,{side:n,...s,ref:e})})}),fe=i.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=i.useRef(null),s=H(e,n),[l,p]=i.useState(null),{trigger:a,onClose:d}=t,c=n.current,{onPointerInTransitChange:v}=r,x=i.useCallback(()=>{p(null),v(!1)},[v]),f=i.useCallback((m,T)=>{const h=m.currentTarget,g={x:m.clientX,y:m.clientY},y=he(g,h.getBoundingClientRect()),w=Te(g,y),P=ye(T.getBoundingClientRect()),E=Ce([...w,...P]);p(E),v(!0)},[v]);return i.useEffect(()=>()=>x(),[x]),i.useEffect(()=>{if(a&&c){const m=h=>f(h,c),T=h=>f(h,a);return a.addEventListener("pointerleave",m),c.addEventListener("pointerleave",T),()=>{a.removeEventListener("pointerleave",m),c.removeEventListener("pointerleave",T)}}},[a,c,f,x]),i.useEffect(()=>{if(l){const m=T=>{const h=T.target,g={x:T.clientX,y:T.clientY},y=(a==null?void 0:a.contains(h))||(c==null?void 0:c.contains(h)),w=!ge(g,l);y?x():w&&(x(),d())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[a,c,l,d,x]),u.jsx(Y,{...o,ref:s})}),[ve,xe]=D(R,{isInside:!1}),me=re("TooltipContent"),Y=i.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...p}=o,a=_(b,t),d=O(t),{onClose:c}=a;return i.useEffect(()=>(document.addEventListener(A,c),()=>document.removeEventListener(A,c)),[c]),i.useEffect(()=>{if(a.trigger){const v=x=>{const f=x.target;f!=null&&f.contains(a.trigger)&&c()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[a.trigger,c]),u.jsx(ee,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:c,children:u.jsxs(te,{"data-state":a.stateAttribute,...d,...p,ref:e,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(me,{children:r}),u.jsx(ve,{scope:t,isInside:!0,children:u.jsx(ae,{id:a.contentId,role:"tooltip",children:n||r})})]})})});V.displayName=b;var q="TooltipArrow",X=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=O(t);return xe(q,t).isInside?null:u.jsx(oe,{...n,...r,ref:e})});X.displayName=q;function he(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Te(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function ye(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function ge(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const p=e[s],a=e[l],d=p.x,c=p.y,v=a.x,x=a.y;c>r!=x>r&&t<(v-d)*(r-c)/(x-c)+d&&(n=!n)}return n}function Ce(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),be(e)}function be(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var we=F,Pe=z,Ee=B,Re=U,_e=V,je=X;function De(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=u.jsx(we,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Ge(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=u.jsx(De,{children:u.jsx(Pe,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Fe(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=u.jsx(Ee,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function ze(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let p;e[5]!==r?(p=ie("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=p):p=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(je,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=a):a=e[7];let d;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==p?(d=u.jsx(Re,{children:u.jsxs(_e,{"data-slot":"tooltip-content",sideOffset:l,className:p,...n,children:[t,a]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=p,e[12]=d):d=e[12],d}export{De as T,Ge as a,Fe as b,ze as c};
1
+ import{r as i,j as u}from"./app.js";import{c as j}from"./compiler-runtime-hB6dAw2d.js";import{d as S,A as K,c as C,b as W,u as J,e as Q,P as Z,D as ee,C as te,f as oe}from"./index-CaJgc5EZ.js";import{u as H,a as re}from"./index-DrWfGwtf.js";import{c as ne}from"./index-D5ir9iUV.js";import{P as $}from"./index-BC0yfOHo.js";import{P as se}from"./index-B8BS9wMC.js";import{R as ae}from"./index-Cgp8OfuI.js";import{c as ie}from"./utils-DjqsqOe8.js";var[D,$e]=ne("Tooltip",[S]),O=S(),G="TooltipProvider",le=700,A="tooltip.open",[ce,k]=D(G),F=o=>{const{__scopeTooltip:e,delayDuration:t=le,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=o,l=i.useRef(!0),p=i.useRef(!1),a=i.useRef(0);return i.useEffect(()=>{const d=a.current;return()=>window.clearTimeout(d)},[]),u.jsx(ce,{scope:e,isOpenDelayedRef:l,delayDuration:t,onOpen:i.useCallback(()=>{window.clearTimeout(a.current),l.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:p,onPointerInTransitChange:i.useCallback(d=>{p.current=d},[]),disableHoverableContent:n,children:s})};F.displayName=G;var R="Tooltip",[ue,_]=D(R),z=o=>{const{__scopeTooltip:e,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:p}=o,a=k(R,o.__scopeTooltip),d=O(e),[c,v]=i.useState(null),x=W(),f=i.useRef(0),m=l??a.disableHoverableContent,T=p??a.delayDuration,h=i.useRef(!1),[g,y]=J({prop:r,defaultProp:n??!1,onChange:I=>{I?(a.onOpen(),document.dispatchEvent(new CustomEvent(A))):a.onClose(),s==null||s(I)},caller:R}),w=i.useMemo(()=>g?h.current?"delayed-open":"instant-open":"closed",[g]),P=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,h.current=!1,y(!0)},[y]),E=i.useCallback(()=>{window.clearTimeout(f.current),f.current=0,y(!1)},[y]),N=i.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>{h.current=!0,y(!0),f.current=0},T)},[T,y]);return i.useEffect(()=>()=>{f.current&&(window.clearTimeout(f.current),f.current=0)},[]),u.jsx(Q,{...d,children:u.jsx(ue,{scope:e,contentId:x,open:g,stateAttribute:w,trigger:c,onTriggerChange:v,onTriggerEnter:i.useCallback(()=>{a.isOpenDelayedRef.current?N():P()},[a.isOpenDelayedRef,N,P]),onTriggerLeave:i.useCallback(()=>{m?E():(window.clearTimeout(f.current),f.current=0)},[E,m]),onOpen:P,onClose:E,disableHoverableContent:m,children:t})})};z.displayName=R;var L="TooltipTrigger",B=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=_(L,t),s=k(L,t),l=O(t),p=i.useRef(null),a=H(e,p,n.onTriggerChange),d=i.useRef(!1),c=i.useRef(!1),v=i.useCallback(()=>d.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),u.jsx(K,{asChild:!0,...l,children:u.jsx(se.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:a,onPointerMove:C(o.onPointerMove,x=>{x.pointerType!=="touch"&&!c.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),c.current=!0)}),onPointerLeave:C(o.onPointerLeave,()=>{n.onTriggerLeave(),c.current=!1}),onPointerDown:C(o.onPointerDown,()=>{n.open&&n.onClose(),d.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:C(o.onFocus,()=>{d.current||n.onOpen()}),onBlur:C(o.onBlur,n.onClose),onClick:C(o.onClick,n.onClose)})})});B.displayName=L;var M="TooltipPortal",[pe,de]=D(M,{forceMount:void 0}),U=o=>{const{__scopeTooltip:e,forceMount:t,children:r,container:n}=o,s=_(M,e);return u.jsx(pe,{scope:e,forceMount:t,children:u.jsx($,{present:t||s.open,children:u.jsx(Z,{asChild:!0,container:n,children:r})})})};U.displayName=M;var b="TooltipContent",V=i.forwardRef((o,e)=>{const t=de(b,o.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=o,l=_(b,o.__scopeTooltip);return u.jsx($,{present:r||l.open,children:l.disableHoverableContent?u.jsx(Y,{side:n,...s,ref:e}):u.jsx(fe,{side:n,...s,ref:e})})}),fe=i.forwardRef((o,e)=>{const t=_(b,o.__scopeTooltip),r=k(b,o.__scopeTooltip),n=i.useRef(null),s=H(e,n),[l,p]=i.useState(null),{trigger:a,onClose:d}=t,c=n.current,{onPointerInTransitChange:v}=r,x=i.useCallback(()=>{p(null),v(!1)},[v]),f=i.useCallback((m,T)=>{const h=m.currentTarget,g={x:m.clientX,y:m.clientY},y=he(g,h.getBoundingClientRect()),w=Te(g,y),P=ye(T.getBoundingClientRect()),E=Ce([...w,...P]);p(E),v(!0)},[v]);return i.useEffect(()=>()=>x(),[x]),i.useEffect(()=>{if(a&&c){const m=h=>f(h,c),T=h=>f(h,a);return a.addEventListener("pointerleave",m),c.addEventListener("pointerleave",T),()=>{a.removeEventListener("pointerleave",m),c.removeEventListener("pointerleave",T)}}},[a,c,f,x]),i.useEffect(()=>{if(l){const m=T=>{const h=T.target,g={x:T.clientX,y:T.clientY},y=(a==null?void 0:a.contains(h))||(c==null?void 0:c.contains(h)),w=!ge(g,l);y?x():w&&(x(),d())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[a,c,l,d,x]),u.jsx(Y,{...o,ref:s})}),[ve,xe]=D(R,{isInside:!1}),me=re("TooltipContent"),Y=i.forwardRef((o,e)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...p}=o,a=_(b,t),d=O(t),{onClose:c}=a;return i.useEffect(()=>(document.addEventListener(A,c),()=>document.removeEventListener(A,c)),[c]),i.useEffect(()=>{if(a.trigger){const v=x=>{const f=x.target;f!=null&&f.contains(a.trigger)&&c()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[a.trigger,c]),u.jsx(ee,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:c,children:u.jsxs(te,{"data-state":a.stateAttribute,...d,...p,ref:e,style:{...p.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(me,{children:r}),u.jsx(ve,{scope:t,isInside:!0,children:u.jsx(ae,{id:a.contentId,role:"tooltip",children:n||r})})]})})});V.displayName=b;var q="TooltipArrow",X=i.forwardRef((o,e)=>{const{__scopeTooltip:t,...r}=o,n=O(t);return xe(q,t).isInside?null:u.jsx(oe,{...n,...r,ref:e})});X.displayName=q;function he(o,e){const t=Math.abs(e.top-o.y),r=Math.abs(e.bottom-o.y),n=Math.abs(e.right-o.x),s=Math.abs(e.left-o.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Te(o,e,t=5){const r=[];switch(e){case"top":r.push({x:o.x-t,y:o.y+t},{x:o.x+t,y:o.y+t});break;case"bottom":r.push({x:o.x-t,y:o.y-t},{x:o.x+t,y:o.y-t});break;case"left":r.push({x:o.x+t,y:o.y-t},{x:o.x+t,y:o.y+t});break;case"right":r.push({x:o.x-t,y:o.y-t},{x:o.x-t,y:o.y+t});break}return r}function ye(o){const{top:e,right:t,bottom:r,left:n}=o;return[{x:n,y:e},{x:t,y:e},{x:t,y:r},{x:n,y:r}]}function ge(o,e){const{x:t,y:r}=o;let n=!1;for(let s=0,l=e.length-1;s<e.length;l=s++){const p=e[s],a=e[l],d=p.x,c=p.y,v=a.x,x=a.y;c>r!=x>r&&t<(v-d)*(r-c)/(x-c)+d&&(n=!n)}return n}function Ce(o){const e=o.slice();return e.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),be(e)}function be(o){if(o.length<=1)return o.slice();const e=[];for(let r=0;r<o.length;r++){const n=o[r];for(;e.length>=2;){const s=e[e.length-1],l=e[e.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))e.pop();else break}e.push(n)}e.pop();const t=[];for(let r=o.length-1;r>=0;r--){const n=o[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var we=F,Pe=z,Ee=B,Re=U,_e=V,je=X;function De(o){const e=j.c(6);let t,r;e[0]!==o?({delayDuration:r,...t}=o,e[0]=o,e[1]=t,e[2]=r):(t=e[1],r=e[2]);const n=r===void 0?0:r;let s;return e[3]!==n||e[4]!==t?(s=u.jsx(we,{"data-slot":"tooltip-provider",delayDuration:n,...t}),e[3]=n,e[4]=t,e[5]=s):s=e[5],s}function Ge(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=u.jsx(De,{children:u.jsx(Pe,{"data-slot":"tooltip",...t})}),e[2]=t,e[3]=r):r=e[3],r}function Fe(o){const e=j.c(4);let t;e[0]!==o?({...t}=o,e[0]=o,e[1]=t):t=e[1];let r;return e[2]!==t?(r=u.jsx(Ee,{"data-slot":"tooltip-trigger",...t}),e[2]=t,e[3]=r):r=e[3],r}function ze(o){const e=j.c(13);let t,r,n,s;e[0]!==o?({className:r,sideOffset:s,children:t,...n}=o,e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=s):(t=e[1],r=e[2],n=e[3],s=e[4]);const l=s===void 0?0:s;let p;e[5]!==r?(p=ie("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",r),e[5]=r,e[6]=p):p=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=u.jsx(je,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"}),e[7]=a):a=e[7];let d;return e[8]!==t||e[9]!==n||e[10]!==l||e[11]!==p?(d=u.jsx(Re,{children:u.jsxs(_e,{"data-slot":"tooltip-content",sideOffset:l,className:p,...n,children:[t,a]})}),e[8]=t,e[9]=n,e[10]=l,e[11]=p,e[12]=d):d=e[12],d}export{De as T,Ge as a,Fe as b,ze as c};
@@ -1 +1 @@
1
- import{c as S}from"./compiler-runtime-tM4jBQ-T.js";import{r as l}from"./app.js";const y=()=>typeof window>"u"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches,E=(e,a,r=365)=>{if(typeof document>"u")return;const o=r*24*60*60;document.cookie=`${e}=${a};path=/;max-age=${o};SameSite=Lax`},c=e=>{const a=e==="dark"||e==="system"&&y();document.documentElement.classList.toggle("dark",a)},w=()=>typeof window>"u"?null:window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{const e=localStorage.getItem("appearance");c(e||"light")};function C(){var a;const e=localStorage.getItem("appearance")||"system";c(e),(a=w())==null||a.addEventListener("change",v)}function L(){const e=S.c(6),[a,r]=l.useState("system"),[o,g]=l.useState(!1);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n=>{g(!0),r(n),localStorage.setItem("appearance",n),E("appearance",n),c(n),setTimeout(()=>{g(!1),window.dispatchEvent(new Event("appearanceChanged"))},0)},e[0]=s):s=e[0];const d=s;let p,i;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{const n=localStorage.getItem("appearance");d(n||"light");const h=t=>{if(t.key==="appearance"){const f=t.newValue;r(f),c(f)}},u=()=>{const t=localStorage.getItem("appearance");r(t),c(t)};return window.addEventListener("storage",h),window.addEventListener("appearanceChanged",u),()=>{var t;window.removeEventListener("storage",h),window.removeEventListener("appearanceChanged",u),(t=w())==null||t.removeEventListener("change",v)}},i=[d],e[1]=p,e[2]=i):(p=e[1],i=e[2]),l.useEffect(p,i);let m;return e[3]!==a||e[4]!==o?(m={appearance:a,updateAppearance:d,isThemeChanging:o},e[3]=a,e[4]=o,e[5]=m):m=e[5],m}export{C as i,L as u};
1
+ import{c as S}from"./compiler-runtime-hB6dAw2d.js";import{r as l}from"./app.js";const y=()=>typeof window>"u"?!1:window.matchMedia("(prefers-color-scheme: dark)").matches,E=(e,a,r=365)=>{if(typeof document>"u")return;const o=r*24*60*60;document.cookie=`${e}=${a};path=/;max-age=${o};SameSite=Lax`},c=e=>{const a=e==="dark"||e==="system"&&y();document.documentElement.classList.toggle("dark",a)},w=()=>typeof window>"u"?null:window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{const e=localStorage.getItem("appearance");c(e||"light")};function C(){var a;const e=localStorage.getItem("appearance")||"system";c(e),(a=w())==null||a.addEventListener("change",v)}function L(){const e=S.c(6),[a,r]=l.useState("system"),[o,g]=l.useState(!1);let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=n=>{g(!0),r(n),localStorage.setItem("appearance",n),E("appearance",n),c(n),setTimeout(()=>{g(!1),window.dispatchEvent(new Event("appearanceChanged"))},0)},e[0]=s):s=e[0];const d=s;let p,i;e[1]===Symbol.for("react.memo_cache_sentinel")?(p=()=>{const n=localStorage.getItem("appearance");d(n||"light");const h=t=>{if(t.key==="appearance"){const f=t.newValue;r(f),c(f)}},u=()=>{const t=localStorage.getItem("appearance");r(t),c(t)};return window.addEventListener("storage",h),window.addEventListener("appearanceChanged",u),()=>{var t;window.removeEventListener("storage",h),window.removeEventListener("appearanceChanged",u),(t=w())==null||t.removeEventListener("change",v)}},i=[d],e[1]=p,e[2]=i):(p=e[1],i=e[2]),l.useEffect(p,i);let m;return e[3]!==a||e[4]!==o?(m={appearance:a,updateAppearance:d,isThemeChanging:o},e[3]=a,e[4]=o,e[5]=m):m=e[5],m}export{C as i,L as u};
@@ -1 +1 @@
1
- import{c as s}from"./compiler-runtime-tM4jBQ-T.js";import{r}from"./app.js";const h=()=>{const e=s.c(3);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},e[0]=i):i=e[0];const[d,w]=r.useState(i);let n,t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{if(typeof window>"u")return;const o=()=>{w({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},t=[],e[1]=n,e[2]=t):(n=e[1],t=e[2]),r.useEffect(n,t),d};export{h as u};
1
+ import{c as s}from"./compiler-runtime-hB6dAw2d.js";import{r}from"./app.js";const h=()=>{const e=s.c(3);let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},e[0]=i):i=e[0];const[d,w]=r.useState(i);let n,t;return e[1]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{if(typeof window>"u")return;const o=()=>{w({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},t=[],e[1]=n,e[2]=t):(n=e[1],t=e[2]),r.useEffect(n,t),d};export{h as u};
@@ -1,4 +1,4 @@
1
- import{d as F,r as g,j as c}from"./app.js";import{c as S}from"./compiler-runtime-tM4jBQ-T.js";import{c as U,a as M,u as w}from"./index-D5ir9iUV.js";import{P as y}from"./index-K81GbF6O.js";import{c as I}from"./utils-DjqsqOe8.js";import"./index-DrWfGwtf.js";var E={exports:{}},A={};/**
1
+ import{a as F,r as g,j as c}from"./app.js";import{c as S}from"./compiler-runtime-hB6dAw2d.js";import{c as U,a as M,u as w}from"./index-D5ir9iUV.js";import{P as y}from"./index-B8BS9wMC.js";import{c as I}from"./utils-DjqsqOe8.js";import"./index-DrWfGwtf.js";var E={exports:{}},A={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *
@@ -1,4 +1,4 @@
1
- import{j as t,J as u}from"./app.js";import{c as f}from"./compiler-runtime-tM4jBQ-T.js";import{g as d,e as x,d as h}from"./dropdown-menu-SEBnEIiL.js";import{UserInfo as y}from"./user-info-DBYoAJYJ.js";import{c as g}from"./createLucideIcon-BFG25zNo.js";import"./index-Cdb9ACvz.js";import"./index-D5ir9iUV.js";import"./index-K81GbF6O.js";import"./index-DrWfGwtf.js";import"./index-DEk3sC8d.js";import"./index-BbXEMx9n.js";import"./index-C0SL3SHw.js";import"./index-BC0yfOHo.js";import"./utils-DjqsqOe8.js";/**
1
+ import{j as t,J as u}from"./app.js";import{c as f}from"./compiler-runtime-hB6dAw2d.js";import{g as d,e as x,d as h}from"./dropdown-menu-Bhj17ENm.js";import{UserInfo as y}from"./user-info-DFrmpJ4y.js";import{c as g}from"./createLucideIcon-BFG25zNo.js";import"./index-CaJgc5EZ.js";import"./index-D5ir9iUV.js";import"./index-B8BS9wMC.js";import"./index-DrWfGwtf.js";import"./index-BKCgnGj_.js";import"./index-BbXEMx9n.js";import"./index-BykbU6Ee.js";import"./index-BC0yfOHo.js";import"./utils-DjqsqOe8.js";/**
2
2
  * @license lucide-react v0.485.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{q as s,j as i}from"./app.js";import{c as l}from"./compiler-runtime-hB6dAw2d.js";import{A as x}from"./app-layout-DYsRFUuP.js";import"./sidebar-CAHsHdjM.js";import"./index-DrWfGwtf.js";import"./button-C9B_5Jf_.js";import"./utils-DjqsqOe8.js";import"./index-Cw5o84pO.js";import"./createLucideIcon-BFG25zNo.js";import"./index-CaJgc5EZ.js";import"./index-D5ir9iUV.js";import"./index-B8BS9wMC.js";import"./index-BykbU6Ee.js";import"./index-BC0yfOHo.js";import"./tooltip-DHwpLKOI.js";import"./index-Cgp8OfuI.js";import"./app-shell-Dd9Eknik.js";import"./app-sidebar-BOmu6-Sl.js";import"./nav-main-Bq3IMk4C.js";import"./material-icon-BJg8o_fs.js";import"./chevron-right-D5q8rF7h.js";import"./index-BbXEMx9n.js";import"./index-BKCgnGj_.js";import"./chevrons-up-down-kALltqHV.js";import"./app-sidebar-header-CoXSzWxk.js";import"./breadcrumbs-BmAq4fHT.js";import"./nav-user-CbB22J5O.js";import"./dropdown-menu-Bhj17ENm.js";import"./user-info-DFrmpJ4y.js";import"./user-menu-content-DPXQdERj.js";import"./icon-Dt0vBgDO.js";import"./use-appearance-DRfIqTgw.js";const a=[];function J(){const t=l.c(8),r=s();let o;t[0]!==r.props.title?(o=r.props.title&&i.jsx("div",{className:"text-3xl mb-8",children:r.props.title}),t[0]=r.props.title,t[1]=o):o=t[1];let e;t[2]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"text-3xl mb-8",children:"Adminizer"}),t[2]=e):e=t[2];let p;t[3]!==r.props.text?(p=r.props.text&&i.jsx("div",{dangerouslySetInnerHTML:{__html:r.props.text}}),t[3]=r.props.text,t[4]=p):p=t[4];let m;return t[5]!==o||t[6]!==p?(m=i.jsx(x,{breadcrumbs:a,children:i.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[o,e,p]})}),t[5]=o,t[6]=p,t[7]=m):m=t[7],m}export{J as default};
@@ -14,10 +14,10 @@ export default async function add(req, res) {
14
14
  return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/${entity.uri}`);
15
15
  }
16
16
  if (req.adminizer.config.auth.enable) {
17
- if (!req.session.UserAP) {
17
+ if (!req.user) {
18
18
  return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
19
19
  }
20
- else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.session.UserAP)) {
20
+ else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.user)) {
21
21
  return res.sendStatus(403);
22
22
  }
23
23
  }
@@ -4,10 +4,10 @@ import { inertiaGroupHelper } from "../helpers/inertiaGroupHelper";
4
4
  export default async function addGroup(req, res) {
5
5
  let entity = ControllerHelper.findEntityObject(req);
6
6
  if (req.adminizer.config.auth.enable) {
7
- if (!req.session.UserAP) {
7
+ if (!req.user) {
8
8
  return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
9
9
  }
10
- else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.session.UserAP)) {
10
+ else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.user)) {
11
11
  return res.sendStatus(403);
12
12
  }
13
13
  }
@@ -25,7 +25,6 @@ export default async function addGroup(req, res) {
25
25
  groupedTokens[department] = req.adminizer.accessRightsHelper.getTokensByDepartment(department);
26
26
  }
27
27
  if (req.method.toUpperCase() === 'POST') {
28
- // console.log(req.body);
29
28
  let allTokens = req.adminizer.accessRightsHelper.getTokens();
30
29
  let usersInThisGroup = [];
31
30
  let tokensOfThisGroup = [];
@@ -60,7 +59,6 @@ export default async function addGroup(req, res) {
60
59
  Adminizer.log.error(e);
61
60
  req.session.messages.adminError.push(e.message || 'Something went wrong...');
62
61
  }
63
- // console.log(group)
64
62
  }
65
63
  const props = inertiaGroupHelper(entity, req, users, groupedTokens);
66
64
  return req.Inertia.render({
@@ -5,10 +5,10 @@ import { inertiaUserHelper } from "../helpers/inertiaUserHelper";
5
5
  export default async function (req, res) {
6
6
  let entity = ControllerHelper.findEntityObject(req);
7
7
  if (req.adminizer.config.auth.enable) {
8
- if (!req.session.UserAP) {
8
+ if (!req.user) {
9
9
  return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
10
10
  }
11
- else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.session.UserAP)) {
11
+ else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.user)) {
12
12
  return res.sendStatus(403);
13
13
  }
14
14
  }
@@ -22,7 +22,6 @@ export default async function (req, res) {
22
22
  }
23
23
  let user;
24
24
  if (req.method.toUpperCase() === 'POST') {
25
- // console.log(req.body);
26
25
  let userGroups = [];
27
26
  for (let key in req.body) {
28
27
  if (key.startsWith("group-checkbox-") && req.body[key] === true) {
@@ -40,12 +39,12 @@ export default async function (req, res) {
40
39
  locale = req.body.locale === 'default' ? req.adminizer.config.translation.defaultLocale : req.body.locale;
41
40
  }
42
41
  try {
43
- let passwordHashed = generate(req.body.login + req.body.userPassword);
42
+ let passwordHashed = generate(req.body.login + req.body.userPassword + process.env.AP_PASSWORD_SALT);
44
43
  let password = 'masked';
45
44
  // TODO refactor CRUD functions for DataAccessor usage
46
45
  user = await req.adminizer.modelHandler.model.get("UserAP")["_create"]({
47
46
  login: req.body.login, fullName: req.body.fullName, email: req.body.email,
48
- password: password, passwordHashed: passwordHashed, timezone: req.body.timezone, expires: req.body.date,
47
+ passwordHashed: passwordHashed, timezone: req.body.timezone, expires: req.body.date,
49
48
  locale: locale, isAdministrator: isAdministrator, isConfirmed: isConfirmed, groups: userGroups
50
49
  });
51
50
  Adminizer.log.debug(`A new user was created: `, user);
@@ -56,7 +55,6 @@ export default async function (req, res) {
56
55
  Adminizer.log.error(e);
57
56
  req.session.messages.adminError.push(e.message || 'Something went wrong...');
58
57
  }
59
- // console.log(user)
60
58
  }
61
59
  const props = inertiaUserHelper(entity, req, groups);
62
60
  return req.Inertia.render({
@@ -6,10 +6,10 @@ export async function catalogController(req, res) {
6
6
  let id = req.params.id ? req.params.id : '';
7
7
  const postfix = id ? `${slug}-${id}` : `${slug}`;
8
8
  if (req.adminizer.config.auth.enable) {
9
- if (!req.session.UserAP) {
9
+ if (!req.user) {
10
10
  return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
11
11
  }
12
- else if (!req.adminizer.accessRightsHelper.hasPermission(`catalog-${postfix}`, req.session.UserAP)) {
12
+ else if (!req.adminizer.accessRightsHelper.hasPermission(`catalog-${postfix}`, req.user)) {
13
13
  return res.sendStatus(403);
14
14
  }
15
15
  }
@@ -38,7 +38,7 @@ export class VueCatalog {
38
38
  obj[actionHandler.name] = "";
39
39
  }
40
40
  let messages = obj;
41
- req.i18n.setLocale(req.session.UserAP.locale);
41
+ req.i18n.setLocale(req.user.locale);
42
42
  let outMessages = {};
43
43
  for (const mess of Object.keys(messages)) {
44
44
  outMessages[mess] = req.i18n.__(mess);
@@ -114,7 +114,6 @@ export class VueCatalog {
114
114
  }
115
115
  // It’s unclear why he’s coming reqNodes
116
116
  for (const reqNode of reqNodes) {
117
- // console.log(">>>>>>>>>", "this.catalog.find", reqNode)
118
117
  const item = await this.catalog.find(reqNode.data);
119
118
  if (!item) {
120
119
  throw `reqNode Item not found`;
@@ -2,10 +2,9 @@ import { ControllerHelper } from "../helpers/controllerHelper";
2
2
  import * as fs from "fs";
3
3
  import { Adminizer } from "../lib/Adminizer";
4
4
  export default function upload(req, res) {
5
- //console.log('admin > CK-upload');
6
5
  let entity = ControllerHelper.findEntityObject(req);
7
6
  if (req.adminizer.config.auth.enable) {
8
- if (!req.session.UserAP) {
7
+ if (!req.user) {
9
8
  res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
10
9
  return;
11
10
  }
@@ -14,7 +13,7 @@ export default function upload(req, res) {
14
13
  `create-${entity.name}-model`,
15
14
  `update-${entity.name}-form`,
16
15
  `create-${entity.name}-form`
17
- ], req.session.UserAP)) {
16
+ ], req.user)) {
18
17
  res.sendStatus(403);
19
18
  return;
20
19
  }
@@ -1,10 +1,24 @@
1
1
  export default function (req, res) {
2
- if (req.adminizer.config.auth.enable && !req.session.UserAP) {
2
+ if (req.adminizer.config.auth.enable && !req.user) {
3
3
  return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
4
4
  }
5
5
  return req.Inertia.render({
6
6
  component: 'dashboard',
7
- props: null
7
+ props: {
8
+ title: req.i18n.__('Quick actions'),
9
+ tooltip: req.i18n.__('Toggle to change the grid. To save the grid, turn it off.'),
10
+ notWidgets: req.i18n.__('You don\'t have any widgets selected yet. You can add them by clicking on the plus sign at the top right.'),
11
+ notFound: req.i18n.__('No widgets found'),
12
+ actionsTitles: {
13
+ "All": req.i18n.__('All'),
14
+ 'Custom': req.i18n.__('Custom'),
15
+ 'Fast links': req.i18n.__('Fast links'),
16
+ 'Actions': req.i18n.__('Actions'),
17
+ 'Info': req.i18n.__('Info'),
18
+ 'Switcher': req.i18n.__('Switcher')
19
+ },
20
+ searchPlaceholder: req.i18n.__('Search'),
21
+ }
8
22
  });
9
23
  }
10
24
  ;
@@ -19,10 +19,10 @@ export default async function edit(req, res) {
19
19
  return res.redirect(`${req.adminizer.config.routePrefix}/${entity.uri}`);
20
20
  }
21
21
  if (req.adminizer.config.auth.enable) {
22
- if (!req.session.UserAP) {
22
+ if (!req.user) {
23
23
  return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
24
24
  }
25
- else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${entity.name}-model`, req.session.UserAP)) {
25
+ else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${entity.name}-model`, req.user)) {
26
26
  return res.sendStatus(403);
27
27
  }
28
28
  }
@@ -145,7 +145,6 @@ export default async function edit(req, res) {
145
145
  let fieldConfigConfig = fields[field].config;
146
146
  if (fieldConfigConfig.type === 'mediamanager') {
147
147
  if (fields[field].model.type === 'association-many') {
148
- console.log(fieldConfigConfig.options);
149
148
  record[field] = await getRelationsMediaManager({
150
149
  list: record[field],
151
150
  mediaManagerId: fieldConfigConfig.options.id ?? "default"
@@ -4,10 +4,10 @@ import { inertiaGroupHelper } from "../helpers/inertiaGroupHelper";
4
4
  export default async function editGroup(req, res) {
5
5
  let entity = ControllerHelper.findEntityObject(req);
6
6
  if (req.adminizer.config.auth.enable) {
7
- if (!req.session.UserAP) {
7
+ if (!req.user) {
8
8
  return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
9
9
  }
10
- else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${entity.name}-model`, req.session.UserAP)) {
10
+ else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${entity.name}-model`, req.user)) {
11
11
  return res.sendStatus(403);
12
12
  }
13
13
  }
@@ -40,7 +40,6 @@ export default async function editGroup(req, res) {
40
40
  }
41
41
  let reloadNeeded = false;
42
42
  if (req.method.toUpperCase() === 'POST') {
43
- // console.log(req.body);
44
43
  let allTokens = req.adminizer.accessRightsHelper.getTokens();
45
44
  let usersInThisGroup = [];
46
45
  let tokensOfThisGroup = [];
@@ -95,7 +94,6 @@ export default async function editGroup(req, res) {
95
94
  Adminizer.log.error(e);
96
95
  }
97
96
  }
98
- // console.log("GROUP", group)
99
97
  const props = inertiaGroupHelper(entity, req, users, groupedTokens, group);
100
98
  return req.Inertia.render({
101
99
  component: 'add-group',
@@ -5,10 +5,10 @@ import { inertiaUserHelper } from "../helpers/inertiaUserHelper";
5
5
  export default async function (req, res) {
6
6
  let entity = ControllerHelper.findEntityObject(req);
7
7
  if (req.adminizer.config.auth.enable) {
8
- if (!req.session.UserAP) {
8
+ if (!req.user) {
9
9
  return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
10
10
  }
11
- else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${entity.name}-model`, req.session.UserAP)) {
11
+ else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${entity.name}-model`, req.user)) {
12
12
  return res.sendStatus(403);
13
13
  }
14
14
  }
@@ -36,7 +36,6 @@ export default async function (req, res) {
36
36
  }
37
37
  let reloadNeeded = false;
38
38
  if (req.method.toUpperCase() === 'POST') {
39
- // console.log(req.body);
40
39
  let userGroups = [];
41
40
  for (let key in req.body) {
42
41
  if (key.startsWith("group-checkbox-") && req.body[key] === true) {
@@ -62,12 +61,11 @@ export default async function (req, res) {
62
61
  locale: locale, isAdministrator: isAdministrator, isConfirmed: isConfirmed, groups: userGroups
63
62
  });
64
63
  if (req.body.userPassword) {
65
- let passwordHashed = generate(req.body.login + req.body.userPassword);
64
+ let passwordHashed = generate(req.body.login + req.body.userPassword + process.env.AP_PASSWORD_SALT);
66
65
  let password = 'masked';
67
66
  // TODO refactor CRUD functions for DataAccessor usage
68
67
  updatedUser = await req.adminizer.modelHandler.model.get("UserAP")["_updateOne"]({ id: user.id }, {
69
68
  login: req.body.login,
70
- password: password,
71
69
  passwordHashed: passwordHashed
72
70
  });
73
71
  }
@@ -8,10 +8,10 @@ export default async function form(req, res) {
8
8
  return res.status(404).send({ error: 'Not Found' });
9
9
  }
10
10
  if (req.adminizer.config.auth.enable) {
11
- if (!req.session.UserAP) {
11
+ if (!req.user) {
12
12
  return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
13
13
  }
14
- else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${slug}-form`, req.session.UserAP)) {
14
+ else if (!req.adminizer.accessRightsHelper.hasPermission(`update-${slug}-form`, req.user)) {
15
15
  return res.sendStatus(403);
16
16
  }
17
17
  }
@@ -61,7 +61,6 @@ export default async function form(req, res) {
61
61
  }
62
62
  }
63
63
  const props = inertiaFormHelper(req, `${req.adminizer.config.routePrefix}/form/${slug}`, form);
64
- // console.log(props)
65
64
  return req.Inertia.render({
66
65
  component: 'form',
67
66
  props: props
@@ -1,15 +1,15 @@
1
1
  export default async function getAllWidgets(req, res) {
2
2
  if (req.adminizer.config.auth.enable) {
3
- if (!req.session.UserAP) {
3
+ if (!req.user) {
4
4
  return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
5
5
  }
6
- else if (!req.adminizer.accessRightsHelper.hasPermission(`widgets`, req.session.UserAP)) {
6
+ else if (!req.adminizer.accessRightsHelper.hasPermission(`widgets`, req.user)) {
7
7
  return res.sendStatus(403);
8
8
  }
9
9
  }
10
10
  if (req.method.toUpperCase() === 'GET') {
11
11
  try {
12
- return res.json({ widgets: await req.adminizer.widgetHandler.getAll(req.session.UserAP) });
12
+ return res.json({ widgets: await req.adminizer.widgetHandler.getAll(req.user, req.i18n) });
13
13
  }
14
14
  catch (e) {
15
15
  return res.status(500).send({ error: e.message || 'Internal Server Error' });