[{"data":1,"prerenderedAt":1165},["ShallowReactive",2],{"text-diagram-doc:\u002Fguide\u002Fpersistence":3,"text-diagram-source:recipes\u002Fsession.ts":250,"mdc--mhn3bc-key":251},{"id":4,"title":5,"body":6,"description":238,"extension":239,"keywords":240,"locale":241,"meta":242,"navigation":243,"order":244,"path":245,"section":246,"seo":247,"stem":248,"__hash__":249},"docs\u002Fguide\u002Fpersistence.zh-CN.md","保存与恢复",{"type":7,"value":8,"toc":230},"minimark",[9,18,22,40,51,60,63,66,93,133,137,140,143,212,215,219],[10,11,12,13,17],"p",{},"结构化宿主保存 ",[14,15,16],"code",{},"TextDiagramEmbed","：版本标识、稳定 id、标题、源码语言\u002F正文\u002F修订号以及对应 PNG。新草稿可以没有预览；保存后的对象应包含由同一份源码生成的预览。",[19,20,21],"h2",{"id":21},"源码与图片一起保存",[10,23,24,27,28,31,32,35,36,39],{},[14,25,26],{},"createTextDiagram"," 创建 revision 为 0 的新对象。",[14,29,30],{},"renderTextDiagram"," 产生源码快照，",[14,33,34],{},"rasterizeTextDiagram"," 从快照生成 PNG，",[14,37,38],{},"prepareTextDiagramSave"," 在原基线基础上提出一次 revision + 1 的完整对象。工作台已经管理这条流水线。",[10,41,42,45,46,50],{},[14,43,44],{},"readTextDiagram"," 校验未知输入并返回不可变副本；不接受额外字段、访问器或非规范值。它验证对象结构与大小，",[47,48,49],"strong",{},"不会重新渲染以证明 PNG 内容等于源码","。不要把来自不可信输入的图片仅因通过结构检查就当作已验证的绘图结果。",[10,52,53,56,57,59],{},[14,54,55],{},"serializeTextDiagram"," 提供稳定比较字符串；JSON 读取后再次经过 ",[14,58,44],{},"，再交给宿主。",[19,61,62],{"id":62},"一个完整的本地宿主",[10,64,65],{},"假设用户打开图形进行编辑，工作台完成后需要把结果交还应用。应用既要保存新图，也要确认打开弹窗后原图没有被其他操作修改。",[10,67,68,69,72,73,76,77,80,81,84,85,88,89,92],{},"示例的 ",[14,70,71],{},"createDiagramSession(initial, persist)"," 为一张图维护已接受的版本。",[14,74,75],{},"read()"," 读取当前图；",[14,78,79],{},"capture()"," 捕获打开时的版本，并提供 ",[14,82,83],{},"commit()"," 接受结果、",[14,86,87],{},"release()"," 结束本次编辑。",[14,90,91],{},"persist"," 是应用提供的同步存储回调，例如写入本地存储；它抛出异常时不会更新当前修订，也不会报告成功。",[94,95,96,109],"table",{},[97,98,99],"thead",{},[100,101,102,106],"tr",{},[103,104,105],"th",{},"文件",[103,107,108],{},"用途",[110,111,112,123],"tbody",{},[100,113,114,120],{},[115,116,117],"td",{},[14,118,119],{},"recipes\u002Fsession.ts",[115,121,122],{},"比较打开时与保存时的版本，调用存储，再更新当前图",[100,124,125,130],{},[115,126,127],{},[14,128,129],{},"shared\u002Ftypes.ts",[115,131,132],{},"定义编辑请求和 session 的类型，供宿主与工作台共用",[134,135],"docs-recipe",{"name":136},"recipes\u002Fsession",[10,138,139],{},"工作台传入的对象已有对应预览。生产宿主还应在最终提交时确认目标仍存在、当前仍可编辑、目标位置映射有效。Classic\u002FBlock\u002FMSFE 的集成各自负责这些编辑器语义；这个示例不实现文档协作或多标签页同步。",[19,141,142],{"id":142},"四种提交结果",[94,144,145,158],{},[97,146,147],{},[100,148,149,152,155],{},[103,150,151],{},"返回值",[103,153,154],{},"含义",[103,156,157],{},"UI 行为",[110,159,160,173,186,199],{},[100,161,162,167,170],{},[115,163,164],{},[14,165,166],{},"saved",[115,168,169],{},"宿主已原子接受源码与预览",[115,171,172],{},"通知保存成功",[100,174,175,180,183],{},[115,176,177],{},[14,178,179],{},"conflict",[115,181,182],{},"基线之后正文已变更",[115,184,185],{},"保留草稿，显示冲突",[100,187,188,193,196],{},[115,189,190],{},[14,191,192],{},"readonly",[115,194,195],{},"当前不允许写入",[115,197,198],{},"保留草稿，显示只读",[100,200,201,206,209],{},[115,202,203],{},[14,204,205],{},"missing",[115,207,208],{},"原目标已删除或释放",[115,210,211],{},"保留草稿，显示目标丢失",[10,213,214],{},"存储故障可以抛出异常，工作台显示失败并允许重试。此合同不包含异步服务端确认、自动合并或后端重试；这些属于宿主的持久化策略。",[19,216,218],{"id":217},"markdown-宿主","Markdown 宿主",[10,220,221,222,225,226,229],{},"调用 ",[14,223,224],{},"textDiagramMarkdown(language, source)"," 生成标准围栏。函数会选择比源码中的反引号更长的围栏，防止正文意外闭合。Markdown 仅持有语言与源码，不保存 ",[14,227,228],{},"id","、标题、PNG 或结构化修订；编辑与冲突校验由对应源码宿主处理。",{"title":231,"searchDepth":232,"depth":232,"links":233},"",2,[234,235,236,237],{"id":21,"depth":232,"text":21},{"id":62,"depth":232,"text":62},{"id":142,"depth":232,"text":142},{"id":217,"depth":232,"text":218},"以源码为权威，原子提交对应预览，并拒绝过期或已释放的编辑请求。","md",null,"zh-CN",{},true,4,"\u002Fguide\u002Fpersistence","接入指南",{"title":5,"description":238},"guide\u002Fpersistence.zh-CN","eg-P_Vefi4NItiKUS9Qdmxu7VrdmKWBaZgKiBBVyiGI","import { readTextDiagram, serializeTextDiagram, type TextDiagramEmbed } from \"@quirekit\u002Ftext-diagram\";\nimport type { DiagramSession } from \"..\u002Fshared\u002Ftypes\";\n\n\u002F**\n * Creates a single-object host with compare-and-save semantics.\n * @param initial - Validated persisted object or new draft.\n * @param persist - Optional synchronous storage write; throwing leaves the baseline unchanged.\n * @returns A host whose requests cannot overwrite a newer accepted revision.\n *\u002F\nexport function createDiagramSession(initial: TextDiagramEmbed, persist?: (next: TextDiagramEmbed) => void): DiagramSession {\n  let current = readTextDiagram(initial);\n  return {\n    \u002F** @returns The immutable accepted revision. *\u002F\n    read() { return current; },\n    \u002F** @returns A detached baseline with explicit commit and release callbacks. *\u002F\n    capture() {\n      const baseline = current, expected = serializeTextDiagram(baseline);\n      let released = false;\n      return {\n        document: baseline,\n        \u002F** @param proposal - Source and preview proposed by the workbench. @returns Atomic host acceptance. *\u002F\n        commit(proposal) {\n          if (released) return \"missing\";\n          if (serializeTextDiagram(current) !== expected) return \"conflict\";\n          const next = readTextDiagram(proposal);\n          if (next.id !== baseline.id || next.document.revision !== baseline.document.revision + 1 || !next.preview) {\n            throw new TypeError(\"Invalid diagram save\");\n          }\n          \u002F\u002F Storage must succeed before publishing the new revision to the UI.\n          persist?.(next);\n          current = next;\n          return \"saved\";\n        },\n        \u002F** Closes this target without changing the accepted object. *\u002F\n        release() { released = true; },\n      };\n    },\n  };\n}\n",{"data":252,"body":253},{},{"type":254,"children":255},"root",[256,1159],{"type":257,"tag":258,"props":259,"children":263},"element","pre",{"className":260,"code":261,"language":262,"meta":231,"style":231},"language-ts shiki shiki-themes github-light github-light github-dark","import { readTextDiagram, serializeTextDiagram, type TextDiagramEmbed } from \"@quirekit\u002Ftext-diagram\";\nimport type { DiagramSession } from \"..\u002Fshared\u002Ftypes\";\n\n\u002F**\n * Creates a single-object host with compare-and-save semantics.\n * @param initial - Validated persisted object or new draft.\n * @param persist - Optional synchronous storage write; throwing leaves the baseline unchanged.\n * @returns A host whose requests cannot overwrite a newer accepted revision.\n *\u002F\nexport function createDiagramSession(initial: TextDiagramEmbed, persist?: (next: TextDiagramEmbed) => void): DiagramSession {\n  let current = readTextDiagram(initial);\n  return {\n    \u002F** @returns The immutable accepted revision. *\u002F\n    read() { return current; },\n    \u002F** @returns A detached baseline with explicit commit and release callbacks. *\u002F\n    capture() {\n      const baseline = current, expected = serializeTextDiagram(baseline);\n      let released = false;\n      return {\n        document: baseline,\n        \u002F** @param proposal - Source and preview proposed by the workbench. @returns Atomic host acceptance. *\u002F\n        commit(proposal) {\n          if (released) return \"missing\";\n          if (serializeTextDiagram(current) !== expected) return \"conflict\";\n          const next = readTextDiagram(proposal);\n          if (next.id !== baseline.id || next.document.revision !== baseline.document.revision + 1 || !next.preview) {\n            throw new TypeError(\"Invalid diagram save\");\n          }\n          \u002F\u002F Storage must succeed before publishing the new revision to the UI.\n          persist?.(next);\n          current = next;\n          return \"saved\";\n        },\n        \u002F** Closes this target without changing the accepted object. *\u002F\n        release() { released = true; },\n      };\n    },\n  };\n}\n\n","ts",[264],{"type":257,"tag":14,"props":265,"children":266},{"__ignoreMap":231},[267,312,342,351,360,369,393,415,433,442,550,579,592,610,634,651,665,708,735,748,757,789,812,839,883,910,976,1009,1018,1027,1041,1059,1077,1086,1095,1123,1132,1141,1150],{"type":257,"tag":268,"props":269,"children":272},"span",{"class":270,"line":271},"line",1,[273,280,286,291,296,301,307],{"type":257,"tag":268,"props":274,"children":276},{"style":275},"--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583",[277],{"type":278,"value":279},"text","import",{"type":257,"tag":268,"props":281,"children":283},{"style":282},"--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8",[284],{"type":278,"value":285}," { readTextDiagram, serializeTextDiagram, ",{"type":257,"tag":268,"props":287,"children":288},{"style":275},[289],{"type":278,"value":290},"type",{"type":257,"tag":268,"props":292,"children":293},{"style":282},[294],{"type":278,"value":295}," TextDiagramEmbed } ",{"type":257,"tag":268,"props":297,"children":298},{"style":275},[299],{"type":278,"value":300},"from",{"type":257,"tag":268,"props":302,"children":304},{"style":303},"--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF",[305],{"type":278,"value":306}," \"@quirekit\u002Ftext-diagram\"",{"type":257,"tag":268,"props":308,"children":309},{"style":282},[310],{"type":278,"value":311},";\n",{"type":257,"tag":268,"props":313,"children":314},{"class":270,"line":232},[315,319,324,329,333,338],{"type":257,"tag":268,"props":316,"children":317},{"style":275},[318],{"type":278,"value":279},{"type":257,"tag":268,"props":320,"children":321},{"style":275},[322],{"type":278,"value":323}," type",{"type":257,"tag":268,"props":325,"children":326},{"style":282},[327],{"type":278,"value":328}," { DiagramSession } ",{"type":257,"tag":268,"props":330,"children":331},{"style":275},[332],{"type":278,"value":300},{"type":257,"tag":268,"props":334,"children":335},{"style":303},[336],{"type":278,"value":337}," \"..\u002Fshared\u002Ftypes\"",{"type":257,"tag":268,"props":339,"children":340},{"style":282},[341],{"type":278,"value":311},{"type":257,"tag":268,"props":343,"children":345},{"class":270,"line":344},3,[346],{"type":257,"tag":268,"props":347,"children":348},{"emptyLinePlaceholder":243},[349],{"type":278,"value":350},"\n",{"type":257,"tag":268,"props":352,"children":353},{"class":270,"line":244},[354],{"type":257,"tag":268,"props":355,"children":357},{"style":356},"--shiki-default:#6A737D;--shiki-light:#6A737D;--shiki-dark:#6A737D",[358],{"type":278,"value":359},"\u002F**\n",{"type":257,"tag":268,"props":361,"children":363},{"class":270,"line":362},5,[364],{"type":257,"tag":268,"props":365,"children":366},{"style":356},[367],{"type":278,"value":368}," * Creates a single-object host with compare-and-save semantics.\n",{"type":257,"tag":268,"props":370,"children":372},{"class":270,"line":371},6,[373,378,383,388],{"type":257,"tag":268,"props":374,"children":375},{"style":356},[376],{"type":278,"value":377}," * ",{"type":257,"tag":268,"props":379,"children":380},{"style":275},[381],{"type":278,"value":382},"@param",{"type":257,"tag":268,"props":384,"children":385},{"style":282},[386],{"type":278,"value":387}," initial",{"type":257,"tag":268,"props":389,"children":390},{"style":356},[391],{"type":278,"value":392}," - Validated persisted object or new draft.\n",{"type":257,"tag":268,"props":394,"children":396},{"class":270,"line":395},7,[397,401,405,410],{"type":257,"tag":268,"props":398,"children":399},{"style":356},[400],{"type":278,"value":377},{"type":257,"tag":268,"props":402,"children":403},{"style":275},[404],{"type":278,"value":382},{"type":257,"tag":268,"props":406,"children":407},{"style":282},[408],{"type":278,"value":409}," persist",{"type":257,"tag":268,"props":411,"children":412},{"style":356},[413],{"type":278,"value":414}," - Optional synchronous storage write; throwing leaves the baseline unchanged.\n",{"type":257,"tag":268,"props":416,"children":418},{"class":270,"line":417},8,[419,423,428],{"type":257,"tag":268,"props":420,"children":421},{"style":356},[422],{"type":278,"value":377},{"type":257,"tag":268,"props":424,"children":425},{"style":275},[426],{"type":278,"value":427},"@returns",{"type":257,"tag":268,"props":429,"children":430},{"style":356},[431],{"type":278,"value":432}," A host whose requests cannot overwrite a newer accepted revision.\n",{"type":257,"tag":268,"props":434,"children":436},{"class":270,"line":435},9,[437],{"type":257,"tag":268,"props":438,"children":439},{"style":356},[440],{"type":278,"value":441}," *\u002F\n",{"type":257,"tag":268,"props":443,"children":445},{"class":270,"line":444},10,[446,451,456,462,467,473,478,483,488,492,497,502,507,511,515,520,525,531,536,540,545],{"type":257,"tag":268,"props":447,"children":448},{"style":275},[449],{"type":278,"value":450},"export",{"type":257,"tag":268,"props":452,"children":453},{"style":275},[454],{"type":278,"value":455}," function",{"type":257,"tag":268,"props":457,"children":459},{"style":458},"--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0",[460],{"type":278,"value":461}," createDiagramSession",{"type":257,"tag":268,"props":463,"children":464},{"style":282},[465],{"type":278,"value":466},"(",{"type":257,"tag":268,"props":468,"children":470},{"style":469},"--shiki-default:#E36209;--shiki-light:#E36209;--shiki-dark:#FFAB70",[471],{"type":278,"value":472},"initial",{"type":257,"tag":268,"props":474,"children":475},{"style":275},[476],{"type":278,"value":477},":",{"type":257,"tag":268,"props":479,"children":480},{"style":458},[481],{"type":278,"value":482}," TextDiagramEmbed",{"type":257,"tag":268,"props":484,"children":485},{"style":282},[486],{"type":278,"value":487},", ",{"type":257,"tag":268,"props":489,"children":490},{"style":458},[491],{"type":278,"value":91},{"type":257,"tag":268,"props":493,"children":494},{"style":275},[495],{"type":278,"value":496},"?:",{"type":257,"tag":268,"props":498,"children":499},{"style":282},[500],{"type":278,"value":501}," (",{"type":257,"tag":268,"props":503,"children":504},{"style":469},[505],{"type":278,"value":506},"next",{"type":257,"tag":268,"props":508,"children":509},{"style":275},[510],{"type":278,"value":477},{"type":257,"tag":268,"props":512,"children":513},{"style":458},[514],{"type":278,"value":482},{"type":257,"tag":268,"props":516,"children":517},{"style":282},[518],{"type":278,"value":519},") ",{"type":257,"tag":268,"props":521,"children":522},{"style":275},[523],{"type":278,"value":524},"=>",{"type":257,"tag":268,"props":526,"children":528},{"style":527},"--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF",[529],{"type":278,"value":530}," void",{"type":257,"tag":268,"props":532,"children":533},{"style":282},[534],{"type":278,"value":535},")",{"type":257,"tag":268,"props":537,"children":538},{"style":275},[539],{"type":278,"value":477},{"type":257,"tag":268,"props":541,"children":542},{"style":458},[543],{"type":278,"value":544}," DiagramSession",{"type":257,"tag":268,"props":546,"children":547},{"style":282},[548],{"type":278,"value":549}," {\n",{"type":257,"tag":268,"props":551,"children":553},{"class":270,"line":552},11,[554,559,564,569,574],{"type":257,"tag":268,"props":555,"children":556},{"style":275},[557],{"type":278,"value":558},"  let",{"type":257,"tag":268,"props":560,"children":561},{"style":282},[562],{"type":278,"value":563}," current ",{"type":257,"tag":268,"props":565,"children":566},{"style":275},[567],{"type":278,"value":568},"=",{"type":257,"tag":268,"props":570,"children":571},{"style":458},[572],{"type":278,"value":573}," readTextDiagram",{"type":257,"tag":268,"props":575,"children":576},{"style":282},[577],{"type":278,"value":578},"(initial);\n",{"type":257,"tag":268,"props":580,"children":582},{"class":270,"line":581},12,[583,588],{"type":257,"tag":268,"props":584,"children":585},{"style":275},[586],{"type":278,"value":587},"  return",{"type":257,"tag":268,"props":589,"children":590},{"style":282},[591],{"type":278,"value":549},{"type":257,"tag":268,"props":593,"children":595},{"class":270,"line":594},13,[596,601,605],{"type":257,"tag":268,"props":597,"children":598},{"style":356},[599],{"type":278,"value":600},"    \u002F** ",{"type":257,"tag":268,"props":602,"children":603},{"style":275},[604],{"type":278,"value":427},{"type":257,"tag":268,"props":606,"children":607},{"style":356},[608],{"type":278,"value":609}," The immutable accepted revision. *\u002F\n",{"type":257,"tag":268,"props":611,"children":613},{"class":270,"line":612},14,[614,619,624,629],{"type":257,"tag":268,"props":615,"children":616},{"style":458},[617],{"type":278,"value":618},"    read",{"type":257,"tag":268,"props":620,"children":621},{"style":282},[622],{"type":278,"value":623},"() { ",{"type":257,"tag":268,"props":625,"children":626},{"style":275},[627],{"type":278,"value":628},"return",{"type":257,"tag":268,"props":630,"children":631},{"style":282},[632],{"type":278,"value":633}," current; },\n",{"type":257,"tag":268,"props":635,"children":637},{"class":270,"line":636},15,[638,642,646],{"type":257,"tag":268,"props":639,"children":640},{"style":356},[641],{"type":278,"value":600},{"type":257,"tag":268,"props":643,"children":644},{"style":275},[645],{"type":278,"value":427},{"type":257,"tag":268,"props":647,"children":648},{"style":356},[649],{"type":278,"value":650}," A detached baseline with explicit commit and release callbacks. *\u002F\n",{"type":257,"tag":268,"props":652,"children":654},{"class":270,"line":653},16,[655,660],{"type":257,"tag":268,"props":656,"children":657},{"style":458},[658],{"type":278,"value":659},"    capture",{"type":257,"tag":268,"props":661,"children":662},{"style":282},[663],{"type":278,"value":664},"() {\n",{"type":257,"tag":268,"props":666,"children":668},{"class":270,"line":667},17,[669,674,679,684,689,694,698,703],{"type":257,"tag":268,"props":670,"children":671},{"style":275},[672],{"type":278,"value":673},"      const",{"type":257,"tag":268,"props":675,"children":676},{"style":527},[677],{"type":278,"value":678}," baseline",{"type":257,"tag":268,"props":680,"children":681},{"style":275},[682],{"type":278,"value":683}," =",{"type":257,"tag":268,"props":685,"children":686},{"style":282},[687],{"type":278,"value":688}," current, ",{"type":257,"tag":268,"props":690,"children":691},{"style":527},[692],{"type":278,"value":693},"expected",{"type":257,"tag":268,"props":695,"children":696},{"style":275},[697],{"type":278,"value":683},{"type":257,"tag":268,"props":699,"children":700},{"style":458},[701],{"type":278,"value":702}," serializeTextDiagram",{"type":257,"tag":268,"props":704,"children":705},{"style":282},[706],{"type":278,"value":707},"(baseline);\n",{"type":257,"tag":268,"props":709,"children":711},{"class":270,"line":710},18,[712,717,722,726,731],{"type":257,"tag":268,"props":713,"children":714},{"style":275},[715],{"type":278,"value":716},"      let",{"type":257,"tag":268,"props":718,"children":719},{"style":282},[720],{"type":278,"value":721}," released ",{"type":257,"tag":268,"props":723,"children":724},{"style":275},[725],{"type":278,"value":568},{"type":257,"tag":268,"props":727,"children":728},{"style":527},[729],{"type":278,"value":730}," false",{"type":257,"tag":268,"props":732,"children":733},{"style":282},[734],{"type":278,"value":311},{"type":257,"tag":268,"props":736,"children":738},{"class":270,"line":737},19,[739,744],{"type":257,"tag":268,"props":740,"children":741},{"style":275},[742],{"type":278,"value":743},"      return",{"type":257,"tag":268,"props":745,"children":746},{"style":282},[747],{"type":278,"value":549},{"type":257,"tag":268,"props":749,"children":751},{"class":270,"line":750},20,[752],{"type":257,"tag":268,"props":753,"children":754},{"style":282},[755],{"type":278,"value":756},"        document: baseline,\n",{"type":257,"tag":268,"props":758,"children":760},{"class":270,"line":759},21,[761,766,770,775,780,784],{"type":257,"tag":268,"props":762,"children":763},{"style":356},[764],{"type":278,"value":765},"        \u002F** ",{"type":257,"tag":268,"props":767,"children":768},{"style":275},[769],{"type":278,"value":382},{"type":257,"tag":268,"props":771,"children":772},{"style":282},[773],{"type":278,"value":774}," proposal",{"type":257,"tag":268,"props":776,"children":777},{"style":356},[778],{"type":278,"value":779}," - Source and preview proposed by the workbench. ",{"type":257,"tag":268,"props":781,"children":782},{"style":275},[783],{"type":278,"value":427},{"type":257,"tag":268,"props":785,"children":786},{"style":356},[787],{"type":278,"value":788}," Atomic host acceptance. *\u002F\n",{"type":257,"tag":268,"props":790,"children":792},{"class":270,"line":791},22,[793,798,802,807],{"type":257,"tag":268,"props":794,"children":795},{"style":458},[796],{"type":278,"value":797},"        commit",{"type":257,"tag":268,"props":799,"children":800},{"style":282},[801],{"type":278,"value":466},{"type":257,"tag":268,"props":803,"children":804},{"style":469},[805],{"type":278,"value":806},"proposal",{"type":257,"tag":268,"props":808,"children":809},{"style":282},[810],{"type":278,"value":811},") {\n",{"type":257,"tag":268,"props":813,"children":815},{"class":270,"line":814},23,[816,821,826,830,835],{"type":257,"tag":268,"props":817,"children":818},{"style":275},[819],{"type":278,"value":820},"          if",{"type":257,"tag":268,"props":822,"children":823},{"style":282},[824],{"type":278,"value":825}," (released) ",{"type":257,"tag":268,"props":827,"children":828},{"style":275},[829],{"type":278,"value":628},{"type":257,"tag":268,"props":831,"children":832},{"style":303},[833],{"type":278,"value":834}," \"missing\"",{"type":257,"tag":268,"props":836,"children":837},{"style":282},[838],{"type":278,"value":311},{"type":257,"tag":268,"props":840,"children":842},{"class":270,"line":841},24,[843,847,851,855,860,865,870,874,879],{"type":257,"tag":268,"props":844,"children":845},{"style":275},[846],{"type":278,"value":820},{"type":257,"tag":268,"props":848,"children":849},{"style":282},[850],{"type":278,"value":501},{"type":257,"tag":268,"props":852,"children":853},{"style":458},[854],{"type":278,"value":55},{"type":257,"tag":268,"props":856,"children":857},{"style":282},[858],{"type":278,"value":859},"(current) ",{"type":257,"tag":268,"props":861,"children":862},{"style":275},[863],{"type":278,"value":864},"!==",{"type":257,"tag":268,"props":866,"children":867},{"style":282},[868],{"type":278,"value":869}," expected) ",{"type":257,"tag":268,"props":871,"children":872},{"style":275},[873],{"type":278,"value":628},{"type":257,"tag":268,"props":875,"children":876},{"style":303},[877],{"type":278,"value":878}," \"conflict\"",{"type":257,"tag":268,"props":880,"children":881},{"style":282},[882],{"type":278,"value":311},{"type":257,"tag":268,"props":884,"children":886},{"class":270,"line":885},25,[887,892,897,901,905],{"type":257,"tag":268,"props":888,"children":889},{"style":275},[890],{"type":278,"value":891},"          const",{"type":257,"tag":268,"props":893,"children":894},{"style":527},[895],{"type":278,"value":896}," next",{"type":257,"tag":268,"props":898,"children":899},{"style":275},[900],{"type":278,"value":683},{"type":257,"tag":268,"props":902,"children":903},{"style":458},[904],{"type":278,"value":573},{"type":257,"tag":268,"props":906,"children":907},{"style":282},[908],{"type":278,"value":909},"(proposal);\n",{"type":257,"tag":268,"props":911,"children":913},{"class":270,"line":912},26,[914,918,923,927,932,937,942,946,951,956,961,966,971],{"type":257,"tag":268,"props":915,"children":916},{"style":275},[917],{"type":278,"value":820},{"type":257,"tag":268,"props":919,"children":920},{"style":282},[921],{"type":278,"value":922}," (next.id ",{"type":257,"tag":268,"props":924,"children":925},{"style":275},[926],{"type":278,"value":864},{"type":257,"tag":268,"props":928,"children":929},{"style":282},[930],{"type":278,"value":931}," baseline.id ",{"type":257,"tag":268,"props":933,"children":934},{"style":275},[935],{"type":278,"value":936},"||",{"type":257,"tag":268,"props":938,"children":939},{"style":282},[940],{"type":278,"value":941}," next.document.revision ",{"type":257,"tag":268,"props":943,"children":944},{"style":275},[945],{"type":278,"value":864},{"type":257,"tag":268,"props":947,"children":948},{"style":282},[949],{"type":278,"value":950}," baseline.document.revision ",{"type":257,"tag":268,"props":952,"children":953},{"style":275},[954],{"type":278,"value":955},"+",{"type":257,"tag":268,"props":957,"children":958},{"style":527},[959],{"type":278,"value":960}," 1",{"type":257,"tag":268,"props":962,"children":963},{"style":275},[964],{"type":278,"value":965}," ||",{"type":257,"tag":268,"props":967,"children":968},{"style":275},[969],{"type":278,"value":970}," !",{"type":257,"tag":268,"props":972,"children":973},{"style":282},[974],{"type":278,"value":975},"next.preview) {\n",{"type":257,"tag":268,"props":977,"children":979},{"class":270,"line":978},27,[980,985,990,995,999,1004],{"type":257,"tag":268,"props":981,"children":982},{"style":275},[983],{"type":278,"value":984},"            throw",{"type":257,"tag":268,"props":986,"children":987},{"style":275},[988],{"type":278,"value":989}," new",{"type":257,"tag":268,"props":991,"children":992},{"style":458},[993],{"type":278,"value":994}," TypeError",{"type":257,"tag":268,"props":996,"children":997},{"style":282},[998],{"type":278,"value":466},{"type":257,"tag":268,"props":1000,"children":1001},{"style":303},[1002],{"type":278,"value":1003},"\"Invalid diagram save\"",{"type":257,"tag":268,"props":1005,"children":1006},{"style":282},[1007],{"type":278,"value":1008},");\n",{"type":257,"tag":268,"props":1010,"children":1012},{"class":270,"line":1011},28,[1013],{"type":257,"tag":268,"props":1014,"children":1015},{"style":282},[1016],{"type":278,"value":1017},"          }\n",{"type":257,"tag":268,"props":1019,"children":1021},{"class":270,"line":1020},29,[1022],{"type":257,"tag":268,"props":1023,"children":1024},{"style":356},[1025],{"type":278,"value":1026},"          \u002F\u002F Storage must succeed before publishing the new revision to the UI.\n",{"type":257,"tag":268,"props":1028,"children":1030},{"class":270,"line":1029},30,[1031,1036],{"type":257,"tag":268,"props":1032,"children":1033},{"style":458},[1034],{"type":278,"value":1035},"          persist",{"type":257,"tag":268,"props":1037,"children":1038},{"style":282},[1039],{"type":278,"value":1040},"?.(next);\n",{"type":257,"tag":268,"props":1042,"children":1044},{"class":270,"line":1043},31,[1045,1050,1054],{"type":257,"tag":268,"props":1046,"children":1047},{"style":282},[1048],{"type":278,"value":1049},"          current ",{"type":257,"tag":268,"props":1051,"children":1052},{"style":275},[1053],{"type":278,"value":568},{"type":257,"tag":268,"props":1055,"children":1056},{"style":282},[1057],{"type":278,"value":1058}," next;\n",{"type":257,"tag":268,"props":1060,"children":1062},{"class":270,"line":1061},32,[1063,1068,1073],{"type":257,"tag":268,"props":1064,"children":1065},{"style":275},[1066],{"type":278,"value":1067},"          return",{"type":257,"tag":268,"props":1069,"children":1070},{"style":303},[1071],{"type":278,"value":1072}," \"saved\"",{"type":257,"tag":268,"props":1074,"children":1075},{"style":282},[1076],{"type":278,"value":311},{"type":257,"tag":268,"props":1078,"children":1080},{"class":270,"line":1079},33,[1081],{"type":257,"tag":268,"props":1082,"children":1083},{"style":282},[1084],{"type":278,"value":1085},"        },\n",{"type":257,"tag":268,"props":1087,"children":1089},{"class":270,"line":1088},34,[1090],{"type":257,"tag":268,"props":1091,"children":1092},{"style":356},[1093],{"type":278,"value":1094},"        \u002F** Closes this target without changing the accepted object. *\u002F\n",{"type":257,"tag":268,"props":1096,"children":1098},{"class":270,"line":1097},35,[1099,1104,1109,1113,1118],{"type":257,"tag":268,"props":1100,"children":1101},{"style":458},[1102],{"type":278,"value":1103},"        release",{"type":257,"tag":268,"props":1105,"children":1106},{"style":282},[1107],{"type":278,"value":1108},"() { released ",{"type":257,"tag":268,"props":1110,"children":1111},{"style":275},[1112],{"type":278,"value":568},{"type":257,"tag":268,"props":1114,"children":1115},{"style":527},[1116],{"type":278,"value":1117}," true",{"type":257,"tag":268,"props":1119,"children":1120},{"style":282},[1121],{"type":278,"value":1122},"; },\n",{"type":257,"tag":268,"props":1124,"children":1126},{"class":270,"line":1125},36,[1127],{"type":257,"tag":268,"props":1128,"children":1129},{"style":282},[1130],{"type":278,"value":1131},"      };\n",{"type":257,"tag":268,"props":1133,"children":1135},{"class":270,"line":1134},37,[1136],{"type":257,"tag":268,"props":1137,"children":1138},{"style":282},[1139],{"type":278,"value":1140},"    },\n",{"type":257,"tag":268,"props":1142,"children":1144},{"class":270,"line":1143},38,[1145],{"type":257,"tag":268,"props":1146,"children":1147},{"style":282},[1148],{"type":278,"value":1149},"  };\n",{"type":257,"tag":268,"props":1151,"children":1153},{"class":270,"line":1152},39,[1154],{"type":257,"tag":268,"props":1155,"children":1156},{"style":282},[1157],{"type":278,"value":1158},"}\n",{"type":257,"tag":1160,"props":1161,"children":1162},"style",{},[1163],{"type":278,"value":1164},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",1793045390059]