@powerhousedao/connect 5.0.0-staging.24 → 5.0.0-staging.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/assets/{atlas-import.huSz2S1P.js → atlas-import.CzW8-AP5.js} +2 -2
  2. package/dist/assets/{atlas-import.huSz2S1P.js.map → atlas-import.CzW8-AP5.js.map} +1 -1
  3. package/dist/assets/{ccip.B4gPk9T8.js → ccip.DqmhJKD0.js} +2 -2
  4. package/dist/assets/{ccip.B4gPk9T8.js.map → ccip.DqmhJKD0.js.map} +1 -1
  5. package/dist/assets/{content.EqFpXqQo.js → content.CxDClVTv.js} +2 -2
  6. package/dist/assets/{content.EqFpXqQo.js.map → content.CxDClVTv.js.map} +1 -1
  7. package/dist/assets/{creators.Cg7hgtUz.js → creators.BVnKHfhT.js} +2 -2
  8. package/dist/assets/{creators.Cg7hgtUz.js.map → creators.BVnKHfhT.js.map} +1 -1
  9. package/dist/assets/{drive-icon.VGDDLaPE.js → drive-icon.BUXuX5Ex.js} +2 -2
  10. package/dist/assets/{drive-icon.VGDDLaPE.js.map → drive-icon.BUXuX5Ex.js.map} +1 -1
  11. package/dist/assets/{index.CYAFrFct.js → index.B-dgtyfz.js} +2 -2
  12. package/dist/assets/{index.CYAFrFct.js.map → index.B-dgtyfz.js.map} +1 -1
  13. package/dist/assets/{index.DL3Up0hU.js → index.BKnM0GnX.js} +2 -2
  14. package/dist/assets/{index.DL3Up0hU.js.map → index.BKnM0GnX.js.map} +1 -1
  15. package/dist/assets/{index.DA_wjuiB.js → index.BS7j0VZJ.js} +2 -2
  16. package/dist/assets/{index.DA_wjuiB.js.map → index.BS7j0VZJ.js.map} +1 -1
  17. package/dist/assets/{index.CCqDl19I.js → index.Bli07gDj.js} +2 -2
  18. package/dist/assets/{index.CCqDl19I.js.map → index.Bli07gDj.js.map} +1 -1
  19. package/dist/assets/{index.CXV2LGi6.js → index.CZ3emu5D.js} +2 -2
  20. package/dist/assets/{index.CXV2LGi6.js.map → index.CZ3emu5D.js.map} +1 -1
  21. package/dist/assets/{index.JK7MVe59.js → index.C_h1SBrG.js} +2 -2
  22. package/dist/assets/{index.JK7MVe59.js.map → index.C_h1SBrG.js.map} +1 -1
  23. package/dist/assets/{index.CYF9Wn1v.js → index.Vc7_nzpo.js} +2 -2
  24. package/dist/assets/{index.CYF9Wn1v.js.map → index.Vc7_nzpo.js.map} +1 -1
  25. package/dist/assets/{main.BXlmSY46.js → main.s5_GNYWM.js} +8 -8
  26. package/dist/assets/{main.BXlmSY46.js.map → main.s5_GNYWM.js.map} +1 -1
  27. package/dist/assets/{nodefs.BpF1PLlt.js → nodefs.BiUz1Kbc.js} +2 -2
  28. package/dist/assets/{nodefs.BpF1PLlt.js.map → nodefs.BiUz1Kbc.js.map} +1 -1
  29. package/dist/assets/{opfs-ahp.BCWCVPBr.js → opfs-ahp.B2bR4XKE.js} +2 -2
  30. package/dist/assets/{opfs-ahp.BCWCVPBr.js.map → opfs-ahp.B2bR4XKE.js.map} +1 -1
  31. package/dist/assets/{root._-_EHvJY.js → root.4AaIaYqm.js} +2 -2
  32. package/dist/assets/{root._-_EHvJY.js.map → root.4AaIaYqm.js.map} +1 -1
  33. package/dist/index.html +1 -1
  34. package/dist/vite-envs.sh +1 -1
  35. package/package.json +9 -9
