@ibgib/space-gib 0.0.12 → 0.0.13
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/client/bootstrap.mjs +1 -1
- package/dist/client/chunk-ROJZUPPE.mjs +19 -0
- package/dist/client/{chunk-GCWH3SH4.mjs.map → chunk-ROJZUPPE.mjs.map} +3 -3
- package/dist/client/{chunk-I7KNBFG3.mjs → chunk-WJHRARK6.mjs} +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/client/index.mjs.map +2 -2
- package/dist/client/script.mjs +1 -1
- package/dist/server/server.mjs +111 -105
- package/dist/server/server.mjs.map +3 -3
- package/package.json +4 -4
- package/src/client/AUTO-GENERATED-version.mts +1 -1
- package/dist/client/chunk-GCWH3SH4.mjs +0 -21
- /package/dist/client/{chunk-I7KNBFG3.mjs.map → chunk-WJHRARK6.mjs.map} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as Ct,Ab as St,Ac as Xt,Ba as ds,Bb as vs,Bc as Yt,C as z,Cb as Is,D as ss,Db as Ot,E as Je,Eb as ui,F as rt,Gb as D,Gc as Qt,H as rs,Hb as zt,I as as,Ic as Gs,J as oe,Jc as ee,Lb as Kt,Ma as qt,Mc as Ms,Nb as Ts,Ob as Cs,Pb as _s,Qb as Ss,Rb as As,Ub as Jt,Va as us,Wa as fs,X as ls,Xa as ps,Y as cs,_b as xs,a as p,b as Ut,d as ie,dc as Ns,e as Ft,eb as di,ec as de,f as Bt,fb as We,fc as at,g as ns,h as L,hb as Q,i as H,ib as K,j as y,kc as ue,l as Ke,mb as J,n as It,nc as $s,o as st,ob as hs,oc as Ge,p as Vt,pb as ms,q as Ht,qb as gs,r as Tt,rb as bs,sb as ys,tc as Ps,u as W,ub as Es,uc as fi,v as is,vb as ws,w as C,wb as _t,x as q,xb as se,xc as pi,yb as Pe,yc as Wt,z as os,zb as ve,zc as Rs}from"./chunk-
|
|
1
|
+
import{A as Ct,Ab as St,Ac as Xt,Ba as ds,Bb as vs,Bc as Yt,C as z,Cb as Is,D as ss,Db as Ot,E as Je,Eb as ui,F as rt,Gb as D,Gc as Qt,H as rs,Hb as zt,I as as,Ic as Gs,J as oe,Jc as ee,Lb as Kt,Ma as qt,Mc as Ms,Nb as Ts,Ob as Cs,Pb as _s,Qb as Ss,Rb as As,Ub as Jt,Va as us,Wa as fs,X as ls,Xa as ps,Y as cs,_b as xs,a as p,b as Ut,d as ie,dc as Ns,e as Ft,eb as di,ec as de,f as Bt,fb as We,fc as at,g as ns,h as L,hb as Q,i as H,ib as K,j as y,kc as ue,l as Ke,mb as J,n as It,nc as $s,o as st,ob as hs,oc as Ge,p as Vt,pb as ms,q as Ht,qb as gs,r as Tt,rb as bs,sb as ys,tc as Ps,u as W,ub as Es,uc as fi,v as is,vb as ws,w as C,wb as _t,x as q,xb as se,xc as pi,yb as Pe,yc as Wt,z as os,zb as ve,zc as Rs}from"./chunk-ROJZUPPE.mjs";var _e=J,hi=class n{static{p(this,"IbGibComponentService")}lc=`[${n.name}]`;_registeredComponentsMeta=[];initialized;constructor(){this.initialized=this.initialize()}async initialize(){let e=`[${this.initialize.name}]`;try{_e&&console.log(`${e} starting... (I: 1cf04e8d768f4b5c55e7c3861e2d2225)`),console.log(`${e} does nothing atow (I: 65bb46c88c82b637ad928b8bf1a07225)`)}catch(t){throw console.error(`${e} ${y(t)}`),t}finally{_e&&console.log(`${e} complete.`)}}registerComponentMeta(e){this._registeredComponentsMeta.push(e),_e&&console.log(`${this.lc}[registerComponentMeta] component meta registered: ${e.constructor.name} (I: 88ddcbd0c8caa2342af0e7348f171225)`)}unregisterComponentMeta(e){this._registeredComponentsMeta=this._registeredComponentsMeta.filter(t=>t!==e),_e&&console.log(`${this.lc}[unregisterComponentMeta] component meta unregistered: ${e.constructor.name} (I: 4e84b5274de688248984896a90f5cc25)`)}async getComponentInstance({useRegExpPrefilter:e,path:t,ibGibAddr:i}){let o=`${this.lc}[${this.getComponentInstance.name}]`;try{_e&&console.log(`${o} starting... (I: 684ef316cbdb4a3b1fdc96096c273b25)`);let s,a=At.getRegisteredComponentsMeta(),c=e?a.filter(d=>{let u=d.routeRegExp?d.routeRegExp.test(t):!1;return _e&&console.log(`${o} ${d.componentName} ${d.routeRegExp} componentMatchesPath: ${u} (I: 3758520e6a4a57f218396c8649283425)`),u}):a.concat();for(let d of c)if(d.fnHandleRoute?await d.fnHandleRoute({path:t,ibGibAddr:i}):!0){s=await d.createInstance({path:t,ibGibAddr:i});break}return s}catch(s){throw console.error(`${o} ${y(s)}`),s}finally{_e&&console.log(`${o} complete.`)}}async inject({parentEl:e,componentToInject:t}){let i=`${this.lc}[${this.inject.name}]`;try{if(_e&&console.log(`${i} starting... (I: 6844cf07eaf8a5b1b106784f7db17125)`),!e)throw new Error(`${i} parentEl required. (E: 6f4eb2d682856ef47d173b970ec3c825)`);if(!t)throw new Error(`${i} componentToInject required. (E: decf0b51ad49257ce44fecbcf84c3a25)`);if(!t.meta)throw new Error(`${i} componentToInject.meta required. (E: f8827c0602ca7b0e030d0b3e2c4a4825)`);if(!t.meta.componentName)throw new Error(`${i} componentToInject.meta.componentName required. (E: 5dcae244ae32690f7b73ce27a32a3c25)`);e.innerHTML="",e.appendChild(t),e.classList.remove("fade-out")}catch(o){console.error(`${i} ${y(o)}`),e.innerHTML=`<p class="error">Error loading component for route. error:</p><br /><br /><p>${o.message}</p>`}finally{_e&&console.log(`${i} complete.`)}}getRegisteredComponentsMeta(){return[...this._registeredComponentsMeta]}},At;async function re(){let n=`[${re.name}]`;try{return _e&&console.log(`${n} starting... (I: 853694c88223381339103a3765129925)`),At||(At=new hi,await At.initialized),At}catch(e){throw console.error(`${n} ${y(e)}`),e}finally{_e&&console.log(`${n} complete.`)}}p(re,"getComponentSvc");var Ds="left-panel";var ks="right-panel";var Ls="left-resizer",Us="right-resizer",Fs="footer-resizer",Bs="btn-left-panel-toggle",Vs="btn-right-panel-toggle",Hs="btn-create-keystone",Zt="center-panel-content";var gi=class{static{p(this,"KeystoneSyncService")}lc="[KeystoneSyncService]";dispatchUpdateAvailableEvent(e){typeof window<"u"&&window.dispatchEvent(new CustomEvent(St,{detail:e,bubbles:!0,composed:!0}))}async checkForKeystoneUpdate({activePrimaryAddr:e,metaspace:t,space:i}){let o=`${this.lc}[${this.checkForKeystoneUpdate.name}]`;try{if(t||(t=await D()),!t)throw new Error("Metaspace not available.");if(i||(i=await t.getLocalUserSpace({lock:!1})),!i)throw new Error("Local user space not available.");let s=await t.getLatestAddr({addr:e,space:i})||e,a=await t.get({addrs:[s],space:i}),c=a.success&&a.ibGibs&&a.ibGibs.length>0?a.ibGibs[0]:void 0,d=c?.data?.n??0,{ib:u}=q({ibGibAddr:e}),f=z({ibGibAddr:e}),h=f.tjpGib?`${u}^${f.tjpGib}`:e,m=(c?Q({ibGib:c}):void 0)||h,g=await ue().getKeystoneGraph(m);if(!g.success||!g.graph){let P={hasUpdate:!1,serverN:d,localN:d,serverLatestAddr:s,graph:{}};return this.dispatchUpdateAvailableEvent({activePrimaryAddr:e,hasUpdate:P.hasUpdate,serverN:P.serverN,localN:P.localN,serverLatestAddr:P.serverLatestAddr}),P}let b=g.graph,E=Object.values(b),w=We({ibGibs:E}),v=w[m]||w[e]||w[Object.keys(w)[0]]||[];if(v.length===0){let P={hasUpdate:!1,serverN:d,localN:d,serverLatestAddr:s,graph:b};return this.dispatchUpdateAvailableEvent({activePrimaryAddr:e,hasUpdate:P.hasUpdate,serverN:P.serverN,localN:P.localN,serverLatestAddr:P.serverLatestAddr}),P}let I=[...v].sort((P,x)=>(P.data?.n??0)-(x.data?.n??0)),T=I[I.length-1],S=T.data?.n??0,N=C({ibGib:T}),A={hasUpdate:S>d,serverN:S,localN:d,serverLatestAddr:N,graph:b};return this.dispatchUpdateAvailableEvent({activePrimaryAddr:e,hasUpdate:A.hasUpdate,serverN:A.serverN,localN:A.localN,serverLatestAddr:A.serverLatestAddr}),A}catch(s){console.error(`${o} ${y(s)}`);let a={hasUpdate:!1,serverN:0,localN:0,serverLatestAddr:e,graph:{}};return this.dispatchUpdateAvailableEvent({activePrimaryAddr:e,hasUpdate:!1,serverN:0,localN:0,serverLatestAddr:e}),a}}async updateActiveKeystone({activePrimaryAddr:e,metaspace:t,space:i}){let o=`${this.lc}[${this.updateActiveKeystone.name}]`;try{if(t||(t=await D()),!t)throw new Error("Metaspace not available.");if(i||(i=await t.getLocalUserSpace({lock:!1})),!i)throw new Error("Local user space not available.");let s=await this.checkForKeystoneUpdate({activePrimaryAddr:e,metaspace:t,space:i});if(s.hasUpdate&&Object.keys(s.graph).length>0){let d=Object.values(s.graph);await t.put({ibGibs:d,space:i});let u=We({ibGibs:d});for(let b of Object.keys(u)){let w=[...u[b]].sort((v,I)=>(v.data?.n??0)-(I.data?.n??0));for(let v of w)await t.registerNewIbGib({ibGib:v,space:i})}let f=z({ibGibAddr:e}).tjpGib??e,m=[...u[f]||u[e]||u[Object.keys(u)[0]]].sort((b,E)=>(b.data?.n??0)-(E.data?.n??0)),g=m[m.length-1];if(g)return await de({type:"keystones",rel8nInfos:[{rel8nName:"keystone",ibGibs:[K({ibGib:g})]}],metaspace:t,space:i}),g}let a=await t.getLatestAddr({addr:e,space:i})||e,c=await t.get({addrs:[a],space:i});return c.success&&c.ibGibs&&c.ibGibs.length>0?c.ibGibs[0]:void 0}catch(s){throw console.error(`${o} ${y(s)}`),s}}},mi;function Le(){return mi||(mi=new gi),mi}p(Le,"getKeystoneSyncService");var qs=`:host {
|
|
2
2
|
display: inline-block;
|
|
3
3
|
vertical-align: middle;
|
|
4
4
|
position: relative;
|
|
@@ -2326,4 +2326,4 @@ Device: ${d}`);let b=document.createElement("td");b.textContent=s,b.title=s;let
|
|
|
2326
2326
|
* SPDX-License-Identifier: Apache-2.0
|
|
2327
2327
|
*)
|
|
2328
2328
|
*/
|
|
2329
|
-
//# sourceMappingURL=chunk-
|
|
2329
|
+
//# sourceMappingURL=chunk-WJHRARK6.mjs.map
|
package/dist/client/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$a as ya,$b as Ia,A as ga,Ac as fe,Ba as Kt,Bc as rt,Cc as ke,D as _t,Dc as ot,E as Gt,Ec as Na,F as je,Fc as La,Gb as L,Hc as Wt,Ia as Me,J as V,Jc as ge,Ka as ua,Kc as qt,Lc as Da,Mc as ka,Xa as at,Yb as wa,Zb as Sa,a as h,ac as ut,bc as yt,c as mt,cc as ee,d as ht,dc as ze,e as Ue,eb as nt,f as jt,fb as qe,fc as M,g as ne,gc as _a,h as z,hb as le,hc as Ga,i as ma,ib as gt,ic as Ca,j as u,jb as Ea,jc as Aa,kb as Xt,lb as De,lc as va,oc as Ta,r as H,tb as Yt,tc as $a,ub as Ht,uc as Ct,vc as Ba,w as p,wc as Je,ya as re,z as ha,za as Ie}from"./chunk-
|
|
1
|
+
import{$a as ya,$b as Ia,A as ga,Ac as fe,Ba as Kt,Bc as rt,Cc as ke,D as _t,Dc as ot,E as Gt,Ec as Na,F as je,Fc as La,Gb as L,Hc as Wt,Ia as Me,J as V,Jc as ge,Ka as ua,Kc as qt,Lc as Da,Mc as ka,Xa as at,Yb as wa,Zb as Sa,a as h,ac as ut,bc as yt,c as mt,cc as ee,d as ht,dc as ze,e as Ue,eb as nt,f as jt,fb as qe,fc as M,g as ne,gc as _a,h as z,hb as le,hc as Ga,i as ma,ib as gt,ic as Ca,j as u,jb as Ea,jc as Aa,kb as Xt,lb as De,lc as va,oc as Ta,r as H,tb as Yt,tc as $a,ub as Ht,uc as Ct,vc as Ba,w as p,wc as Je,ya as re,z as ha,za as Ie}from"./chunk-ROJZUPPE.mjs";var At="sync",oe="syncmsg",zt="@payloadAddrsDomain",jn="init",Kn="ack",Xn="delta",Yn="commit",Y={init:jn,ack:Kn,delta:Xn,commit:Yn},Ir=Object.values(Y),Hn="abort",Wn="optimistic-graft-longest-common-subsequence",Ee={abort:Hn,optimisticWithLCS:Wn},Ze=Object.values(Ee);function vt(r){return Ze.includes(r)}h(vt,"isValidSyncConflictStrategy");var qn="push",zn="pull",Jn="sync",Jt={push:qn,pull:zn,sync:Jn},vr=Object.values(Jt);var Zn="sender",Qn="receiver",Tt={sender:Zn,receiver:Qn},Tr=Object.values(Tt);var Pa=!1;function Zt({base:r,extended:t,throwIfExtendedDoesntContainBase:e}){let a=`[${Zt.name}]`;try{Pa&&console.log(`${a} starting... (I: 00d70d79a0249165c2a230389c962526)`);let s=!0;for(let o=0;o<r.length;o++)if(r[o]!==t[o]){s=!1;break}if(e&&!s)throw new Error(`base addrs do not correspond to extended addrs. We were expecting the base to be the exact start of the extended strand, e.g., base [a, b, c] with extended [a, b, c, d, e]. base: ${r}. extended: ${t}. (E: fb80b40003289bbf1aaedd4829fa1826)`);let i;if(s)i=t.slice(r.length);else{i=[];for(let o of t)r.includes(o)||i.push(o)}return i}catch(s){throw console.error(`${a} ${u(s)}`),s}finally{Pa&&console.log(`${a} complete.`)}}h(Zt,"getUniqueDnas");async function $t({src:r,createdIbGibs_Running:t,dnaAddrsToApplyToStoreVersion_MUTATES_IN_PLACE:e,allLocalIbGibs:a}){let s=`[${$t.name}]`;try{if(e.length>0){let i=e.splice(0,1)[0],o=a.filter(f=>p({ibGib:f})===i),c;if(o.length>0)c=o[0];else throw new Error(`dna ibGib not found in supplied allLocalIbGibs. dnaAddr: ${i}. (E: 7f56826852cf48a79ab8af16bf27e284)`);let d=ht(c.data);d.src=r,d.srcAddr=p({ibGib:r});let l;switch(d.type){case"mut8":l=await _t(d);break;case"rel8":l=await Gt(d);break;case"fork":throw new Error("fork transform not expected. atow only a single fork is expected at the beginning of the lifetime of a tjp ibgib. This fork defines the uniqueness of the tjp ibgib. When merging another tjp ibgib, we would only expect update transforms to be mut8 or rel8. (E: f8ad6996ac5545edad2d58a293d37d94)");default:throw new Error(`unknown dna argTransform.type (${d.type}) for dna address: ${i}. Expecting either mut8 or rel8. (fork transform is known but not expected either.) (E: 52a98db56e934e4cb42c64e2f45fa552)`)}if((l.intermediateIbGibs??[]).forEach(f=>t.push(f)),(l.dnas??[]).forEach(f=>t.push(f)),t.push(l.newIbGib),(l.dnas??[]).length>0){if(!l.dnas.some(f=>p(f)===i))throw new Error(`${s}(UNEXPECTED) Expected to generate exact dna that we applied in transform. dnaAddr: ${i} (E: 4a364c0b5d8d46c8af6bd540915fd973)`)}else console.warn(`${s}(UNEXPECTED) expected resTransform to include generated dna. dnaAddr: ${i}(W: 9648e2d5c40d42b7b9fb7efb09c5b13a)`);return await $t({src:l.newIbGib,createdIbGibs_Running:t,dnaAddrsToApplyToStoreVersion_MUTATES_IN_PLACE:e,allLocalIbGibs:a})}else return t.length===0&&console.warn(`${s} no dna transforms to apply but createdIbGibs_Running is empty. Dna is expected to start with at least one transform, otherwise don't call this function. (W: 52c7f2f6bd7e4bd0b31f53611b90268b)(UNEXPECTED)`),r}catch(i){throw console.error(`${s} ${u(i)}`),i}}h($t,"applyTransforms");var st="graftinfo",Te=st,Oa="latestcommonaddr",Ke="base",Pe="orphan",xa="dnaapplied",er="longest-common-subsequence",Qt={lcs:er},Rr=Object.values(Qt);var ue=!0;async function tr({data:r}){if(!r.conflictStrategy)throw new Error("(UNEXPECTED) data.conflictStrategy required for GraftInfoIb (E: 2c0968a0dac8d0ab3d67da9756d6df26)");if(!vt(r.conflictStrategy))throw new Error(`invalid data.conflictStrategy (${r.conflictStrategy}). valid conflict strategies: ${Ze} (E: 41e2680089786d4d28046b4c0884bd26)`);return[st,r.conflictStrategy].join(" ")}h(tr,"getGraftInfoIb");async function Ra({conflictStrategy:r,details:t,addlGraftDetails:e,latestCommonFrameAddr:a,baseAddrsSinceLCA:s,orphanAddrsSinceLCA:i,dnaAddrsApplied:o}){let c=`[${Ra.name}]`;try{if(ue&&console.log(`${c} starting... (I: 0030f62cbae28cf5882f87981edc3826)`),s.length===0)throw new Error("(UNEXPECTED) baseAddrsSinceLCA empty? (E: 005f8449a9236d445902a148f59fc826)");if(i.length===0)throw new Error("(UNEXPECTED) orphanAddrsSinceLCA empty? (E: 19e4082e82c67759c880392aca186826)");let d={conflictStrategy:r,description:t};e&&(d.addlGraftDetails=e);let l={[Oa]:[a],[Ke]:s.concat(),[Pe]:i.concat(),[xa]:o.concat()},f=await tr({data:d});return await V.stone({parentPrimitiveIb:st,ib:f,data:d,rel8ns:l,uuid:!0})}catch(d){throw console.error(`${c} ${u(d)}`),d}finally{ue&&console.log(`${c} complete.`)}}h(Ra,"createGraftInfo");async function ar({textA:r,textB:t}){if(r===t)return r;if(r==="")return t;if(t==="")return r;function e(l,f){let b=l.length,m=f.length,y=Array(b+1).fill(0).map(()=>Array(m+1).fill(0));for(let G=1;G<=b;G++)for(let T=1;T<=m;T++)l[G-1]===f[T-1]?y[G][T]=y[G-1][T-1]+1:y[G][T]=Math.max(y[G-1][T],y[G][T-1]);let g=b,w=m,C=[];for(;g>0&&w>0;)l[g-1]===f[w-1]?(C.unshift({line:l[g-1],indexA:g-1,indexB:w-1}),g--,w--):y[g-1][w]>y[g][w-1]?g--:w--;return C}h(e,"longestCommonSubsequence");let a=r.split(`
|
|
2
2
|
`),s=t.split(`
|
|
3
3
|
`),i=e(a,s),o=[],c=0,d=0;for(let l of i){for(;c<l.indexA;)o.push(a[c]),c++;for(;d<l.indexB;)o.push(s[d]),d++;o.push(l.line),c++,d++}for(;c<a.length;)o.push(a[c]),c++;for(;d<s.length;)o.push(s[d]),d++;return o.join(`
|
|
4
4
|
`)}h(ar,"mergeTextByLongestCommonSubsequence");async function ea({timelineAddrsA:r,timelineAddrsB:t,latestCommonFrameAddr:e,conflictStrategy:a,ibGibReadCache:s,space:i}){let o=`[${ea.name}]`;try{let T=function(te){let Re=`${o}[${T.name}]`;for(let he of te){if(!he.rel8ns)throw new Error(`(UNEXPECTED) ${Re} someIbGib.rel8ns falsy? All ibgibs with mergeable timelines are expected to have rel8ns. addr: ${p({ibGib:he})} (E: 5534a478cd183a5ee27b28487448b226)`);if(!he.rel8ns.dna)throw new Error(`(UNEXPECTED) someIbGib.rel8ns.dna falsy? We only have implemented grafting for dna. addr: ${p({ibGib:he})} (there should be another route for merging for non-dna timelines) (E: d86b388c627afd613f897e3819d8ab26)`);if(he.rel8ns.dna.length===0)throw new Error(`(UNEXPECTED) someIbGib.rel8ns.dna.length === 0? We only have implemented grafting for dna. addr: ${p({ibGib:he})} (there should be another route for merging for non-dna timelines) (E: bf973662a0689dd9089912b861af2826)`)}};var c=T;h(T,"throwIfUnexpected"),ue&&console.log(`${o} starting... (I: 3b4c3e8e59c883d9d3c352efd6380826)`);let d=[],l=[];if(r.length===0)throw new Error("timelineAddrsA empty (E: 93a78cd1cd2a4a16ba99bd4820468f26)");if(t.length===0)throw new Error("timelineAddrsB empty (E: 76d53848152a66971b734068c3316826)");if(e){if(!r.includes(e))throw new Error(`timelineAddrsA does not include latestCommonFrameAddr (${e}). timelineAddrsA: ${r} (E: c5a9afe371888da2a79963983426e826)`);if(!t.includes(e))throw new Error(`timelineAddrsB does not include latestCommonFrameAddr (${e}). timelineAddrsB: ${t} (E: 7e641f67c452b67d582d78484a88c826)`)}else if(e=r.findLast(te=>t.includes(te)),!e)throw new Error(`timelines do not share a common frame. A: ${r}. B: ${t} (E: 4c0e78a88a375d8588736668573f1e26)`);if(r.at(-1)===e){debugger;throw new Error("timelineAddrsA.at(-1) === latestCommonFrameAddr. Graft requires a branch BEYOND the LCA (E: 3796fc4074a8c5899d549bb8c2e68826)")}if(t.at(-1)===e)throw new Error("timelineAddrsB.at(-1) === latestCommonFrameAddr. Graft requires a branch BEYOND the LCA (E: 66fbb86e9e98531549888bf10a344f26)");let f=r.lastIndexOf(e),b=r.slice(f+1),m=await De({readCache_graph:s,addrs:b,space:i}),y=m.at(-1),g=t.lastIndexOf(e),w=t.slice(g+1),C=await De({readCache_graph:s,addrs:w,space:i}),G=C.at(-1);T(m),T(C);let I,v,_,S,$=Xt({ibGib:y}),B=$.valid?Number.parseInt($.ticks):Number.MAX_SAFE_INTEGER,P=$.valid?$.ms??0:0,N=Xt({ibGib:G}),k=N.valid?Number.parseInt(N.ticks):Number.MAX_SAFE_INTEGER,D=N.valid?N.ms??0:0;B<k?(I=y,v=m,_=G,S=C):B>k?(I=G,v=C,_=y,S=m):P<=D?(I=y,v=m,_=G,S=C):(I=G,v=C,_=y,S=m);let O=p({ibGib:I}),F=v.map(te=>p({ibGib:te})),J=p({ibGib:_}),de=S.map(te=>p({ibGib:te}));ue&&console.log(`${o} baseTipAddr: ${O} (I: 93353d9b9b68b17088f57958df85e826)`),ue&&console.log(`${o} orphanTipAddr: ${J} (I: 14df8867adc5dab97ff3c1e989b40e26)`);let[Q]=await De({addrs:[e],space:i});if(!Q)throw new Error("(UNEXPECTED) latestCommonFrameIbGib falsy? (E: ead2020b7ab8e4c4f824573133e33826)");if(!Q.rel8ns)throw new Error("(UNEXPECTED) latestCommonFrameIbGib.rel8ns falsy? (E: b3f338032d19816fc87d3c78af255726)");if(!Q.rel8ns.dna||Q.rel8ns.dna.length===0)throw new Error("(UNEXPECTED) latestCommonFrameIbGib.rel8ns.dna falsy/empty? It should at least have the first fork transform. (E: 98fd8c725f484d85c8d23ceb181ce826)");let Ge=Q.rel8ns.dna.concat(),pe=[];for(let te of S){if(!te.rel8ns)throw new Error("(UNEXPECTED) orphanFrame.rel8ns falsy? (E: ed910e3b930b1b5388d87c6f736a4826)");let Re=Zt({base:Ge,extended:te.rel8ns.dna??[],throwIfExtendedDoesntContainBase:!0});if(Re.forEach(he=>Ge.push(he)),Re.length===0)throw new Error("(UNEXPECTED) orphanDnaAddrsToApply empty? (E: d44ed439e538e5b538d12d71063f0826)");Re.forEach(he=>pe.push(he))}let me=await De({addrs:pe,readCache_graph:s,space:i}),Se=[],W=await $t({src:I,dnaAddrsToApplyToStoreVersion_MUTATES_IN_PLACE:pe.concat(),allLocalIbGibs:me,createdIbGibs_Running:Se});if(!W.data)throw new Error("(UNEXPECTED) graftTip_sansGraftInfo.data falsy? (E: 4792f8e84fc84966e89220fae0657826)");if(!W.data.n)throw new Error("(UNEXPECTED) graftTip_sansGraftInfo.data.n falsy? (E: a2b3ca4cdec8d01f282dd3e4ff9eab26)");if(Se.length===0)throw new Error("(UNEXPECTED) applyTransforms called but createdIbGibs_Running is empty? This should contain all of the (E: 5b6c788488f5095b08eb8e31d55b1726)");console.warn(`${o} START...................... Do we get a bunch of "already had addr(s)" messages for dna ibgibs? I'm thinking we will already have the dna ibgibs stored in the space (temp space?) before we do this graft. Maybe it creates new dna, I don't know. remove this later when we decide something to do about it. space.ib: ${i.ib} (W: bb60481ecabaa6f49e14203891824a26)`),await Ie({space:i,ibGibs:Se}),console.warn(`${o} END........................ Do we get a bunch of "already had addr(s)" messages for dna ibgibs? I'm thinking we will already have the dna ibgibs stored in the space (temp space?) before we do this graft. Maybe it creates new dna, I don't know. remove this later when we decide something to do about it. space.ib: ${i.ib} (W: bb60481ecabaa6f49e14203891824a26)`);let{mapWithTjp_NoDna:Ce,mapWithTjp_YesDna:Be,mapWithoutTjps:q}=nt({ibGibs:Se});if(Object.keys(Ce).length>0)throw new Error("(UNEXPECTED) mapWithTjp_NoDna is populated? We've just applied the dna from the orphan branch which created ibgibs (and dnas). But we are expected to be executing on an ibgib timeline that has dna. The applyTransforms was not expected to create any other ibgibs than the one in our timeline (with dna) and any corresponding dnas. (E: 236e989fb5e8a4a498a21b98f718c826)");let Ae=Object.values(Be),Ne=qe({ibGibs:Ae});if(Object.keys(Ne).length===0)throw new Error("(UNEXPECTED) newGraftedIbGibsByTjp has 0 timelines? we expect this to have a single timeline: the one we're grafting. (E: 2b7127bd0c6bfeaec8d66038ba208226)");if(Object.keys(Ne).length>1)throw new Error("(UNEXPECTED) newGraftedIbGibsByTjp has more than one timeline? we expect this to have a single timeline: the one we're grafting. (E: 076758885b8ea7c89849a76334222326)");Object.values(Ne)[0].forEach(te=>d.push(te));for(let te of d)await Me({ibGib:te,space:i});let We;if(a===Ee.optimisticWithLCS){if(!I.data)throw new Error("(UNEXPECTED) baseTip.data falsy? (E: 92623857e19b9b4e081e8c8d9eb45526)");if(!_.data)throw new Error("(UNEXPECTED) orphanTip.data falsy? (E: 2e6828a4c9226ac917ab6fe833672826)");if((_.data.text||I.data.text)&&_.data.text!==I.data.text){ue&&console.log(`${o} different data.text found. executing text merge for conflictStrategy ${a} (I: cfb5f9580832040388fc576eb71ac526)`);let te=_.data.text??"",Re=J,he=I.data.text??"",It=O,pt=await ar({textA:te,textB:he}),Le=await _t({src:W,dataToAddOrPatch:{text:pt},dna:!0,nCounter:!!W.data.n});if(Le.intermediateIbGibs&&Le.intermediateIbGibs.length>0)throw new Error("(UNEXPECTED) resMut8Text.intermediateIbGibs truthy/non-empty? This is expected to only create the newIbGib with no intermediates. (E: 7932a8964a3869accadc9b0d93d23826)");if(!Le.dnas||Le.dnas.length===0)throw new Error("(UNEXPECTED) resMut8Text.dnas falsy/empty? We're expected to generate dna from this merge text mut8. (E: fdf03754bf0f8661f80f59ea0701dd26)");if(Le.dnas.length!==1)throw new Error("(UNEXPECTED) resMut8Text.dnas.length !== 1? we're expecting a single mut8 dna. (E: 9574d86a9108095cb454b049bcca5326)");if(l.push(Le.dnas[0]),d.push(Le.newIbGib),await Kt({resTransform:Le,space:i}),await Me({ibGib:Le.newIbGib,space:i}),We={mergeTextStrategy:Qt.lcs,textAAddr:Re,textBAddr:It},W=Le.newIbGib,!W.data)throw new Error("(UNEXPECTED) graftTip_sansGraftInfo.data falsy after mut8 merge text? (E: 6b65d83df6681887686a0098144eea26)")}}let Ve=await Ra({conflictStrategy:a,details:`Replayed ${pe.length} transforms from orphan (${J}) onto base (${O}).`,addlGraftDetails:We?[We]:void 0,latestCommonFrameAddr:e,baseAddrsSinceLCA:F,orphanAddrsSinceLCA:de,dnaAddrsApplied:pe});ue&&console.log(`${o} intrinsic graft complete. graftInfo to be appended to timeline:
|