PageSourceSearch

https://www.deta.studio/_next/static/chunks/d65cb519feac199c.js

js deta.studio collected 2026-10-02 01:13:48 UTC 20,659 bytes, 27 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,92372,e=>{"use strict";e.s([],577648),e.i(577648);var t=e.i(391610),r=e.i(138415),n=e.i(735924),i=e.i(875487),a=e.i(539780),o=e.i(292908),l=e.i(880449),s=e.i(502916),d=e.i(784711);let u=["annotations-changed","comments-changed","book-changed"],c=new WeakMap;function f(e,t){let n=(0,r.useRef)(e);n.current=e;let i=(0,r.useRef)(null),a=(0,r.useMemo)(()=>()=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>n.current(),t)},[t]);return(0,r.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[]),a}var p=e.i(223182);e.i(916612);var h=e.i(698481),m=e.i(679094);async function g(e){let t=(await h.offlineOpLog.list()).filter(t=>t.branchId===e),r=new Map,n=new Map,i=[];for(let e of t){let t=e.kind??"persist";if("picture"===t&&e.picture)r.set(e.picture.shapeId,{data:e.picture.data,mimeType:e.picture.mimeType});else if("attachment"===t&&e.attachment){let t=n.get(e.attachment.annotationId)??[];t.push(e),n.set(e.attachment.annotationId,t)}else"response"===t&&e.response&&i.push(e.response)}let a=new Map;for(let e of t)if((e.kind??"persist")==="persist"){for(let t of e.creates)a.set(t.id,function(e,t){if(void 0!==e.z_key)return e;let r=null;for(let n of t.values())n.page_number===e.page_number&&(n.manifest_entry_id??null)===(e.manifest_entry_id??null)&&void 0!==n.z_key&&(null===r||n.z_key>r)&&(r=n.z_key);return{...e,z_key:(0,m.stackKeyAbove)(r)}}({id:t.id,page_number:t.pageNumber,manifest_entry_id:t.manifestEntryId??null,type:t.type,geometry:t.geometry,stroke_color:t.strokeColor??null,fill_color:t.fillColor??null,stroke_width:t.strokeWidth??null,opacity:t.opacity??null,marker_type:t.markerType??null,text_content:t.textContent??null,text_offset:t.textOffset??null,attached_annotation_id:t.attachedAnnotationId??null,attached_at:t.attachedAt??null,system_authored:t.systemAuthored??!1,locked:t.locked??!1,text_anchor:t.textAnchor??null,pinned:t.pinned??!1,from_version_diff_id:t.fromVersionDiffId??null,from_region_id:t.fromRegionId??null,from_bbox:t.fromBbox??null,group_id:t.groupId??null,...void 0!==t.zKey?{z_key:t.zKey}:{}},a));for(let t of e.updates){let e=a.get(t.id);e&&a.set(t.id,function(e,t){let r={...e,geometry:t.geometry};return void 0!==t.pageNumber&&(r.page_number=t.pageNumber),void 0!==t.strokeColor&&(r.stroke_color=t.strokeColor),void 0!==t.strokeWidth&&(r.stroke_width=t.strokeWidth),void 0!==t.fillColor&&(r.fill_color=t.fillColor),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.textContent&&(r.text_content=t.textContent),void 0!==t.textOffset&&(r.text_offset=t.textOffset),void 0!==t.systemAuthored&&(r.system_authored=t.systemAuthored),void 0!==t.locked&&(r.locked=t.locked),void 0!==t.pinned&&(r.pinned=t.pinned),void 0!==t.textAnchor&&(r.text_anchor=t.textAnchor),void 0!==t.fromVersionDiffId&&(r.from_version_diff_id=t.fromVersionDiffId),void 0!==t.fromRegionId&&(r.from_region_id=t.fromRegionId),void 0!==t.fromBbox&&(r.from_bbox=t.fromBbox),void 0!==t.zKey&&(r.z_key=t.zKey),r}(e,t))}for(let t of e.deletes)a.delete(t)}for(let[e,t]of(await Promise.all(Array.from(a.values()).map(async e=>{var t,n;let i=r.get(e.id);if(!i)return;let a=await (t=i.data,n=i.mimeType,new Promise((e,r)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>r(i.error),i.readAsDataURL(new Blob([t],{type:n}))}));e.geometry={...e.geometry,src:a}})),n)){let r=a.get(e);r&&(r.attachments=t.map(e=>{let t=e.attachment;return{id:t.attachmentId,storage_path:"",file_name:t.fileName,mime_type:t.mimeType,byte_size:t.data.byteLength,response_id:t.responseId,local_url:URL.createObjectURL(new Blob([t.data],{type:t.mimeType}))}}))}for(let e of i){let t=a.get(e.annotationId);if(t)if("add"===e.op)t.responses=[...t.responses??[],{id:e.responseId,text:e.text??"",created_by:e.authorId??null,author_name:e.authorName??null,author_picture_url:e.authorPictureUrl??null,author_role:e.authorRole??null,created_at:e.createdAt??null}];else if("edit"===e.op){let r=t.responses?.find(t=>t.id===e.responseId);r&&(r.text=e.text??r.text)}else t.responses=(t.responses??[]).filter(t=>t.id!==e.responseId)}return Array.from(a.values())}var y=e.i(397853);e.i(577630);var w=e.i(455852),v=e.i(190034),_=e.i(372080);let R=["renderedWidth","renderedHeight","baselineOffset","centerToBaseline","renderedLineHeight","wrappedLines"],S=["responses","statusEvents","status"];function b(e,t){return void 0!==t&&e.zKey!==t.zKey}function k({versionId:e,initialAnnotations:h,isExternallySourced:k,initialBranchId:I,autoBranch:E,initialSeq:N,isReadOnly:T,forceReadOnly:C=!1,setIsReadOnly:B,drawingSetId:x,accountId:A,siteVisitLock:P,paneId:M,shareToken:z,children:O}){var U;let L,V,D,q,F,K,$,j,W,H,Q,{state:Y,setShapesWithoutHistory:G,reconcileShapes:J,adoptStackKeys:X,clearSelection:Z}=(0,l.useDrawingStore)(),[ee,et]=(0,r.useState)(I??null),er=(U=Y.shapes,L=(0,r.useRef)(!1),V=(0,r.useRef)(!1),D=(0,r.useRef)(new Set),q=(0,r.useRef)(new Set),F=(0,r.useRef)(new Set),K=(0,r.useRef)(new Set),$=(0,r.useRef)(new Map),j=(0,r.useRef)(new Map),W=(0,r.useRef)(U),H=(0,r.useRef)(new Set),Q=(0,r.useRef)(!1),W.current=U,{initializedRef:L,skipNextPersistRef:V,dbIdsRef:D,pendingCreatesRef:q,pendingSavesRef:F,pendingDeletesRef:K,idMappingRef:$,prevShapesRef:j,shapesRef:W,realtimeIdsRef:H,reconcilerFrozenRef:Q}),en=P.active&&!P.readOnly&&ee===P.privateBranchId,ei=!!P.privateBranchId&&ee===P.privateBranchId,{reconcile:ea}=function({versionId:e,branchId:t,drawingSetId:n,shareToken:i,enabled:a=!0,refs:o,reconcileShapes:l}
1){let u=(0,s.useSupabase)(),c=(0,r.useMemo)(()=>({versionId:e,branchId:t,drawingSetId:n,shareToken:i,enabled:a,fetching:!1,requested:!1,active:!0}),[e,t,n,i,a]),f=(0,r.useRef)(c);return f.current=c,(0,r.useEffect)(()=>(c.active=!0,()=>{c.active=!1}),[c]),{reconcile:(0,r.useCallback)(async()=>{if(!(!a||(0,d.isLocalViewerMode)(e))&&c.active&&f.current===c&&e&&!o.reconcilerFrozenRef.current){if(c.fetching){c.requested=!0;return}c.fetching=!0;try{do{c.requested=!1;try{let r=[];if(i&&n){let a=new URLSearchParams({versionId:e,branchId:t??"main"});a.set("token",i);let o=await fetch(`/api/external/${n}/annotations?${a}`);if(!o.ok)throw Error(`Share fetch failed: ${o.status}`);r=(await o.json()).annotations??[]}else{let n=(r,n)=>{let i=u.from("annotations").select(`
2              *,
3              annotation_responses (
4                id,
5                text,
6                created_by,
7                created_at,
8                imported_author_name
9              ),
10              annotation_status_events (
11                id,
12                status,
13                created_by,
14                created_at
15              ),
16              attachments:annotation_attachments (
17                id,
18                storage_path,
19                file_name,
20                mime_type,
21                byte_size,
22                created_by,
23                imported_author_name,
24                created_at,
25                response_id
26              )
27            `).eq("drawing_set_version_id",e);return(i=t?i.eq("branch_id",t):i.is("branch_id",null)).order("created_at").order("id").range(r,n)},i=0,a=!0;for(;a;){let{data:e,error:t}=await n(i,i+1e3-1);if(t)throw t;let o=e??[];r=r.concat(o),i+=o.length,a=1e3===o.length}r=(0,m.sortRowsByStackOrder)(r)}if(!c.active||f.current!==c||o.reconcilerFrozenRef.current)return;let a=o.shapesRef.current,{pendingCreatesRef:s,pendingSavesRef:d,idMappingRef:h}=o,g=new Map(a.map(e=>[e.id,e])),y=function(e){let t=new Map,r=(e,r,n,i)=>{!e||!r||t.has(e)||t.set(e,{name:r,pictureUrl:n??null,role:i??null})};for(let t of e){for(let e of(t.systemAuthored||r(t.createdBy,t.createdByName,t.createdByPictureUrl,t.createdByRole),t.responses??[]))r(e.authorId,e.authorName,e.authorPictureUrl,e.authorRole);for(let e of t.statusEvents??[])r(e.authorId,e.authorName,e.authorPictureUrl,e.authorRole)}return t}(a),w=[],v=new Set;for(let e of r){let t=(0,p.annotationToShape)(e);if(t&&!o.pendingDeletesRef.current.has(t.id)){if(null==t.createdByName){let e=g.get(t.id),r=e?.createdByName?{name:e.createdByName,pictureUrl:e.createdByPictureUrl??null,role:e.createdByRole??null}:t.createdBy?y.get(t.createdBy):void 0;r&&(t.createdByName=r.name,t.createdByPictureUrl=r.pictureUrl,t.createdByRole=r.role)}for(let e of t.responses??[]){if(e.authorName)continue;let t=y.get(e.authorId);t&&(e.authorName=t.name,e.authorPictureUrl=t.pictureUrl??void 0,e.authorRole=t.role)}for(let e of t.statusEvents??[]){if(e.authorName)continue;let t=y.get(e.authorId);t&&(e.authorName=t.name,e.authorPictureUrl=t.pictureUrl??void 0,e.authorRole=t.role)}if("picture"===t.type&&t.filePath){let e=g.get(t.id);e?.type==="picture"&&e.filePath===t.filePath&&e.src&&(t.src=e.src)}w.push(t),v.add(t.id)}}let _=new Set([...s.current,...d.current]),R=new Map;for(let[e,t]of h.current.entries())R.set(t,e);let S=[...w];for(let e of a){if(v.has(e.id))continue;let t=h.current.get(e.id);!(t&&v.has(t))&&_.has(e.id)&&S.push(e)}o.skipNextPersistRef.current=!0,o.dbIdsRef.current=new Set(v),o.prevShapesRef.current=new Map(S.map(e=>[e.id,e])),l(S)}catch(e){console.error("[reconciler] Failed to refresh annotations:",e)}}while(c.requested&&c.active&&f.current===c)}finally{c.fetching=!1}}},[c,a,e,t,n,i,o,l,u])}}({versionId:e,branchId:ee,drawingSetId:x,shareToken:z,enabled:!ei,refs:er,reconcileShapes:J});!function({versionId:e,initialAnnotations:t,isReadOnly:n,refs:i,setShapesWithoutHistory:a}){let{initializedRef:o,skipNextPersistRef:l,dbIdsRef:s,prevShapesRef:u}=i;(0,r.useEffect)(()=>{if(o.current)return;o.current=!0;let r=(0,d.isLocalViewerMode)(e)?(0,y.getLocalDrawingState)(e):null,n=r?.getSeed(),i=n??[];for(let e of n?[]:t){let t=(0,p.annotationToShape)(e);t&&(i.push(t),s.current.add(t.id))}for(let e of i)s.current.add(e.id);
27r?.markInitialized(),u.current=new Map(i.map(e=>[e.id,e])),l.current=!0,!n&&i.length>0&&a(i)},[t,n,a,i])}({versionId:e,initialAnnotations:ei?[]:h,isReadOnly:T,refs:er,setShapesWithoutHistory:G});let eo=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!ei||!ee){ei||(eo.current=null);return}if(eo.current===ee)return;let e=!1;return g(ee).then(t=>{if(e)return;let r=t.map(e=>(0,p.annotationToShape)(e)).filter(e=>null!==e);er.skipNextPersistRef.current=!0,er.dbIdsRef.current=new Set(r.map(e=>e.id)),er.idMappingRef.current.clear(),er.pendingCreatesRef.current.clear(),er.pendingSavesRef.current.clear(),er.pendingDeletesRef.current.clear(),er.prevShapesRef.current=new Map(r.map(e=>[e.id,e])),Z(),G(r),eo.current=ee}),()=>{e=!0}},[ei,ee]),function({enabled:e,drawingSetId:t,versionId:n,branchId:i,shareToken:a,refs:o,reconcileShapes:l}){(0,r.useEffect)(()=>{if(!e||!n||(0,d.isLocalViewerMode)(n))return;let r=!1,s=e=>{if(o.reconcilerFrozenRef.current)return;let t=[],r=new Set;for(let n of e){let e=(0,p.annotationToShape)(n);e&&(t.push(e),r.add(e.id))}let n=new Set([...o.pendingCreatesRef.current,...o.pendingSavesRef.current]),i=[...t];for(let e of o.shapesRef.current){if(r.has(e.id))continue;let t=o.idMappingRef.current.get(e.id);!(t&&r.has(t))&&n.has(e.id)&&i.push(e)}o.skipNextPersistRef.current=!0,o.dbIdsRef.current=new Set(r),o.prevShapesRef.current=new Map(i.map(e=>[e.id,e])),l(i)};return(async()=>{let e=new URLSearchParams({versionId:n,branchId:i??"main"});a&&e.set("token",a);let o=`/api/external/${t}/annotations?${e}`;for(let e=1;e<=3;e++){if(r)return;try{let e=await fetch(o);if(!e.ok)throw Error(`HTTP ${e.status}`);let t=await e.json();if(r)return;s(t.annotations??[]);return}catch(t){if(3===e)return void console.warn("[background-load] Failed to load remaining annotations:",t);await new Promise(t=>setTimeout(t,400*e))}}})(),()=>{r=!0}},[])}({enabled:!ei,drawingSetId:x,versionId:e,branchId:ee,shareToken:z,refs:er,reconcileShapes:J});let el=(0,n.useQueryClient)(),{signalAnnotationsChanged:es,signalBookChanged:ed}=function({versionId:e,branchId:t,onAnnotationsChanged:n,onCommentsChanged:i,onBookChanged:a}){let o=(0,s.useSupabase)(),l=(0,r.useRef)(null),p=f(n,150),h=f(i,150),m=f(a,200);(0,r.useEffect)(()=>{var r;let n,i,a,s,f,g,y,w,v;if(!e||(0,d.isLocalViewerMode)(e))return;let _=(r=e=>{"annotations-changed"===e?p():"comments-changed"===e?h():m()},n=`sync:${e}:${t??"main"}`,(i=c.get(o))||(i=new Map,c.set(o,i)),(a=i.get(n))||(a={channel:null,listeners:new Set,pending:new Set,sending:!1,retry:null,teardown:null,removing:null},i.set(n,a)),s=a,f=i,s.teardown&&clearTimeout(s.teardown),s.teardown=null,s.listeners.add(r),g=e=>{for(let t of s.listeners)t(e)},y=async()=>{let e=s.channel;if(!e||s.sending||!s.pending.size)return;s.sending=!0;let t=[...s.pending];s.pending.clear();let r=!1;try{for(let n of t)try{if("joined"===e.state&&o.realtime.isConnected()){let t=await e.send({type:"broadcast",event:n,payload:{}},{timeout:5e3});if("ok"===t)continue}let t=await e.httpSend(n,{},{timeout:5e3});if(!t.success)throw Error(t.error)}catch(e){r=!0,s.pending.add(n),console.warn("[annotation-sync] Broadcast failed; will retry",e)}}finally{s.sending=!1,s.pending.size&&s.listeners.size&&!r?y():s.pending.size&&s.listeners.size&&!s.retry&&(s.retry=setTimeout(()=>{s.retry=null,y()},5e3))}},w=()=>{if(s.channel||s.removing||!s.listeners.size)return;let e=o.channel(n,{config:{broadcast:{self:!1,ack:!0}}});for(let t of(s.channel=e,u))e.on("broadcast",{event:t},()=>g(t));e.subscribe(t=>{if(s.channel===e&&"SUBSCRIBED"===t){for(let e of u)g(e);y()}})},s.removing?s.removing.then(w):w(),v=!1,{signal(e){if(!v){for(let t of s.listeners)t!==r&&t(e);s.pending.add(e),y()}},refresh(){if(!v){for(let e of u)r(e);y()}},release(){v||(v=!0,s.listeners.delete(r),s.listeners.size||(s.teardown=setTimeout(()=>{s.teardown=null,s.retry&&clearTimeout(s.retry),s.retry=null;let e=s.channel;s.channel=null,s.removing=(e?o.removeChannel(e):Promise.resolve()).finally(()=>{s.removing=null,s.listeners.size?w():f.delete(n)})},2e3)))}});l.current=_;let R=()=>{"visible"===document.visibilityState&&_.refresh()};return window.addEventListener("online",R),window.addEventListener("focus",R),document.addEventListener("visibilitychange",R),()=>{window.removeEventListener("online",R),window.removeEventListener("focus",R),document.removeEventListener("visibilitychange",R),_.release(),l.current=null}},[e,t,o,p,h,m]);let g=(0,r.useCallback)(()=>{l.current?.signal("annotations-changed")},[]);return{signalAnnotationsChanged:g,signalCommentsChanged:(0,r.useCallback)(()=>{l.current?.signal("comments-changed")},[]),signalBookChanged:(0,r.useCallback)(()=>{l.current?.signal("book-changed")},[])}}({versionId:e,branchId:ee,onAnnotationsChanged:ea,onCommentsChanged:ea,onBookChanged:()=>
27{el.invalidateQueries({queryKey:["version-book",e]})}});(0,r.useEffect)(()=>(0,a.onBookChange)(t=>{t===e&&ed()}),[e,ed]),(0,r.useEffect)(()=>(0,a.onMarkCascade)(t=>{t===e&&(ea(),es())}),[e,ea,es]);let{resetSeq:eu,setQueueBranchId:ec,clearQueue:ef}=function({versionId:e,branchId:t,durable:n,drawingId:a,accountId:o,shapes:l,localShapeState:s,isReadOnly:d,setIsReadOnly:u,isExternallySourced:c,initialSeq:f,refs:p,autoBranch:h,setShapes:m,adoptStackKeys:g,onPersisted:y}){let{t:k}=(0,w.useTranslation)("drawings"),{initializedRef:I,skipNextPersistRef:E,dbIdsRef:N,pendingCreatesRef:T,pendingSavesRef:C,pendingDeletesRef:B,idMappingRef:x,prevShapesRef:A,shapesRef:P,realtimeIdsRef:M}=p,z=(0,r.useCallback)(e=>x.current.get(e)??e,[x]),O=(0,r.useCallback)(e=>{let t=new Map(P.current.map(e=>[e.id,e])),r=e.filter(e=>{let r=t.get(e.id);return void 0!==r&&void 0===r.zKey});if(0!==r.length){for(let{id:e,zKey:t}of r){let r=A.current.get(e);r&&A.current.set(e,{...r,zKey:t})}g(r)}},[g,A,P]),U=(0,_.useOpQueue)({versionId:e,branchId:t,durable:n,drawingId:a,accountId:o,initialSeq:f,resolveDbId:z,onOpComplete:(t,r,n)=>{for(let e of t.creates)N.current.add(e.id),T.current.delete(e.id),C.current.delete(e.id);for(let e of(O(n),t.deletes))B.current.delete(e);y(),(0,v.emitAnnotationsPersisted)(e)},onPersistenceFailure:(e,t)=>{if(u(!0),B.current.clear(),e.length>0){let t=new Set(e),r=P.current.filter(e=>!t.has(e.id));E.current=!0,A.current=new Map(r.map(e=>[e.id,e])),m(r)}i.notify.sticky("persistence-failure",k("useShapePersistence.saveFailed"))},onSeqMismatch:e=>{B.current.clear(),i.notify.warning(k("useShapePersistence.syncFailed"),{duration:1e4,id:"seq-mismatch"})}});return(0,r.useEffect)(()=>{U.setBranchId(t)},[t,U]),(0,r.useEffect)(()=>{if(!I.current)return;if(d){A.current=new Map(l.map(e=>[e.id,e]));return}if(E.current){E.current=!1,A.current=new Map(l.map(e=>[e.id,e]));return}if(Object.keys(s).length>0)return;let e=A.current,r=new Set(l.map(e=>e.id)),n=new Set(x.current.values()),i=l.filter(t=>!(e.has(t.id)||N.current.has(t.id)||M.current.has(t.id)||n.has(t.id)||"isUploading"in t&&t.isUploading||T.current.has(t.id))),a=[];for(let[t,n]of e)r.has(t)||a.push(n);let u=l.filter(t=>{let r=e.get(t.id);if(!r)return!1;if(t===r)return!1;if(t.x!==r.x||t.y!==r.y||t.rotation!==r.rotation||t.stroke!==r.stroke||t.strokeWidth!==r.strokeWidth||t.fill!==r.fill||t.opacity!==r.opacity||t.strokeOpacity!==r.strokeOpacity)return!0;let n=e=>{let t={...e};for(let e of R)delete t[e];for(let e of S)delete t[e];return t};return JSON.stringify(n(t))!==JSON.stringify(n(r))}).filter(e=>!M.current.has(e.id)),f=a.filter(e=>!M.current.has(e.id)),p=i.length>0||u.length>0||f.length>0;if(c&&null===t&&p&&!h.isCreatingRef.current){let t=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;for(let e of i)C.current.add(e.id),T.current.add(e.id);let r=u.filter(e=>t.test(e.id)).map(t=>(0,_.buildUpdatePayload)(t,t.id,b(t,e.get(t.id)))),n=[];for(let e of f){if(T.current.has(e.id)){T.current.delete(e.id),C.current.delete(e.id);continue}t.test(e.id)&&n.push(e.id)}h.ensureBranch({pendingCreates:i.map(e=>(0,_.buildCreatePayload)(e,o)),pendingUpdates:r,pendingDeletes:n}),A.current=new Map(l.filter(e=>!("isUploading"in e&&e.isUploading)).map(e=>[e.id,e]));return}let m=[];for(let e of i){if(N.current.has(e.id)||M.current.has(e.id)||n.has(e.id)||C.current.has(e.id))continue;C.current.add(e.id),T.current.add(e.id);let t="comment"===e.type&&e.attachedShapeId?{...e,attachedShapeId:x.current.get(e.attachedShapeId)??e.attachedShapeId}:e;m.push(t)}let g=[],y=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;for(let t of u){let r=z(t.id);y.test(r)&&g.push({shape:t,dbId:r,restacked:b(t,e.get(t.id))})}let w=[];for(let e of f){if(M.current.has(e.id))continue;if(T.current.has(e.id)){T.current.delete(e.id),C.current.delete(e.id);continue}let t=z(e.id);y.test(t)&&(x.current.delete(e.id),N.current.delete(e.id),N.current.delete(t),B.current.add(t),w.push(t))}U.enqueueOp(m,g,w),A.current=new Map(l.filter(e=>!("isUploading"in e&&e.isUploading)).map(e=>[e.id,e]))},[l,s,e,t,o,d,u,c,p,h,U,z,f]),{resetSeq:U.resetSeq,setQueueBranchId:U.setBranchId,clearQueue:U.clear}}({versionId:e,branchId:ee,durable:en,drawingId:x,accountId:A,shapes:Y.shapes,localShapeState:Y.localShapeState,isReadOnly:T,setIsReadOnly:B,isExternallySourced:k,initialSeq:N,refs:er,autoBranch:E,setShapes:G,adoptStackKeys:X,onPersisted:es}),ep=(0,r.useRef)(T);ep.current=T;let eh=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=e=>
27{er.skipNextPersistRef.current=!0,er.dbIdsRef.current=new Set(e.map(e=>e.id)),er.idMappingRef.current.clear(),er.pendingCreatesRef.current.clear(),er.pendingSavesRef.current.clear(),er.pendingDeletesRef.current.clear(),er.prevShapesRef.current=new Map(e.map(e=>[e.id,e])),Z(),G(e)},t=t=>{let{annotations:r}=t.detail;e(r.map(e=>(0,p.annotationToShape)(e)).filter(e=>null!==e))},r=t=>{let r=t.detail;if(r.drawingSetId&&r.drawingSetId!==x||M&&r.paneId&&r.paneId!==M)return;i.notify.dismiss("persistence-failure");let{annotations:n,isReadOnly:a,branchId:o,updateStateOnly:l,seq:s}=r;if(l||void 0===n){B(C||a),et(o),ec(o),ef();return}let d=n.map(e=>(0,p.annotationToShape)(e)).filter(e=>null!==e);B(C||a),et(o),ec(o),void 0!==s?eu(s):ef(),e(d)},n=t=>{let r=t.detail;if(r.drawingSetId!==x||r.paneId&&M&&r.paneId!==M)return;let n=r.annotations.map(e=>(0,p.annotationToShape)(e)).filter(e=>null!==e);if(er.reconcilerFrozenRef.current=r.active,r.active)null===eh.current&&(eh.current=ep.current),B(!0);else{let e=eh.current??!1;eh.current=null,B(C||e)}e(n)};
27return window.addEventListener(o.SYNC_ANNOTATIONS_EVENT,t),window.addEventListener(o.BRANCH_NAVIGATE_EVENT,r),window.addEventListener(o.ANNOTATION_OVERRIDE_EVENT,n),()=>{window.removeEventListener(o.SYNC_ANNOTATIONS_EVENT,t),window.removeEventListener(o.BRANCH_NAVIGATE_EVENT,r),window.removeEventListener(o.ANNOTATION_OVERRIDE_EVENT,n)}},[C,er,G,Z,eu,ec,ef,B,x,M]),(0,r.useEffect)(()=>{window.dispatchEvent(new CustomEvent(o.PERSISTENCE_READY_EVENT))},[]),(0,t.jsx)(t.Fragment,{children:O})}e.s(["DrawingPersistence",()=>k],92372)},413219,e=>{e.n(e.i(92372))}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.