@@ -1,2 +1,2 @@
1
- var v=Object.defineProperty;var _=(o,e,t)=>e in o?v(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var f=(o,e,t)=>_(o,typeof e!="symbol"?e+"":e,t);import{k as O,A as i,D as I}from"./main.BXlmSY46.js";import"react/jsx-runtime";import"react-dom/client";import"react";import"react-dom";class w{constructor(e,t=O(["processor","document-analytics"])){f(this,"analyticsStore");f(this,"logger");this.analyticsStore=e,this.logger=t}async onStrands(e){if(e.length!==0)for(const t of e){if(t.operations.length===0)continue;const E=t.operations[0],u=i.fromString(`ph/doc/${t.driveId}/${t.documentId}/${t.branch}/${t.scope}`);E.index===0&&await this.clearSource(u);const{driveId:s,documentId:g,branch:m,scope:a}=t,l=s===g?"DRIVE":"NODE",d=50;for(let r=0;r<t.operations.length;r+=d){const n=t.operations.slice(r,r+d),c=[];for(const p of n){const D=p.index,h={source:u,metric:"DocumentOperations",start:I.fromISO(p.timestampUtcMs),value:1,dimensions:{drive:i.fromString(`ph/doc/drive/${s}/${m}/${a}/${D}`),operation:i.fromString(`ph/doc/operation/${p.action.type}/${p.index}`),target:i.fromString(`ph/doc/target/${s}/${l}/${g}`)}};for(c.push(h);c.length>=d;){const y=c.splice(0,d);await this.analyticsStore.addSeriesValues(y)}}c.length>0&&await this.analyticsStore.addSeriesValues(c)}}}async onDisconnect(){}async clearSource(e){try{await this.analyticsStore.clearSeriesBySource(e,!0)}catch(t){this.logger.error("Failed to clear source",t)}}}const $=["ADD_FILE","ADD_FOLDER"],T=["COPY_NODE"],C=["UPDATE_FILE","UPDATE_NODE"],A=["MOVE_NODE"],N=["DELETE_NODE"],V=[...$,...T,...C,...A,...N];class b{constructor(e,t=O(["processor","drive-analytics"])){f(this,"analyticsStore");f(this,"logger");this.analyticsStore=e,this.logger=t}async onStrands(e){if(e.length!==0)for(const t of e){if(t.operations.length===0)continue;const E=t.operations[0],u=i.fromString(`ph/drive/${t.documentId}/${t.branch}/${t.scope}`);E.index===0&&await this.clearSource(u);const{documentId:s,branch:g,scope:m}=t,a=50;for(let l=0;l<t.operations.length;l+=a){const d=t.operations.slice(l,l+a),r=[];for(const n of d){const c=n.index,p=this.getActionType(n.action.type),D=V.includes(n.action.type)?"NODE":"DRIVE";let h=s;if(D==="NODE"){const S=n.action.input;h=S.id||S.targetId||S.srcFolder||s}const y={source:u,metric:"DriveOperations",start:I.fromISO(n.timestampUtcMs),value:1,dimensions:{drive:i.fromString(`ph/drive/${s}/${g}/${m}/${c}`),operation:i.fromString(`ph/drive/operation/${n.action.type}/${n.index}`),target:i.fromString(`ph/drive/target/${D}/${h}`),actionType:i.fromString(`ph/drive/actionType/${p}/${h}`)}};for(r.push(y);r.length>=a;){const S=r.splice(0,a);await this.analyticsStore.addSeriesValues(S)}}r.length>0&&await this.analyticsStore.addSeriesValues(r)}}}async onDisconnect(){}getActionType(e){return $.includes(e)?"CREATED":T.includes(e)?"DUPLICATED":N.includes(e)?"REMOVED":A.includes(e)?"MOVED":"UPDATED"}async clearSource(e){try{await this.analyticsStore.clearSeriesBySource(e,!0)}catch(t){this.logger.error("Failed to clear source",t)}}}const R=o=>e=>[{processor:new b(o.analyticsStore),filter:{branch:["main"],documentId:["*"],scope:["*"],documentType:["powerhouse/document-drive"]}},{processor:new w(o.analyticsStore),filter:{branch:["main"],documentId:["*"],scope:["*"],documentType:["*"]}}];export{w as DocumentAnalyticsProcessor,b as DriveAnalyticsProcessor,R as processorFactory};
2
- //# sourceMappingURL=index.CCqDl19I.js.map
1
+ var v=Object.defineProperty;var _=(o,e,t)=>e in o?v(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var f=(o,e,t)=>_(o,typeof e!="symbol"?e+"":e,t);import{k as O,A as i,D as I}from"./main.s5_GNYWM.js";import"react/jsx-runtime";import"react-dom/client";import"react";import"react-dom";class w{constructor(e,t=O(["processor","document-analytics"])){f(this,"analyticsStore");f(this,"logger");this.analyticsStore=e,this.logger=t}async onStrands(e){if(e.length!==0)for(const t of e){if(t.operations.length===0)continue;const E=t.operations[0],u=i.fromString(`ph/doc/${t.driveId}/${t.documentId}/${t.branch}/${t.scope}`);E.index===0&&await this.clearSource(u);const{driveId:s,documentId:g,branch:m,scope:a}=t,l=s===g?"DRIVE":"NODE",d=50;for(let r=0;r<t.operations.length;r+=d){const n=t.operations.slice(r,r+d),c=[];for(const p of n){const D=p.index,h={source:u,metric:"DocumentOperations",start:I.fromISO(p.timestampUtcMs),value:1,dimensions:{drive:i.fromString(`ph/doc/drive/${s}/${m}/${a}/${D}`),operation:i.fromString(`ph/doc/operation/${p.action.type}/${p.index}`),target:i.fromString(`ph/doc/target/${s}/${l}/${g}`)}};for(c.push(h);c.length>=d;){const y=c.splice(0,d);await this.analyticsStore.addSeriesValues(y)}}c.length>0&&await this.analyticsStore.addSeriesValues(c)}}}async onDisconnect(){}async clearSource(e){try{await this.analyticsStore.clearSeriesBySource(e,!0)}catch(t){this.logger.error("Failed to clear source",t)}}}const $=["ADD_FILE","ADD_FOLDER"],T=["COPY_NODE"],C=["UPDATE_FILE","UPDATE_NODE"],A=["MOVE_NODE"],N=["DELETE_NODE"],V=[...$,...T,...C,...A,...N];class b{constructor(e,t=O(["processor","drive-analytics"])){f(this,"analyticsStore");f(this,"logger");this.analyticsStore=e,this.logger=t}async onStrands(e){if(e.length!==0)for(const t of e){if(t.operations.length===0)continue;const E=t.operations[0],u=i.fromString(`ph/drive/${t.documentId}/${t.branch}/${t.scope}`);E.index===0&&await this.clearSource(u);const{documentId:s,branch:g,scope:m}=t,a=50;for(let l=0;l<t.operations.length;l+=a){const d=t.operations.slice(l,l+a),r=[];for(const n of d){const c=n.index,p=this.getActionType(n.action.type),D=V.includes(n.action.type)?"NODE":"DRIVE";let h=s;if(D==="NODE"){const S=n.action.input;h=S.id||S.targetId||S.srcFolder||s}const y={source:u,metric:"DriveOperations",start:I.fromISO(n.timestampUtcMs),value:1,dimensions:{drive:i.fromString(`ph/drive/${s}/${g}/${m}/${c}`),operation:i.fromString(`ph/drive/operation/${n.action.type}/${n.index}`),target:i.fromString(`ph/drive/target/${D}/${h}`),actionType:i.fromString(`ph/drive/actionType/${p}/${h}`)}};for(r.push(y);r.length>=a;){const S=r.splice(0,a);await this.analyticsStore.addSeriesValues(S)}}r.length>0&&await this.analyticsStore.addSeriesValues(r)}}}async onDisconnect(){}getActionType(e){return $.includes(e)?"CREATED":T.includes(e)?"DUPLICATED":N.includes(e)?"REMOVED":A.includes(e)?"MOVED":"UPDATED"}async clearSource(e){try{await this.analyticsStore.clearSeriesBySource(e,!0)}catch(t){this.logger.error("Failed to clear source",t)}}}const R=o=>e=>[{processor:new b(o.analyticsStore),filter:{branch:["main"],documentId:["*"],scope:["*"],documentType:["powerhouse/document-drive"]}},{processor:new w(o.analyticsStore),filter:{branch:["main"],documentId:["*"],scope:["*"],documentType:["*"]}}];export{w as DocumentAnalyticsProcessor,b as DriveAnalyticsProcessor,R as processorFactory};
2
+ //# sourceMappingURL=index.Bli07gDj.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.CCqDl19I.js","sources":["../../../../packages/common/dist/drive-analytics/processor/document-processor.js","../../../../packages/common/dist/drive-analytics/processor/drive-processor.js","../../../../packages/common/dist/drive-analytics/processor/index.js"],"sourcesContent":["import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nexport class DocumentAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"document-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/doc/${strand.driveId}/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { driveId, documentId, branch, scope } = strand;\n const target = driveId === documentId ? \"DRIVE\" : \"NODE\";\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const seriesInput = {\n source,\n metric: \"DocumentOperations\",\n start: DateTime.fromISO(operation.timestampUtcMs),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/doc/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/doc/operation/${operation.action.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/doc/target/${driveId}/${target}/${documentId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=document-processor.js.map","import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nconst CREATE_NODE_ACTIONS = [\"ADD_FILE\", \"ADD_FOLDER\"];\nconst DUPLICATE_NODE_ACTIONS = [\"COPY_NODE\"];\nconst UPDATE_NODE_ACTIONS = [\"UPDATE_FILE\", \"UPDATE_NODE\"];\nconst MOVE_NODE_ACTIONS = [\"MOVE_NODE\"];\nconst REMOVE_NODE_ACTIONS = [\"DELETE_NODE\"];\nconst NODE_ACTIONS = [\n ...CREATE_NODE_ACTIONS,\n ...DUPLICATE_NODE_ACTIONS,\n ...UPDATE_NODE_ACTIONS,\n ...MOVE_NODE_ACTIONS,\n ...REMOVE_NODE_ACTIONS,\n];\nexport class DriveAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"drive-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/drive/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { documentId: driveId, branch, scope } = strand;\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const actionType = this.getActionType(operation.action.type);\n const target = NODE_ACTIONS.includes(operation.action.type)\n ? \"NODE\"\n : \"DRIVE\";\n let targetId = driveId;\n if (target === \"NODE\") {\n const operationInput = operation.action.input;\n targetId =\n operationInput.id ||\n operationInput.targetId ||\n operationInput.srcFolder ||\n driveId;\n }\n const seriesInput = {\n source,\n metric: \"DriveOperations\",\n start: DateTime.fromISO(operation.timestampUtcMs),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/drive/operation/${operation.action.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/drive/target/${target}/${targetId}`),\n actionType: AnalyticsPath.fromString(`ph/drive/actionType/${actionType}/${targetId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n getActionType(action) {\n if (CREATE_NODE_ACTIONS.includes(action)) {\n return \"CREATED\";\n }\n if (DUPLICATE_NODE_ACTIONS.includes(action)) {\n return \"DUPLICATED\";\n }\n if (REMOVE_NODE_ACTIONS.includes(action)) {\n return \"REMOVED\";\n }\n if (MOVE_NODE_ACTIONS.includes(action)) {\n return \"MOVED\";\n }\n return \"UPDATED\";\n }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=drive-processor.js.map","import { DocumentAnalyticsProcessor } from \"./document-processor.js\";\nimport { DriveAnalyticsProcessor } from \"./drive-processor.js\";\nexport const processorFactory = (module) => (driveHeader) => {\n return [\n {\n processor: new DriveAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"powerhouse/document-drive\"],\n },\n },\n {\n processor: new DocumentAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"*\"],\n },\n },\n ];\n};\nexport * from \"./document-processor.js\";\nexport * from \"./drive-processor.js\";\n//# sourceMappingURL=index.js.map"],"names":["DocumentAnalyticsProcessor","analyticsStore","logger","childLogger","__publicField","strands","strand","firstOp","source","AnalyticsPath","driveId","documentId","branch","scope","target","CHUNK_SIZE","i","chunk","buffer","operation","revision","seriesInput","DateTime","batch","e","CREATE_NODE_ACTIONS","DUPLICATE_NODE_ACTIONS","UPDATE_NODE_ACTIONS","MOVE_NODE_ACTIONS","REMOVE_NODE_ACTIONS","NODE_ACTIONS","DriveAnalyticsProcessor","actionType","targetId","operationInput","action","processorFactory","module","driveHeader"],"mappings":"4SAEO,MAAMA,CAA2B,CAGpC,YAAYC,EAAgBC,EAASC,EAAY,CAAC,YAAa,oBAAoB,CAAC,EAAG,CAFvFC,EAAA,uBACAA,EAAA,eAEI,KAAK,eAAiBH,EACtB,KAAK,OAASC,CAElB,CACA,MAAM,UAAUG,EAAS,CACrB,GAAIA,EAAQ,SAAW,EAGvB,UAAWC,KAAUD,EAAS,CAE1B,GAAIC,EAAO,WAAW,SAAW,EAC7B,SAEJ,MAAMC,EAAUD,EAAO,WAAW,CAAC,EAC7BE,EAASC,EAAc,WAAW,UAAUH,EAAO,OAAO,IAAIA,EAAO,UAAU,IAAIA,EAAO,MAAM,IAAIA,EAAO,KAAK,EAAE,EACpHC,EAAQ,QAAU,GAClB,MAAM,KAAK,YAAYC,CAAM,EAEjC,KAAM,CAAE,QAAAE,EAAS,WAAAC,EAAY,OAAAC,EAAQ,MAAAC,CAAK,EAAKP,EACzCQ,EAASJ,IAAYC,EAAa,QAAU,OAC5CI,EAAa,GACn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,CAAM,IAAImB,CAAQ,EAAE,EACxE,WAAYxB,EAAc,WAAW,uBAAuBuB,CAAU,IAAIC,CAAQ,EAAE,CAChH,CACA,EAEoB,IADAf,EAAO,KAAKG,CAAW,EAChBH,EAAO,QAAUH,GAAY,CAChC,MAAMQ,EAAQL,EAAO,OAAO,EAAGH,CAAU,EACzC,MAAM,KAAK,eAAe,gBAAgBQ,CAAK,CACnD,CACJ,CACIL,EAAO,OAAS,GAChB,MAAM,KAAK,eAAe,gBAAgBA,CAAM,CAExD,CACJ,CACJ,CACA,MAAM,cAAe,CAAE,CACvB,cAAciB,EAAQ,CAClB,OAAIV,EAAoB,SAASU,CAAM,EAC5B,UAEPT,EAAuB,SAASS,CAAM,EAC/B,aAEPN,EAAoB,SAASM,CAAM,EAC5B,UAEPP,EAAkB,SAASO,CAAM,EAC1B,QAEJ,SACX,CACA,MAAM,YAAY3B,EAAQ,CACtB,GAAI,CACA,MAAM,KAAK,eAAe,oBAAoBA,EAAQ,EAAI,CAC9D,OACOgB,EAAG,CACN,KAAK,OAAO,MAAM,yBAA0BA,CAAC,CACjD,CACJ,CACJ,CCtGY,MAACY,EAAoBC,GAAYC,GAClC,CACH,CACI,UAAW,IAAIP,EAAwBM,EAAO,cAAc,EAC5D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,2BAA2B,CAC1D,CACA,EACQ,CACI,UAAW,IAAIrC,EAA2BqC,EAAO,cAAc,EAC/D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,GAAG,CAClC,CACA,CACA"}
1
+ {"version":3,"file":"index.Bli07gDj.js","sources":["../../../../packages/common/dist/drive-analytics/processor/document-processor.js","../../../../packages/common/dist/drive-analytics/processor/drive-processor.js","../../../../packages/common/dist/drive-analytics/processor/index.js"],"sourcesContent":["import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nexport class DocumentAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"document-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/doc/${strand.driveId}/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { driveId, documentId, branch, scope } = strand;\n const target = driveId === documentId ? \"DRIVE\" : \"NODE\";\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const seriesInput = {\n source,\n metric: \"DocumentOperations\",\n start: DateTime.fromISO(operation.timestampUtcMs),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/doc/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/doc/operation/${operation.action.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/doc/target/${driveId}/${target}/${documentId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=document-processor.js.map","import { AnalyticsPath, DateTime, } from \"@powerhousedao/reactor-browser/analytics\";\nimport { childLogger } from \"document-drive\";\nconst CREATE_NODE_ACTIONS = [\"ADD_FILE\", \"ADD_FOLDER\"];\nconst DUPLICATE_NODE_ACTIONS = [\"COPY_NODE\"];\nconst UPDATE_NODE_ACTIONS = [\"UPDATE_FILE\", \"UPDATE_NODE\"];\nconst MOVE_NODE_ACTIONS = [\"MOVE_NODE\"];\nconst REMOVE_NODE_ACTIONS = [\"DELETE_NODE\"];\nconst NODE_ACTIONS = [\n ...CREATE_NODE_ACTIONS,\n ...DUPLICATE_NODE_ACTIONS,\n ...UPDATE_NODE_ACTIONS,\n ...MOVE_NODE_ACTIONS,\n ...REMOVE_NODE_ACTIONS,\n];\nexport class DriveAnalyticsProcessor {\n analyticsStore;\n logger;\n constructor(analyticsStore, logger = childLogger([\"processor\", \"drive-analytics\"])) {\n this.analyticsStore = analyticsStore;\n this.logger = logger;\n //\n }\n async onStrands(strands) {\n if (strands.length === 0) {\n return;\n }\n for (const strand of strands) {\n // skip empty strands\n if (strand.operations.length === 0) {\n continue;\n }\n const firstOp = strand.operations[0];\n const source = AnalyticsPath.fromString(`ph/drive/${strand.documentId}/${strand.branch}/${strand.scope}`);\n if (firstOp.index === 0) {\n await this.clearSource(source);\n }\n const { documentId: driveId, branch, scope } = strand;\n const CHUNK_SIZE = 50;\n for (let i = 0; i < strand.operations.length; i += CHUNK_SIZE) {\n const chunk = strand.operations.slice(i, i + CHUNK_SIZE);\n const buffer = [];\n for (const operation of chunk) {\n const revision = operation.index;\n const actionType = this.getActionType(operation.action.type);\n const target = NODE_ACTIONS.includes(operation.action.type)\n ? \"NODE\"\n : \"DRIVE\";\n let targetId = driveId;\n if (target === \"NODE\") {\n const operationInput = operation.action.input;\n targetId =\n operationInput.id ||\n operationInput.targetId ||\n operationInput.srcFolder ||\n driveId;\n }\n const seriesInput = {\n source,\n metric: \"DriveOperations\",\n start: DateTime.fromISO(operation.timestampUtcMs),\n value: 1,\n dimensions: {\n drive: AnalyticsPath.fromString(`ph/drive/${driveId}/${branch}/${scope}/${revision}`),\n operation: AnalyticsPath.fromString(`ph/drive/operation/${operation.action.type}/${operation.index}`),\n target: AnalyticsPath.fromString(`ph/drive/target/${target}/${targetId}`),\n actionType: AnalyticsPath.fromString(`ph/drive/actionType/${actionType}/${targetId}`),\n },\n };\n buffer.push(seriesInput);\n while (buffer.length >= CHUNK_SIZE) {\n const batch = buffer.splice(0, CHUNK_SIZE);\n await this.analyticsStore.addSeriesValues(batch);\n }\n }\n if (buffer.length > 0) {\n await this.analyticsStore.addSeriesValues(buffer);\n }\n }\n }\n }\n async onDisconnect() { }\n getActionType(action) {\n if (CREATE_NODE_ACTIONS.includes(action)) {\n return \"CREATED\";\n }\n if (DUPLICATE_NODE_ACTIONS.includes(action)) {\n return \"DUPLICATED\";\n }\n if (REMOVE_NODE_ACTIONS.includes(action)) {\n return \"REMOVED\";\n }\n if (MOVE_NODE_ACTIONS.includes(action)) {\n return \"MOVED\";\n }\n return \"UPDATED\";\n }\n async clearSource(source) {\n try {\n await this.analyticsStore.clearSeriesBySource(source, true);\n }\n catch (e) {\n this.logger.error(\"Failed to clear source\", e);\n }\n }\n}\n//# sourceMappingURL=drive-processor.js.map","import { DocumentAnalyticsProcessor } from \"./document-processor.js\";\nimport { DriveAnalyticsProcessor } from \"./drive-processor.js\";\nexport const processorFactory = (module) => (driveHeader) => {\n return [\n {\n processor: new DriveAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"powerhouse/document-drive\"],\n },\n },\n {\n processor: new DocumentAnalyticsProcessor(module.analyticsStore),\n filter: {\n branch: [\"main\"],\n documentId: [\"*\"],\n scope: [\"*\"],\n documentType: [\"*\"],\n },\n },\n ];\n};\nexport * from \"./document-processor.js\";\nexport * from \"./drive-processor.js\";\n//# sourceMappingURL=index.js.map"],"names":["DocumentAnalyticsProcessor","analyticsStore","logger","childLogger","__publicField","strands","strand","firstOp","source","AnalyticsPath","driveId","documentId","branch","scope","target","CHUNK_SIZE","i","chunk","buffer","operation","revision","seriesInput","DateTime","batch","e","CREATE_NODE_ACTIONS","DUPLICATE_NODE_ACTIONS","UPDATE_NODE_ACTIONS","MOVE_NODE_ACTIONS","REMOVE_NODE_ACTIONS","NODE_ACTIONS","DriveAnalyticsProcessor","actionType","targetId","operationInput","action","processorFactory","module","driveHeader"],"mappings":"4SAEO,MAAMA,CAA2B,CAGpC,YAAYC,EAAgBC,EAASC,EAAY,CAAC,YAAa,oBAAoB,CAAC,EAAG,CAFvFC,EAAA,uBACAA,EAAA,eAEI,KAAK,eAAiBH,EACtB,KAAK,OAASC,CAElB,CACA,MAAM,UAAUG,EAAS,CACrB,GAAIA,EAAQ,SAAW,EAGvB,UAAWC,KAAUD,EAAS,CAE1B,GAAIC,EAAO,WAAW,SAAW,EAC7B,SAEJ,MAAMC,EAAUD,EAAO,WAAW,CAAC,EAC7BE,EAASC,EAAc,WAAW,UAAUH,EAAO,OAAO,IAAIA,EAAO,UAAU,IAAIA,EAAO,MAAM,IAAIA,EAAO,KAAK,EAAE,EACpHC,EAAQ,QAAU,GAClB,MAAM,KAAK,YAAYC,CAAM,EAEjC,KAAM,CAAE,QAAAE,EAAS,WAAAC,EAAY,OAAAC,EAAQ,MAAAC,CAAK,EAAKP,EACzCQ,EAASJ,IAAYC,EAAa,QAAU,OAC5CI,EAAa,GACnB,QAASC,EAAI,EAAGA,EAAIV,EAAO,WAAW,OAAQU,GAAKD,EAAY,CAC3D,MAAME,EAAQX,EAAO,WAAW,MAAMU,EAAGA,EAAID,CAAU,EACjDG,EAAS,CAAA,EACf,UAAWC,KAAaF,EAAO,CAC3B,MAAMG,EAAWD,EAAU,MACrBE,EAAc,CAChB,OAAAb,EACA,OAAQ,qBACR,MAAOc,EAAS,QAAQH,EAAU,cAAc,EAChD,MAAO,EACP,WAAY,CACR,MAAOV,EAAc,WAAW,gBAAgBC,CAAO,IAAIE,CAAM,IAAIC,CAAK,IAAIO,CAAQ,EAAE,EACxF,UA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AAIV,EAAoB,SAASU,CAAM,EAC5B,UAEPT,EAAuB,SAASS,CAAM,EAC/B,aAEPN,EAAoB,SAASM,CAAM,EAC5B,UAEPP,EAAkB,SAASO,CAAM,EAC1B,QAEJ,SACX,CACA,MAAM,YAAY3B,EAAQ,CACtB,GAAI,CACA,MAAM,KAAK,eAAe,oBAAoBA,EAAQ,EAAI,CAC9D,OACOgB,EAAG,CACN,KAAK,OAAO,MAAM,yBAA0BA,CAAC,CACjD,CACJ,CACJ,CCtGY,MAACY,EAAoBC,GAAYC,GAClC,CACH,CACI,UAAW,IAAIP,EAAwBM,EAAO,cAAc,EAC5D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,2BAA2B,CAC1D,CACA,EACQ,CACI,UAAW,IAAIrC,EAA2BqC,EAAO,cAAc,EAC/D,OAAQ,CACJ,OAAQ,CAAC,MAAM,EACf,WAAY,CAAC,GAAG,EAChB,MAAO,CAAC,GAAG,EACX,aAAc,CAAC,GAAG,CAClC,CACA,CACA"}
@@ -1,5 +1,5 @@
1
- import{jsxs as N,jsx as l}from"react/jsx-runtime";import{I as C,F as A,aU as me,aV as xe,aW as fe,aX as pe,aY as ge,aZ as be,a_ as Ae,a$ as Ie,b0 as Me,b1 as Ee,b2 as Fe,b3 as ze,b4 as De,b5 as Oe,b6 as Re,a2 as ke,b7 as Y,b8 as P,b9 as Be,ba as Te,bb as Le,bc as Ve,bd as Ge,be as Pe,bf as He,bg as Ue,bh as We,i as je,bi as Je,bj as W,bk as Ye,bl as Ze,bm as Qe}from"./main.BXlmSY46.js";import*as U from"react";import Ke,{useState as D,useEffect as Xe,useCallback as E,Fragment as qe,useRef as Z,useMemo as Q,useLayoutEffect as _e}from"react";import{flushSync as $e}from"react-dom";const et=()=>{const[i,s]=D({innerWidth:window.innerWidth,innerHeight:window.innerHeight});return Xe(()=>{const e=()=>{s({innerWidth:window.innerWidth,innerHeight:window.innerHeight})};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),i};function tt(i){const{breadcrumbs:s,createEnabled:e,onBreadcrumbSelected:n}=i,[t,o]=D(!1),r=i.createEnabled?i.onCreate:void 0;function a(){o(!0)}const d=E(c=>{var f;!e||!r||(r(c,(f=s.at(-1))==null?void 0:f.id),o(!1))},[s,e,r]),u=E(()=>{o(!1)},[]);return N("div",{className:"flex h-9 flex-row items-center gap-2 p-6 text-gray-500",children:[s.map(c=>N(qe,{children:[l(nt,{node:c,onClick:n}),l("span",{children:"/"})]},c.id)),e&&(t?l(X,{className:"text-gray-800",defaultValue:"New Folder",onCancel:u,onSubmit:d,placeholder:"New Folder"}):N("button",{type:"button",className:"ml-1 flex items-center justify-center gap-2 rounded-md bg-gray-50 px-2 py-1.5 transition-colors hover:bg-gray-200 hover:text-gray-800",onClick:a,children:[l(C,{name:"Plus",size:14}),"Add new"]}))]})}function nt(i){const{node:s,onClick:e}=i;return l("div",{className:"transition-colors last-of-type:text-gray-800 hover:text-gray-800",onClick:()=>e(s),role:"button",children:s.name})}function st({selectedNodePath:i,setSelectedNode:s}){const e=E(n=>{s(n)},[s]);return{breadcrumbs:i,onBreadcrumbSelected:e}}function K(i){const{node:s,onAddFile:e,onCopyNode:n,onMoveNode:t,trackNestedDrag:o=!1,acceptedFileExtensions:r}=i,[a,d]=D(!1),u=Z(0),c=E(m=>!r||r.length===0||m.types.includes(J)?!0:m.types.includes("Files")?Array.from(m.items).some(S=>{if(S.kind==="file"){if(S.type==="application/zip"||S.type==="application/x-zip-compressed")return r.includes(".zip");if(S.type===""||S.type==="application/octet-stream")return!0}return!1}):!1,[r]),f=E(m=>{m.preventDefault(),m.stopPropagation(),c(m.dataTransfer)?d(!0):m.dataTransfer.dropEffect="none"},[c]),g=E(m=>{m.preventDefault(),m.stopPropagation(),c(m.dataTransfer)&&(u.current+=1,d(!0))},[c]),h=E(m=>{m.preventDefault(),m.stopPropagation(),u.current=Math.max(0,u.current-1),u.current===0&&d(!1)},[]),p=E(()=>{d(!1)},[]),b=E(async m=>{m.preventDefault();const S=m.target.closest("[data-drop-zone]"),M=(s==null?void 0:s.id)||"root";if(((S==null?void 0:S.getAttribute("data-drop-zone"))||"root")!==M){d(!1);return}try{let y=ot(m.dataTransfer.items).filter(Boolean);if(r&&r.length>0&&(y=y.filter(R=>{if(!R)return!1;const V=R.name.toLowerCase();return r.some(x=>V.endsWith(x.toLowerCase()))})),y.length){for(const R of y)R&&await e(R,s);return}const k=m.getModifierState("Alt"),O=m.dataTransfer.getData(J),v=JSON.parse(O);k?await n(v,s):await t(v,s)}catch(y){console.error(y)}finally{o&&(u.current=0),d(!1)}},[e,n,t,parent,s==null?void 0:s.id,o]);return Q(()=>{const m={onDragOver:f,onDrop:b,"data-drop-zone":(s==null?void 0:s.id)||"root"};return o?(m.onDragEnter=g,m.onDragLeave=h):m.onDragLeave=p,{isDropTarget:a,dropProps:m}},[a,s==null?void 0:s.id,g,h,p,f,b,o])}function ot(i){return Array.from(i).map(e=>e.kind==="file"?e.getAsFile():null).filter(Boolean)}const it={SYNCING:"Syncing",SUCCESS:"Synced",CONFLICT:"Error",MISSING:"Circle",ERROR:"Error",INITIAL_SYNC:"Syncing"};function Se(i){const{syncStatus:s,className:e,overrideSyncIcons:n={},...t}=i,o={...it,...n};return{[ue]:l(C,{size:16,...t,className:A("text-blue-900",e),name:o[ue]}),[re]:l(C,{size:16,...t,className:A("text-blue-900",e),name:o[re]}),[le]:l(C,{size:16,...t,className:A("text-green-900",e),name:o[le]}),[ae]:l(C,{size:16,...t,className:A("text-orange-900",e),name:o[ae]}),[ce]:l(C,{size:16,...t,className:A("text-red-900",e),name:o[ce]}),[de]:l(C,{size:16,...t,className:A("text-red-900",e),name:o[de]})}[s]}function rt(i){const{fileNode:s,sharingType:e,className:n,customDocumentIconSrc:t,isAllowedToCreateDocuments:o,getSyncStatusSync:r,setSelectedNode:a,onRenameNode:d,onDuplicateNode:u,showDeleteNodeModal:c}=i,[f,g]=D(B),[h,p]=D(!1),{dragProps:b}=ve({node:s}),m=f===B,w=r(s.id,e),S={[be]:()=>u(s),[ge]:()=>g(ye),[pe]:()=>c(s)},M=Object.entries(me).map(([x,T])=>({...T,id:x})).filter(x=>xe.includes(x.id));function F(x){d(x,s),g(B)}function y(){g(B)}function k(x){const T=S[x];if(!T){console.error(`No handler found for dropdown menu item: ${x}`);return}T(),p(!1)}const O=xt(s.documentType,t),v=N("div",{className:"relative",children:[l("img",{alt:"file icon",className:"max-w-none",height:34,src:O,width:32}),m&&w&&l("div",{className:"absolute bottom-[-2px] right-0 size-3 rounded-full bg-white",children:l("div",{className:"absolute left-[-2px] top-[-2px]",children:l(Se,{overrideSyncIcons:{SUCCESS:"CheckCircleFill"},syncStatus:w})})})]}),R=A("group flex h-12 cursor-pointer select-none items-center rounded-lg bg-gray-200 px-2 text-gray-600 hover:text-gray-800",n),V=m?N("div",{className:"flex w-52 items-center justify-between",children:[N("div",{className:"mr-2 truncate group-hover:mr-0",children:[l("div",{className:"max-h-6 truncate text-sm font-medium group-hover:text-gray-800",children:s.name}),l("div",{className:"max-h-6 truncate text-xs font-medium text-gray-600 group-hover:text-gray-800",children:s.documentType})]}),o?l(fe,{items:M,onItemClick:k,onOpenChange:p,open:h,children:l("button",{className:A("hidden group-hover:block",h&&"block"),onClick:x=>{x.stopPropagation(),p(!0)},children:l(C,{className:"text-gray-600",name:"VerticalDots"})})}):null]}):l(X,{className:"ml-3 flex-1 font-medium",defaultValue:s.name,onCancel:y,onSubmit:F});return l("div",{className:"relative w-64",onClick:()=>a(s),children:l("div",{...b,className:R,children:N("div",{className:"flex items-center",children:[l("div",{className:"mr-1.5",children:v}),V]})})})}function lt(i){const{folderNode:s,sharingType:e,isAllowedToCreateDocuments:n,className:t,setSelectedNode:o,getSyncStatusSync:r,onRenameNode:a,onDuplicateNode:d,showDeleteNodeModal:u,onAddFile:c,onCopyNode:f,onMoveNode:g}=i,[h,p]=D(B),[b,m]=D(!1),{dragProps:w}=ve({node:s}),{isDropTarget:S,dropProps:M}=K({node:s,onAddFile:c,onCopyNode:f,onMoveNode:g}),F=h===B,y=r(s.id,e);function k(){p(B)}function O(z){a(z,s),p(B)}const v={[be]:()=>d(s),[ge]:()=>p(ye),[pe]:()=>u(s)},R=Object.entries(me).map(([z,H])=>({...H,id:z})).filter(z=>Ae.includes(z.id));function V(z){const H=v[z];if(!H){console.error(`No handler found for dropdown menu item: ${z}`);return}H(),m(!1)}const x=F||!n?l("div",{className:"ml-3 max-h-6 truncate font-medium text-gray-600 group-hover:text-gray-800",children:s.name}):l(X,{className:"ml-3 font-medium",defaultValue:s.name,onCancel:k,onSubmit:O}),T=A("group flex h-12 cursor-pointer select-none items-center rounded-lg bg-gray-200 px-2",t,S&&"bg-blue-100");return l("div",{className:"relative w-64",onClick:()=>o(s),children:N("div",{...w,...M,className:T,children:[N("div",{className:"flex items-center overflow-hidden",children:[l("div",{className:"p-1",children:N("div",{className:"relative",children:[l(C,{name:"FolderClose",size:24}),F&&y?l("div",{className:"absolute bottom-[-3px] right-[-2px] size-3 rounded-full bg-white",children:l("div",{className:"absolute left-[-2px] top-[-2px]",children:l(Se,{overrideSyncIcons:{SUCCESS:"CheckCircleFill"},syncStatus:y})})}):null]})}),x]}),F&&n?l(fe,{items:R,onItemClick:V,onOpenChange:m,open:b,children:l("button",{className:A("ml-auto hidden group-hover:block",b&&"block"),onClick:z=>{z.stopPropagation(),m(!0)},children:l(C,{className:"text-gray-600",name:"VerticalDots"})})}):null]})})}function X(i){const{onSubmit:s,onCancel:e,defaultValue:n,className:t,minLength:o=1,...r}=i,[a,d]=D(n??""),u=Z(null);Ie(u,c),Me("keyup",f=>{f.key==="Enter"&&c(),f.key==="Escape"&&e()}),_e(()=>{setTimeout(()=>{var f,g,h;(f=u.current)==null||f.focus(),(g=u.current)==null||g.select(),(h=u.current)==null||h.scroll({left:9999})},100)},[]);function c(){a.length>=o&&s(a)}return l("input",{...r,autoFocus:!0,className:A("bg-inherit text-inherit outline-none",t),minLength:o,onChange:f=>d(f.target.value),ref:u,required:!0,type:"text",value:a})}function L(i,s,e){let n=e.initialDeps??[],t;function o(){var r,a,d,u;let c;e.key&&((r=e.debug)!=null&&r.call(e))&&(c=Date.now());const f=i();if(!(f.length!==n.length||f.some((p,b)=>n[b]!==p)))return t;n=f;let h;if(e.key&&((a=e.debug)!=null&&a.call(e))&&(h=Date.now()),t=s(...f),e.key&&((d=e.debug)!=null&&d.call(e))){const p=Math.round((Date.now()-c)*100)/100,b=Math.round((Date.now()-h)*100)/100,m=b/16,w=(S,M)=>{for(S=String(S);S.length<M;)S=" "+S;return S};console.info(`%c⏱ ${w(b,5)} /${w(p,5)} ms`,`
1
+ import{jsxs as N,jsx as l}from"react/jsx-runtime";import{I as C,F as A,aU as me,aV as xe,aW as fe,aX as pe,aY as ge,aZ as be,a_ as Ae,a$ as Ie,b0 as Me,b1 as Ee,b2 as Fe,b3 as ze,b4 as De,b5 as Oe,b6 as Re,a2 as ke,b7 as Y,b8 as P,b9 as Be,ba as Te,bb as Le,bc as Ve,bd as Ge,be as Pe,bf as He,bg as Ue,bh as We,i as je,bi as Je,bj as W,bk as Ye,bl as Ze,bm as Qe}from"./main.s5_GNYWM.js";import*as U from"react";import Ke,{useState as D,useEffect as Xe,useCallback as E,Fragment as qe,useRef as Z,useMemo as Q,useLayoutEffect as _e}from"react";import{flushSync as $e}from"react-dom";const et=()=>{const[i,s]=D({innerWidth:window.innerWidth,innerHeight:window.innerHeight});return Xe(()=>{const e=()=>{s({innerWidth:window.innerWidth,innerHeight:window.innerHeight})};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),i};function tt(i){const{breadcrumbs:s,createEnabled:e,onBreadcrumbSelected:n}=i,[t,o]=D(!1),r=i.createEnabled?i.onCreate:void 0;function a(){o(!0)}const d=E(c=>{var f;!e||!r||(r(c,(f=s.at(-1))==null?void 0:f.id),o(!1))},[s,e,r]),u=E(()=>{o(!1)},[]);return N("div",{className:"flex h-9 flex-row items-center gap-2 p-6 text-gray-500",children:[s.map(c=>N(qe,{children:[l(nt,{node:c,onClick:n}),l("span",{children:"/"})]},c.id)),e&&(t?l(X,{className:"text-gray-800",defaultValue:"New Folder",onCancel:u,onSubmit:d,placeholder:"New Folder"}):N("button",{type:"button",className:"ml-1 flex items-center justify-center gap-2 rounded-md bg-gray-50 px-2 py-1.5 transition-colors hover:bg-gray-200 hover:text-gray-800",onClick:a,children:[l(C,{name:"Plus",size:14}),"Add new"]}))]})}function nt(i){const{node:s,onClick:e}=i;return l("div",{className:"transition-colors last-of-type:text-gray-800 hover:text-gray-800",onClick:()=>e(s),role:"button",children:s.name})}function st({selectedNodePath:i,setSelectedNode:s}){const e=E(n=>{s(n)},[s]);return{breadcrumbs:i,onBreadcrumbSelected:e}}function K(i){const{node:s,onAddFile:e,onCopyNode:n,onMoveNode:t,trackNestedDrag:o=!1,acceptedFileExtensions:r}=i,[a,d]=D(!1),u=Z(0),c=E(m=>!r||r.length===0||m.types.includes(J)?!0:m.types.includes("Files")?Array.from(m.items).some(S=>{if(S.kind==="file"){if(S.type==="application/zip"||S.type==="application/x-zip-compressed")return r.includes(".zip");if(S.type===""||S.type==="application/octet-stream")return!0}return!1}):!1,[r]),f=E(m=>{m.preventDefault(),m.stopPropagation(),c(m.dataTransfer)?d(!0):m.dataTransfer.dropEffect="none"},[c]),g=E(m=>{m.preventDefault(),m.stopPropagation(),c(m.dataTransfer)&&(u.current+=1,d(!0))},[c]),h=E(m=>{m.preventDefault(),m.stopPropagation(),u.current=Math.max(0,u.current-1),u.current===0&&d(!1)},[]),p=E(()=>{d(!1)},[]),b=E(async m=>{m.preventDefault();const S=m.target.closest("[data-drop-zone]"),M=(s==null?void 0:s.id)||"root";if(((S==null?void 0:S.getAttribute("data-drop-zone"))||"root")!==M){d(!1);return}try{let y=ot(m.dataTransfer.items).filter(Boolean);if(r&&r.length>0&&(y=y.filter(R=>{if(!R)return!1;const V=R.name.toLowerCase();return r.some(x=>V.endsWith(x.toLowerCase()))})),y.length){for(const R of y)R&&await e(R,s);return}const k=m.getModifierState("Alt"),O=m.dataTransfer.getData(J),v=JSON.parse(O);k?await n(v,s):await t(v,s)}catch(y){console.error(y)}finally{o&&(u.current=0),d(!1)}},[e,n,t,parent,s==null?void 0:s.id,o]);return Q(()=>{const m={onDragOver:f,onDrop:b,"data-drop-zone":(s==null?void 0:s.id)||"root"};return o?(m.onDragEnter=g,m.onDragLeave=h):m.onDragLeave=p,{isDropTarget:a,dropProps:m}},[a,s==null?void 0:s.id,g,h,p,f,b,o])}function ot(i){return Array.from(i).map(e=>e.kind==="file"?e.getAsFile():null).filter(Boolean)}const it={SYNCING:"Syncing",SUCCESS:"Synced",CONFLICT:"Error",MISSING:"Circle",ERROR:"Error",INITIAL_SYNC:"Syncing"};function Se(i){const{syncStatus:s,className:e,overrideSyncIcons:n={},...t}=i,o={...it,...n};return{[ue]:l(C,{size:16,...t,className:A("text-blue-900",e),name:o[ue]}),[re]:l(C,{size:16,...t,className:A("text-blue-900",e),name:o[re]}),[le]:l(C,{size:16,...t,className:A("text-green-900",e),name:o[le]}),[ae]:l(C,{size:16,...t,className:A("text-orange-900",e),name:o[ae]}),[ce]:l(C,{size:16,...t,className:A("text-red-900",e),name:o[ce]}),[de]:l(C,{size:16,...t,className:A("text-red-900",e),name:o[de]})}[s]}function rt(i){const{fileNode:s,sharingType:e,className:n,customDocumentIconSrc:t,isAllowedToCreateDocuments:o,getSyncStatusSync:r,setSelectedNode:a,onRenameNode:d,onDuplicateNode:u,showDeleteNodeModal:c}=i,[f,g]=D(B),[h,p]=D(!1),{dragProps:b}=ve({node:s}),m=f===B,w=r(s.id,e),S={[be]:()=>u(s),[ge]:()=>g(ye),[pe]:()=>c(s)},M=Object.entries(me).map(([x,T])=>({...T,id:x})).filter(x=>xe.includes(x.id));function F(x){d(x,s),g(B)}function y(){g(B)}function k(x){const T=S[x];if(!T){console.error(`No handler found for dropdown menu item: ${x}`);return}T(),p(!1)}const O=xt(s.documentType,t),v=N("div",{className:"relative",children:[l("img",{alt:"file icon",className:"max-w-none",height:34,src:O,width:32}),m&&w&&l("div",{className:"absolute bottom-[-2px] right-0 size-3 rounded-full bg-white",children:l("div",{className:"absolute left-[-2px] top-[-2px]",children:l(Se,{overrideSyncIcons:{SUCCESS:"CheckCircleFill"},syncStatus:w})})})]}),R=A("group flex h-12 cursor-pointer select-none items-center rounded-lg bg-gray-200 px-2 text-gray-600 hover:text-gray-800",n),V=m?N("div",{className:"flex w-52 items-center justify-between",children:[N("div",{className:"mr-2 truncate group-hover:mr-0",children:[l("div",{className:"max-h-6 truncate text-sm font-medium group-hover:text-gray-800",children:s.name}),l("div",{className:"max-h-6 truncate text-xs font-medium text-gray-600 group-hover:text-gray-800",children:s.documentType})]}),o?l(fe,{items:M,onItemClick:k,onOpenChange:p,open:h,children:l("button",{className:A("hidden group-hover:block",h&&"block"),onClick:x=>{x.stopPropagation(),p(!0)},children:l(C,{className:"text-gray-600",name:"VerticalDots"})})}):null]}):l(X,{className:"ml-3 flex-1 font-medium",defaultValue:s.name,onCancel:y,onSubmit:F});return l("div",{className:"relative w-64",onClick:()=>a(s),children:l("div",{...b,className:R,children:N("div",{className:"flex items-center",children:[l("div",{className:"mr-1.5",children:v}),V]})})})}function lt(i){const{folderNode:s,sharingType:e,isAllowedToCreateDocuments:n,className:t,setSelectedNode:o,getSyncStatusSync:r,onRenameNode:a,onDuplicateNode:d,showDeleteNodeModal:u,onAddFile:c,onCopyNode:f,onMoveNode:g}=i,[h,p]=D(B),[b,m]=D(!1),{dragProps:w}=ve({node:s}),{isDropTarget:S,dropProps:M}=K({node:s,onAddFile:c,onCopyNode:f,onMoveNode:g}),F=h===B,y=r(s.id,e);function k(){p(B)}function O(z){a(z,s),p(B)}const v={[be]:()=>d(s),[ge]:()=>p(ye),[pe]:()=>u(s)},R=Object.entries(me).map(([z,H])=>({...H,id:z})).filter(z=>Ae.includes(z.id));function V(z){const H=v[z];if(!H){console.error(`No handler found for dropdown menu item: ${z}`);return}H(),m(!1)}const x=F||!n?l("div",{className:"ml-3 max-h-6 truncate font-medium text-gray-600 group-hover:text-gray-800",children:s.name}):l(X,{className:"ml-3 font-medium",defaultValue:s.name,onCancel:k,onSubmit:O}),T=A("group flex h-12 cursor-pointer select-none items-center rounded-lg bg-gray-200 px-2",t,S&&"bg-blue-100");return l("div",{className:"relative w-64",onClick:()=>o(s),children:N("div",{...w,...M,className:T,children:[N("div",{className:"flex items-center overflow-hidden",children:[l("div",{className:"p-1",children:N("div",{className:"relative",children:[l(C,{name:"FolderClose",size:24}),F&&y?l("div",{className:"absolute bottom-[-3px] right-[-2px] size-3 rounded-full bg-white",children:l("div",{className:"absolute left-[-2px] top-[-2px]",children:l(Se,{overrideSyncIcons:{SUCCESS:"CheckCircleFill"},syncStatus:y})})}):null]})}),x]}),F&&n?l(fe,{items:R,onItemClick:V,onOpenChange:m,open:b,children:l("button",{className:A("ml-auto hidden group-hover:block",b&&"block"),onClick:z=>{z.stopPropagation(),m(!0)},children:l(C,{className:"text-gray-600",name:"VerticalDots"})})}):null]})})}function X(i){const{onSubmit:s,onCancel:e,defaultValue:n,className:t,minLength:o=1,...r}=i,[a,d]=D(n??""),u=Z(null);Ie(u,c),Me("keyup",f=>{f.key==="Enter"&&c(),f.key==="Escape"&&e()}),_e(()=>{setTimeout(()=>{var f,g,h;(f=u.current)==null||f.focus(),(g=u.current)==null||g.select(),(h=u.current)==null||h.scroll({left:9999})},100)},[]);function c(){a.length>=o&&s(a)}return l("input",{...r,autoFocus:!0,className:A("bg-inherit text-inherit outline-none",t),minLength:o,onChange:f=>d(f.target.value),ref:u,required:!0,type:"text",value:a})}function L(i,s,e){let n=e.initialDeps??[],t;function o(){var r,a,d,u;let c;e.key&&((r=e.debug)!=null&&r.call(e))&&(c=Date.now());const f=i();if(!(f.length!==n.length||f.some((p,b)=>n[b]!==p)))return t;n=f;let h;if(e.key&&((a=e.debug)!=null&&a.call(e))&&(h=Date.now()),t=s(...f),e.key&&((d=e.debug)!=null&&d.call(e))){const p=Math.round((Date.now()-c)*100)/100,b=Math.round((Date.now()-h)*100)/100,m=b/16,w=(S,M)=>{for(S=String(S);S.length<M;)S=" "+S;return S};console.info(`%c⏱ ${w(b,5)} /${w(p,5)} ms`,`
2
2
  font-size: .6rem;
3
3
  font-weight: bold;
4
4
  color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,e==null?void 0:e.key)}return(u=e==null?void 0:e.onChange)==null||u.call(e,t),t}return o.updateDeps=r=>{n=r},o}function _(i,s){if(i===void 0)throw new Error("Unexpected undefined");return i}const at=(i,s)=>Math.abs(i-s)<1.01,ct=(i,s,e)=>{let n;return function(...t){i.clearTimeout(n),n=i.setTimeout(()=>s.apply(this,t),e)}},$=i=>{const{offsetWidth:s,offsetHeight:e}=i;return{width:s,height:e}},dt=i=>i,ut=i=>{const s=Math.max(i.startIndex-i.overscan,0),e=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let t=s;t<=e;t++)n.push(t);return n},ht=(i,s)=>{const e=i.scrollElement;if(!e)return;const n=i.targetWindow;if(!n)return;const t=r=>{const{width:a,height:d}=r;s({width:Math.round(a),height:Math.round(d)})};if(t($(e)),!n.ResizeObserver)return()=>{};const o=new n.ResizeObserver(r=>{const a=()=>{const d=r[0];if(d!=null&&d.borderBoxSize){const u=d.borderBoxSize[0];if(u){t({width:u.inlineSize,height:u.blockSize});return}}t($(e))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(e,{box:"border-box"}),()=>{o.unobserve(e)}},ee={passive:!0},te=typeof window>"u"?!0:"onscrollend"in window,mt=(i,s)=>{const e=i.scrollElement;if(!e)return;const n=i.targetWindow;if(!n)return;let t=0;const o=i.options.useScrollendEvent&&te?()=>{}:ct(n,()=>{s(t,!1)},i.options.isScrollingResetDelay),r=c=>()=>{const{horizontal:f,isRtl:g}=i.options;t=f?e.scrollLeft*(g&&-1||1):e.scrollTop,o(),s(t,c)},a=r(!0),d=r(!1);d(),e.addEventListener("scroll",a,ee);const u=i.options.useScrollendEvent&&te;return u&&e.addEventListener("scrollend",d,ee),()=>{e.removeEventListener("scroll",a),u&&e.removeEventListener("scrollend",d)}},ft=(i,s,e)=>{if(s!=null&&s.borderBoxSize){const n=s.borderBoxSize[0];if(n)return Math.round(n[e.options.horizontal?"inlineSize":"blockSize"])}return i[e.options.horizontal?"offsetWidth":"offsetHeight"]},pt=(i,{adjustments:s=0,behavior:e},n)=>{var t,o;const r=i+s;(o=(t=n.scrollElement)==null?void 0:t.scrollTo)==null||o.call(t,{[n.options.horizontal?"left":"top"]:r,behavior:e})};class gt{constructor(s){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const n=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(t=>{t.forEach(o=>{const r=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var t;(t=n())==null||t.disconnect(),e=null},observe:t=>{var o;return(o=n())==null?void 0:o.observe(t,{box:"border-box"})},unobserve:t=>{var o;return(o=n())==null?void 0:o.unobserve(t)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([n,t])=>{typeof t>"u"&&delete e[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:dt,rangeExtractor:ut,onChange:()=>{},measureElement:ft,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var n,t;(t=(n=this.options).onChange)==null||t.call(n,this,e)},this.maybeNotify=L(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(t=>{this.observer.observe(t)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,t=>{this.scrollRect=t,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(t,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<t?"forward":"backward":null,this.scrollOffset=t,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,n)=>{const t=new Map,o=new Map;for(let r=n-1;r>=0;r--){const a=e[r];if(t.has(a.lane))continue;const d=o.get(a.lane);if(d==null||a.end>d.end?o.set(a.lane,a):a.end<d.end&&t.set(a.lane,!0),t.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((r,a)=>r.end===a.end?r.index-a.index:r.end-a.end)[0]:void 0},this.getMeasurementOptions=L(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,n,t,o,r)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:t,getItemKey:o,enabled:r}),{key:!1}),this.getMeasurements=L(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:n,scrollMargin:t,getItemKey:o,enabled:r},a)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const d=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,d);for(let c=d;c<e;c++){const f=o(c),g=this.options.lanes===1?u[c-1]:this.getFurthestMeasurement(u,c),h=g?g.end+this.options.gap:n+t,p=a.get(f),b=typeof p=="number"?p:this.options.estimateSize(c),m=h+b,w=g?g.lane:c%this.options.lanes;u[c]={index:c,start:h,size:b,end:m,key:f,lane:w}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=L(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,n,t,o)=>this.range=e.length>0&&n>0?bt({measurements:e,outerSize:n,scrollOffset:t,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=L(()=>{let e=null,n=null;const t=this.calculateRange();return t&&(e=t.startIndex,n=t.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,n]},(e,n,t,o,r)=>o===null||r===null?[]:e({startIndex:o,endIndex:r,overscan:n,count:t}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const n=this.options.indexAttribute,t=e.getAttribute(n);return t?parseInt(t,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(e,n)=>{const t=this.indexFromElement(e),o=this.measurementsCache[t];if(!o)return;const r=o.key,a=this.elementsCache.get(r);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(r,e)),e.isConnected&&this.resizeItem(t,this.options.measureElement(e,n,this))},this.resizeItem=(e,n)=>{const t=this.measurementsCache[e];if(!t)return;const o=this.itemSizeCache.get(t.key)??t.size,r=n-o;r!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(t,r,this):t.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(t.index),this.itemSizeCache=new Map(this.itemSizeCache.set(t.key,n)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((n,t)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(t))});return}this._measureElement(e,void 0)},this.getVirtualItems=L(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,n)=>{const t=[];for(let o=0,r=e.length;o<r;o++){const a=e[o],d=n[a];t.push(d)}return t},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const n=this.getMeasurements();if(n.length!==0)return _(n[Ne(0,n.length-1,t=>_(n[t]).start,e)])},this.getOffsetForAlignment=(e,n,t=0)=>{const o=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=e>=r+o?"end":"start"),n==="center"?e+=(t-o)/2:n==="end"&&(e-=o);const a=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,n="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const t=this.measurementsCache[e];if(!t)return;const o=this.getSize(),r=this.getScrollOffset();if(n==="auto")if(t.end>=r+o-this.options.scrollPaddingEnd)n="end";else if(t.start<=r+this.options.scrollPaddingStart)n="start";else return[r,n];const a=n==="end"?t.end+this.options.scrollPaddingEnd:t.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,t.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:n="start",behavior:t}={})=>{t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,n),{adjustments:void 0,behavior:t})},this.scrollToIndex=(e,{align:n="auto",behavior:t}={})=>{t==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let o=0;const r=10,a=u=>{if(!this.targetWindow)return;const c=this.getOffsetForIndex(e,u);if(!c){console.warn("Failed to get offset for index:",e);return}const[f,g]=c;this._scrollToOffset(f,{adjustments:void 0,behavior:t}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),p=this.getOffsetForIndex(e,g);if(!p){console.warn("Failed to get offset for index:",e);return}at(p[0],h)||d(g)})},d=u=>{this.targetWindow&&(o++,o<r?this.targetWindow.requestAnimationFrame(()=>a(u)):console.warn(`Failed to scroll to index ${e} after ${r} attempts.`))};a(n)},this.scrollBy=(e,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var e;const n=this.getMeasurements();let t;if(n.length===0)t=this.options.paddingStart;else if(this.options.lanes===1)t=((e=n[n.length-1])==null?void 0:e.end)??0;else{const o=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&o.some(a=>a===null);){const a=n[r];o[a.lane]===null&&(o[a.lane]=a.end),r--}t=Math.max(...o.filter(a=>a!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:n,behavior:t})=>{this.options.scrollToFn(e,{behavior:t,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(s)}}const Ne=(i,s,e,n)=>{for(;i<=s;){const t=(i+s)/2|0,o=e(t);if(o<n)i=t+1;else if(o>n)s=t-1;else return t}return i>0?i-1:0};function bt({measurements:i,outerSize:s,scrollOffset:e,lanes:n}){const t=i.length-1,o=d=>i[d].start;if(i.length<=n)return{startIndex:0,endIndex:t};let r=Ne(0,t,o,e),a=r;if(n===1)for(;a<t&&i[a].end<e+s;)a++;else if(n>1){const d=Array(n).fill(0);for(;a<t&&d.some(c=>c<e+s);){const c=i[a];d[c.lane]=c.end,a++}const u=Array(n).fill(e+s);for(;r>=0&&u.some(c=>c>=e);){const c=i[r];u[c.lane]=c.start,r--}r=Math.max(0,r-r%n),a=Math.min(t,a+(n-1-a%n))}return{startIndex:r,endIndex:a}}const ne=typeof document<"u"?U.useLayoutEffect:U.useEffect;function St(i){const s=U.useReducer(()=>({}),{})[1],e={...i,onChange:(t,o)=>{var r;o?$e(s):s(),(r=i.onChange)==null||r.call(i,t,o)}},[n]=U.useState(()=>new gt(e));return n.setOptions(e),ne(()=>n._didMount(),[]),ne(()=>n._willUpdate()),n}function se(i){return St({observeElementRect:ht,observeElementOffset:mt,scrollToFn:pt,...i})}const oe=i=>{const{item:s,...e}=i;return N("div",{...Ee(e,"flex h-full flex-row items-center justify-between gap-x-4 px-2"),children:[s.icon,l("div",{className:"text-sm font-semibold text-slate-200",children:s.label})]})},Nt=i=>{const{value:s,onChange:e,placeholder:n,filterLabel:t,filterItems:o,selectedFilter:r,onFilterSelect:a=()=>{},className:d}=i,u=Q(()=>(o==null?void 0:o.map(h=>({id:h.id,content:l(oe,{item:h})})))??[],[o]),c=o==null?void 0:o.find(h=>h.id===r),f=c?l(oe,{className:"gap-x-1",item:c}):t&&l("div",{className:"mr-2 text-sm font-semibold text-slate-200",children:t});function g(h){e==null||e(h.target.value)}return N("div",{className:Fe("flex items-center",d),children:[l(C,{className:"mr-3",name:"Search"}),l("input",{className:A("flex h-[52px] min-w-0 flex-1 items-center rounded-xl border border-gray-200 bg-gray-50 px-4 text-sm text-slate-200 outline-none"),onChange:g,placeholder:n,value:s}),N(ze,{children:[N(De,{className:"ml-3 flex h-full flex-row items-center outline-none",children:[f," ",l(C,{name:"ChevronDown"})]}),l(Oe,{className:"rounded-xl border border-gray-100 bg-gray-50 p-2",children:u.map(h=>l(Re,{className:"h-10 cursor-pointer overflow-hidden rounded-lg hover:bg-gray-100",id:h.id,onSelect:()=>a(h.id),children:h.content},h.id))})]})]})},we="powerhouse/budget-statement",q="powerhouse/default",Ce="makerdao/rwa-portfolio",wt=[we,q,Ce],Ct="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAB4CAYAAAAXIRdAAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAzWSURBVHgB7V1dbBXHFZ5d/wI1WMhuVBUJq1GlAg9QlZSngNU2D9BIreoYGikKUdVKjaoSklSRWol4TdWmUgs0SFVTVaqUELUKhDTlIUFqiDA8lKQ8QCvMS5PaVRAN14kMjrGN7TuZb5izPne89/r+7HrXvvNJ17s7O3v3er89Z845M3PGE+XDw58j372+Pi8bv+3n5WZV0i2l1y6EbBfLFNKT/U8fvycQGYFXznkppTi8O7fXF95eKWS3qDN4irQnM0LaPMIUOWGZ53ni0O7r3Z5o+JOQokvUMYyk9dOhSAkFhHGyfvXg/9pbVq7oU7tP8DotqzzRsb5R3Lu1Sazb2CTaOnxdtpxw9OGPI8st0nSRWGT4dgGk6je7P+xSZL0tGFkgZVvPCvHY8+2i50Cb2LKzVRHXsOzIKgVPen1HdufwEosgCPCPL/o/79n7v+79f1eD57/NVeCWnS2KrJV1Q04xCSOol7p//ysd/Xi5LSQucY1Qg3Tj57453G6Ttf3RlVqaHOagnlnf4T03sNtvnfJgoKnnmRhxPn9LdJvFyHrgh6scWUUA9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bNK9GP/e+1O21gUfMcURp1TCwVV1Srhx9gHYe08EV+hE8uMDkHQ/Wb1oiYWgA7JhcynVzJQuLtQimZfyF+U/nNNezVUyTNHmxP07i6YbHbwFYwkkp2k/uvi6XhXWqSYWUCfovuE95GQpV3j66SlhmyBX6RgaGkrcv0XjFBG4oS0MfempB+c6vg7lK0LCI3TB/L4Deu4Ul0sC0sEfbB0gjF2uIUudnfjPZ9OPPnz2ilaXzHRZO2uFSqJTrY54qTLo2JZt+/3FmU9mox7bnimULr0O0V/+CHLqpv4RSZLYpye8Ml63P4Powms1ZCmMfy43fOfk3U2WLHbvbRcLvvOyRbEzggoZjMxJzSay/MrXZrvuL3/lH+qZ6LJPx6bNMP/4HpDf3qO3XUvj+2mzL1zwa9Kud4/Rfj3XNoqVft61KAzYSsqqorcug2CaoRRw9ZPZ2Z6Oly+N436WZfE/7X4X8aPJouQND05OTgr8wzfE7GPob+kDQumM5b9fgA0vHIfyn04BqIZUfnBNP01kefRy99Ne/Jq067P+Zj3XNvpa6ef1//2j/+l7UX7p1/relNQ94mThPfw/zH13n8q5XAKo1B6V3zPHUx8Ksja8KOKyCM+80U1+caTn0IaodIJbW0BdGL89Lw//fFqM0gFKkskdklUhWUQetV8Etx3TYT0fyGjM036gu7tbjI6OyrmB/QejKHmOByQBi4Gq0ZwQZ/tvylc5Qei51L1MUtwf1xBTJ/Rx0rSF0YfoncwTvwSzcdzGL0fyLn3zoc77RPIjEcHeKIJORWCnOt0B6xMz6uZ8rNzemJwXV6fl7N8eUs0JPeSuioFwx9KTdS01JwxBJH4JoOdEKaNKcdAAAAAASUVORK5CYII=",ie={[we]:Ct,[q]:vt,[Ce]:yt},ye="WRITE",B="READ",J="UI_NODE",re="SYNCING",le="SUCCESS",ae="CONFLICT",ce="MISSING",de="ERROR",ue="INITIAL_SYNC";function ve(i){const{node:s}=i,[e,n]=D(!1),t=E(r=>{r.dataTransfer.setData(J,JSON.stringify(s))},[s]),o=E(()=>{n(!1)},[]);return Q(()=>({isDragging:e,dragProps:{draggable:!0,onDragStart:t,onDragEnd:o}}),[e,o,t])}function xt(i,s){return s||(wt.includes(i)?ie[i]:ie[q])}function At(i){return"documentModelState"in i?i.documentModelState:i.documentModel}const It=({documentModels:i,createDocument:s})=>N("div",{className:"px-6",children:[l("h3",{className:"mb-3 mt-4 text-xl font-bold text-gray-600",children:"New document"}),l("div",{className:"flex w-full flex-wrap gap-4",children:i==null?void 0:i.map(e=>{const n=At(e);return l(ke,{color:"light",title:n.name,"aria-description":n.description,onClick:()=>s(e),children:l("span",{className:"text-sm",children:n.name})},n.id)})})]}),G=8,j=256,he=48,Mt=420;function Et(i){const s=Z(null),{t:e}=Y(),n=et(),{fileNodes:t}=i,o=n.innerWidth-Mt,r=Math.floor(o/(j+G))||1,a=Math.ceil(t.length/r),d=se({count:a,getScrollElement:()=>s.current,estimateSize:h=>h>0?he+G:he,overscan:5}),u=se({horizontal:!0,count:r,getScrollElement:()=>s.current,estimateSize:h=>h>0?j+G:j,overscan:5}),c=(h,p)=>h*r+p,f=(h,p)=>{const b=c(h,p);return t[b]||null};if(t.length===0)return l("div",{className:"mb-8 text-sm text-gray-400",children:e("folderView.sections.documents.empty",{defaultValue:"No documents or files 📄"})});const g=(h,p)=>{const b=f(h,p);return b?l("div",{style:{marginLeft:p===0?0:G},children:l(rt,{fileNode:b,...i},b.id)}):null};return l("div",{ref:s,style:{height:"400px",width:"100%",overflow:"auto"},children:l("div",{style:{height:`${d.getTotalSize()}px`,width:`${u.getTotalSize()}px`,position:"relative"},children:d.getVirtualItems().map(h=>l(Ke.Fragment,{children:u.getVirtualItems().map(p=>l("div",{style:{position:"absolute",top:0,left:0,marginTop:h.index===0?0:G,width:`${p.size}px`,height:`${h.size}px`,transform:`translateX(${p.start}px) translateY(${h.start}px)`},children:g(h.index,p.index)},p.key))},h.key))})})}function I({children:i,className:s,...e}){return l(I.Container,{className:s,...e,children:i})}I.Container=function({children:s,className:e,containerProps:n,...t}){return l("div",{className:P("flex grow flex-col overflow-auto rounded-2xl bg-gray-50 p-2",e),...n,...t,children:s})};I.Header=function({children:s,className:e,containerProps:n,...t}){return l("div",{className:P("flex-0",e),...n,...t,children:s})};I.Content=function({children:s,className:e,containerProps:n,...t}){return l("div",{className:P("mb-5 flex-1 px-4",e),...n,...t,children:s})};I.ContentSection=function({title:s,children:e,className:n,containerProps:t,...o}){return N("div",{className:P(n),...t,...o,children:[s&&l("div",{className:"mb-4 text-base font-semibold text-gray-600",children:s}),l("div",{className:"flex flex-wrap gap-2",children:e})]})};I.Footer=function({children:s,className:e,containerProps:n,...t}){return l("div",{className:P("flex-0",e),...n,...t,children:s})};function Ft(i){const{node:s,isAllowedToCreateDocuments:e,className:n,containerProps:t,sharingType:o,getSyncStatusSync:r,setSelectedNode:a,onAddFile:d,onCopyNode:u,onMoveNode:c,onRenameNode:f,onDuplicateNode:g,onAddFolder:h,onAddAndSelectNewFolder:p,showDeleteNodeModal:b}=i,{t:m}=Y(),w=Be(s==null?void 0:s.id),S=Te(s==null?void 0:s.id),{isDropTarget:M,dropProps:F}=K({node:s,onAddFile:d,onCopyNode:u,onMoveNode:c});return N("div",{className:A("rounded-md border-2 border-transparent p-2",M&&"border-dashed border-blue-100",n),...t,...F,children:[l(I.ContentSection,{title:m("folderView.sections.folders.title",{defaultValue:"Folders"}),className:"mb-4",children:w.length>0?w.map(y=>l(lt,{folderNode:y,isAllowedToCreateDocuments:e,sharingType:o,getSyncStatusSync:r,setSelectedNode:a,onAddFile:d,onCopyNode:u,onMoveNode:c,onRenameNode:f,onDuplicateNode:g,onAddFolder:h,onAddAndSelectNewFolder:p,showDeleteNodeModal:b},y.id)):l("div",{className:"mb-8 text-sm text-gray-400",children:m("folderView.sections.folders.empty",{defaultValue:"No documents or files 📄"})})}),l(I.ContentSection,{title:m("folderView.sections.documents.title",{defaultValue:"Documents and files"}),children:l("div",{className:A("w-full",S.length>0?"min-h-[400px]":"min-h-14"),children:l(Et,{fileNodes:S,isAllowedToCreateDocuments:e,sharingType:o,getSyncStatusSync:r,setSelectedNode:a,showDeleteNodeModal:b,onAddFile:d,onCopyNode:u,onMoveNode:c,onRenameNode:f,onDuplicateNode:g,onAddFolder:h,onAddAndSelectNewFolder:p})})})]})}const zt=[{id:"project",label:".project",icon:l(C,{name:"Project",color:"#FF6A55",size:16})},{id:"budget",label:".budget",icon:l(C,{name:"BarChart",color:"#8E55EA",size:16})},{id:"profile",label:".profile",icon:l(C,{name:"Person",color:"#3E90F0",size:16})},{id:"legal",label:".legal",icon:l(C,{name:"Briefcase",color:"#4BAB71",size:16})},{id:"atlas",label:".Atlas",icon:l(C,{name:"Globe",color:"#FF8A00",size:16})}],Dt=()=>{const{t:i}=Y(),[s,e]=D("");return l(Nt,{className:"max-w-searchbar-width m-4 shrink-0 bg-gray-100",placeholder:i("searchbar.placeholder"),filterLabel:i("searchbar.filterLabel"),filterItems:zt,value:s,onChange:e})};function Ot(i){const{className:s,children:e}=i,[n]=Le(),{onRenameNode:t,onDuplicateNode:o,onAddFolder:r,onAddFile:a,onCopyNode:d,onMoveNode:u}=Ve(),c=Ge(),f=Ze(n),g=Pe(),h=He(),{isAllowedToCreateDocuments:p}=Ue(),b=We(),m=v=>{Qe(v.documentModel.id)},{isDropTarget:w,dropProps:S}=K({node:f,onAddFile:a,onCopyNode:d,onMoveNode:u}),{breadcrumbs:M,onBreadcrumbSelected:F}=st({selectedNodePath:h,setSelectedNode:W}),y=je(n);async function k(v){await r(v,c),W(c)}const O=!!e;return N(I,{className:s,children:[!O&&N(I.Header,{children:[l(tt,{breadcrumbs:M,createEnabled:p,onCreate:k,onBreadcrumbSelected:F}),b&&l(Dt,{})]}),O?e:l(I.Content,{...S,className:w?"rounded-xl bg-blue-100":"",children:l(Ft,{node:c??f,sharingType:y,getSyncStatusSync:Ye,setSelectedNode:W,onRenameNode:t,onDuplicateNode:o,onAddFolder:r,onAddFile:a,onCopyNode:d,onMoveNode:u,onAddAndSelectNewFolder:k,showDeleteNodeModal:v=>Je(v.id),isAllowedToCreateDocuments:p})}),!O&&l(I.Footer,{children:p&&l(It,{documentModels:g==null?void 0:g.filter(v=>v.documentModel.id!=="powerhouse/document-drive"),createDocument:m})})]})}const Rt={Component:Ot,documentTypes:["powerhouse/document-drive"],config:{id:"GenericDriveExplorer",name:"Drive Explorer App",disableExternalControls:!0,documentToolbarEnabled:!0,showSwitchboardLink:!0}},Vt=Object.freeze(Object.defineProperty({__proto__:null,GenericDriveExplorer:Rt},Symbol.toStringTag,{value:"Module"}));export{Rt as G,Vt as i,se as u};
5
- //# sourceMappingURL=index.CXV2LGi6.js.map
5
+ //# sourceMappingURL=index.CZ3emu5D.js.map