@betteroffice/docx 0.2.1 → 0.3.0

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 (69) hide show
  1. package/README.md +522 -3
  2. package/dist/{chunk-JHJLG4I6.mjs → chunk-5B4VMUXM.mjs} +1 -1
  3. package/dist/chunk-5JEQC76K.mjs +1 -0
  4. package/dist/chunk-7GJG6LLU.mjs +1 -0
  5. package/dist/chunk-FE6FWGBJ.mjs +1 -0
  6. package/dist/chunk-H5YYCN42.mjs +1 -0
  7. package/dist/chunk-NT2OYIJ4.mjs +57 -0
  8. package/dist/chunk-QE4ZDRKV.mjs +1 -0
  9. package/dist/chunk-VQXNED2P.mjs +2 -0
  10. package/dist/chunk-Z4HZIPBS.mjs +1 -0
  11. package/dist/collaboration/index.d.mts +8 -6
  12. package/dist/compareDocx-XXTZV4CG.mjs +1 -0
  13. package/dist/computeLayout-LWLAJWYA.mjs +1 -0
  14. package/dist/{content-CvEtPl0c.d.mts → content-BzoC6bSz.d.mts} +48 -8
  15. package/dist/core.d.mts +172 -9
  16. package/dist/core.mjs +1 -1
  17. package/dist/{displayListQueries-DF8F6fMl.d.mts → displayListQueries-BYFrBkw5.d.mts} +2 -2
  18. package/dist/docx/index.d.mts +5 -4
  19. package/dist/docx/index.mjs +1 -1
  20. package/dist/editor/index.d.mts +10 -8
  21. package/dist/editor/index.mjs +1 -1
  22. package/dist/{fontLoader-b8eicJKV.d.mts → fontLoader-CkXcPB1C.d.mts} +1 -1
  23. package/dist/{formatting-7zKCTu5a.d.mts → formatting-gqLFeJ9X.d.mts} +8 -0
  24. package/dist/{frameDelta-pA4jrQ1G.d.mts → frameDelta-CVt5FAXT.d.mts} +14 -3
  25. package/dist/generated/edit/docx_edit_bg.wasm +0 -0
  26. package/dist/generated/layout/docx_layout_bg.wasm +0 -0
  27. package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
  28. package/dist/generated/parse/docx_parse_bg.wasm +0 -0
  29. package/dist/{index-CHl2zLJ7.d.mts → index-BbZwdkPz.d.mts} +457 -29
  30. package/dist/layout/index.d.mts +6 -6
  31. package/dist/layout/index.mjs +1 -1
  32. package/dist/layout/pagination/index.d.mts +4 -4
  33. package/dist/layout/render/index.d.mts +12 -10
  34. package/dist/layout/render/index.mjs +1 -1
  35. package/dist/pagedExport-D3E4jZ-B.d.mts +907 -0
  36. package/dist/plugin-api/RenderedDomContext.d.mts +10 -9
  37. package/dist/plugin-api/RenderedDomContext.mjs +1 -1
  38. package/dist/plugin-api/index.d.mts +21 -4
  39. package/dist/plugin-api/resolveItemPositions.d.mts +3 -3
  40. package/dist/rezip-Bxiq4Z_R.d.mts +24 -0
  41. package/dist/{rustDisplayList-BJqaN9tt.d.mts → rustDisplayList-CwOoUn3t.d.mts} +2 -2
  42. package/dist/{rustMeasureSource-C0EZB055.d.mts → rustMeasureSource-CyBMcy1x.d.mts} +12 -4
  43. package/dist/{selectiveSave-CRh-_Y_C.d.mts → selectiveSave-r-NMK6aI.d.mts} +1 -22
  44. package/dist/styles/index.d.mts +2 -2
  45. package/dist/{styles-7e-mq3c-.d.mts → styles-AryxLAhx.d.mts} +1 -1
  46. package/dist/types/content.d.mts +2 -2
  47. package/dist/types/document.d.mts +6 -6
  48. package/dist/{types-C4A8mWjU.d.mts → types-B4jD0rrc.d.mts} +19 -2
  49. package/dist/utils/comments.d.mts +2 -2
  50. package/dist/utils/index.d.mts +7 -4
  51. package/dist/utils/index.mjs +1 -1
  52. package/dist/utils/stylePreview.d.mts +2 -2
  53. package/dist/wasm-G62X4WRW.mjs +1 -0
  54. package/dist/wasm-US6R7SWN.mjs +1 -0
  55. package/dist/wasm-edit.d.mts +246 -13
  56. package/dist/wasm-edit.mjs +1 -1
  57. package/dist/wasm-layout.d.mts +8 -1
  58. package/dist/wasm-layout.mjs +1 -1
  59. package/dist/yrs/index.d.mts +7 -5
  60. package/dist/yrs/index.mjs +1 -1
  61. package/dist/yrs/residentEngineWorker.mjs +1 -1
  62. package/package.json +2 -2
  63. package/dist/chunk-6LQJAKOC.mjs +0 -1
  64. package/dist/chunk-AFMVSI4Z.mjs +0 -57
  65. package/dist/chunk-GD4VNJ64.mjs +0 -1
  66. package/dist/chunk-WRWRCBLK.mjs +0 -1
  67. package/dist/chunk-WTFRNX5K.mjs +0 -1
  68. package/dist/wasm-7SOSHNGP.mjs +0 -1
  69. package/dist/wasm-ZQAVP7P2.mjs +0 -1
