document-model 1.0.40 → 1.0.41
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.
- package/dist/browser/document-model.cjs +1 -1
- package/dist/browser/document-model.js +2 -2
- package/dist/browser/document.cjs +1 -1
- package/dist/browser/document.js +2 -2
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.js +3 -3
- package/dist/{node/internal/index-DyCS1h0M.js → browser/internal/index-BD_7XeO5.js} +1 -1
- package/dist/{node/internal/index-Dl5T5qdc.js → browser/internal/index-BNBYVtaF.js} +1 -1
- package/dist/browser/internal/{index-4Z_H8F_J.js → index-BWV1Osza.js} +1 -1
- package/dist/browser/internal/{index-6u2yDIEF.js → index-BxGRRPwY.js} +1 -1
- package/dist/browser/internal/{object-EriwiDIs.js → object-DHqlosWD.js} +3 -3
- package/dist/browser/internal/{object-Fq6PThAX.js → object-StihF423.js} +413 -413
- package/dist/node/document-model.cjs +1 -1
- package/dist/node/document-model.js +2 -2
- package/dist/node/document.cjs +1 -1
- package/dist/node/document.js +2 -2
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.js +3 -3
- package/dist/node/internal/{index-A6Rqm2SZ.js → index-DeKx7EaE.js} +1 -1
- package/dist/node/internal/{index-BpBnSlTZ.js → index-Dh0vfIdX.js} +1 -1
- package/dist/{browser/internal/index-QJX_Fa1V.js → node/internal/index-LD_vrQff.js} +1 -1
- package/dist/{browser/internal/index-DQeD1Q-a.js → node/internal/index-LEexvgqj.js} +1 -1
- package/dist/node/internal/object-CKxJA706.js +2 -0
- package/dist/node/internal/{object-S6TngMa9.js → object-CudRLU4J.js} +62 -62
- package/package.json +1 -1
- package/dist/node/internal/object-ifvac9k2.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./internal/object-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./internal/object-CKxJA706.js");require("immer");require("json-stringify-deterministic");require("crypto");require("fs");require("https");require("path");require("jszip");const e=require("./internal/index-Dh0vfIdX.js");require("zod");exports.Document=e.Document;exports.DocumentModel=e.DocumentModel$1;exports.actions=e.actions;exports.documentModel=e.documentModel;exports.module=e.module;exports.reducer=e.reducer;exports.utils=e.utils;exports.validateInitialState=e.validateInitialState;exports.validateModule=e.validateModule;exports.validateModuleOperation=e.validateModuleOperation;exports.validateModules=e.validateModules;exports.validateStateSchemaName=e.validateStateSchemaName;exports.z=e.zod;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./internal/object-
|
|
1
|
+
import "./internal/object-CudRLU4J.js";
|
|
2
2
|
import "immer";
|
|
3
3
|
import "json-stringify-deterministic";
|
|
4
4
|
import "crypto";
|
|
@@ -6,7 +6,7 @@ import "fs";
|
|
|
6
6
|
import "https";
|
|
7
7
|
import "path";
|
|
8
8
|
import "jszip";
|
|
9
|
-
import { b as u, a as c, c as n, d as v, m as M, r as S, u as f, v as h, g as D, h as b, f as g, e as x, z } from "./internal/index-
|
|
9
|
+
import { b as u, a as c, c as n, d as v, m as M, r as S, u as f, v as h, g as D, h as b, f as g, e as x, z } from "./internal/index-DeKx7EaE.js";
|
|
10
10
|
import "zod";
|
|
11
11
|
export {
|
|
12
12
|
u as Document,
|
package/dist/node/document.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./internal/object-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./internal/object-CKxJA706.js"),r=require("./internal/index-LD_vrQff.js");require("immer");require("json-stringify-deterministic");require("zod");require("crypto");require("fs");require("https");require("path");require("jszip");exports.BaseDocument=e.BaseDocument;exports.actions=e.BaseActions;exports.applyMixins=e.applyMixins;exports.baseReducer=e.baseReducer;exports.processUndoRedo=e.processUndoRedo;exports.z=e.zod;exports.utils=r.index;
|
package/dist/node/document.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as n, h as d, g as u, C as x, D as f, E as l } from "./internal/object-
|
|
2
|
-
import { i as D } from "./internal/index-
|
|
1
|
+
import { B as n, h as d, g as u, C as x, D as f, E as l } from "./internal/object-CudRLU4J.js";
|
|
2
|
+
import { i as D } from "./internal/index-LEexvgqj.js";
|
|
3
3
|
import "immer";
|
|
4
4
|
import "json-stringify-deterministic";
|
|
5
5
|
import "zod";
|
package/dist/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./internal/index-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./internal/index-LD_vrQff.js"),o=require("./internal/index-Dh0vfIdX.js");require("./internal/object-CKxJA706.js");require("immer");require("json-stringify-deterministic");require("zod");require("crypto");require("fs");require("https");require("path");require("jszip");const u={"powerhouse/document":e.Document,"powerhouse/document-model":o.DocumentModel},r={Document:e.Document,DocumentModel:o.DocumentModel};exports.Document=e.Document;exports.DocumentModel=o.DocumentModel;exports.DocumentModels=u;exports.default=r;
|
package/dist/node/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as o } from "./internal/index-
|
|
2
|
-
import { D as t } from "./internal/index-
|
|
3
|
-
import "./internal/object-
|
|
1
|
+
import { D as o } from "./internal/index-LEexvgqj.js";
|
|
2
|
+
import { D as t } from "./internal/index-DeKx7EaE.js";
|
|
3
|
+
import "./internal/object-CudRLU4J.js";
|
|
4
4
|
import "immer";
|
|
5
5
|
import "json-stringify-deterministic";
|
|
6
6
|
import "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Rt = Object.defineProperty;
|
|
2
2
|
var xt = (t, e, r) => e in t ? Rt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var Ee = (t, e, r) => (xt(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
-
import { c as At, i as Mt, a as Dt, b as Nt, s as Lt, d as Pt, l as Ct, e as jt, f as a, B as c, g as yt, h as wt } from "./object-
|
|
4
|
+
import { c as At, i as Mt, a as Dt, b as Nt, s as Lt, d as Pt, l as Ct, e as jt, f as a, B as c, g as yt, h as wt } from "./object-CudRLU4J.js";
|
|
5
5
|
import "immer";
|
|
6
6
|
import "json-stringify-deterministic";
|
|
7
7
|
import "crypto";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Tt=Object.defineProperty;var Rt=(t,e,r)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var be=(t,e,r)=>(Rt(t,typeof e!="symbol"?e+"":e,r),r);const s=require("./object-
|
|
1
|
+
"use strict";var Tt=Object.defineProperty;var Rt=(t,e,r)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var be=(t,e,r)=>(Rt(t,typeof e!="symbol"?e+"":e,r),r);const s=require("./object-CKxJA706.js");require("immer");require("json-stringify-deterministic");require("crypto");require("fs");require("https");require("path");require("jszip");const o=require("zod"),xt=new RegExp("([\\p{Ll}\\d])(\\p{Lu})","gu"),Mt=new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])","gu"),Dt=new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d","u"),Nt=/[^\p{L}\d]+/giu,_e="$1\0$2",Ae="";function ze(t){let e=t.trim();e=e.replace(xt,_e).replace(Mt,_e),e=e.replace(Nt,"\0");let r=0,n=e.length;for(;e.charAt(r)==="\0";)r++;if(r===n)return[];for(;e.charAt(n-1)==="\0";)n--;return e.slice(r,n).split(/\0/g)}function Lt(t){const e=ze(t);for(let r=0;r<e.length;r++){const n=e[r],i=Dt.exec(n);if(i){const a=i.index+(i[1]??i[2]).length;e.splice(r,1,n.slice(0,a),n.slice(a))}}return e}function Ie(t,e){const[r,n,i]=wt(t,e),a=Pt(e==null?void 0:e.locale),l=jt(e==null?void 0:e.locale),d=e!=null&&e.mergeAmbiguousCharacters?Ct(a,l):yt(a,l);return r+n.map(d).join((e==null?void 0:e.delimiter)??"")+i}function Pt(t){return t===!1?e=>e.toLowerCase():e=>e.toLocaleLowerCase(t)}function jt(t){return t===!1?e=>e.toUpperCase():e=>e.toLocaleUpperCase(t)}function Ct(t,e){return r=>`${e(r[0])}${t(r.slice(1))}`}function yt(t,e){return(r,n)=>{const i=r[0];return(n>0&&i>="0"&&i<="9"?"_"+i:e(i))+t(r.slice(1))}}function wt(t,e={}){const r=e.split??(e.separateNumbers?Lt:ze),n=e.prefixCharacters??Ae,i=e.suffixCharacters??Ae;let a=0,l=t.length;for(;a<t.length;){const d=t.charAt(a);if(!n.includes(d))break;a++}for(;l>a;){const d=l-1,zt=t.charAt(d);if(!i.includes(zt))break;l=d}return[t.slice(0,a),r(t.slice(a,l)),t.slice(l)]}function T(t,e=!1){const r=[];if(e&&t==="")return r;try{const n=JSON.parse(t);!e&&!Object.keys(n).length&&r.push({message:"Initial state cannot be empty",details:{initialState:t}})}catch{r.push({message:"Invalid initial state",details:{initialState:t}})}return r}function R(t,e,r="",n=!0){const i=[];if(!n&&!t)return i.push({message:"State schema is required",details:{schema:t}}),i;if(n&&!t)return i;const a=`type ${Ie(e)}${Ie(r)}State`;return t.includes(a)||i.push({message:`Invalid state schema name. Expected ${a}`,details:{schema:t}}),i}function x(t){const e=[];t.length||e.push({message:"Modules are required",details:{modules:t}});const r=t.reduce((n,i)=>[...n,...b(i)],[]);return[...e,...r]}function b(t){const e=[];t.name||e.push({message:"Module name is required",details:{module:t}}),t.operations.length||e.push({message:"Module operations are required",details:{module:t}});const r=t.operations.reduce((n,i)=>[...n,..._(i)],[]);return[...e,...r]}function _(t){const e=[];return t.name||e.push({message:"Operation name is required",details:{operation:t}}),t.schema||e.push({message:"Operation schema is required",details:{operation:t}}),e}const kt=Object.freeze(Object.defineProperty({__proto__:null,validateInitialState:T,validateModule:b,validateModuleOperation:_,validateModules:x,validateStateSchemaName:R},Symbol.toStringTag,{value:"Module"})),M={id:"powerhouse/document-model",name:"DocumentModel",extension:"phdm",description:"The Powerhouse Document Model describes the state and operations of a document type.",author:{name:"Powerhouse",website:"https://www.powerhouse.inc/"},specifications:[{version:1,changeLog:[],modules:[{name:"header",operations:[{name:"SetModelName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelId",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelExtension",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModelDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetAuthorName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetAuthorWebsite",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"versioning",operations:[{name:"AddChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteChangeLogItem",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderChangeLogItems",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReleaseNewVersion",schema:null,id:"",description:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"module",operations:[{name:"AddModule",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModuleName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetModuleDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteModule",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderModules",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation-error",operations:[{name:"AddOperationError",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorCode",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationErrorTemplate",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperationError",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderOperationErrors",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation-example",operations:[{name:"AddOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperationExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderOperationExamples",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"operation",operations:[{name:"AddOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationName",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationSchema",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationDescription",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationTemplate",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetOperationReducer",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"MoveOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteOperation",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderModuleOperations",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""},{name:"state",operations:[{name:"SetStateSchema",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"SetInitialState",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"AddStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"UpdateStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"DeleteStateExample",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"},{name:"ReorderStateExamples",id:"",description:"",schema:"",template:"",reducer:"",examples:[],errors:[],scope:"global"}],id:"",description:""}],state:{global:{schema:"",initialValue:`{
|
|
2
2
|
"id": "",
|
|
3
3
|
"name": "",
|
|
4
4
|
"extension": "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./object-
|
|
1
|
+
"use strict";const e=require("./object-CKxJA706.js"),t=Object.freeze(Object.defineProperty({__proto__:null,calculateSkipsLeft:e.calculateSkipsLeft,createAction:e.createAction,createDocument:e.createDocument,createExtendedState:e.createExtendedState,createReducer:e.createReducer,createZip:e.createZip,getLocalFile:e.getLocalFile,getRemoteFile:e.getRemoteFile,hashDocument:e.hashDocument,hashKey:e.hashKey,isBaseAction:e.isBaseAction,isNoopOperation:e.isNoopOperation,isSameDocument:e.isSameDocument,isUndoRedo:e.isUndoRedo,loadFromFile:e.loadFromFile,loadFromInput:e.loadFromInput,mapSkippedOperations:e.mapSkippedOperations,readOnly:e.readOnly,replayDocument:e.replayDocument,replayOperations:e.replayOperations,saveToFile:e.saveToFile,saveToFileHandle:e.saveToFileHandle,sortMappedOperations:e.sortMappedOperations,sortOperations:e.sortOperations,validateOperations:e.validateOperations},Symbol.toStringTag,{value:"Module"})),o=Object.freeze(Object.defineProperty({__proto__:null,BaseDocument:e.BaseDocument,actions:e.BaseActions,applyMixins:e.applyMixins,baseReducer:e.baseReducer,processUndoRedo:e.processUndoRedo,utils:t,z:e.zod},Symbol.toStringTag,{value:"Module"}));exports.Document=o;exports.index=t;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as e, f as a, b as s, a as o, c as t, k as r, m as i, n, o as c, p as l, i as p, q as d, r as u, t as m, l as O, e as y, u as b, v as D, w as S, x as _, s as f, d as g, y as F, z as v, A as h, B as j, h as x, g as z, C as R, D as A, E as B } from "./object-
|
|
1
|
+
import { j as e, f as a, b as s, a as o, c as t, k as r, m as i, n, o as c, p as l, i as p, q as d, r as u, t as m, l as O, e as y, u as b, v as D, w as S, x as _, s as f, d as g, y as F, z as v, A as h, B as j, h as x, g as z, C as R, D as A, E as B } from "./object-CudRLU4J.js";
|
|
2
2
|
const M = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3
3
|
__proto__: null,
|
|
4
4
|
calculateSkipsLeft: e,
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var Nt=Object.defineProperty;var Tt=(e,t,i)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var D=(e,t,i)=>(Tt(e,typeof t!="symbol"?t+"":t,i),i);const h=require("immer"),A=require("json-stringify-deterministic"),c=require("zod"),At=require("crypto"),M=require("fs"),Mt=require("https"),Ft=require("path"),V=require("jszip"),G=e=>e!=null,It=c.z.any().refine(e=>G(e)),Q=c.z.enum(["LOAD_STATE"]),X=c.z.enum(["PRUNE"]),Y=c.z.enum(["REDO"]),tt=c.z.enum(["SET_NAME"]),et=c.z.enum(["UNDO"]);function Pt(){return c.z.object({__typename:c.z.literal("Action").optional(),type:c.z.string()})}function k(){return c.z.literal("global").or(c.z.literal("local"))}function it(){return c.z.union([nt(),at(),st(),pt(),ct()])}function qt(){return c.z.object({__typename:c.z.literal("DocumentFile").optional(),data:c.z.string(),extension:c.z.string().nullable(),fileName:c.z.string().nullable(),mimeType:c.z.string()})}function nt(){return c.z.object({input:c.z.lazy(()=>q()),type:Q,scope:k()})}function q(){return c.z.object({operations:c.z.number(),state:c.z.lazy(()=>ot())})}function ot(){return c.z.object({data:c.z.unknown().nullish(),name:c.z.string()})}function Rt(){return c.z.object({__typename:c.z.literal("Operation").optional(),hash:c.z.string(),index:c.z.number(),timestamp:c.z.string().datetime(),type:c.z.string()})}function at(){return c.z.object({input:c.z.lazy(()=>R()),type:X,scope:k()})}function R(){return c.z.object({end:c.z.number().nullish(),start:c.z.number().nullish()})}const L=c.z.number;function st(){return c.z.object({input:L(),type:Y,scope:k()})}const $=c.z.string;function pt(){return c.z.object({input:$(),type:tt,scope:c.z.literal("global")})}function Lt(){return c.z.object({__typename:c.z.literal("SetNameOperation").optional(),hash:c.z.string(),index:c.z.number(),input:c.z.string(),timestamp:c.z.string().datetime(),type:c.z.string()})}const U=c.z.number;function ct(){return c.z.object({input:U(),type:et,scope:k()})}const $t=Object.freeze(Object.defineProperty({__proto__:null,ActionSchema:Pt,BaseActionSchema:it,DocumentFileSchema:qt,LoadStateActionInputSchema:q,LoadStateActionSchema:nt,LoadStateActionStateInputSchema:ot,Load_StateSchema:Q,OperationSchema:Rt,OperationScopeSchema:k,PruneActionInputSchema:R,PruneActionSchema:at,PruneSchema:X,RedoActionInputSchema:L,RedoActionSchema:st,RedoSchema:Y,SetNameActionInputSchema:$,SetNameActionSchema:pt,SetNameOperationSchema:Lt,Set_NameSchema:tt,UndoActionInputSchema:U,UndoActionSchema:ct,UndoSchema:et,definedNonNullAnySchema:It,isDefinedNonNullAny:G},Symbol.toStringTag,{value:"Module"}));function Ut(e,t){return{...e,name:t}}function Ct(e,t,i){const n={skip:i,document:e},{scope:a}=t;return!a||t.skip===void 0?n:h.produce(n,p=>{const[o]=p.document.operations[a].slice(-1);t.skip&&t.skip>0&&(p.skip=t.skip),o.type==="NOOP"&&t.index===o.index&&p.skip>o.skip&&p.document.operations[a].pop()})}function Jt(e,t,i){const{scope:n,input:a}=t,p={document:e,action:t,skip:i};return h.produce(p,o=>{if(o.document.operations[n].length<1)throw new Error(`Cannot undo: no operations in history for scope "${n}"`);if(a<1)throw new Error("Invalid UNDO action: input value must be greater than 0");if(o.skip>0)throw new Error("Cannot undo: skip value from reducer cannot be used with UNDO action");const[s]=o.document.operations[n].slice(-1),l=s.type==="NOOP"&&s.skip>0;if(o.skip+=a,l){o.skip+=s.skip;const m=o.document.operations[n][o.document.operations[n].length-2];m&&s.index-m.index===1&&o.document.operations[n].pop()}if(o.document.operations[n].length<o.skip)throw new Error("Cannot undo: you can't undo more operations than the ones in the scope history");const r=o.document.operations[n].length-1;let f=a,d=l?r-s.skip:r;for(;f>0&&d>=0;){const m=o.document.operations[n][d];if(!m){f--,d--;continue}m.type==="NOOP"&&m.skip>0?(d=d-(m.skip+1),o.skip+=m.skip+1):(o.document.clipboard.push({...m}),f--,d--)}o.action=Z(n)})}function Bt(e,t,i){const{scope:n,input:a}=t,p={document:e,action:t,skip:i};return h.produce(p,o=>{if(o.skip>0)throw new Error("Cannot redo: skip value from reducer cannot be used with REDO action");if(a>1)throw new Error("Cannot redo: you can only redo one operation at a time");if(a<1)throw new Error("Invalid REDO action: invalid redo input value");if(o.document.clipboard.length<1)throw new Error("Cannot redo: no operations in the clipboard");const s=o.document.clipboard.findLastIndex(r=>r.scope===n);if(s<0)throw new Error(`Cannot redo: no operations in clipboard for scope "${n}"`);const l=o.document.clipboard.splice(s,1)[0];o.action=h.castDraft({type:l.type,scope:l.scope,input:l.input})})}function Wt(e,t,i){const{scope:n}=t,a=e.operations[n];let{input:{start:p,end:o}}=t;p=p||0,o=o||a.length;const s=a.slice(p,o),l=a.slice(0,p),r=a.slice(o),f=E(e.initialState,{...e.operations,[n]:l.concat(s)},i),{name:d,state:m}=f,x=l.length,u=l.length?l[l.length-1].timestamp:r.length?r[0].timestamp:new Date().toISOString();return E(e.initialState,{...e.operations,[n]:[...l,{...W({name:d,state:m},s.length),timestamp:u,index:x,hash:J({state:m},"global")},...r.map((y,_)=>({...y,index:x+_+1}))]},i)}function Zt(e,t){return{...e,name:t.name,state:t.state??{global:{},local:{}}}}const rt="SET_NAME",S="UNDO",z="REDO",N="PRUNE",lt="LOAD_STATE",Ht="NOOP";function Kt(e,t){let i;return"index"in t?i={...t}:i=e.operations[t.scope].slice(-1)[0],((i==null?void 0:i.index)??-1)+1}function Vt(e,t){return{...e,revision:{...e.revision,[t.scope]:Kt(e,t)},lastModified:new Date().toISOString()}}function Gt(e,t,i=0){if([S,z,N].includes(t.type))return e;const{scope:n}=t,a=e.operations[n].slice(0,e.revision[n]),p=[...a].pop();let o=((p==null?void 0:p.index)??-1)+1;if("index"in t){if(t.index>o+i)throw new Error(`Missing operations: expected ${o} with skip 0 or equivalent, got index ${t.index} with skip ${i}`);o=t.index}return a.push({...t,index:o,timestamp:new Date().toISOString(),hash:"",scope:n,skip:i}),{...e,operations:{...e.operations,[n]:a}}}function Qt(e,t,i=0){let n=Gt(e,t,i);return n=Vt(n,t),n}function Xt(e,t,i){switch(it().parse(t),t.type){case rt:return Ut(e,t.input);case N:return Wt(e,t,i);case lt:return Zt(e,t.input.state);default:return e}}function mt(e,t,i){switch(t.type){case S:return Jt(e,t,i);case z:return Bt(e,t,i);default:return{document:e,action:t,skip:i}}}function C(e,t,i,n,a={}){const{skip:p,ignoreSkipOperations:o=!1}=a;let s={...t},l=p||0,r=e,f=[...e.clipboard];if(ut(s)){const{document:d,skip:m}=Ct(r,s,l);l=m,r=d}if(F(s)){const{skip:d,action:m,document:x}=mt(e,s,l);s=m,l=d,r=x,f=[...r.clipboard]}if(I(s)&&(r=Xt(r,s,i)),l>0&&!o){let d=l;"index"in s&&(d=bt(r.operations[s.scope],s.index,l)),r=E(r.initialState,r.operations,i,void 0,void 0,void 0,{[s.scope]:d})}return r=Qt(r,s,l),r=h.produce(r,d=>{const m=i(d.state,s,n),x=F(t)?[...f]:[];if(m)return h.castDraft({...r,clipboard:[...x],state:m});d.clipboard=h.castDraft([...x])}),h.produce(r,d=>{if([S,z,N].includes(s.type))return d;const m=s.scope||"global";d.operations[m][d.operations[m].length-1].hash=J(d,m),!I(s)&&s.attachments&&s.attachments.forEach(x=>{const{hash:u,...y}=x;d.attachments[u]={...y}})})}function Yt(e,t,i){const n=Ft.join(e,t);return M.mkdirSync(e,{recursive:!0}),new Promise((a,p)=>{try{M.writeFile(n,i,{},o=>{o?p(o):a(n)})}catch(o){p(o)}})}function dt(e){return M.readFileSync(e)}function te(e){return new Promise((t,i)=>{Mt.get(e,n=>{const a=[],p=n.headers["content-type"];n.on("data",o=>{a.push(o)}),n.on("end",()=>{t({buffer:Buffer.concat(a),mimeType:p})})}).on("error",n=>{i(n)})})}const ee=async e=>dt(e),T=(e,t="sha1")=>At.createHash(t).update(e).digest("base64");function ut(e){return e.type===Ht&&e.skip!==void 0&&e.skip>0&&e.hash!==void 0}function F(e){return[S,z].includes(e.type)}function I(e){return[rt,S,z,N,lt].includes(e.type)}function w(e,t,i,n,a="global"){if(!e)throw new Error("Empty action type");if(typeof e!="string")throw new Error(`Invalid action type: ${e}`);const p={type:e,input:t,scope:a};i&&(p.attachments=i);try{n==null||n().parse(p.input)}catch(o){throw new Error(`Invalid action input: ${o}`)}return p}function xt(e,t=C){return(i,n,a,p)=>t(i,n,e,a,p)}const ft=(e,t)=>({name:"",documentType:"",revision:{global:0,local:0},created:new Date().toISOString(),lastModified:new Date().toISOString(),attachments:{},...e,state:(t==null?void 0:t(e==null?void 0:e.state))??(e==null?void 0:e.state)??{global:{},local:{}}}),gt=(e,t)=>{const i=ft(e,t);return{...i,initialState:i,operations:{global:[],local:[]},clipboard:[]}},J=(e,t="global")=>T(A(e.state[t])),ie=(e,t=1e3)=>{const i=Math.random()*t;return T(`${(e??new Date).toISOString()}${i}`)};function j(e){return h.castImmutable(h.freeze(e,!0))}function ht(e,t){const i=[...e];let n=t||0,a=i.length>0?i[i.length-1].index:0;const p=[];for(const o of i.reverse()){if(n>0){const r=a-o.index;n-=r}if(n<0)throw new Error("Invalid operation index, missing operations");const s={ignore:n>0,operation:o},l=o.skip>0?o.skip+1:0;if(l>0&&l>n){const r=l-n;n=n+r}a=o.index,p.push(s)}return p.reverse()}function bt(e,t,i){const n=e.slice().sort((s,l)=>s.skip-l.skip).sort((s,l)=>s.index-l.index);let a=i,p=0,o=t;for(const s of n.reverse()){const l=o-s.index;if(a=a-l,a>-1)p++,o=s.index;else break}return p}function ne(e){return Object.values(e).flatMap(t=>t).sort((t,i)=>new Date(t.timestamp).getTime()-new Date(i.timestamp).getTime())}function wt(e){return Object.values(e).flatMap(t=>t).sort((t,i)=>new Date(t.operation.timestamp).getTime()-new Date(i.operation.timestamp).getTime())}function E(e,t,i,n,a,p=C,o={}){const s=xt(i,p);return B(e,t,s,n,a,o)}function B(e,t,i,n,a,p={}){const o=gt(e),s=Object.keys(t).reduce((m,x)=>{const u=x;return{...m,[u]:t[u].slice(0,a==null?void 0:a.revision[u])}},{}),l=Object.keys(s).reduce((m,x)=>{const u=x;return{...m,[u]:ht(s[u],p[u])}},{}),r=wt(l).reduce((m,{ignore:x,operation:u})=>x?i(m,Z(u.scope),n,{skip:u.skip,ignoreSkipOperations:!0}):i(m,u,n,{skip:u.skip,ignoreSkipOperations:!0}),o),f=Object.keys(r.operations).reduce((m,x)=>{const u=x,y=a&&a.revision[u]<t[u].length?t[u].slice(a.revision[u]):[];return{...m,[u]:[...r.operations[u].map((_,Et)=>{var K;return{..._,timestamp:((K=t[u][Et])==null?void 0:K.timestamp)??_.timestamp}}),...y]}},{global:[],local:[]}),d=Object.values(f).reduce((m,x)=>{for(const u of x)u.timestamp>m&&(m=u.timestamp);return m},e.lastModified);return{...r,operations:f,lastModified:d}}function oe(e,t){return A(e)===A(t)}const vt=e=>w("SET_NAME",e,void 0,$,void 0),yt=(e=1,t="global")=>w("UNDO",e,void 0,U,t),jt=(e=1,t="global")=>w("REDO",e,void 0,L,t),Ot=(e,t,i="global")=>w("PRUNE",{start:e,end:t},void 0,R,i),W=(e,t)=>w("LOAD_STATE",{state:e,operations:t},void 0,q),Z=(e="global")=>w("NOOP",{},void 0,void 0,e),ae=Object.freeze(Object.defineProperty({__proto__:null,loadState:W,noop:Z,prune:Ot,redo:jt,setName:vt,undo:yt},Symbol.toStringTag,{value:"Module"})),kt={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(kt);var g=function(e,t,i,n){if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(e):n?n.value:t.get(e)},v,O,b;class se{constructor(...t){v.set(this,new Map),O.set(this,new Map),b.set(this,new Map);for(const i of t)this.define(i)}define(t,i=!1){for(let[n,a]of Object.entries(t)){n=n.toLowerCase(),a=a.map(s=>s.toLowerCase()),g(this,b,"f").has(n)||g(this,b,"f").set(n,new Set);const p=g(this,b,"f").get(n);let o=!0;for(let s of a){const l=s.startsWith("*");if(s=l?s.slice(1):s,p==null||p.add(s),o&&g(this,O,"f").set(n,s),o=!1,l)continue;const r=g(this,v,"f").get(s);if(r&&r!=n&&!i)throw new Error(`"${n} -> ${s}" conflicts with "${r} -> ${s}". Pass \`force=true\` to override this definition.`);g(this,v,"f").set(s,n)}}return this}getType(t){if(typeof t!="string")return null;const i=t.replace(/^.*[/\\]/,"").toLowerCase(),n=i.replace(/^.*\./,"").toLowerCase(),a=i.length<t.length;return!(n.length<i.length-1)&&a?null:g(this,v,"f").get(n)??null}getExtension(t){var i;return typeof t!="string"?null:(t=(i=t==null?void 0:t.split)==null?void 0:i.call(t,";")[0],(t&&g(this,O,"f").get(t.trim().toLowerCase()))??null)}getAllExtensions(t){return typeof t!="string"?null:g(this,b,"f").get(t.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const t of g(this,b,"f").values())Object.freeze(t);return this}_getTestState(){return{types:g(this,v,"f"),extensions:g(this,O,"f")}}}v=new WeakMap,O=new WeakMap,b=new WeakMap;const pe=new se(kt)._freeze();function St(e){const t=[],i=Object.keys(e);for(const n of i){const a=e[n].sort((p,o)=>p.index-o.index);for(let p=0;p<a.length;p++)a[p].index!==p&&t.push({message:`Invalid operation index ${a[p].index} at position ${p}`,details:{position:p,operation:a[p],scope:a[p].scope}})}return t}const H=async e=>{const t=new V,{name:i,revision:n,documentType:a,created:p,lastModified:o}=e,s={name:i,revision:n,documentType:a,created:p,lastModified:o};return t.file("header.json",JSON.stringify(s,null,2)),t.file("state.json",JSON.stringify(e.initialState||{},null,2)),t.file("operations.json",JSON.stringify(e.operations,null,2)),Object.keys(e.attachments).forEach(r=>{const{data:f,...d}=e.attachments[r];t.file(r,f,{base64:!0,createFolders:!0,comment:JSON.stringify(d)})}),t},zt=async(e,t,i,n)=>{const p=await(await H(e)).generateAsync({type:"uint8array",streamFiles:!0}),o=n??e.name,s=`.${i}.zip`;return Yt(t,o.endsWith(s)?o:`${o}${s}`,p)},ce=async(e,t)=>{const n=await(await H(e)).generateAsync({type:"blob"}),a=await t.createWritable();await a.write(n),await a.close()},P=async(e,t)=>{const i=dt(e);return _t(i,t)},_t=async(e,t)=>{const i=new V;return await i.loadAsync(e),re(i,t)};async function re(e,t){const i=e.file("state.json");if(!i)throw new Error("Initial state not found");const n=await i.async("string"),a=JSON.parse(n),p=e.file("header.json");let o;p&&(o=JSON.parse(await p.async("string")));const s=e.file("operations.json");if(!s)throw new Error("Operations history not found");const l=JSON.parse(await s.async("string")),r=St(l);if(r.length){const d=r.map(m=>m.message);throw new Error(d.join(`
|
|
2
|
+
`))}let f=B(a,l,t,void 0,o);return o&&(f={...f,...o}),f}function Dt(e){const t=e.replace(/^.*\./,"")||void 0,i=e.replace(/^.*[/\\]/,"")||void 0;return{extension:t,fileName:i}}async function le(e){const{buffer:t,mimeType:i="application/octet-stream"}=await te(e),n=Dt(e),a=t.toString("base64");return{data:a,hash:T(a),mimeType:i,...n}}async function me(e){const t=await ee(e),i=pe.getType(e)||"application/octet-stream",n=Dt(e),a=t.toString("base64");return{data:a,hash:T(a),mimeType:i,...n}}class de{constructor(t,i,n){D(this,"_document");D(this,"_reducer");D(this,"_signalDispatch");this._reducer=t,this._document=i,this._signalDispatch=n}dispatch(t,i){return this._document=this._reducer(this._document,t,this._signalDispatch,i),this}saveToFile(t,i,n){return zt(this._document,t,i,n)}async loadFromFile(t){this._document=await P(t,this._reducer)}static async stateFromFile(t,i){return await P(t,i)}get state(){return j(this._document.state)}get operations(){return j(this._document.operations)}get name(){return this._document.name}get documentType(){return this._document.documentType}get created(){return this._document.created}get lastModified(){return this._document.lastModified}get revision(){return this._document.revision.global}getRevision(t){return this._document.revision[t]}get initialState(){return j(this._document.initialState)}toDocument(){return j(this._document)}getAttachment(t){return this._document.attachments[t]}setName(t){return this.dispatch(vt(t)),this}undo(t){return this.dispatch(yt(t)),this}redo(t){return this.dispatch(jt(t)),this}prune(t,i){return this.dispatch(Ot(t,i)),this}loadState(t,i){return this.dispatch(W(t,i)),this}}function ue(e,t){t.forEach(i=>{Object.getOwnPropertyNames(i.prototype).forEach(n=>{Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(i.prototype,n)||Object.create(null))})})}exports.BaseActions=ae;exports.BaseDocument=de;exports.applyMixins=ue;exports.baseReducer=C;exports.calculateSkipsLeft=bt;exports.createAction=w;exports.createDocument=gt;exports.createExtendedState=ft;exports.createReducer=xt;exports.createZip=H;exports.getLocalFile=me;exports.getRemoteFile=le;exports.hashDocument=J;exports.hashKey=ie;exports.isBaseAction=I;exports.isNoopOperation=ut;exports.isSameDocument=oe;exports.isUndoRedo=F;exports.loadFromFile=P;exports.loadFromInput=_t;exports.mapSkippedOperations=ht;exports.processUndoRedo=mt;exports.readOnly=j;exports.replayDocument=B;exports.replayOperations=E;exports.saveToFile=zt;exports.saveToFileHandle=ce;exports.sortMappedOperations=wt;exports.sortOperations=ne;exports.validateOperations=St;exports.zod=$t;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var vt = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { produce as
|
|
2
|
+
var jt = (e, t, i) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[t] = i;
|
|
3
|
+
var E = (e, t, i) => (jt(e, typeof t != "symbol" ? t + "" : t, i), i);
|
|
4
|
+
import { produce as y, castDraft as A, castImmutable as yt, freeze as Ot } from "immer";
|
|
5
5
|
import z from "json-stringify-deterministic";
|
|
6
6
|
import { z as c } from "zod";
|
|
7
7
|
import kt from "crypto";
|
|
@@ -16,7 +16,7 @@ function Dt() {
|
|
|
16
16
|
type: c.string()
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function O() {
|
|
20
20
|
return c.literal("global").or(c.literal("local"));
|
|
21
21
|
}
|
|
22
22
|
function Y() {
|
|
@@ -41,7 +41,7 @@ function tt() {
|
|
|
41
41
|
return c.object({
|
|
42
42
|
input: c.lazy(() => P()),
|
|
43
43
|
type: K,
|
|
44
|
-
scope:
|
|
44
|
+
scope: O()
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
function P() {
|
|
@@ -69,7 +69,7 @@ function it() {
|
|
|
69
69
|
return c.object({
|
|
70
70
|
input: c.lazy(() => F()),
|
|
71
71
|
type: V,
|
|
72
|
-
scope:
|
|
72
|
+
scope: O()
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
function F() {
|
|
@@ -83,7 +83,7 @@ function nt() {
|
|
|
83
83
|
return c.object({
|
|
84
84
|
input: R(),
|
|
85
85
|
type: G,
|
|
86
|
-
scope:
|
|
86
|
+
scope: O()
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
const L = c.string;
|
|
@@ -109,7 +109,7 @@ function ot() {
|
|
|
109
109
|
return c.object({
|
|
110
110
|
input: q(),
|
|
111
111
|
type: X,
|
|
112
|
-
scope:
|
|
112
|
+
scope: O()
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
115
|
const ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -122,7 +122,7 @@ const ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
122
122
|
LoadStateActionStateInputSchema: et,
|
|
123
123
|
Load_StateSchema: K,
|
|
124
124
|
OperationSchema: Tt,
|
|
125
|
-
OperationScopeSchema:
|
|
125
|
+
OperationScopeSchema: O,
|
|
126
126
|
PruneActionInputSchema: F,
|
|
127
127
|
PruneActionSchema: it,
|
|
128
128
|
PruneSchema: V,
|
|
@@ -147,14 +147,14 @@ function Mt(e, t, i) {
|
|
|
147
147
|
skip: i,
|
|
148
148
|
document: e
|
|
149
149
|
}, { scope: o } = t;
|
|
150
|
-
return !o || t.skip === void 0 ? n :
|
|
150
|
+
return !o || t.skip === void 0 ? n : y(n, (p) => {
|
|
151
151
|
const [a] = p.document.operations[o].slice(-1);
|
|
152
152
|
t.skip && t.skip > 0 && (p.skip = t.skip), a.type === "NOOP" && t.index === a.index && p.skip > a.skip && p.document.operations[o].pop();
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
function It(e, t, i) {
|
|
156
156
|
const { scope: n, input: o } = t;
|
|
157
|
-
return
|
|
157
|
+
return y({
|
|
158
158
|
document: e,
|
|
159
159
|
action: t,
|
|
160
160
|
skip: i
|
|
@@ -196,7 +196,7 @@ function It(e, t, i) {
|
|
|
196
196
|
}
|
|
197
197
|
function Pt(e, t, i) {
|
|
198
198
|
const { scope: n, input: o } = t;
|
|
199
|
-
return
|
|
199
|
+
return y({
|
|
200
200
|
document: e,
|
|
201
201
|
action: t,
|
|
202
202
|
skip: i
|
|
@@ -257,9 +257,9 @@ function Ft(e, t, i) {
|
|
|
257
257
|
index: f,
|
|
258
258
|
hash: lt({ state: m }, "global")
|
|
259
259
|
},
|
|
260
|
-
...r.map((
|
|
261
|
-
...
|
|
262
|
-
index: f +
|
|
260
|
+
...r.map((v, _) => ({
|
|
261
|
+
...v,
|
|
262
|
+
index: f + _ + 1
|
|
263
263
|
}))
|
|
264
264
|
]
|
|
265
265
|
},
|
|
@@ -273,10 +273,10 @@ function Rt(e, t) {
|
|
|
273
273
|
state: t.state ?? { global: {}, local: {} }
|
|
274
274
|
};
|
|
275
275
|
}
|
|
276
|
-
const st = "SET_NAME",
|
|
276
|
+
const st = "SET_NAME", k = "UNDO", S = "REDO", N = "PRUNE", pt = "LOAD_STATE", Lt = "NOOP";
|
|
277
277
|
function qt(e, t) {
|
|
278
|
-
|
|
279
|
-
return
|
|
278
|
+
let i;
|
|
279
|
+
return "index" in t ? i = { ...t } : i = e.operations[t.scope].slice(-1)[0], ((i == null ? void 0 : i.index) ?? -1) + 1;
|
|
280
280
|
}
|
|
281
281
|
function $t(e, t) {
|
|
282
282
|
return {
|
|
@@ -289,7 +289,7 @@ function $t(e, t) {
|
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
291
|
function Ut(e, t, i = 0) {
|
|
292
|
-
if ([
|
|
292
|
+
if ([k, S, N].includes(t.type))
|
|
293
293
|
return e;
|
|
294
294
|
const { scope: n } = t, o = e.operations[n].slice(
|
|
295
295
|
0,
|
|
@@ -323,7 +323,7 @@ function Jt(e, t, i) {
|
|
|
323
323
|
switch (Y().parse(t), t.type) {
|
|
324
324
|
case st:
|
|
325
325
|
return zt(e, t.input);
|
|
326
|
-
case
|
|
326
|
+
case N:
|
|
327
327
|
return Ft(e, t, i);
|
|
328
328
|
case pt:
|
|
329
329
|
return Rt(e, t.input.state);
|
|
@@ -333,9 +333,9 @@ function Jt(e, t, i) {
|
|
|
333
333
|
}
|
|
334
334
|
function Wt(e, t, i) {
|
|
335
335
|
switch (t.type) {
|
|
336
|
-
case
|
|
336
|
+
case k:
|
|
337
337
|
return It(e, t, i);
|
|
338
|
-
case
|
|
338
|
+
case S:
|
|
339
339
|
return Pt(e, t, i);
|
|
340
340
|
default:
|
|
341
341
|
return { document: e, action: t, skip: i };
|
|
@@ -372,7 +372,7 @@ function ct(e, t, i, n, o = {}) {
|
|
|
372
372
|
{ [s.scope]: d }
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
-
return r = Ct(r, s, l), r =
|
|
375
|
+
return r = Ct(r, s, l), r = y(r, (d) => {
|
|
376
376
|
const m = i(
|
|
377
377
|
d.state,
|
|
378
378
|
s,
|
|
@@ -385,14 +385,14 @@ function ct(e, t, i, n, o = {}) {
|
|
|
385
385
|
state: m
|
|
386
386
|
});
|
|
387
387
|
d.clipboard = A([...f]);
|
|
388
|
-
}),
|
|
389
|
-
if ([
|
|
388
|
+
}), y(r, (d) => {
|
|
389
|
+
if ([k, S, N].includes(s.type))
|
|
390
390
|
return d;
|
|
391
391
|
const m = s.scope || "global";
|
|
392
392
|
d.operations[m][d.operations[m].length - 1].hash = lt(d, m), !W(s) && s.attachments && s.attachments.forEach((f) => {
|
|
393
|
-
const { hash: u, ...
|
|
393
|
+
const { hash: u, ...v } = f;
|
|
394
394
|
d.attachments[u] = {
|
|
395
|
-
...
|
|
395
|
+
...v
|
|
396
396
|
};
|
|
397
397
|
});
|
|
398
398
|
});
|
|
@@ -431,12 +431,12 @@ function Kt(e) {
|
|
|
431
431
|
return e.type === Lt && e.skip !== void 0 && e.skip > 0 && e.hash !== void 0;
|
|
432
432
|
}
|
|
433
433
|
function J(e) {
|
|
434
|
-
return [
|
|
434
|
+
return [k, S].includes(e.type);
|
|
435
435
|
}
|
|
436
436
|
function W(e) {
|
|
437
|
-
return [st,
|
|
437
|
+
return [st, k, S, N, pt].includes(e.type);
|
|
438
438
|
}
|
|
439
|
-
function
|
|
439
|
+
function w(e, t, i, n, o = "global") {
|
|
440
440
|
if (!e)
|
|
441
441
|
throw new Error("Empty action type");
|
|
442
442
|
if (typeof e != "string")
|
|
@@ -480,8 +480,8 @@ const Gt = (e, t) => ({
|
|
|
480
480
|
const i = Math.random() * t;
|
|
481
481
|
return T(`${(e ?? /* @__PURE__ */ new Date()).toISOString()}${i}`);
|
|
482
482
|
};
|
|
483
|
-
function
|
|
484
|
-
return
|
|
483
|
+
function D(e) {
|
|
484
|
+
return yt(Ot(e, !0));
|
|
485
485
|
}
|
|
486
486
|
function Xt(e, t) {
|
|
487
487
|
const i = [...e];
|
|
@@ -571,18 +571,18 @@ function mt(e, t, i, n, o, p = {}) {
|
|
|
571
571
|
r.operations
|
|
572
572
|
).reduce(
|
|
573
573
|
(m, f) => {
|
|
574
|
-
const u = f,
|
|
574
|
+
const u = f, v = o && o.revision[u] < t[u].length ? t[u].slice(o.revision[u]) : [];
|
|
575
575
|
return {
|
|
576
576
|
...m,
|
|
577
577
|
[u]: [
|
|
578
|
-
...r.operations[u].map((
|
|
578
|
+
...r.operations[u].map((_, wt) => {
|
|
579
579
|
var C;
|
|
580
580
|
return {
|
|
581
|
-
...
|
|
582
|
-
timestamp: ((C = t[u][wt]) == null ? void 0 : C.timestamp) ??
|
|
581
|
+
..._,
|
|
582
|
+
timestamp: ((C = t[u][wt]) == null ? void 0 : C.timestamp) ?? _.timestamp
|
|
583
583
|
};
|
|
584
584
|
}),
|
|
585
|
-
...
|
|
585
|
+
...v
|
|
586
586
|
]
|
|
587
587
|
};
|
|
588
588
|
},
|
|
@@ -597,36 +597,36 @@ function mt(e, t, i, n, o, p = {}) {
|
|
|
597
597
|
function we(e, t) {
|
|
598
598
|
return z(e) === z(t);
|
|
599
599
|
}
|
|
600
|
-
const dt = (e) =>
|
|
600
|
+
const dt = (e) => w(
|
|
601
601
|
"SET_NAME",
|
|
602
602
|
e,
|
|
603
603
|
void 0,
|
|
604
604
|
L,
|
|
605
605
|
void 0
|
|
606
|
-
), ut = (e = 1, t = "global") =>
|
|
606
|
+
), ut = (e = 1, t = "global") => w(
|
|
607
607
|
"UNDO",
|
|
608
608
|
e,
|
|
609
609
|
void 0,
|
|
610
610
|
q,
|
|
611
611
|
t
|
|
612
|
-
), ft = (e = 1, t = "global") =>
|
|
612
|
+
), ft = (e = 1, t = "global") => w(
|
|
613
613
|
"REDO",
|
|
614
614
|
e,
|
|
615
615
|
void 0,
|
|
616
616
|
R,
|
|
617
617
|
t
|
|
618
|
-
), xt = (e, t, i = "global") =>
|
|
618
|
+
), xt = (e, t, i = "global") => w(
|
|
619
619
|
"PRUNE",
|
|
620
620
|
{ start: e, end: t },
|
|
621
621
|
void 0,
|
|
622
622
|
F,
|
|
623
623
|
i
|
|
624
|
-
), $ = (e, t) =>
|
|
624
|
+
), $ = (e, t) => w(
|
|
625
625
|
"LOAD_STATE",
|
|
626
626
|
{ state: e, operations: t },
|
|
627
627
|
void 0,
|
|
628
628
|
P
|
|
629
|
-
), U = (e = "global") =>
|
|
629
|
+
), U = (e = "global") => w("NOOP", {}, void 0, void 0, e), ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
630
630
|
__proto__: null,
|
|
631
631
|
loadState: $,
|
|
632
632
|
noop: U,
|
|
@@ -642,10 +642,10 @@ var g = function(e, t, i, n) {
|
|
|
642
642
|
if (typeof t == "function" ? e !== t || !n : !t.has(e))
|
|
643
643
|
throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
644
644
|
return i === "m" ? n : i === "a" ? n.call(e) : n ? n.value : t.get(e);
|
|
645
|
-
}, b,
|
|
645
|
+
}, b, j, h;
|
|
646
646
|
class ee {
|
|
647
647
|
constructor(...t) {
|
|
648
|
-
b.set(this, /* @__PURE__ */ new Map()),
|
|
648
|
+
b.set(this, /* @__PURE__ */ new Map()), j.set(this, /* @__PURE__ */ new Map()), h.set(this, /* @__PURE__ */ new Map());
|
|
649
649
|
for (const i of t)
|
|
650
650
|
this.define(i);
|
|
651
651
|
}
|
|
@@ -656,7 +656,7 @@ class ee {
|
|
|
656
656
|
let a = !0;
|
|
657
657
|
for (let s of o) {
|
|
658
658
|
const l = s.startsWith("*");
|
|
659
|
-
if (s = l ? s.slice(1) : s, p == null || p.add(s), a && g(this,
|
|
659
|
+
if (s = l ? s.slice(1) : s, p == null || p.add(s), a && g(this, j, "f").set(n, s), a = !1, l)
|
|
660
660
|
continue;
|
|
661
661
|
const r = g(this, b, "f").get(s);
|
|
662
662
|
if (r && r != n && !i)
|
|
@@ -674,7 +674,7 @@ class ee {
|
|
|
674
674
|
}
|
|
675
675
|
getExtension(t) {
|
|
676
676
|
var i;
|
|
677
|
-
return typeof t != "string" ? null : (t = (i = t == null ? void 0 : t.split) == null ? void 0 : i.call(t, ";")[0], (t && g(this,
|
|
677
|
+
return typeof t != "string" ? null : (t = (i = t == null ? void 0 : t.split) == null ? void 0 : i.call(t, ";")[0], (t && g(this, j, "f").get(t.trim().toLowerCase())) ?? null);
|
|
678
678
|
}
|
|
679
679
|
getAllExtensions(t) {
|
|
680
680
|
return typeof t != "string" ? null : g(this, h, "f").get(t.toLowerCase()) ?? null;
|
|
@@ -690,11 +690,11 @@ class ee {
|
|
|
690
690
|
_getTestState() {
|
|
691
691
|
return {
|
|
692
692
|
types: g(this, b, "f"),
|
|
693
|
-
extensions: g(this,
|
|
693
|
+
extensions: g(this, j, "f")
|
|
694
694
|
};
|
|
695
695
|
}
|
|
696
696
|
}
|
|
697
|
-
b = /* @__PURE__ */ new WeakMap(),
|
|
697
|
+
b = /* @__PURE__ */ new WeakMap(), j = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap();
|
|
698
698
|
const ie = new ee(gt)._freeze();
|
|
699
699
|
function ne(e) {
|
|
700
700
|
const t = [], i = Object.keys(e);
|
|
@@ -741,7 +741,7 @@ const ht = async (e) => {
|
|
|
741
741
|
a.endsWith(s) ? a : `${a}${s}`,
|
|
742
742
|
p
|
|
743
743
|
);
|
|
744
|
-
},
|
|
744
|
+
}, je = async (e, t) => {
|
|
745
745
|
const n = await (await ht(e)).generateAsync({ type: "blob" }), o = await t.createWritable();
|
|
746
746
|
await o.write(n), await o.close();
|
|
747
747
|
}, B = async (e, t) => {
|
|
@@ -785,7 +785,7 @@ function bt(e) {
|
|
|
785
785
|
const t = e.replace(/^.*\./, "") || void 0, i = e.replace(/^.*[/\\]/, "") || void 0;
|
|
786
786
|
return { extension: t, fileName: i };
|
|
787
787
|
}
|
|
788
|
-
async function
|
|
788
|
+
async function ye(e) {
|
|
789
789
|
const { buffer: t, mimeType: i = "application/octet-stream" } = await Zt(e), n = bt(e), o = t.toString("base64");
|
|
790
790
|
return {
|
|
791
791
|
data: o,
|
|
@@ -805,9 +805,9 @@ class ke {
|
|
|
805
805
|
* @param document - The initial state of the document.
|
|
806
806
|
*/
|
|
807
807
|
constructor(t, i, n) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
808
|
+
E(this, "_document");
|
|
809
|
+
E(this, "_reducer");
|
|
810
|
+
E(this, "_signalDispatch");
|
|
811
811
|
this._reducer = t, this._document = i, this._signalDispatch = n;
|
|
812
812
|
}
|
|
813
813
|
/**
|
|
@@ -852,13 +852,13 @@ class ke {
|
|
|
852
852
|
* Gets the current state of the document.
|
|
853
853
|
*/
|
|
854
854
|
get state() {
|
|
855
|
-
return
|
|
855
|
+
return D(this._document.state);
|
|
856
856
|
}
|
|
857
857
|
/**
|
|
858
858
|
* Gets the list of operations performed on the document.
|
|
859
859
|
*/
|
|
860
860
|
get operations() {
|
|
861
|
-
return
|
|
861
|
+
return D(this._document.operations);
|
|
862
862
|
}
|
|
863
863
|
/**
|
|
864
864
|
* Gets the name of the document.
|
|
@@ -897,13 +897,13 @@ class ke {
|
|
|
897
897
|
* Gets the initial state of the document.
|
|
898
898
|
*/
|
|
899
899
|
get initialState() {
|
|
900
|
-
return
|
|
900
|
+
return D(this._document.initialState);
|
|
901
901
|
}
|
|
902
902
|
/**
|
|
903
903
|
* Returns the current document as an object
|
|
904
904
|
*/
|
|
905
905
|
toDocument() {
|
|
906
|
-
return
|
|
906
|
+
return D(this._document);
|
|
907
907
|
}
|
|
908
908
|
/**
|
|
909
909
|
* Gets the attachment associated with the given key.
|
|
@@ -972,9 +972,9 @@ export {
|
|
|
972
972
|
Gt as a,
|
|
973
973
|
Qt as b,
|
|
974
974
|
Vt as c,
|
|
975
|
-
|
|
975
|
+
je as d,
|
|
976
976
|
oe as e,
|
|
977
|
-
|
|
977
|
+
w as f,
|
|
978
978
|
Se as g,
|
|
979
979
|
ve as h,
|
|
980
980
|
W as i,
|
|
@@ -982,7 +982,7 @@ export {
|
|
|
982
982
|
ht as k,
|
|
983
983
|
B as l,
|
|
984
984
|
Oe as m,
|
|
985
|
-
|
|
985
|
+
ye as n,
|
|
986
986
|
lt as o,
|
|
987
987
|
he as p,
|
|
988
988
|
Kt as q,
|
|
@@ -990,7 +990,7 @@ export {
|
|
|
990
990
|
ae as s,
|
|
991
991
|
J as t,
|
|
992
992
|
Xt as u,
|
|
993
|
-
|
|
993
|
+
D as v,
|
|
994
994
|
mt as w,
|
|
995
995
|
I as x,
|
|
996
996
|
te as y,
|