@@ -1 +0,0 @@
1
- import {a}from'./chunk-5F6DLQZP.mjs';var I=class{__destroy_into_raw(){let _=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),_}free(){let _=this.__destroy_into_raw();e.__wbg_editsession_free(_,0);}accept_change(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_accept_change(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}add_comment(_,r,o,t){let n,i;try{let a=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=d(o,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c,v=e.editsession_add_comment(this.__wbg_ptr,a,f,g,u,m,y,h,x);var l=v[0],s=v[1];if(v[3])throw l=0,s=0,w(v[2]);return n=l,i=s,p(l,s)}finally{e.__wbindgen_free(n,i,1);}}apply_delete(_,r){let o=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,n=e.editsession_apply_delete(this.__wbg_ptr,o,t,r);if(n[3])throw w(n[2]);var i=S(n[0],n[1]).slice();return e.__wbindgen_free(n[0],n[1]*1,1),i}apply_delete_profiled(_,r){let o=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,n=e.editsession_apply_delete_profiled(this.__wbg_ptr,o,t,r);if(n[3])throw w(n[2]);var i=S(n[0],n[1]).slice();return e.__wbindgen_free(n[0],n[1]*1,1),i}apply_input(_,r){let o=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,n=e.editsession_apply_input(this.__wbg_ptr,o,t,r);if(n[3])throw w(n[2]);var i=S(n[0],n[1]).slice();return e.__wbindgen_free(n[0],n[1]*1,1),i}apply_input_profile_json(){let _,r;try{let o=e.editsession_apply_input_profile_json(this.__wbg_ptr);return _=o[0],r=o[1],p(o[0],o[1])}finally{e.__wbindgen_free(_,r,1);}}apply_input_profiled(_,r){let o=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,n=e.editsession_apply_input_profiled(this.__wbg_ptr,o,t,r);if(n[3])throw w(n[2]);var i=S(n[0],n[1]).slice();return e.__wbindgen_free(n[0],n[1]*1,1),i}apply_local_update(_){let r=R(_,e.__wbindgen_malloc),o=c,t=e.editsession_apply_local_update(this.__wbg_ptr,r,o);if(t[1])throw w(t[0])}apply_paragraph_style(_,r,o,t,n,i,l,s){let a=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c;var v=j(l)?0:d(l,e.__wbindgen_malloc,e.__wbindgen_realloc),A=c,W=j(s)?0:d(s,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c;let k=e.editsession_apply_paragraph_style(this.__wbg_ptr,a,f,g,u,o,m,y,n,h,x,v,A,W,E);if(k[1])throw w(k[0])}apply_raw_ops(_,r){let o=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,n=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=e.editsession_apply_raw_ops(this.__wbg_ptr,o,t,n,i);if(l[1])throw w(l[0])}apply_seed_raw_ops(_,r){let o=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,n=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=e.editsession_apply_seed_raw_ops(this.__wbg_ptr,o,t,n,i);if(l[1])throw w(l[0])}apply_update(_){let r=R(_,e.__wbindgen_malloc),o=c,t=e.editsession_apply_update(this.__wbg_ptr,r,o);if(t[1])throw w(t[0])}apply_update_with_inference(_){let r,o;try{let i=R(_,e.__wbindgen_malloc),l=c,s=e.editsession_apply_update_with_inference(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}build_display_list_frame(_,r){let o=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,n=e.editsession_build_display_list_frame(this.__wbg_ptr,o,t,r);if(n[3])throw w(n[2]);var i=S(n[0],n[1]).slice();return e.__wbindgen_free(n[0],n[1]*1,1),i}build_display_list_json(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_build_display_list_json(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}can_redo(){return e.editsession_can_redo(this.__wbg_ptr)!==0}can_undo(){return e.editsession_can_undo(this.__wbg_ptr)!==0}cell_selection(){let _,r;try{let n=e.editsession_cell_selection(this.__wbg_ptr);var o=n[0],t=n[1];if(n[3])throw o=0,t=0,w(n[2]);return _=o,r=t,p(o,t)}finally{e.__wbindgen_free(_,r,1);}}clear_content_control_value(_){let r=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,t=e.editsession_clear_content_control_value(this.__wbg_ptr,r,o);if(t[1])throw w(t[0])}clear_formatting(_,r,o,t,n){let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),a=c,f=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=e.editsession_clear_formatting(this.__wbg_ptr,i,l,s,a,o,f,g,n);if(u[1])throw w(u[0])}clear_measure_fonts(){e.editsession_clear_measure_fonts(this.__wbg_ptr);}clear_update_event_observation(){e.editsession_clear_update_event_observation(this.__wbg_ptr);}clear_update_observer(){e.editsession_clear_update_observer(this.__wbg_ptr);}client_id(){return e.editsession_client_id(this.__wbg_ptr)}create_story(_,r,o,t){let n,i;try{let a=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=d(o,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c,v=e.editsession_create_story(this.__wbg_ptr,a,f,g,u,m,y,h,x);var l=v[0],s=v[1];if(v[3])throw l=0,s=0,w(v[2]);return n=l,i=s,p(l,s)}finally{e.__wbindgen_free(n,i,1);}}delete_column(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_delete_column(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}delete_range(_,r,o,t,n,i,l){let s,a;try{let x=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),v=c,A=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),W=c,E=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),k=c;var f=j(i)?0:d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=j(l)?0:d(l,e.__wbindgen_malloc,e.__wbindgen_realloc),m=c;let M=e.editsession_delete_range(this.__wbg_ptr,x,v,A,W,o,E,k,n,f,g,u,m);var y=M[0],h=M[1];if(M[3])throw y=0,h=0,w(M[2]);return s=y,a=h,p(y,h)}finally{e.__wbindgen_free(s,a,1);}}delete_row(_,r,o){let t,n;try{let u=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),m=c;var i=j(r)?0:d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=j(o)?0:d(o,e.__wbindgen_malloc,e.__wbindgen_realloc),a=c;let y=e.editsession_delete_row(this.__wbg_ptr,u,m,i,l,s,a);var f=y[0],g=y[1];if(y[3])throw f=0,g=0,w(y[2]);return t=f,n=g,p(f,g)}finally{e.__wbindgen_free(t,n,1);}}delete_story(_){let r=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,t=e.editsession_delete_story(this.__wbg_ptr,r,o);if(t[1])throw w(t[0])}delete_table(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_delete_table(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}display_hit_test_regions_json(_,r,o){let t,n;try{let s=e.editsession_display_hit_test_regions_json(this.__wbg_ptr,_,r,o);var i=s[0],l=s[1];if(s[3])throw i=0,l=0,w(s[2]);return t=i,n=l,p(i,l)}finally{e.__wbindgen_free(t,n,1);}}display_range_rects_json(_,r){let o,t;try{let l=e.editsession_display_range_rects_json(this.__wbg_ptr,_,r);var n=l[0],i=l[1];if(l[3])throw n=0,i=0,w(l[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}display_range_rects_region_json(_,r,o,t){let n,i;try{let a=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=e.editsession_display_range_rects_region_json(this.__wbg_ptr,a,f,g,u,o,t);var l=m[0],s=m[1];if(m[3])throw l=0,s=0,w(m[2]);return n=l,i=s,p(l,s)}finally{e.__wbindgen_free(n,i,1);}}display_vertical_move_json(_,r,o){let t,n;try{let s=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),a=c,f=e.editsession_display_vertical_move_json(this.__wbg_ptr,_,s,a,o);var i=f[0],l=f[1];if(f[3])throw i=0,l=0,w(f[2]);return t=i,n=l,p(i,l)}finally{e.__wbindgen_free(t,n,1);}}drain_update_event(){let _=e.editsession_drain_update_event(this.__wbg_ptr);var r=S(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*1,1),r}encode_diff(_){let r=R(_,e.__wbindgen_malloc),o=c,t=e.editsession_encode_diff(this.__wbg_ptr,r,o);if(t[3])throw w(t[2]);var n=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),n}encode_state(){let _=e.editsession_encode_state(this.__wbg_ptr);var r=S(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*1,1),r}encode_state_vector(){let _=e.editsession_encode_state_vector(this.__wbg_ptr);var r=S(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*1,1),r}encode_sticky_position(_,r,o){let t=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,i=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_encode_sticky_position(this.__wbg_ptr,t,n,i,l,o);if(s[3])throw w(s[2]);var a=S(s[0],s[1]).slice();return e.__wbindgen_free(s[0],s[1]*1,1),a}encoded_selection(){let _,r;try{let n=e.editsession_encoded_selection(this.__wbg_ptr);var o=n[0],t=n[1];if(n[3])throw o=0,t=0,w(n[2]);return _=o,r=t,p(o,t)}finally{e.__wbindgen_free(_,r,1);}}format_range(_,r,o,t,n,i){let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=e.editsession_format_range(this.__wbg_ptr,l,s,a,f,o,g,u,n,m,y);if(h[1])throw w(h[0])}history_stories(){let _=e.editsession_history_stories(this.__wbg_ptr);var r=q(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*4,4),r}insert_column(_,r){let o,t;try{let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=e.editsession_insert_column(this.__wbg_ptr,l,s,r);var n=a[0],i=a[1];if(a[3])throw n=0,i=0,w(a[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}insert_image(_,r,o,t,n,i){let l,s;try{let h=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c,v=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),A=c,W=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c;var a=j(n)?0:d(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=j(i)?0:d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c;let k=e.editsession_insert_image(this.__wbg_ptr,h,x,v,A,o,W,E,a,f,g,u);var m=k[0],y=k[1];if(k[3])throw m=0,y=0,w(k[2]);return l=m,s=y,p(m,y)}finally{e.__wbindgen_free(l,s,1);}}insert_page_break(_,r,o){let t=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,i=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_insert_page_break(this.__wbg_ptr,t,n,i,l,o);if(s[1])throw w(s[0])}insert_row(_,r,o,t){let n,i;try{let m=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c;var l=j(o)?0:d(o,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=j(t)?0:d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c;let h=e.editsession_insert_row(this.__wbg_ptr,m,y,r,l,s,a,f);var g=h[0],u=h[1];if(h[3])throw g=0,u=0,w(h[2]);return n=g,i=u,p(g,u)}finally{e.__wbindgen_free(n,i,1);}}insert_section_break(_,r,o,t){let n=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_insert_section_break(this.__wbg_ptr,n,i,l,s,o,a,f);if(g[1])throw w(g[0])}insert_table(_,r,o,t,n,i,l){let s,a;try{let x=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),v=c,A=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),W=c;var f=j(i)?0:d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=j(l)?0:d(l,e.__wbindgen_malloc,e.__wbindgen_realloc),m=c;let E=e.editsession_insert_table(this.__wbg_ptr,x,v,A,W,o,t,n,f,g,u,m);var y=E[0],h=E[1];if(E[3])throw y=0,h=0,w(E[2]);return s=y,a=h,p(y,h)}finally{e.__wbindgen_free(s,a,1);}}insert_text(_,r,o,t,n,i){let l,s;try{let h=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c,v=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),A=c,W=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c;var a=j(n)?0:d(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=j(i)?0:d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c;let k=e.editsession_insert_text(this.__wbg_ptr,h,x,v,A,o,W,E,a,f,g,u);var m=k[0],y=k[1];if(k[3])throw m=0,y=0,w(k[2]);return l=m,s=y,p(m,y)}finally{e.__wbindgen_free(l,s,1);}}insert_watermark(_,r,o,t){let n=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_insert_watermark(this.__wbg_ptr,n,i,l,s,o,a,f);if(g[1])throw w(g[0])}layout_document_json(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_layout_document_json(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}layout_document_with_regions_json(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_layout_document_with_regions_json(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}layout_document_with_regions_retained_json(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_layout_document_with_regions_retained_json(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}layout_font_requirements_json(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_layout_font_requirements_json(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}list_revisions(){let _,r;try{let n=e.editsession_list_revisions(this.__wbg_ptr);var o=n[0],t=n[1];if(n[3])throw o=0,t=0,w(n[2]);return _=o,r=t,p(o,t)}finally{e.__wbindgen_free(_,r,1);}}load(_){let r=R(_,e.__wbindgen_malloc),o=c,t=e.editsession_load(this.__wbg_ptr,r,o);if(t[1])throw w(t[0])}load_json(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_load_json(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}locate_paragraph(_,r){let o,t;try{let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_locate_paragraph(this.__wbg_ptr,l,s,a,f);var n=g[0],i=g[1];if(g[3])throw n=0,i=0,w(g[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}materialize_docx(){let _=e.editsession_materialize_docx(this.__wbg_ptr);if(_[3])throw w(_[2]);let r;return _[0]!==0&&(r=p(_[0],_[1]).slice(),e.__wbindgen_free(_[0],_[1]*1,1)),r}measure_paragraph_json(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_measure_paragraph_json(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}merge_cells(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_merge_cells(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}merge_paragraphs(_,r,o,t){let n,i;try{let m=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c;var l=j(o)?0:d(o,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=j(t)?0:d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c;let v=e.editsession_merge_paragraphs(this.__wbg_ptr,m,y,h,x,l,s,a,f);var g=v[0],u=v[1];if(v[3])throw g=0,u=0,w(v[2]);return n=g,i=u,p(g,u)}finally{e.__wbindgen_free(n,i,1);}}constructor(_){let r=e.editsession_new(_);if(r[2])throw w(r[1]);return this.__wbg_ptr=r[0],V.register(this,this.__wbg_ptr,this),this}open_docx(_,r){let o,t;try{let l=R(_,e.__wbindgen_malloc),s=c,a=e.editsession_open_docx(this.__wbg_ptr,l,s,r);var n=a[0],i=a[1];if(a[3])throw n=0,i=0,w(a[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}outline_glyph_json(_,r){let o,t;try{let l=e.editsession_outline_glyph_json(this.__wbg_ptr,_,r);var n=l[0],i=l[1];if(l[3])throw n=0,i=0,w(l[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}paragraph_spans(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_paragraph_spans(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}paragraphs(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_paragraphs(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}redo(){return e.editsession_redo(this.__wbg_ptr)!==0}register_measure_font(_){let r=R(_,e.__wbindgen_malloc),o=c,t=e.editsession_register_measure_font(this.__wbg_ptr,r,o);if(t[2])throw w(t[1]);return t[0]>>>0}reject_change(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_reject_change(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}replace_range(_,r,o,t,n,i,l,s){let a,f;try{let v=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),A=c,W=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c,k=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),M=c,Y=d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),H=c;var g=j(l)?0:d(l,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=j(s)?0:d(s,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c;let U=e.editsession_replace_range(this.__wbg_ptr,v,A,W,E,o,k,M,n,Y,H,g,u,m,y);var h=U[0],x=U[1];if(U[3])throw h=0,x=0,w(U[2]);return a=h,f=x,p(h,x)}finally{e.__wbindgen_free(a,f,1);}}resident_caret_snapshot_json(){let _,r;try{let n=e.editsession_resident_caret_snapshot_json(this.__wbg_ptr);var o=n[0],t=n[1];if(n[3])throw o=0,t=0,w(n[2]);return _=o,r=t,p(o,t)}finally{e.__wbindgen_free(_,r,1);}}resolve_comment(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_resolve_comment(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}resolve_encoded_selection(_,r,o){let t,n;try{let s=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),a=c,f=R(r,e.__wbindgen_malloc),g=c,u=R(o,e.__wbindgen_malloc),m=c,y=e.editsession_resolve_encoded_selection(this.__wbg_ptr,s,a,f,g,u,m);var i=y[0],l=y[1];if(y[3])throw i=0,l=0,w(y[2]);return t=i,n=l,p(i,l)}finally{e.__wbindgen_free(t,n,1);}}resolve_sticky_position(_,r){let o,t;try{let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=R(r,e.__wbindgen_malloc),f=c,g=e.editsession_resolve_sticky_position(this.__wbg_ptr,l,s,a,f);var n=g[0],i=g[1];if(g[3])throw n=0,i=0,w(g[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}retained_kernel_inputs_json(){let _,r;try{let n=e.editsession_retained_kernel_inputs_json(this.__wbg_ptr);var o=n[0],t=n[1];if(n[3])throw o=0,t=0,w(n[2]);return _=o,r=t,p(o,t)}finally{e.__wbindgen_free(_,r,1);}}seed_from_docx(_){let r,o;try{let i=R(_,e.__wbindgen_malloc),l=c,s=e.editsession_seed_from_docx(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}select_story(_){let r=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c;e.editsession_select_story(this.__wbg_ptr,r,o);}selection(){let _,r;try{let n=e.editsession_selection(this.__wbg_ptr);var o=n[0],t=n[1];if(n[3])throw o=0,t=0,w(n[2]);return _=o,r=t,p(o,t)}finally{e.__wbindgen_free(_,r,1);}}selection_context(_,r,o,t,n){let i,l;try{let f=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),m=c,y=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),h=c,x=e.editsession_selection_context(this.__wbg_ptr,f,g,u,m,o,y,h,n);var s=x[0],a=x[1];if(x[3])throw s=0,a=0,w(x[2]);return i=s,l=a,p(s,a)}finally{e.__wbindgen_free(i,l,1);}}set_cell_borders(_,r){let o,t;try{let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_set_cell_borders(this.__wbg_ptr,l,s,a,f);var n=g[0],i=g[1];if(g[3])throw n=0,i=0,w(g[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}set_cell_selection(_){let r=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,t=e.editsession_set_cell_selection(this.__wbg_ptr,r,o);if(t[1])throw w(t[0])}set_cell_shading(_,r){let o,t;try{let a=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c;var n=j(r)?0:d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c;let g=e.editsession_set_cell_shading(this.__wbg_ptr,a,f,n,i);var l=g[0],s=g[1];if(g[3])throw l=0,s=0,w(g[2]);return o=l,t=s,p(l,s)}finally{e.__wbindgen_free(o,t,1);}}set_cell_text_format(_,r){let o,t;try{let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_set_cell_text_format(this.__wbg_ptr,l,s,a,f);var n=g[0],i=g[1];if(g[3])throw n=0,i=0,w(g[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}set_column_width(_,r){let o,t;try{let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=e.editsession_set_column_width(this.__wbg_ptr,l,s,r);var n=a[0],i=a[1];if(a[3])throw n=0,i=0,w(a[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}set_content_control_value(_,r){let o=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,n=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=e.editsession_set_content_control_value(this.__wbg_ptr,o,t,n,i);if(l[1])throw w(l[0])}set_content_control_value_at(_,r,o,t){let n=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_set_content_control_value_at(this.__wbg_ptr,n,i,l,s,o,a,f);if(g[1])throw w(g[0])}set_hyperlink(_,r,o,t,n,i){let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=e.editsession_set_hyperlink(this.__wbg_ptr,l,s,a,f,o,g,u,n,m,y);if(h[1])throw w(h[0])}set_image_geometry(_,r){let o=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=c,n=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),i=c,l=e.editsession_set_image_geometry(this.__wbg_ptr,o,t,n,i);if(l[1])throw w(l[0])}set_paragraph_attr(_,r,o){let t=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=c,i=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=d(o,e.__wbindgen_malloc,e.__wbindgen_realloc),a=c,f=e.editsession_set_paragraph_attr(this.__wbg_ptr,t,n,i,l,s,a);if(f[1])throw w(f[0])}set_paragraph_attrs(_,r,o,t,n,i,l,s){let a=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),x=c;var v=j(l)?0:d(l,e.__wbindgen_malloc,e.__wbindgen_realloc),A=c,W=j(s)?0:d(s,e.__wbindgen_malloc,e.__wbindgen_realloc),E=c;let k=e.editsession_set_paragraph_attrs(this.__wbg_ptr,a,f,g,u,o,m,y,n,h,x,v,A,W,E);if(k[1])throw w(k[0])}set_selection(_,r,o,t,n){let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),a=c,f=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c,u=e.editsession_set_selection(this.__wbg_ptr,i,l,s,a,o,f,g,n);if(u[1])throw w(u[0])}set_table_width(_,r){let o,t;try{let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=e.editsession_set_table_width(this.__wbg_ptr,l,s,r);var n=a[0],i=a[1];if(a[3])throw n=0,i=0,w(a[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}set_update_observer(_){let r=e.editsession_set_update_observer(this.__wbg_ptr,_);if(r[1])throw w(r[0])}split_cell(_,r,o){let t,n;try{let s=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),a=c,f=e.editsession_split_cell(this.__wbg_ptr,s,a,j(r)?Number.MAX_SAFE_INTEGER:r>>>0,j(o)?Number.MAX_SAFE_INTEGER:o>>>0);var i=f[0],l=f[1];if(f[3])throw i=0,l=0,w(f[2]);return t=i,n=l,p(i,l)}finally{e.__wbindgen_free(t,n,1);}}split_paragraph(_,r,o,t,n){let i,l;try{let y=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),h=c,x=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),v=c;var s=j(t)?0:d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),a=c,f=j(n)?0:d(n,e.__wbindgen_malloc,e.__wbindgen_realloc),g=c;let A=e.editsession_split_paragraph(this.__wbg_ptr,y,h,x,v,o,s,a,f,g);var u=A[0],m=A[1];if(A[3])throw u=0,m=0,w(A[2]);return i=u,l=m,p(u,m)}finally{e.__wbindgen_free(i,l,1);}}start_update_event_observation(){let _=e.editsession_start_update_event_observation(this.__wbg_ptr);if(_[1])throw w(_[0])}story_checksum(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_story_checksum(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}story_ids(){let _=e.editsession_story_ids(this.__wbg_ptr);var r=q(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*4,4),r}story_len(_){let r=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=c,t=e.editsession_story_len(this.__wbg_ptr,r,o);if(t[2])throw w(t[1]);return t[0]>>>0}story_segments(_){let r,o;try{let i=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=c,s=e.editsession_story_segments(this.__wbg_ptr,i,l);var t=s[0],n=s[1];if(s[3])throw t=0,n=0,w(s[2]);return r=t,o=n,p(t,n)}finally{e.__wbindgen_free(r,o,1);}}toggle_mark(_,r,o,t,n,i){let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=d(t,e.__wbindgen_malloc,e.__wbindgen_realloc),u=c,m=d(i,e.__wbindgen_malloc,e.__wbindgen_realloc),y=c,h=e.editsession_toggle_mark(this.__wbg_ptr,l,s,a,f,o,g,u,n,m,y);if(h[1])throw w(h[0])}track_undo(){e.editsession_track_undo(this.__wbg_ptr);}undo(){return e.editsession_undo(this.__wbg_ptr)!==0}yrs_blocks_for_story(_,r){let o,t;try{let l=d(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=c,a=d(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=c,g=e.editsession_yrs_blocks_for_story(this.__wbg_ptr,l,s,a,f);var n=g[0],i=g[1];if(g[3])throw n=0,i=0,w(g[2]);return o=n,t=i,p(n,i)}finally{e.__wbindgen_free(o,t,1);}}};Symbol.dispose&&(I.prototype[Symbol.dispose]=I.prototype.free);function C(){return {__proto__:null,"./docx_edit_bg.js":{__proto__:null,__wbg___wbindgen_throw_344f42d3211c4765:function(_,r){throw new Error(p(_,r))},__wbg_call_e3b662382210db98:function(){return B(function(_,r,o,t){return _.call(r,o,t)},arguments)},__wbg_error_b18880534f2a3062:function(_,r){console.error(p(_,r));},__wbg_getRandomValues_3f44b700395062e5:function(){return B(function(_,r){globalThis.crypto.getRandomValues(S(_,r));},arguments)},__wbg_new_from_slice_77cdfb7977362f3c:function(_,r){return new Uint8Array(S(_,r))},__wbg_now_2e73155e6756a923:function(){return performance.now()},__wbg_now_86c0d4ba3fa605b8:function(){return Date.now()},__wbindgen_cast_0000000000000001:function(_){return _},__wbindgen_cast_0000000000000002:function(_,r){return p(_,r)},__wbindgen_init_externref_table:function(){let _=e.__wbindgen_externrefs,r=_.grow(4);_.set(0,void 0),_.set(r+0,void 0),_.set(r+1,null),_.set(r+2,true),_.set(r+3,false);}}}}var V=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(b=>e.__wbg_editsession_free(b,1));function Z(b){let _=e.__externref_table_alloc();return e.__wbindgen_externrefs.set(_,b),_}function q(b,_){b=b>>>0;let r=$(),o=[];for(let t=b;t<b+4*_;t+=4)o.push(e.__wbindgen_externrefs.get(r.getUint32(t,true)));return e.__externref_drop_slice(b,_),o}function S(b,_){return b=b>>>0,z().subarray(b/1,b/1+_)}var T=null;function $(){return (T===null||T.buffer.detached===true||T.buffer.detached===void 0&&T.buffer!==e.memory.buffer)&&(T=new DataView(e.memory.buffer)),T}function p(b,_){return _e(b>>>0,_)}var F=null;function z(){return (F===null||F.byteLength===0)&&(F=new Uint8Array(e.memory.buffer)),F}function B(b,_){try{return b.apply(this,_)}catch(r){let o=Z(r);e.__wbindgen_exn_store(o);}}function j(b){return b==null}function R(b,_){let r=_(b.length*1,1)>>>0;return z().set(b,r/1),c=b.length,r}function d(b,_,r){if(r===void 0){let l=O.encode(b),s=_(l.length,1)>>>0;return z().subarray(s,s+l.length).set(l),c=l.length,s}let o=b.length,t=_(o,1)>>>0,n=z(),i=0;for(;i<o;i++){let l=b.charCodeAt(i);if(l>127)break;n[t+i]=l;}if(i!==o){i!==0&&(b=b.slice(i)),t=r(t,o,o=i+b.length*3,1)>>>0;let l=z().subarray(t+i,t+o),s=O.encodeInto(b,l);i+=s.written,t=r(t,o,i,1)>>>0;}return c=i,t}function w(b){let _=e.__wbindgen_externrefs.get(b);return e.__externref_table_dealloc(b),_}var D=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true});D.decode();var ee=2146435072,L=0;function _e(b,_){return L+=_,L>=ee&&(D=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}),D.decode(),L=_),D.decode(z().subarray(b,b+_))}var O=new TextEncoder;"encodeInto"in O||(O.encodeInto=function(b,_){let r=O.encode(b);return _.set(r),{read:b.length,written:r.length}});var c=0,e;function P(b,_){return e=b.exports,T=null,F=null,e.__wbindgen_start(),e}async function re(b,_){if(typeof Response=="function"&&b instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(b,_)}catch(t){if(b.ok&&r(b.type)&&b.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t);else throw t}let o=await b.arrayBuffer();return await WebAssembly.instantiate(o,_)}else {let o=await WebAssembly.instantiate(b,_);return o instanceof WebAssembly.Instance?{instance:o,module:b}:o}function r(o){switch(o){case "basic":case "cors":case "default":return true}return false}}function X(b){if(e!==void 0)return e;b!==void 0&&(Object.getPrototypeOf(b)===Object.prototype?{module:b}=b:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let _=C();b instanceof WebAssembly.Module||(b=new WebAssembly.Module(b));let r=new WebAssembly.Instance(b,_);return P(r)}async function G(b){if(e!==void 0)return e;if(b!==void 0&&(Object.getPrototypeOf(b)===Object.prototype?{module_or_path:b}=b:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),b===void 0)throw new Error("docx-edit requires an explicit module or URL");let _=C();(typeof b=="string"||typeof Request=="function"&&b instanceof Request||typeof URL=="function"&&b instanceof URL)&&(b=fetch(b));let{instance:r,module:o}=await re(await b,_);return P(r)}var J=a({label:"docx-edit",preloadName:"preloadEditWasm",assetUrl:()=>new URL("./generated/edit/docx_edit_bg.wasm",import.meta.url),initAsync:G,initSync:X});function ce(b){return J.preload(b)}function de(b){return J.ensure(),new I(b)}export{ce as a,de as b};
@@ -1 +0,0 @@
1
- function C(s){return Array.from(s.querySelectorAll("canvas[data-page-index]"))}function T(s,c,a,o){let h=s.querySelector(`canvas[data-page-index="${a}"]`);if(h){let e=h.getBoundingClientRect();if(e.width>0&&e.height>0)return e}let p=c.pageSize(a);if(!p||p.width<=0||p.height<=0)return null;let r=s.getBoundingClientRect();if(r.width<=0)return null;let n=s.offsetWidth||s.clientWidth||r.width,i=n>0?r.width/n:1,g=Number.isFinite(i)&&i>0?i:1,l=o?.pageGap??24,f=o?.paddingTop??l;for(let e=0;e<a;e++)f+=(c.pageSize(e)?.height??0)+l;let u=p.width*g,m=p.height*g,t=r.left+(r.width-u)/2,d=r.top+f*g;return {left:t,top:d,right:t+u,bottom:d+m,width:u,height:m}}function H(s,c,a,o,h){let p=C(s),r=new Map;for(let t of p){let d=Number(t.dataset.pageIndex);Number.isFinite(d)&&r.set(d,t);}let n=null,i=null;for(let t=0;t<c.pageCount();t++){let e=r.get(t)?.getBoundingClientRect()??T(s,c,t,h);if(!e||e.width<=0||e.height<=0)continue;if(a>=e.left&&a<=e.right&&o>=e.top&&o<=e.bottom){n={pageIndex:t,rect:e};break}let y=o<e.top?e.top-o:Math.max(0,o-e.bottom),v=a<e.left?e.left-a:Math.max(0,a-e.right),x=y*4+v;(!i||x<i.dist)&&(i={pageIndex:t,rect:e,dist:x});}if(!n){if(!h?.clampToNearestPage||!i)return null;n={pageIndex:i.pageIndex,rect:i.rect};}let g=n.pageIndex,l=c.pageSize(g);if(!l)return null;let b=l.width/n.rect.width,f=l.height/n.rect.height,u=Math.min(Math.max((a-n.rect.left)*b,0),l.width),m=Math.min(Math.max((o-n.rect.top)*f,0),l.height);return {pageIndex:g,x:u,y:m,hit:c.hitTestRegions(g,u,m)}}export{T as a,H as b};
@@ -1 +0,0 @@
1
- import {a as a$1}from'./chunk-5F6DLQZP.mjs';import {a}from'./chunk-TTRUPDAB.mjs';var S={};a(S,{build_display_list_json:()=>A,clear_measure_fonts:()=>D,close_display_list:()=>P,default:()=>J,hit_test_json:()=>X,hit_test_regions_by_handle:()=>z,hit_test_regions_json:()=>M,initSync:()=>H,install_panic_hook:()=>N,layout_document_json:()=>T,measure_paragraph_json:()=>W,open_display_list:()=>Y,outline_glyph_json:()=>O,range_rects_by_handle:()=>K,range_rects_json:()=>B,range_rects_region_by_handle:()=>Q,range_rects_region_json:()=>Z,register_measure_font:()=>I,update_display_list:()=>$,vertical_move_by_handle:()=>ee,vertical_move_json:()=>ne});function A(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=d,s=o.build_display_list_json(_,a);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,y(s[2]);return n=r,t=i,b(r,i)}finally{o.__wbindgen_free(n,t,1);}}function D(){o.clear_measure_fonts();}function P(e){o.close_display_list(e);}function X(e,n,t,r){let i,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),f=d,u=o.hit_test_json(l,f,n,t,r);var a=u[0],s=u[1];if(u[3])throw a=0,s=0,y(u[2]);return i=a,_=s,b(a,s)}finally{o.__wbindgen_free(i,_,1);}}function z(e,n,t,r){let i,_;try{let l=o.hit_test_regions_by_handle(e,n,t,r);var a=l[0],s=l[1];if(l[3])throw a=0,s=0,y(l[2]);return i=a,_=s,b(a,s)}finally{o.__wbindgen_free(i,_,1);}}function M(e,n,t,r){let i,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),f=d,u=o.hit_test_regions_json(l,f,n,t,r);var a=u[0],s=u[1];if(u[3])throw a=0,s=0,y(u[2]);return i=a,_=s,b(a,s)}finally{o.__wbindgen_free(i,_,1);}}function N(){o.install_panic_hook();}function T(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=d,s=o.layout_document_json(_,a);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,y(s[2]);return n=r,t=i,b(r,i)}finally{o.__wbindgen_free(n,t,1);}}function W(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=d,s=o.measure_paragraph_json(_,a);var r=s[0],i=s[1];if(s[3])throw r=0,i=0,y(s[2]);return n=r,t=i,b(r,i)}finally{o.__wbindgen_free(n,t,1);}}function Y(e){let n=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),t=d,r=o.open_display_list(n,t);if(r[2])throw y(r[1]);return r[0]>>>0}function O(e,n){let t,r;try{let a=o.outline_glyph_json(e,n);var i=a[0],_=a[1];if(a[3])throw i=0,_=0,y(a[2]);return t=i,r=_,b(i,_)}finally{o.__wbindgen_free(t,r,1);}}function K(e,n,t){let r,i;try{let s=o.range_rects_by_handle(e,n,t);var _=s[0],a=s[1];if(s[3])throw _=0,a=0,y(s[2]);return r=_,i=a,b(_,a)}finally{o.__wbindgen_free(r,i,1);}}function B(e,n,t){let r,i;try{let s=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),l=d,f=o.range_rects_json(s,l,n,t);var _=f[0],a=f[1];if(f[3])throw _=0,a=0,y(f[2]);return r=_,i=a,b(_,a)}finally{o.__wbindgen_free(r,i,1);}}function Q(e,n,t,r,i){let _,a;try{let f=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),u=d,h=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),m=d,w=o.range_rects_region_by_handle(e,f,u,h,m,r,i);var s=w[0],l=w[1];if(w[3])throw s=0,l=0,y(w[2]);return _=s,a=l,b(s,l)}finally{o.__wbindgen_free(_,a,1);}}function Z(e,n,t,r,i){let _,a;try{let f=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),u=d,h=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),m=d,w=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),F=d,E=o.range_rects_region_json(f,u,h,m,w,F,r,i);var s=E[0],l=E[1];if(E[3])throw s=0,l=0,y(E[2]);return _=s,a=l,b(s,l)}finally{o.__wbindgen_free(_,a,1);}}function I(e){let n=te(e,o.__wbindgen_malloc),t=d,r=o.register_measure_font(n,t);if(r[2])throw y(r[1]);return r[0]>>>0}function $(e,n){let t=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),r=d,i=o.update_display_list(e,t,r);if(i[1])throw y(i[0])}function ee(e,n,t,r){let i,_;try{let l=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),f=d,u=o.vertical_move_by_handle(e,n,l,f,r);var a=u[0],s=u[1];if(u[3])throw a=0,s=0,y(u[2]);return i=a,_=s,b(a,s)}finally{o.__wbindgen_free(i,_,1);}}function ne(e,n,t,r){let i,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),f=d,u=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),h=d,m=o.vertical_move_json(l,f,n,u,h,r);var a=m[0],s=m[1];if(m[3])throw a=0,s=0,y(m[2]);return i=a,_=s,b(a,s)}finally{o.__wbindgen_free(i,_,1);}}function k(){return {__proto__:null,"./docx_layout_bg.js":{__proto__:null,__wbg_error_b18880534f2a3062:function(n,t){console.error(b(n,t));},__wbindgen_cast_0000000000000001:function(n,t){return b(n,t)},__wbindgen_init_externref_table:function(){let n=o.__wbindgen_externrefs,t=n.grow(4);n.set(0,void 0),n.set(t+0,void 0),n.set(t+1,null),n.set(t+2,true),n.set(t+3,false);}}}}function b(e,n){return oe(e>>>0,n)}var x=null;function v(){return (x===null||x.byteLength===0)&&(x=new Uint8Array(o.memory.buffer)),x}function te(e,n){let t=n(e.length*1,1)>>>0;return v().set(e,t/1),d=e.length,t}function g(e,n,t){if(t===void 0){let s=R.encode(e),l=n(s.length,1)>>>0;return v().subarray(l,l+s.length).set(s),d=s.length,l}let r=e.length,i=n(r,1)>>>0,_=v(),a=0;for(;a<r;a++){let s=e.charCodeAt(a);if(s>127)break;_[i+a]=s;}if(a!==r){a!==0&&(e=e.slice(a)),i=t(i,r,r=a+e.length*3,1)>>>0;let s=v().subarray(i+a,i+r),l=R.encodeInto(e,s);a+=l.written,i=t(i,r,a,1)>>>0;}return d=a,i}function y(e){let n=o.__wbindgen_externrefs.get(e);return o.__externref_table_dealloc(e),n}var j=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true});j.decode();var re=2146435072,L=0;function oe(e,n){return L+=n,L>=re&&(j=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}),j.decode(),L=n),j.decode(v().subarray(e,e+n))}var R=new TextEncoder;"encodeInto"in R||(R.encodeInto=function(e,n){let t=R.encode(e);return n.set(t),{read:e.length,written:t.length}});var d=0,o;function q(e,n){return o=e.exports,x=null,o.__wbindgen_start(),o}async function ae(e,n){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,n)}catch(i){if(e.ok&&t(e.type)&&e.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,n)}else {let r=await WebAssembly.instantiate(e,n);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}function t(r){switch(r){case "basic":case "cors":case "default":return true}return false}}function H(e){if(o!==void 0)return o;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let n=k();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let t=new WebAssembly.Instance(e,n);return q(t)}async function J(e){if(o!==void 0)return o;if(e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),e===void 0)throw new Error("docx-layout requires an explicit module or URL");let n=k();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:t,module:r}=await ae(await e,n);return q(t)}var c=a$1({label:"docx-layout",preloadName:"preloadLayoutWasm",assetUrl:()=>new URL("./generated/layout/docx_layout_bg.wasm",import.meta.url),initAsync:J,initSync:H});function de(e){return c.preload(e)}function fe(e,n,t,r){return c.ensure(),M(e,n,t,r)}function ge(e,n,t){return c.ensure(),B(e,n,t)}function p(e){let n=S[e];return typeof n=="function"?n:void 0}function ye(){return c.ensure(),p("open_display_list")!==void 0}function be(){return c.ensure(),p("range_rects_region_json")!==void 0}function pe(e){c.ensure();let n=p("open_display_list");if(!n)throw new Error("open_display_list is not available in the embedded layout wasm yet");return n(e)}function me(e){c.ensure(),p("close_display_list")?.(e);}function we(e,n){c.ensure();let t=p("update_display_list");if(!t)throw new Error("update_display_list is not available in the embedded layout wasm yet");t(e,n);}function he(){return c.ensure(),p("update_display_list")!==void 0}function xe(e,n,t,r){c.ensure();let i=p("hit_test_regions_by_handle");if(!i)throw new Error("hit_test_regions_by_handle is not available in the embedded layout wasm yet");return i(e,n,t,r)}function ve(e,n,t,r){c.ensure();let i=p("vertical_move_json");if(!i)throw new Error("vertical_move_json is not available in the embedded layout wasm");return i(e,n,t,r)}function Re(e,n,t,r){c.ensure();let i=p("vertical_move_by_handle");if(!i)throw new Error("vertical_move_by_handle is not available in the embedded layout wasm");return i(e,n,t,r)}function Ee(e,n,t){c.ensure();let r=p("range_rects_by_handle");if(!r)throw new Error("range_rects_by_handle is not available in the embedded layout wasm yet");return r(e,n,t)}function je(e,n,t,r,i){c.ensure();let _=p("range_rects_region_json");if(!_)throw new Error("range_rects_region_json is not available in the embedded layout wasm yet");return _(e,n,t,r,i)}function Le(e,n,t,r,i){c.ensure();let _=p("range_rects_region_by_handle");if(!_)throw new Error("range_rects_region_by_handle is not available in the embedded layout wasm yet");return _(e,n,t,r,i)}function Ae(e){return c.ensure(),A(e)}function De(e){return c.ensure(),T(e)}function Me(e){return c.ensure(),I(e)}function Te(){c.ensure(),D();}function We(e){return c.ensure(),W(e)}function _e(){let e=O;return typeof e=="function"?e:void 0}function Oe(e,n){c.ensure();let t=_e();if(!t)throw new Error("outline_glyph_json is not available in the embedded layout wasm yet");return t(e,n)}export{de as a,fe as b,ge as c,ye as d,be as e,pe as f,me as g,we as h,he as i,xe as j,ve as k,Re as l,Ee as m,je as n,Le as o,Ae as p,De as q,Me as r,Te as s,We as t,Oe as u};
@@ -1 +0,0 @@
1
- import'./chunk-EUUIJVM6.mjs';export{b as createEditSession,a as preloadEditWasm}from'./chunk-GD4VNJ64.mjs';import'./chunk-5F6DLQZP.mjs';import'./chunk-TTRUPDAB.mjs';
@@ -1 +0,0 @@
1
- export{p as buildDisplayListJson,s as clearMeasureFonts,g as closeDisplayList,d as hasDisplayListSession,i as hasDisplayListUpdate,e as hasRangeRectsRegion,j as hitTestRegionsByHandle,b as hitTestRegionsJson,q as layoutDocumentJson,t as measureParagraphJson,f as openDisplayList,u as outlineGlyphJson,a as preloadLayoutWasm,m as rangeRectsByHandle,c as rangeRectsJson,o as rangeRectsRegionByHandle,n as rangeRectsRegionJson,r as registerMeasureFont,h as updateDisplayList,l as verticalMoveByHandle,k as verticalMoveJson}from'./chunk-WTFRNX5K.mjs';import'./chunk-5F6DLQZP.mjs';import'./chunk-TTRUPDAB.mjs';