@ifc-lite/viewer 1.21.0 → 1.22.0
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/.turbo/turbo-build.log +57 -50
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +10 -0
- package/dist/assets/arrow-fie-E7fe.js +20 -0
- package/dist/assets/ascii-points-source-bTjLVmUX.js +1 -0
- package/dist/assets/{basketViewActivator-Bzw51jhm.js → basketViewActivator-EHAhHlwN.js} +12 -13
- package/dist/assets/bcf-Bhx-K17f.js +281 -0
- package/dist/assets/{browser-C5TFR7sH.js → browser-CVf8ATeW.js} +6 -6
- package/dist/assets/cesium-B4ZIU9jS.js +17742 -0
- package/dist/assets/decode-worker-CYqSjk1n.js +172 -0
- package/dist/assets/e57-source-CQHxE8n3.js +1 -0
- package/dist/assets/emscripten-module.browser-DcFZLAUx.js +1 -0
- package/dist/assets/exporters-KTio0Tdm.js +5723 -0
- package/dist/assets/geometry-controller.worker-Cm2P_EJr.js +7 -0
- package/dist/assets/geometry.worker-DchLBqZ8.js +1 -0
- package/dist/assets/{ids-B7AXEv7h.js → ids-CS7VCFin.js} +5 -5
- package/dist/assets/ifc-lite-C6wEhXa6.js +7 -0
- package/dist/assets/{ifc-lite_bg-DlKs5-yM.wasm → ifc-lite_bg-CSeT3fNI.wasm} +0 -0
- package/dist/assets/{ifc-lite_bg-PqmRe3Ph.wasm → ifc-lite_bg-ns4cSnX2.wasm} +0 -0
- package/dist/assets/{index-DVNSvEMh.js → index-8k9h-ANq.js} +60997 -59926
- package/dist/assets/index-BZC2YaOP.css +1 -0
- package/dist/assets/index-HqAIQkr6.js +22 -0
- package/dist/assets/inline-worker-BpBzlmd6.js +1 -0
- package/dist/assets/las-BW6LIc_j.js +1 -0
- package/dist/assets/las-source-C_IGrgRq.js +1 -0
- package/dist/assets/laz-source-jj3xI5Y4.js +125 -0
- package/dist/assets/maplibre-gl-C4LXKM6c.js +808 -0
- package/dist/assets/{native-bridge-BiD01jI9.js → native-bridge-DNrEhx2R.js} +5 -8
- package/dist/assets/{parser.worker-Bnbrl6gy.js → parser.worker-BcjkIo89.js} +2 -2
- package/dist/assets/pcd-source-Ck0UnVDn.js +3 -0
- package/dist/assets/ply-source-C8jjyzxE.js +4 -0
- package/dist/assets/{exporters-u0sz2Upj.js → sandbox-BSn5MyEJ.js} +11745 -7412
- package/dist/assets/{server-client-DP8fMPY9.js → server-client-D-kU2XAF.js} +4 -4
- package/dist/assets/{three-CDRZThFA.js → three-DwNDHx9-.js} +163 -171
- package/dist/assets/wasm-bridge-Cha08LdC.js +1 -0
- package/dist/assets/{workerHelpers-CBbWSJmd.js → workerHelpers-pUUnk9Wc.js} +1 -1
- package/dist/assets/zip-BJqVbRkU.js +2 -0
- package/dist/index.html +10 -12
- package/package.json +11 -11
- package/src/components/mcp/PlaygroundChat.tsx +90 -52
- package/src/components/viewer/CesiumOverlay.tsx +150 -91
- package/src/components/viewer/CesiumPlacementEditor.tsx +1009 -0
- package/src/components/viewer/ChatPanel.tsx +76 -93
- package/src/components/viewer/EntityContextMenu.tsx +68 -10
- package/src/components/viewer/MainToolbar.tsx +33 -3
- package/src/components/viewer/ViewportContainer.tsx +70 -16
- package/src/components/viewer/ViewportOverlays.tsx +2 -98
- package/src/components/viewer/chat/ByokKeyModal.tsx +338 -0
- package/src/components/viewer/chat/ByokStreamingPill.tsx +62 -0
- package/src/components/viewer/chat/ByokTrustDiagram.tsx +192 -0
- package/src/components/viewer/properties/GeoreferencingPanel.tsx +49 -52
- package/src/components/viewer/properties/ModelMetadataPanel.tsx +55 -44
- package/src/components/viewer/selectionHandlers.ts +7 -1
- package/src/lib/geo/cesium-bridge.ts +86 -50
- package/src/lib/geo/cesium-placement.test.ts +244 -0
- package/src/lib/geo/cesium-placement.ts +231 -0
- package/src/lib/geo/effective-georef.test.ts +74 -1
- package/src/lib/geo/effective-georef.ts +40 -93
- package/src/lib/geo/geo-scale.ts +104 -0
- package/src/lib/geo/reproject.test.ts +130 -0
- package/src/lib/geo/reproject.ts +37 -12
- package/src/lib/geo/terrain-elevation.ts +198 -89
- package/src/lib/lens/adapter.ts +52 -6
- package/src/lib/llm/clipboard-detect.test.ts +150 -0
- package/src/lib/llm/clipboard-detect.ts +90 -0
- package/src/lib/llm/models.ts +28 -0
- package/src/lib/llm/stream-direct.ts +16 -4
- package/src/lib/llm/types.ts +8 -0
- package/src/services/playground-model.ts +55 -0
- package/src/store/index.ts +4 -5
- package/src/store/slices/cesiumSlice.ts +100 -19
- package/src/store.ts +3 -0
- package/dist/assets/arrow-CZ5kQ26f.js +0 -20
- package/dist/assets/bcf-4K724hw0.js +0 -281
- package/dist/assets/cesium-DUOzBlqv.js +0 -17817
- package/dist/assets/decode-worker-t2EGKAxO.js +0 -1708
- package/dist/assets/emscripten-module.browser-CY5t0Vfq.js +0 -1
- package/dist/assets/geometry-controller.worker-NH8pZmrU.js +0 -7
- package/dist/assets/geometry.worker-Bp4rW_R1.js +0 -1
- package/dist/assets/ifc-lite-DfZHk36-.js +0 -7
- package/dist/assets/index-CSWgTe1s.css +0 -1
- package/dist/assets/index-XwKzDuw6.js +0 -22
- package/dist/assets/maplibre-gl-CGLcoNXc.js +0 -811
- package/dist/assets/sandbox-DPD1ROr0.js +0 -9700
- package/dist/assets/wasm-bridge-CErti6zX.js +0 -1
- package/dist/assets/zip-DBEtpeu6.js +0 -12
- package/src/components/viewer/CesiumSettingsDialog.tsx +0 -100
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import{J as X}from"./zip-BJqVbRkU.js";import{g as C}from"./sandbox-BSn5MyEJ.js";async function te(t){const e=await X.loadAsync(t),i=await Q(e),{projectId:o,name:n,extensions:s}=await tt(e),c=await et(e);return{version:i.versionId,projectId:o,name:n,topics:c,extensions:s}}async function Q(t){const e=t.file("bcf.version");if(!e)throw new Error("Invalid BCF file: missing bcf.version");const o=(await e.async("string")).match(/VersionId="([^"]+)"/);if(!o)throw new Error("Invalid BCF version file: could not parse VersionId");const n=o[1];return n!=="2.1"&&n!=="3.0"&&console.warn(`Unsupported BCF version: ${n}, treating as 2.1`),{versionId:n==="3.0"?"3.0":"2.1",detailedVersion:o[1]}}async function tt(t){const e=t.file("project.bcfp");if(!e)return{};const i=await e.async("string"),o=i.match(/ProjectId="([^"]+)"/),n=i.match(/<Name>([^<]+)<\/Name>/);return{projectId:o?.[1],name:n?.[1]}}async function et(t){const e=new Map,i=new Set;t.forEach(o=>{const n=o.match(/^([^/]+)\/markup\.bcf$/i);n&&i.add(n[1])});for(const o of i)try{const n=await it(t,o);n&&e.set(n.guid,n)}catch(n){console.warn(`Failed to parse topic ${o}:`,n)}return e}async function it(t,e){const i=t.file(`${e}/markup.bcf`);if(!i)return null;const o=await i.async("string"),n=o.match(/<Topic\s+Guid="([^"]+)"[^>]*>([\s\S]*?)<\/Topic>/);if(!n)return console.warn(`Invalid markup.bcf in ${e}: missing Topic element`),null;const s=n[1],c=n[2],r=o.match(/<Topic[^>]*TopicType="([^"]+)"/),a=o.match(/<Topic[^>]*TopicStatus="([^"]+)"/),l=h(c,"Title")||"Untitled",p=h(c,"Description"),f=h(c,"Priority"),m=h(c,"Index"),u=h(c,"CreationDate")||new Date().toISOString(),g=h(c,"CreationAuthor")||"Unknown",d=h(c,"ModifiedDate"),x=h(c,"ModifiedAuthor"),w=h(c,"DueDate"),b=h(c,"AssignedTo"),v=h(c,"Stage"),T=[],q=c.matchAll(/<Labels>([^<]+)<\/Labels>/g);for(const A of q)T.push(A[1]);const H=ot(c),O=nt(c),z=[],W=c.matchAll(/<RelatedTopic\s+Guid="([^"]+)"/g);for(const A of W)z.push(A[1]);const J=st(o),K=await ct(t,e,o);return{guid:s,title:l,description:p,topicType:r?.[1],topicStatus:a?.[1],priority:f,index:m?parseInt(m,10):void 0,creationDate:u,creationAuthor:g,modifiedDate:d,modifiedAuthor:x,dueDate:w,assignedTo:b,stage:v,labels:T.length>0?T:void 0,bimSnippet:H,documentReferences:O.length>0?O:void 0,relatedTopics:z.length>0?z:void 0,comments:J,viewpoints:K}}function h(t,e){return t.match(new RegExp(`<${e}>([^<]*)<\\/${e}>`))?.[1]}function ot(t){const e=t.match(/<BimSnippet\s+SnippetType="([^"]+)"[^>]*>([\s\S]*?)<\/BimSnippet>/);if(!e)return;const i=e[0].match(/isExternal="([^"]+)"/),o=h(e[2],"Reference"),n=h(e[2],"ReferenceSchema");return{snippetType:e[1],isExternal:i?.[1]==="true",reference:o||"",referenceSchema:n}}function nt(t){const e=[],i=t.matchAll(/<DocumentReference[^>]*>([\s\S]*?)<\/DocumentReference>/g);for(const o of i){const n=o[0].match(/Guid="([^"]+)"/),s=o[0].match(/isExternal="([^"]+)"/),c=h(o[1],"ReferencedDocument"),r=h(o[1],"Description");c&&e.push({guid:n?.[1],isExternal:s?.[1]==="true",referencedDocument:c,description:r})}return e}function st(t){const e=[],i=t.matchAll(/<Comment\s+Guid="([^"]+)"[^>]*>([\s\S]*?)<\/Comment>/g);for(const o of i){const n=o[1],s=o[2],c=h(s,"Date")||new Date().toISOString(),r=h(s,"Author")||"Unknown",a=h(s,"Comment")||"",l=h(s,"ModifiedDate"),p=h(s,"ModifiedAuthor"),f=s.match(/<Viewpoint\s+Guid="([^"]+)"/);e.push({guid:n,date:c,author:r,comment:a,viewpointGuid:f?.[1],modifiedDate:l,modifiedAuthor:p})}return e}async function ct(t,e,i){const o=[],n=new Map,s=/<Viewpoint\s+Guid="([^"]+)"[^>]*>([\s\S]*?)<\/Viewpoint>/g;for(const a of i.matchAll(s)){const l=a[1],p=a[2],f=p.match(/<Viewpoint>([^<]+)<\/Viewpoint>/),m=p.match(/<Snapshot>([^<]+)<\/Snapshot>/);n.set(l,{viewpointFile:f?.[1],snapshotFile:m?.[1]})}const c=i.matchAll(/<Viewpoint\s+Guid="([^"]+)"[^>]*\/>/g);for(const a of c)n.has(a[1])||n.set(a[1],{});const r=[];t.forEach(a=>{a.startsWith(`${e}/`)&&a.endsWith(".bcfv")&&r.push(a)});for(const a of r)try{const l=t.file(a);if(!l)continue;const p=await l.async("string"),f=at(p);if(f){const m=n.get(f.guid);let u=null,g="png";if(m?.snapshotFile){const d=`${e}/${m.snapshotFile}`;u=t.file(d),(m.snapshotFile.toLowerCase().endsWith(".jpg")||m.snapshotFile.toLowerCase().endsWith(".jpeg"))&&(g="jpeg")}if(!u){const d=a.replace(".bcfv",""),x=d.replace(/Viewpoint_/i,"Snapshot_"),w=d.replace(/_viewpoint$/i,"_snapshot"),b=[`${x}.png`,`${w}.png`,`${d}.png`,`${e}/snapshot.png`,`${x}.jpg`,`${w}.jpg`,`${d}.jpg`,`${e}/snapshot.jpg`];for(const v of b)if(u=t.file(v),u){(v.toLowerCase().endsWith(".jpg")||v.toLowerCase().endsWith(".jpeg"))&&(g="jpeg");break}}if(u){const d=await u.async("uint8array");f.snapshotData=d,f.snapshot=`data:image/${g};base64,${j(d)}`}o.push(f)}}catch(l){console.warn(`Failed to parse viewpoint ${a}:`,l)}if(o.length===0){const a=t.file(`${e}/snapshot.png`)||t.file(`${e}/snapshot.jpg`);if(a){const l=a.name.toLowerCase().endsWith(".jpg"),p=await a.async("uint8array");o.push({guid:e,snapshot:`data:image/${l?"jpeg":"png"};base64,${j(p)}`,snapshotData:p})}}return o}function at(t){const i=t.match(/<VisualizationInfo[^>]+Guid="([^"]+)"/)?.[1]||crypto.randomUUID?.()||`vp-${Date.now()}`,o=rt(t),n=lt(t),s=pt(t),c=mt(t),r=dt(t),a=ht(t);return{guid:i,perspectiveCamera:o,orthogonalCamera:n,components:s,lines:c.length>0?c:void 0,clippingPlanes:r.length>0?r:void 0,bitmaps:a.length>0?a:void 0}}function rt(t){const e=t.match(/<PerspectiveCamera>([\s\S]*?)<\/PerspectiveCamera>/);if(!e)return;const i=e[1],o=V(i,"CameraViewPoint"),n=P(i,"CameraDirection"),s=P(i,"CameraUpVector"),c=h(i,"FieldOfView");if(!(!o||!n||!s||!c))return{cameraViewPoint:o,cameraDirection:n,cameraUpVector:s,fieldOfView:parseFloat(c)}}function lt(t){const e=t.match(/<OrthogonalCamera>([\s\S]*?)<\/OrthogonalCamera>/);if(!e)return;const i=e[1],o=V(i,"CameraViewPoint"),n=P(i,"CameraDirection"),s=P(i,"CameraUpVector"),c=h(i,"ViewToWorldScale");if(!(!o||!n||!s||!c))return{cameraViewPoint:o,cameraDirection:n,cameraUpVector:s,viewToWorldScale:parseFloat(c)}}function V(t,e){const i=t.match(new RegExp(`<${e}>([\\s\\S]*?)<\\/${e}>`));if(!i)return;const o=h(i[1],"X"),n=h(i[1],"Y"),s=h(i[1],"Z");if(!(o===void 0||n===void 0||s===void 0))return{x:parseFloat(o),y:parseFloat(n),z:parseFloat(s)}}function P(t,e){return V(t,e)}function pt(t){const e=t.match(/<Components>([\s\S]*?)<\/Components>/);if(!e)return;const i=e[1],o=B(i,"Selection"),n=ft(i),s=ut(i);if(!(!o&&!n&&!s))return{selection:o?.length?o:void 0,visibility:n,coloring:s?.length?s:void 0}}function B(t,e){const i=t.match(new RegExp(`<${e}>([\\s\\S]*?)<\\/${e}>`));if(!i)return;const o=[],n=i[1].matchAll(/<Component[^>]*(?:\/>|>[\s\S]*?<\/Component>)/g);for(const s of n){const c=Y(s[0]);c&&o.push(c)}return o.length>0?o:void 0}function Y(t){const e=t.match(/IfcGuid="([^"]+)"/),i=t.match(/AuthoringToolId="([^"]+)"/),o=t.match(/OriginatingSystem="([^"]+)"/);if(!(!e&&!i))return{ifcGuid:e?.[1],authoringToolId:i?.[1],originatingSystem:o?.[1]}}function ft(t){const e=t.match(/<Visibility[^>]*>([\s\S]*?)<\/Visibility>/);if(!e)return;const o=t.match(/DefaultVisibility="([^"]+)"/)?.[1]!=="false",n=B(e[1],"Exceptions");return{defaultVisibility:o,exceptions:n}}function ut(t){const e=t.match(/<Coloring>([\s\S]*?)<\/Coloring>/);if(!e)return;const i=[],o=e[1].matchAll(/<Color\s+Color="([^"]+)"[^>]*>([\s\S]*?)<\/Color>/g);for(const n of o){const s=n[1],c=[],r=n[2].matchAll(/<Component[^>]*(?:\/>|>[\s\S]*?<\/Component>)/g);for(const a of r){const l=Y(a[0]);l&&c.push(l)}c.length>0&&i.push({color:s,components:c})}return i.length>0?i:void 0}function mt(t){const e=[],i=t.match(/<Lines>([\s\S]*?)<\/Lines>/);if(!i)return e;const o=i[1].matchAll(/<Line>([\s\S]*?)<\/Line>/g);for(const n of o){const s=V(n[1],"StartPoint"),c=V(n[1],"EndPoint");s&&c&&e.push({startPoint:s,endPoint:c})}return e}function dt(t){const e=[],i=t.match(/<ClippingPlanes>([\s\S]*?)<\/ClippingPlanes>/);if(!i)return e;const o=i[1].matchAll(/<ClippingPlane>([\s\S]*?)<\/ClippingPlane>/g);for(const n of o){const s=V(n[1],"Location"),c=P(n[1],"Direction");s&&c&&e.push({location:s,direction:c})}return e}function ht(t){const e=[],i=t.match(/<Bitmaps>([\s\S]*?)<\/Bitmaps>/);if(!i)return e;const o=i[1].matchAll(/<Bitmap>([\s\S]*?)<\/Bitmap>/g);for(const n of o){const s=h(n[1],"Format")||h(n[1],"Bitmap"),c=h(n[1],"Reference"),r=V(n[1],"Location"),a=P(n[1],"Normal"),l=P(n[1],"Up"),p=h(n[1],"Height");s&&c&&r&&a&&l&&p&&e.push({format:s.toUpperCase()==="JPG"?"JPG":"PNG",reference:c,location:r,normal:a,up:l,height:parseFloat(p)})}return e}function j(t){let e="";for(let i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return btoa(e)}async function ee(t){const e=new X;gt(e,t.version),(t.projectId||t.name)&&yt(e,t);for(const[i,o]of t.topics)await xt(e,o);return e.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}})}function gt(t,e){const i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<Version xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" VersionId="${e}">
|
|
3
|
+
<DetailedVersion>${e}</DetailedVersion>
|
|
4
|
+
</Version>`;t.file("bcf.version",i)}function yt(t,e){const i=e.projectId||C(),o=e.name?`
|
|
5
|
+
<Name>${y(e.name)}</Name>`:"",n=`<?xml version="1.0" encoding="UTF-8"?>
|
|
6
|
+
<ProjectExtension xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
7
|
+
<Project ProjectId="${i}">${o}
|
|
8
|
+
</Project>
|
|
9
|
+
</ProjectExtension>`;t.file("project.bcfp",n)}async function xt(t,e){const i=t.folder(e.guid);if(i){wt(i,e);for(let o=0;o<e.viewpoints.length;o++){const n=e.viewpoints[o];await Ct(i,n)}}}function wt(t,e){let i=`<?xml version="1.0" encoding="UTF-8"?>
|
|
10
|
+
<Markup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
11
|
+
<Topic Guid="${e.guid}"${e.topicType?` TopicType="${y(e.topicType)}"`:""}${e.topicStatus?` TopicStatus="${y(e.topicStatus)}"`:""}>
|
|
12
|
+
<Title>${y(e.title)}</Title>`;if(e.description&&(i+=`
|
|
13
|
+
<Description>${y(e.description)}</Description>`),e.priority&&(i+=`
|
|
14
|
+
<Priority>${y(e.priority)}</Priority>`),e.index!==void 0&&(i+=`
|
|
15
|
+
<Index>${e.index}</Index>`),i+=`
|
|
16
|
+
<CreationDate>${e.creationDate}</CreationDate>`,i+=`
|
|
17
|
+
<CreationAuthor>${y(e.creationAuthor)}</CreationAuthor>`,e.modifiedDate){i+=`
|
|
18
|
+
<ModifiedDate>${e.modifiedDate}</ModifiedDate>`;const o=e.modifiedAuthor||e.creationAuthor;i+=`
|
|
19
|
+
<ModifiedAuthor>${y(o)}</ModifiedAuthor>`}if(e.dueDate&&(i+=`
|
|
20
|
+
<DueDate>${e.dueDate}</DueDate>`),e.assignedTo&&(i+=`
|
|
21
|
+
<AssignedTo>${y(e.assignedTo)}</AssignedTo>`),e.stage&&(i+=`
|
|
22
|
+
<Stage>${y(e.stage)}</Stage>`),e.labels&&e.labels.length>0)for(const o of e.labels)i+=`
|
|
23
|
+
<Labels>${y(o)}</Labels>`;if(e.relatedTopics&&e.relatedTopics.length>0)for(const o of e.relatedTopics)i+=`
|
|
24
|
+
<RelatedTopic Guid="${o}"/>`;i+=`
|
|
25
|
+
</Topic>`;for(let o=0;o<e.viewpoints.length;o++){const n=e.viewpoints[o],s=`Viewpoint_${n.guid}.bcfv`,c=`Snapshot_${n.guid}.png`;i+=`
|
|
26
|
+
<Viewpoints Guid="${n.guid}">`,i+=`
|
|
27
|
+
<Viewpoint>${s}</Viewpoint>`,(n.snapshot||n.snapshotData)&&(i+=`
|
|
28
|
+
<Snapshot>${c}</Snapshot>`),i+=`
|
|
29
|
+
</Viewpoints>`}for(const o of e.comments)i+=`
|
|
30
|
+
<Comment Guid="${o.guid}">`,i+=`
|
|
31
|
+
<Date>${o.date}</Date>`,i+=`
|
|
32
|
+
<Author>${y(o.author)}</Author>`,i+=`
|
|
33
|
+
<Comment>${y(o.comment)}</Comment>`,o.viewpointGuid&&(i+=`
|
|
34
|
+
<Viewpoint Guid="${o.viewpointGuid}"/>`),o.modifiedDate&&(i+=`
|
|
35
|
+
<ModifiedDate>${o.modifiedDate}</ModifiedDate>`),o.modifiedAuthor&&(i+=`
|
|
36
|
+
<ModifiedAuthor>${y(o.modifiedAuthor)}</ModifiedAuthor>`),i+=`
|
|
37
|
+
</Comment>`;i+=`
|
|
38
|
+
</Markup>`,t.file("markup.bcf",i)}async function Ct(t,e,i){const o=`Viewpoint_${e.guid}.bcfv`,n=`Snapshot_${e.guid}.png`;let s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
39
|
+
<VisualizationInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="${e.guid}">`;if(e.components&&(s+=vt(e.components)),e.perspectiveCamera&&(s+=bt(e.perspectiveCamera)),e.orthogonalCamera&&(s+=Tt(e.orthogonalCamera)),e.lines&&e.lines.length>0){s+=`
|
|
40
|
+
<Lines>`;for(const c of e.lines)s+=Vt(c);s+=`
|
|
41
|
+
</Lines>`}if(e.clippingPlanes&&e.clippingPlanes.length>0){s+=`
|
|
42
|
+
<ClippingPlanes>`;for(const c of e.clippingPlanes)s+=Pt(c);s+=`
|
|
43
|
+
</ClippingPlanes>`}if(e.bitmaps&&e.bitmaps.length>0){s+=`
|
|
44
|
+
<Bitmaps>`;for(const c of e.bitmaps)s+=Mt(c);s+=`
|
|
45
|
+
</Bitmaps>`}if(s+=`
|
|
46
|
+
</VisualizationInfo>`,t.file(o,s),e.snapshotData)t.file(n,e.snapshotData);else if(e.snapshot&&e.snapshot.startsWith("data:")){const c=e.snapshot.split(",")[1],r=atob(c),a=new Uint8Array(r.length);for(let l=0;l<r.length;l++)a[l]=r.charCodeAt(l);t.file(n,a)}}function vt(t){let e=`
|
|
47
|
+
<Components>`;if(t.visibility?.viewSetupHints){const i=t.visibility.viewSetupHints;e+=`
|
|
48
|
+
<ViewSetupHints`,i.spacesVisible!==void 0&&(e+=` SpacesVisible="${i.spacesVisible}"`),i.spaceBoundariesVisible!==void 0&&(e+=` SpaceBoundariesVisible="${i.spaceBoundariesVisible}"`),i.openingsVisible!==void 0&&(e+=` OpeningsVisible="${i.openingsVisible}"`),e+="/>"}if(t.selection&&t.selection.length>0){e+=`
|
|
49
|
+
<Selection>`;for(const i of t.selection)e+=E(i);e+=`
|
|
50
|
+
</Selection>`}if(e+=$t(t.visibility),t.coloring&&t.coloring.length>0){e+=`
|
|
51
|
+
<Coloring>`;for(const i of t.coloring)e+=St(i);e+=`
|
|
52
|
+
</Coloring>`}return e+=`
|
|
53
|
+
</Components>`,e}function $t(t){let i=`
|
|
54
|
+
<Visibility DefaultVisibility="${t?.defaultVisibility??!0}">`;if(t?.exceptions&&t.exceptions.length>0){i+=`
|
|
55
|
+
<Exceptions>`;for(const o of t.exceptions)i+=E(o," ");i+=`
|
|
56
|
+
</Exceptions>`}return i+=`
|
|
57
|
+
</Visibility>`,i}function E(t,e=" "){const i=t.originatingSystem||t.authoringToolId;let o=`
|
|
58
|
+
${e}<Component`;return t.ifcGuid&&(o+=` IfcGuid="${t.ifcGuid}"`),i?(o+=">",t.originatingSystem&&(o+=`
|
|
59
|
+
${e} <OriginatingSystem>${y(t.originatingSystem)}</OriginatingSystem>`),t.authoringToolId&&(o+=`
|
|
60
|
+
${e} <AuthoringToolId>${y(t.authoringToolId)}</AuthoringToolId>`),o+=`
|
|
61
|
+
${e}</Component>`):o+="/>",o}function St(t){let e=`
|
|
62
|
+
<Color Color="${t.color}">`;for(const i of t.components)e+=E(i," ");return e+=`
|
|
63
|
+
</Color>`,e}function bt(t){return`
|
|
64
|
+
<PerspectiveCamera>
|
|
65
|
+
<CameraViewPoint>
|
|
66
|
+
<X>${t.cameraViewPoint.x}</X>
|
|
67
|
+
<Y>${t.cameraViewPoint.y}</Y>
|
|
68
|
+
<Z>${t.cameraViewPoint.z}</Z>
|
|
69
|
+
</CameraViewPoint>
|
|
70
|
+
<CameraDirection>
|
|
71
|
+
<X>${t.cameraDirection.x}</X>
|
|
72
|
+
<Y>${t.cameraDirection.y}</Y>
|
|
73
|
+
<Z>${t.cameraDirection.z}</Z>
|
|
74
|
+
</CameraDirection>
|
|
75
|
+
<CameraUpVector>
|
|
76
|
+
<X>${t.cameraUpVector.x}</X>
|
|
77
|
+
<Y>${t.cameraUpVector.y}</Y>
|
|
78
|
+
<Z>${t.cameraUpVector.z}</Z>
|
|
79
|
+
</CameraUpVector>
|
|
80
|
+
<FieldOfView>${t.fieldOfView}</FieldOfView>
|
|
81
|
+
</PerspectiveCamera>`}function Tt(t){return`
|
|
82
|
+
<OrthogonalCamera>
|
|
83
|
+
<CameraViewPoint>
|
|
84
|
+
<X>${t.cameraViewPoint.x}</X>
|
|
85
|
+
<Y>${t.cameraViewPoint.y}</Y>
|
|
86
|
+
<Z>${t.cameraViewPoint.z}</Z>
|
|
87
|
+
</CameraViewPoint>
|
|
88
|
+
<CameraDirection>
|
|
89
|
+
<X>${t.cameraDirection.x}</X>
|
|
90
|
+
<Y>${t.cameraDirection.y}</Y>
|
|
91
|
+
<Z>${t.cameraDirection.z}</Z>
|
|
92
|
+
</CameraDirection>
|
|
93
|
+
<CameraUpVector>
|
|
94
|
+
<X>${t.cameraUpVector.x}</X>
|
|
95
|
+
<Y>${t.cameraUpVector.y}</Y>
|
|
96
|
+
<Z>${t.cameraUpVector.z}</Z>
|
|
97
|
+
</CameraUpVector>
|
|
98
|
+
<ViewToWorldScale>${t.viewToWorldScale}</ViewToWorldScale>
|
|
99
|
+
</OrthogonalCamera>`}function Vt(t){return`
|
|
100
|
+
<Line>
|
|
101
|
+
<StartPoint>
|
|
102
|
+
<X>${t.startPoint.x}</X>
|
|
103
|
+
<Y>${t.startPoint.y}</Y>
|
|
104
|
+
<Z>${t.startPoint.z}</Z>
|
|
105
|
+
</StartPoint>
|
|
106
|
+
<EndPoint>
|
|
107
|
+
<X>${t.endPoint.x}</X>
|
|
108
|
+
<Y>${t.endPoint.y}</Y>
|
|
109
|
+
<Z>${t.endPoint.z}</Z>
|
|
110
|
+
</EndPoint>
|
|
111
|
+
</Line>`}function Pt(t){return`
|
|
112
|
+
<ClippingPlane>
|
|
113
|
+
<Location>
|
|
114
|
+
<X>${t.location.x}</X>
|
|
115
|
+
<Y>${t.location.y}</Y>
|
|
116
|
+
<Z>${t.location.z}</Z>
|
|
117
|
+
</Location>
|
|
118
|
+
<Direction>
|
|
119
|
+
<X>${t.direction.x}</X>
|
|
120
|
+
<Y>${t.direction.y}</Y>
|
|
121
|
+
<Z>${t.direction.z}</Z>
|
|
122
|
+
</Direction>
|
|
123
|
+
</ClippingPlane>`}function Mt(t){return`
|
|
124
|
+
<Bitmap>
|
|
125
|
+
<Format>${t.format}</Format>
|
|
126
|
+
<Reference>${y(t.reference)}</Reference>
|
|
127
|
+
<Location>
|
|
128
|
+
<X>${t.location.x}</X>
|
|
129
|
+
<Y>${t.location.y}</Y>
|
|
130
|
+
<Z>${t.location.z}</Z>
|
|
131
|
+
</Location>
|
|
132
|
+
<Normal>
|
|
133
|
+
<X>${t.normal.x}</X>
|
|
134
|
+
<Y>${t.normal.y}</Y>
|
|
135
|
+
<Z>${t.normal.z}</Z>
|
|
136
|
+
</Normal>
|
|
137
|
+
<Up>
|
|
138
|
+
<X>${t.up.x}</X>
|
|
139
|
+
<Y>${t.up.y}</Y>
|
|
140
|
+
<Z>${t.up.z}</Z>
|
|
141
|
+
</Up>
|
|
142
|
+
<Height>${t.height}</Height>
|
|
143
|
+
</Bitmap>`}function y(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function $(t){return{x:t.x,y:-t.z,z:t.y}}function S(t){return{x:t.x,y:t.z,z:-t.y}}function Dt(t){const e=$(t.position),i=$(t.target),o=$(t.up),n=i.x-e.x,s=i.y-e.y,c=i.z-e.z,r=Math.sqrt(n*n+s*s+c*c),a=r>1e-4?{x:n/r,y:s/r,z:c/r}:{x:0,y:1,z:0},l=Math.sqrt(o.x*o.x+o.y*o.y+o.z*o.z),p=l>1e-4?{x:o.x/l,y:o.y/l,z:o.z/l}:{x:0,y:0,z:1},f=t.fov*180/Math.PI;return{cameraViewPoint:e,cameraDirection:a,cameraUpVector:p,fieldOfView:Math.max(1,Math.min(179,f))}}function It(t,e){const i=$(t.position),o=$(t.target),n=$(t.up),s=o.x-i.x,c=o.y-i.y,r=o.z-i.z,a=Math.sqrt(s*s+c*c+r*r),l=a>1e-4?{x:s/a,y:c/a,z:r/a}:{x:0,y:1,z:0},p=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z),f=p>1e-4?{x:n.x/p,y:n.y/p,z:n.z/p}:{x:0,y:0,z:1};return{cameraViewPoint:i,cameraDirection:l,cameraUpVector:f,viewToWorldScale:e}}function zt(t,e=10){const i={x:t.cameraViewPoint.x+t.cameraDirection.x*e,y:t.cameraViewPoint.y+t.cameraDirection.y*e,z:t.cameraViewPoint.z+t.cameraDirection.z*e},o=S(t.cameraViewPoint),n=S(i),s=S(t.cameraUpVector),c=t.fieldOfView*Math.PI/180;return{position:o,target:n,up:s,fov:c,isOrthographic:!1}}function At(t,e=10){const i={x:t.cameraViewPoint.x+t.cameraDirection.x*e,y:t.cameraViewPoint.y+t.cameraDirection.y*e,z:t.cameraViewPoint.z+t.cameraDirection.z*e},o=S(t.cameraViewPoint),n=S(i),s=S(t.cameraUpVector);return{position:o,target:n,up:s,fov:Math.PI/4,isOrthographic:!0,orthoScale:t.viewToWorldScale}}function Gt(t,e){if(!t.enabled)return null;const i=t.position/100;let o,n;switch(t.axis){case"down":o={x:(e.min.x+e.max.x)/2,y:e.min.y+i*(e.max.y-e.min.y),z:(e.min.z+e.max.z)/2},n=t.flipped?{x:0,y:1,z:0}:{x:0,y:-1,z:0};break;case"front":o={x:(e.min.x+e.max.x)/2,y:(e.min.y+e.max.y)/2,z:e.min.z+i*(e.max.z-e.min.z)},n=t.flipped?{x:0,y:0,z:1}:{x:0,y:0,z:-1};break;case"side":o={x:e.min.x+i*(e.max.x-e.min.x),y:(e.min.y+e.max.y)/2,z:(e.min.z+e.max.z)/2},n=t.flipped?{x:1,y:0,z:0}:{x:-1,y:0,z:0};break}return{location:$(o),direction:$(n)}}function kt(t,e){const i=S(t.location),o=S(t.direction),n=Math.abs(o.x),s=Math.abs(o.y),c=Math.abs(o.z);let r,a,l;if(s>=n&&s>=c){r="down";const p=e.max.y-e.min.y;a=p>0?(i.y-e.min.y)/p*100:50,l=o.y>0}else if(c>=n){r="front";const p=e.max.z-e.min.z;a=p>0?(i.z-e.min.z)/p*100:50,l=o.z>0}else{r="side";const p=e.max.x-e.min.x;a=p>0?(i.x-e.min.x)/p*100:50,l=o.x>0}return a=Math.max(0,Math.min(100,a)),{axis:r,position:a,enabled:!0,flipped:l}}function ie(t){const{camera:e,sectionPlane:i,bounds:o,snapshot:n,snapshotData:s,selectedGuids:c,hiddenGuids:r,visibleGuids:a,coloredGuids:l}=t,p={guid:C()};if(e.isOrthographic&&e.orthoScale!==void 0?p.orthogonalCamera=It(e,e.orthoScale):p.perspectiveCamera=Dt(e),i?.enabled&&o){const d=Gt(i,o);d&&(p.clippingPlanes=[d])}n&&(p.snapshot=n),s&&(p.snapshotData=s);const f=c&&c.length>0,m=r&&r.length>0,u=a&&a.length>0,g=l&&l.length>0;return(f||m||u||g)&&(p.components={},f&&(p.components.selection=c.map(d=>({ifcGuid:d}))),u?p.components.visibility={defaultVisibility:!1,exceptions:a.map(d=>({ifcGuid:d}))}:m&&(p.components.visibility={defaultVisibility:!0,exceptions:r.map(d=>({ifcGuid:d}))}),g&&(p.components.coloring=l.map(({color:d,guids:x})=>({color:d,components:x.map(w=>({ifcGuid:w}))})))),p}function oe(t,e,i=10){let o,n;t.perspectiveCamera?o=zt(t.perspectiveCamera,i):t.orthogonalCamera&&(o=At(t.orthogonalCamera,i)),t.clippingPlanes&&t.clippingPlanes.length>0&&e&&(n=kt(t.clippingPlanes[0],e));const s=[];if(t.components?.selection)for(const l of t.components.selection)l.ifcGuid&&s.push(l.ifcGuid);const c=[],r=[];if(t.components?.visibility){const{defaultVisibility:l,exceptions:p}=t.components.visibility;if(p)for(const f of p)f.ifcGuid&&(l===!1?r.push(f.ifcGuid):c.push(f.ifcGuid))}const a=[];if(t.components?.coloring)for(const l of t.components.coloring){const p=[];for(const f of l.components)f.ifcGuid&&p.push(f.ifcGuid);p.length>0&&a.push({color:l.color,guids:p})}return{camera:o,sectionPlane:n,selectedGuids:s,hiddenGuids:c,visibleGuids:r,coloredGuids:a}}function k(t){return{x:t.x,y:t.z,z:-t.y}}function Lt(t,e){const i=t.perspectiveCamera??t.orthogonalCamera;if(!i)return null;const o=k(i.cameraViewPoint),n=k(i.cameraDirection),s=Math.sqrt(n.x*n.x+n.y*n.y+n.z*n.z);if(s<1e-6)return null;const c=n.x/s,r=n.y/s,a=n.z/s;return{x:o.x+c*e,y:o.y+r*e,z:o.z+a*e}}function U(t){const e=(t.min.x+t.max.x)/2,i=(t.min.z+t.max.z)/2,o=t.max.y,n=t.max.y-t.min.y,s=Math.max(n*.3,.5);return{position:{x:e,y:o+s,z:i},connectorAnchor:{x:e,y:o,z:i}}}function Et(t,e,i){const o=t.components?.selection;if(o&&o.length>0)for(const r of o){if(!r.ifcGuid)continue;const a=e(r.ifcGuid);if(a)return{...U(a),source:"component"}}const n=t.components?.visibility;if(n&&!n.defaultVisibility&&n.exceptions&&n.exceptions.length>0)for(const r of n.exceptions){if(!r.ifcGuid)continue;const a=e(r.ifcGuid);if(a)return{...U(a),source:"component"}}const s=Lt(t,i);if(s)return{position:s,source:"camera-target"};const c=t.perspectiveCamera??t.orthogonalCamera;return c?{position:k(c.cameraViewPoint),source:"camera-position"}:null}function ne(t,e,i){const{targetDistance:o=50,statusFilter:n}=i??{},s=[];for(let c=0;c<t.length;c++){const r=t[c];if(n&&n.length>0){const p=(r.topicStatus??"").toLowerCase();if(!n.some(f=>f.toLowerCase()===p))continue}let a=null;for(const p of r.viewpoints)if(a=Et(p,e,o),a)break;if(!a)continue;const l=r.viewpoints[0];s.push({topicGuid:r.guid,position:a.position,connectorAnchor:a.connectorAnchor,title:r.title,status:r.topicStatus??"Open",priority:r.priority??"Normal",topicType:r.topicType??"Issue",commentCount:r.comments.length,hasViewpoint:r.viewpoints.length>0,snapshot:l?.snapshot,positionSource:a.source,index:r.index??c+1})}return s}const G="bcf-overlay-marker",R="bcf-overlay-connector",M="bcf-overlay-active",D="bcf-overlay-tooltip",Ft={high:"#f7768e",critical:"#f7768e",medium:"#ff9e64",normal:"#ff9e64",low:"#9ece6a"},Ot={open:"●","in progress":"◐",resolved:"✓",closed:"○"};class L{container;svgLayer;markerElements=new Map;connectorElements=new Map;markers=[];activeMarkerId=null;projection;unsubCamera=null;clickCallbacks=[];hoverCallbacks=[];opts;_visible=!0;_disposed=!1;constructor(e,i,o){this.projection=i,this.opts={showConnectors:o?.showConnectors??!0,showTooltips:o?.showTooltips??!0,minScale:o?.minScale??.65,maxScale:o?.maxScale??1,verticalOffset:o?.verticalOffset??36},this.container=document.createElement("div"),this.container.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:20;",e.appendChild(this.container),this.svgLayer=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svgLayer.style.cssText="position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;",this.container.appendChild(this.svgLayer),this.injectStyles(),this.unsubCamera=i.onCameraChange(()=>this.updatePositions())}setMarkers(e){this.markers=e;const i=new Set(e.map(o=>o.topicGuid));for(const[o,n]of this.markerElements)i.has(o)||(n.remove(),this.markerElements.delete(o));for(const[o,n]of this.connectorElements)i.has(o)||(n.remove(),this.connectorElements.delete(o));for(const o of e)this.markerElements.has(o.topicGuid)?this.updateMarkerContent(o):this.createMarkerElement(o);this.updatePositions()}setActiveMarker(e){if(this.activeMarkerId){const i=this.markerElements.get(this.activeMarkerId);i&&i.classList.remove(M)}if(this.activeMarkerId=e,e){const i=this.markerElements.get(e);i&&i.classList.add(M)}}setVisible(e){this._visible=e,this.container.style.display=e?"":"none"}onMarkerClick(e){return this.clickCallbacks.push(e),()=>{this.clickCallbacks=this.clickCallbacks.filter(i=>i!==e)}}onMarkerHover(e){return this.hoverCallbacks.push(e),()=>{this.hoverCallbacks=this.hoverCallbacks.filter(i=>i!==e)}}updatePositions(){if(this._disposed||!this._visible)return;const{width:e,height:i}=this.projection.getCanvasSize();if(e===0||i===0)return;const o=this.projection.getCameraPosition?.();for(const n of this.markers){const s=this.markerElements.get(n.topicGuid);if(!s)continue;const c=this.projection.projectToScreen(n.position);if(!c||c.x<-80||c.y<-80||c.x>e+80||c.y>i+80){s.style.display="none";const f=this.connectorElements.get(n.topicGuid);f&&(f.style.display="none");continue}s.style.display="";let r=1;if(o){const f=n.position.x-o.x,m=n.position.y-o.y,u=n.position.z-o.z,g=Math.sqrt(f*f+m*m+u*u),d=Math.max(0,Math.min(1,(g-20)/180));r=this.opts.maxScale+d*(this.opts.minScale-this.opts.maxScale)}const a=c.x,l=c.y;s.style.transform=`translate(${a}px, ${l}px) translate(-50%, -100%) scale(${r.toFixed(3)})`;const p=o?.6+(1-Math.max(0,Math.min(1,(Math.sqrt((n.position.x-o.x)**2+(n.position.y-o.y)**2+(n.position.z-o.z)**2)-20)/250)))*.4:1;if(s.style.opacity=p.toFixed(2),this.opts.showConnectors){const f=n.connectorAnchor??n.position,m=this.projection.projectToScreen(f);let u=this.connectorElements.get(n.topicGuid);if(u||(u=document.createElementNS("http://www.w3.org/2000/svg","line"),u.classList.add(R),this.svgLayer.appendChild(u),this.connectorElements.set(n.topicGuid,u)),!m){u.style.display="none";continue}u.style.display="";const g=this.getPriorityColor(n.priority);u.setAttribute("x1",String(a)),u.setAttribute("y1",String(l)),u.setAttribute("x2",String(m.x)),u.setAttribute("y2",String(m.y)),u.setAttribute("stroke",g),u.setAttribute("stroke-width","1.5"),u.setAttribute("stroke-dasharray","3 2"),u.setAttribute("stroke-opacity",String((p*.5).toFixed(2)))}}}dispose(){this._disposed=!0,this.unsubCamera&&this.unsubCamera(),this.container.remove(),this.markerElements.clear(),this.connectorElements.clear(),this.clickCallbacks=[],this.hoverCallbacks=[]}createMarkerElement(e){const i=document.createElement("div");i.className=G,i.dataset.topicGuid=e.topicGuid,this.updateMarkerInnerHTML(i,e),i.addEventListener("click",o=>{o.stopPropagation();for(const n of this.clickCallbacks)n(e.topicGuid)}),i.addEventListener("mouseenter",()=>{for(const n of this.hoverCallbacks)n(e.topicGuid);const o=i.querySelector(`.${D}`);o&&(o.style.display="")}),i.addEventListener("mouseleave",()=>{for(const n of this.hoverCallbacks)n(null);const o=i.querySelector(`.${D}`);o&&(o.style.display="none")}),e.topicGuid===this.activeMarkerId&&i.classList.add(M),this.container.appendChild(i),this.markerElements.set(e.topicGuid,i)}updateMarkerContent(e){const i=this.markerElements.get(e.topicGuid);i&&(this.updateMarkerInnerHTML(i,e),e.topicGuid===this.activeMarkerId?i.classList.add(M):i.classList.remove(M))}updateMarkerInnerHTML(e,i){const o=this.getPriorityColor(i.priority),n=Ot[i.status.toLowerCase()]??"●";e.innerHTML=`
|
|
144
|
+
<div class="bcf-marker-pin" style="--marker-color:${o};">
|
|
145
|
+
<span class="bcf-marker-index">${i.index}</span>
|
|
146
|
+
</div>
|
|
147
|
+
<div class="${D}" style="display:none;">
|
|
148
|
+
<div class="bcf-tooltip-header">
|
|
149
|
+
<span class="bcf-tooltip-status" style="color:${o}">${n}</span>
|
|
150
|
+
<span class="bcf-tooltip-title">${this.escapeHtml(i.title)}</span>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="bcf-tooltip-meta">
|
|
153
|
+
${this.escapeHtml(i.status)}${i.commentCount>0?` · ${i.commentCount} comment${i.commentCount!==1?"s":""}`:""}
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
`}getPriorityColor(e){return Ft[e.toLowerCase()]??"#7aa2f7"}escapeHtml(e){const i=document.createElement("div");return i.textContent=e,i.innerHTML}static stylesInjected=!1;injectStyles(){if(L.stylesInjected)return;L.stylesInjected=!0;const e=document.createElement("style");e.textContent=`
|
|
157
|
+
/* BCF 3D Overlay Markers */
|
|
158
|
+
|
|
159
|
+
.${G} {
|
|
160
|
+
position: absolute;
|
|
161
|
+
left: 0;
|
|
162
|
+
top: 0;
|
|
163
|
+
pointer-events: auto;
|
|
164
|
+
cursor: pointer;
|
|
165
|
+
will-change: transform, opacity;
|
|
166
|
+
z-index: 21;
|
|
167
|
+
filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
|
|
168
|
+
transform-origin: center bottom;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.bcf-marker-pin {
|
|
172
|
+
width: 28px;
|
|
173
|
+
height: 28px;
|
|
174
|
+
border-radius: 50% 50% 50% 0;
|
|
175
|
+
background: var(--marker-color, #7aa2f7);
|
|
176
|
+
transform: rotate(-45deg);
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
border: 2px solid rgba(255,255,255,0.9);
|
|
181
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.25);
|
|
182
|
+
transition: transform 0.15s ease, box-shadow 0.15s ease;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.${G}:hover .bcf-marker-pin {
|
|
186
|
+
transform: rotate(-45deg) scale(1.2);
|
|
187
|
+
box-shadow: 0 4px 16px rgba(0,0,0,0.4);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.${M} .bcf-marker-pin {
|
|
191
|
+
transform: rotate(-45deg) scale(1.25);
|
|
192
|
+
box-shadow: 0 0 0 4px rgba(122,162,247,0.35), 0 4px 16px rgba(0,0,0,0.4);
|
|
193
|
+
animation: bcf-pulse 1.8s ease-in-out infinite;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.bcf-marker-index {
|
|
197
|
+
transform: rotate(45deg);
|
|
198
|
+
font-size: 11px;
|
|
199
|
+
font-weight: 700;
|
|
200
|
+
color: white;
|
|
201
|
+
font-family: ui-monospace, monospace;
|
|
202
|
+
line-height: 1;
|
|
203
|
+
user-select: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Tooltip */
|
|
207
|
+
.${D} {
|
|
208
|
+
position: absolute;
|
|
209
|
+
bottom: calc(100% + 6px);
|
|
210
|
+
left: 50%;
|
|
211
|
+
transform: translateX(-50%);
|
|
212
|
+
background: #1a1b26;
|
|
213
|
+
color: #a9b1d6;
|
|
214
|
+
border: 1px solid #3b4261;
|
|
215
|
+
padding: 8px 12px;
|
|
216
|
+
min-width: 160px;
|
|
217
|
+
max-width: 260px;
|
|
218
|
+
font-family: ui-monospace, monospace;
|
|
219
|
+
font-size: 11px;
|
|
220
|
+
line-height: 1.4;
|
|
221
|
+
white-space: nowrap;
|
|
222
|
+
z-index: 100;
|
|
223
|
+
pointer-events: none;
|
|
224
|
+
box-shadow: 0 4px 16px rgba(0,0,0,0.5);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.${D}::after {
|
|
228
|
+
content: '';
|
|
229
|
+
position: absolute;
|
|
230
|
+
top: 100%;
|
|
231
|
+
left: 50%;
|
|
232
|
+
transform: translateX(-50%);
|
|
233
|
+
border: 5px solid transparent;
|
|
234
|
+
border-top-color: #3b4261;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.bcf-tooltip-header {
|
|
238
|
+
display: flex;
|
|
239
|
+
align-items: center;
|
|
240
|
+
gap: 6px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.bcf-tooltip-status {
|
|
244
|
+
font-size: 10px;
|
|
245
|
+
flex-shrink: 0;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.bcf-tooltip-title {
|
|
249
|
+
font-weight: 600;
|
|
250
|
+
color: #c0caf5;
|
|
251
|
+
overflow: hidden;
|
|
252
|
+
text-overflow: ellipsis;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.bcf-tooltip-meta {
|
|
256
|
+
margin-top: 3px;
|
|
257
|
+
font-size: 10px;
|
|
258
|
+
color: #565f89;
|
|
259
|
+
text-transform: uppercase;
|
|
260
|
+
letter-spacing: 0.05em;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* Connector lines */
|
|
264
|
+
.${R} {
|
|
265
|
+
pointer-events: none;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/* Pulse animation for active marker */
|
|
269
|
+
@keyframes bcf-pulse {
|
|
270
|
+
0%, 100% { box-shadow: 0 0 0 4px rgba(122,162,247,0.35), 0 4px 16px rgba(0,0,0,0.4); }
|
|
271
|
+
50% { box-shadow: 0 0 0 8px rgba(122,162,247,0.1), 0 4px 16px rgba(0,0,0,0.4); }
|
|
272
|
+
}
|
|
273
|
+
`,document.head.appendChild(e)}}function jt(t,e){return{version:e,projectId:C(),name:t,topics:new Map}}function F(t){return{guid:C(),title:t.title,description:t.description,topicType:t.topicType??"Issue",topicStatus:t.topicStatus??"Open",priority:t.priority,creationDate:new Date().toISOString(),creationAuthor:t.author,labels:t.labels,comments:[],viewpoints:[]}}function I(t){return{guid:C(),date:new Date().toISOString(),author:t.author,comment:t.comment,viewpointGuid:t.viewpointGuid}}const Ut="ids-validator@ifc-lite",Rt=1e3,Xt="FFFF3333",Bt="Error",_="Info",Yt=50;function se(t,e={}){const{author:i=Ut,projectName:o,version:n="2.1",topicGrouping:s="per-entity",includePassingEntities:c=!1,failureTopicType:r=Bt,passTopicType:a=_,maxTopics:l=Rt,failureColor:p=Xt,entityBounds:f,entitySnapshots:m}=e,u=jt(o??t.title,n);switch(s){case"per-entity":_t(u,t,{author:i,includePassingEntities:c,failureTopicType:r,passTopicType:a,maxTopics:l,failureColor:p,entityBounds:f,entitySnapshots:m});break;case"per-specification":Zt(u,t,{author:i,failureTopicType:r,maxTopics:l,failureColor:p});break;case"per-requirement":Nt(u,t,{author:i,failureTopicType:r,maxTopics:l,failureColor:p,entityBounds:f,entitySnapshots:m});break}return u}function _t(t,e,i){let o=0;for(const n of e.specificationResults)if(n.status!=="not_applicable")for(const s of n.entityResults){if(o>=i.maxTopics)return;if(s.passed&&!i.includePassingEntities)continue;const c=s.requirementResults.filter(m=>m.status==="fail"),r=s.requirementResults.filter(m=>m.status!=="not_applicable").length,a=s.entityName||`#${s.expressId}`,l=!s.passed,p=F({title:`${s.entityType}: ${a}`,description:qt(n,s,c.length,r),author:i.author,topicType:l?i.failureTopicType:i.passTopicType??_,topicStatus:l?"Open":"Closed",priority:l?c.length===r?"High":"Medium":void 0,labels:["IDS",n.specification.name]});let f;if(s.globalId){const m=`${s.modelId}:${s.expressId}`,u=i.entityBounds?.get(m),g=i.entitySnapshots?.get(m),d=N(s.globalId,l?i.failureColor:void 0,u,g);p.viewpoints.push(d),f=d.guid}for(const m of c){const u=I({author:i.author,comment:Z(m),viewpointGuid:f});p.comments.push(u)}t.topics.set(p.guid,p),o++}}function Zt(t,e,i){let o=0;for(const n of e.specificationResults){if(n.status!=="fail")continue;if(o>=i.maxTopics)return;const s=n.entityResults.filter(f=>!f.passed),c=F({title:`[FAIL] ${n.specification.name}`,description:Ht(n),author:i.author,topicType:i.failureTopicType,topicStatus:"Open",priority:n.failedCount>n.passedCount?"High":"Medium",labels:["IDS",n.specification.name]}),r=s.map(f=>f.globalId).filter(f=>f!==void 0);let a;if(r.length>0){const f=Jt(r,i.failureColor);c.viewpoints.push(f),a=f.guid}const l=Yt,p=s.slice(0,l);for(const f of p){const m=f.entityName||`#${f.expressId}`,g=f.requirementResults.filter(x=>x.status==="fail").map(x=>x.failureReason??x.checkedDescription).join("; "),d=I({author:i.author,comment:`${f.entityType}: ${m}${f.globalId?` (${f.globalId})`:""}
|
|
274
|
+
${g}`,viewpointGuid:a});c.comments.push(d)}if(s.length>l){const f=I({author:i.author,comment:`... and ${s.length-l} more failing entities`});c.comments.push(f)}t.topics.set(c.guid,c),o++}}function Nt(t,e,i){let o=0;for(const n of e.specificationResults)if(n.status==="fail"){for(const s of n.entityResults)if(!s.passed)for(const c of s.requirementResults){if(c.status!=="fail")continue;if(o>=i.maxTopics)return;const r=s.entityName||`#${s.expressId}`,a=F({title:`${s.entityType}: ${r} - ${c.failureReason??c.checkedDescription}`,description:`Specification: ${n.specification.name}
|
|
275
|
+
${n.specification.description??""}
|
|
276
|
+
|
|
277
|
+
Requirement: ${c.checkedDescription}${s.globalId?`
|
|
278
|
+
GlobalId: ${s.globalId}`:""}`,author:i.author,topicType:i.failureTopicType,topicStatus:"Open",labels:["IDS",n.specification.name]});let l;if(s.globalId){const f=`${s.modelId}:${s.expressId}`,m=i.entityBounds?.get(f),u=i.entitySnapshots?.get(f),g=N(s.globalId,i.failureColor,m,u);a.viewpoints.push(g),l=g.guid}const p=I({author:i.author,comment:Z(c),viewpointGuid:l});a.comments.push(p),t.topics.set(a.guid,a),o++}}}function qt(t,e,i,o){const n=[];return e.passed?n.push("IDS Validation Passed — all requirements satisfied"):n.push(`IDS Validation Failure — ${i} of ${o} requirements failed`),n.push(""),n.push(`Specification: ${t.specification.name}`),t.specification.description&&n.push(`Description: ${t.specification.description}`),n.push(`Entity Type: ${e.entityType}`),e.globalId&&n.push(`GlobalId: ${e.globalId}`),e.entityName&&n.push(`Name: ${e.entityName}`),n.join(`
|
|
279
|
+
`)}function Ht(t){const e=[];return e.push(`IDS Specification Failure — ${t.failedCount} of ${t.applicableCount} entities failed`),t.specification.description&&(e.push(""),e.push(t.specification.description)),e.push(""),e.push(`Applicable: ${t.applicableCount}`),e.push(`Passed: ${t.passedCount}`),e.push(`Failed: ${t.failedCount}`),e.join(`
|
|
280
|
+
`)}function Z(t){const e=[];return e.push(`[${t.facetType}] ${t.checkedDescription}`),t.failureReason&&e.push(`Failure: ${t.failureReason}`),t.expectedValue&&e.push(`Expected: ${t.expectedValue}`),t.actualValue&&e.push(`Actual: ${t.actualValue}`),e.join(`
|
|
281
|
+
`)}function Wt(t){const e=(t.min.x+t.max.x)/2,i=(t.min.y+t.max.y)/2,o=(t.min.z+t.max.z)/2,n=t.max.x-t.min.x,s=t.max.y-t.min.y,c=t.max.z-t.min.z,r=Math.max(n,s,c,.1),a=60*Math.PI/180,l=r/2/Math.tan(a/2)*1.5,p=Math.sqrt(.6*.6+.5*.5+.6*.6),f=.6/p*l,m=.5/p*l,u=.6/p*l,g=e+f,d=i+m,x=o+u,w=e-g,b=i-d,v=o-x,T=Math.sqrt(w*w+b*b+v*v);return{cameraViewPoint:{x:g,y:-x,z:d},cameraDirection:{x:w/T,y:-v/T,z:b/T},cameraUpVector:{x:0,y:0,z:1},fieldOfView:60}}function N(t,e,i,o){const n={guid:C(),components:{selection:[{ifcGuid:t}],visibility:{defaultVisibility:!1,exceptions:[{ifcGuid:t}]}}};return e&&(n.components.coloring=[{color:e,components:[{ifcGuid:t}]}]),i&&(n.perspectiveCamera=Wt(i)),o&&(n.snapshot=o),n}function Jt(t,e){const i={guid:C(),components:{selection:t.map(o=>({ifcGuid:o})),visibility:{defaultVisibility:!1,exceptions:t.map(o=>({ifcGuid:o}))}}};return e&&(i.components.coloring=[{color:e,components:t.map(o=>({ifcGuid:o}))}]),i}function ce(t){return{version:t?.version??"2.1",projectId:C(),name:t?.name,topics:new Map}}function ae(t){return{guid:C(),title:t.title,description:t.description,topicType:t.topicType??"Issue",topicStatus:t.topicStatus??"Open",priority:t.priority,creationDate:new Date().toISOString(),creationAuthor:t.author,assignedTo:t.assignedTo,dueDate:t.dueDate,labels:t.labels,comments:[],viewpoints:[]}}function re(t){return{guid:C(),date:new Date().toISOString(),author:t.author,comment:t.comment,viewpointGuid:t.viewpointGuid}}function le(t,e){t.topics.set(e.guid,e)}function pe(t,e){t.comments.push(e),t.modifiedDate=new Date().toISOString()}function fe(t,e){t.viewpoints.push(e),t.modifiedDate=new Date().toISOString()}function ue(t,e,i){t.topicStatus=e,t.modifiedDate=new Date().toISOString(),t.modifiedAuthor=i}export{L as B,ne as a,ce as b,ie as c,ae as d,oe as e,re as f,se as g,fe as h,pe as i,le as j,te as r,ue as u,ee as w};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import{g as
|
|
1
|
+
import{g as Ct}from"./zip-BJqVbRkU.js";function At(ye,_e){for(var oe=0;oe<_e.length;oe++){const ae=_e[oe];if(typeof ae!="string"&&!Array.isArray(ae)){for(const ce in ae)if(ce!=="default"&&!(ce in ye)){const we=Object.getOwnPropertyDescriptor(ae,ce);we&&Object.defineProperty(ye,ce,we.get?we:{enumerable:!0,get:()=>ae[ce]})}}}return Object.freeze(Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"}))}var Re={exports:{}},Qe;function Dt(){return Qe||(Qe=1,(function(ye){(_e=>{var oe=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,ce=Object.getOwnPropertyNames,we=Object.prototype.hasOwnProperty,Ke=(e,t)=>{for(var r in t)oe(e,r,{get:t[r],enumerable:!0})},Ze=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let g of ce(t))!we.call(e,g)&&g!==r&&oe(e,g,{get:()=>t[g],enumerable:!(a=ae(t,g))||a.enumerable});return e},et=e=>Ze(oe({},"__esModule",{value:!0}),e),le=(e,t,r)=>new Promise((a,g)=>{var y=f=>{try{k(r.next(f))}catch(D){g(D)}},h=f=>{try{k(r.throw(f))}catch(D){g(D)}},k=f=>f.done?a(f.value):Promise.resolve(f.value).then(y,h);k((r=r.apply(e,t)).next())}),Ee={};Ke(Ee,{analyzeMetafile:()=>vt,analyzeMetafileSync:()=>kt,build:()=>pt,buildSync:()=>xt,context:()=>yt,default:()=>jt,formatMessages:()=>bt,formatMessagesSync:()=>Et,initialize:()=>Tt,stop:()=>St,transform:()=>wt,transformSync:()=>_t,version:()=>gt}),_e.exports=et(Ee);function Ue(e){let t=a=>{if(a===null)r.write8(0);else if(typeof a=="boolean")r.write8(1),r.write8(+a);else if(typeof a=="number")r.write8(2),r.write32(a|0);else if(typeof a=="string")r.write8(3),r.write(Z(a));else if(a instanceof Uint8Array)r.write8(4),r.write(a);else if(a instanceof Array){r.write8(5),r.write32(a.length);for(let g of a)t(g)}else{let g=Object.keys(a);r.write8(6),r.write32(g.length);for(let y of g)r.write(Z(y)),t(a[y])}},r=new Ie;return r.write32(0),r.write32(e.id<<1|+!e.isRequest),t(e.value),De(r.buf,r.len-4,0),r.buf.subarray(0,r.len)}function tt(e){let t=()=>{switch(r.read8()){case 0:return null;case 1:return!!r.read8();case 2:return r.read32();case 3:return he(r.read());case 4:return r.read();case 5:{let h=r.read32(),k=[];for(let f=0;f<h;f++)k.push(t());return k}case 6:{let h=r.read32(),k={};for(let f=0;f<h;f++)k[he(r.read())]=t();return k}default:throw new Error("Invalid packet")}},r=new Ie(e),a=r.read32(),g=(a&1)===0;a>>>=1;let y=t();if(r.ptr!==e.length)throw new Error("Invalid packet");return{id:a,isRequest:g,value:y}}var Ie=class{constructor(e=new Uint8Array(1024)){this.buf=e,this.len=0,this.ptr=0}_write(e){if(this.len+e>this.buf.length){let t=new Uint8Array((this.len+e)*2);t.set(this.buf),this.buf=t}return this.len+=e,this.len-e}write8(e){let t=this._write(1);this.buf[t]=e}write32(e){let t=this._write(4);De(this.buf,e,t)}write(e){let t=this._write(4+e.length);De(this.buf,e.length,t),this.buf.set(e,t+4)}_read(e){if(this.ptr+e>this.buf.length)throw new Error("Invalid packet");return this.ptr+=e,this.ptr-e}read8(){return this.buf[this._read(1)]}read32(){return Me(this.buf,this._read(4))}read(){let e=this.read32(),t=new Uint8Array(e),r=this._read(t.length);return t.set(this.buf.subarray(r,r+e)),t}},Z,he,Ae;if(typeof TextEncoder<"u"&&typeof TextDecoder<"u"){let e=new TextEncoder,t=new TextDecoder;Z=r=>e.encode(r),he=r=>t.decode(r),Ae='new TextEncoder().encode("")'}else if(typeof Buffer<"u")Z=e=>Buffer.from(e),he=e=>{let{buffer:t,byteOffset:r,byteLength:a}=e;return Buffer.from(t,r,a).toString()},Ae='Buffer.from("")';else throw new Error("No UTF-8 codec found");if(!(Z("")instanceof Uint8Array))throw new Error(`Invariant violation: "${Ae} instanceof Uint8Array" is incorrectly false
|
|
2
2
|
|
|
3
3
|
This indicates that your JavaScript environment is broken. You cannot use
|
|
4
4
|
esbuild in this environment because esbuild relies on this invariant. This
|
|
5
5
|
is not a problem with esbuild. You need to fix your environment instead.
|
|
6
|
-
`);function Ie(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function De(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var J=JSON.stringify,Me="warning",Fe="silent";function me(e,t){const r=[];for(const a of e){if(Y(a,t),a.indexOf(",")>=0)throw new Error(`Invalid ${t}: ${a}`);r.push(a)}return r.join(",")}var ke=()=>null,L=e=>typeof e=="boolean"?null:"a boolean",j=e=>typeof e=="string"?null:"a string",Se=e=>e instanceof RegExp?null:"a RegExp object",ue=e=>typeof e=="number"&&e===(e|0)?null:"an integer",tt=e=>typeof e=="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",Ne=e=>typeof e=="function"?null:"a function",te=e=>Array.isArray(e)?null:"an array",q=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"an array of strings",Q=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",nt=e=>typeof e=="object"&&e!==null?null:"an array or an object",rt=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Ve=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Be=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",st=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",Le=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"a string or an array of strings",We=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",it=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function i(e,t,r,a){let g=e[r];if(t[r+""]=!0,g===void 0)return;let y=a(g);if(y!==null)throw new Error(`${J(r)} must be ${y}`);return g}function z(e,t,r){for(let a in e)if(!(a in t))throw new Error(`Invalid option ${r}: ${J(a)}`)}function lt(e){let t=Object.create(null),r=i(e,t,"wasmURL",it),a=i(e,t,"wasmModule",rt),g=i(e,t,"worker",L);return z(e,t,"in initialize() call"),{wasmURL:r,wasmModule:a,worker:g}}function ze(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let a=e[r];if(typeof a=="string"||a===!1)t[r]=a;else throw new Error(`Expected ${J(r)} in mangle cache to map to either a string or false`)}}return t}function Te(e,t,r,a,g){let y=i(t,r,"color",L),h=i(t,r,"logLevel",j),k=i(t,r,"logLimit",ue);y!==void 0?e.push(`--color=${y}`):a&&e.push("--color=true"),e.push(`--log-level=${h||g}`),e.push(`--log-limit=${k||0}`)}function Y(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+J(r):""} to be a string, got ${typeof e} instead`);return e}function Ge(e,t,r){let a=i(t,r,"legalComments",j),g=i(t,r,"sourceRoot",j),y=i(t,r,"sourcesContent",L),h=i(t,r,"target",Le),k=i(t,r,"format",j),f=i(t,r,"globalName",j),D=i(t,r,"mangleProps",Se),R=i(t,r,"reserveProps",Se),C=i(t,r,"mangleQuoted",L),V=i(t,r,"minify",L),A=i(t,r,"minifySyntax",L),M=i(t,r,"minifyWhitespace",L),F=i(t,r,"minifyIdentifiers",L),$=i(t,r,"lineLimit",ue),W=i(t,r,"drop",q),T=i(t,r,"dropLabels",q),S=i(t,r,"charset",j),p=i(t,r,"treeShaking",L),u=i(t,r,"ignoreAnnotations",L),s=i(t,r,"jsx",j),o=i(t,r,"jsxFactory",j),d=i(t,r,"jsxFragment",j),v=i(t,r,"jsxImportSource",j),_=i(t,r,"jsxDev",L),c=i(t,r,"jsxSideEffects",L),m=i(t,r,"define",Q),x=i(t,r,"logOverride",Q),n=i(t,r,"supported",Q),l=i(t,r,"pure",q),b=i(t,r,"keepNames",L),w=i(t,r,"platform",j),O=i(t,r,"tsconfigRaw",st),B=i(t,r,"absPaths",q);if(a&&e.push(`--legal-comments=${a}`),g!==void 0&&e.push(`--source-root=${g}`),y!==void 0&&e.push(`--sources-content=${y}`),h&&e.push(`--target=${me(Array.isArray(h)?h:[h],"target")}`),k&&e.push(`--format=${k}`),f&&e.push(`--global-name=${f}`),w&&e.push(`--platform=${w}`),O&&e.push(`--tsconfig-raw=${typeof O=="string"?O:JSON.stringify(O)}`),V&&e.push("--minify"),A&&e.push("--minify-syntax"),M&&e.push("--minify-whitespace"),F&&e.push("--minify-identifiers"),$&&e.push(`--line-limit=${$}`),S&&e.push(`--charset=${S}`),p!==void 0&&e.push(`--tree-shaking=${p}`),u&&e.push("--ignore-annotations"),W)for(let E of W)e.push(`--drop:${Y(E,"drop")}`);if(T&&e.push(`--drop-labels=${me(T,"drop label")}`),B&&e.push(`--abs-paths=${me(B,"abs paths")}`),D&&e.push(`--mangle-props=${Pe(D)}`),R&&e.push(`--reserve-props=${Pe(R)}`),C!==void 0&&e.push(`--mangle-quoted=${C}`),s&&e.push(`--jsx=${s}`),o&&e.push(`--jsx-factory=${o}`),d&&e.push(`--jsx-fragment=${d}`),v&&e.push(`--jsx-import-source=${v}`),_&&e.push("--jsx-dev"),c&&e.push("--jsx-side-effects"),m)for(let E in m){if(E.indexOf("=")>=0)throw new Error(`Invalid define: ${E}`);e.push(`--define:${E}=${Y(m[E],"define",E)}`)}if(x)for(let E in x){if(E.indexOf("=")>=0)throw new Error(`Invalid log override: ${E}`);e.push(`--log-override:${E}=${Y(x[E],"log override",E)}`)}if(n)for(let E in n){if(E.indexOf("=")>=0)throw new Error(`Invalid supported: ${E}`);const N=n[E];if(typeof N!="boolean")throw new Error(`Expected value for supported ${J(E)} to be a boolean, got ${typeof N} instead`);e.push(`--supported:${E}=${N}`)}if(l)for(let E of l)e.push(`--pure:${Y(E,"pure")}`);b&&e.push("--keep-names")}function ot(e,t,r,a,g){var y;let h=[],k=[],f=Object.create(null),D=null,R=null;Te(h,t,f,r,a),Ge(h,t,f);let C=i(t,f,"sourcemap",Be),V=i(t,f,"bundle",L),A=i(t,f,"splitting",L),M=i(t,f,"preserveSymlinks",L),F=i(t,f,"metafile",L),$=i(t,f,"outfile",j),W=i(t,f,"outdir",j),T=i(t,f,"outbase",j),S=i(t,f,"tsconfig",j),p=i(t,f,"resolveExtensions",q),u=i(t,f,"nodePaths",q),s=i(t,f,"mainFields",q),o=i(t,f,"conditions",q),d=i(t,f,"external",q),v=i(t,f,"packages",j),_=i(t,f,"alias",Q),c=i(t,f,"loader",Q),m=i(t,f,"outExtension",Q),x=i(t,f,"publicPath",j),n=i(t,f,"entryNames",j),l=i(t,f,"chunkNames",j),b=i(t,f,"assetNames",j),w=i(t,f,"inject",q),O=i(t,f,"banner",Q),B=i(t,f,"footer",Q),E=i(t,f,"entryPoints",nt),N=i(t,f,"absWorkingDir",j),I=i(t,f,"stdin",Q),U=(y=i(t,f,"write",L))!=null?y:g,H=i(t,f,"allowOverwrite",L),G=i(t,f,"mangleCache",Q);if(f.plugins=!0,z(t,f,`in ${e}() call`),C&&h.push(`--sourcemap${C===!0?"":`=${C}`}`),V&&h.push("--bundle"),H&&h.push("--allow-overwrite"),A&&h.push("--splitting"),M&&h.push("--preserve-symlinks"),F&&h.push("--metafile"),$&&h.push(`--outfile=${$}`),W&&h.push(`--outdir=${W}`),T&&h.push(`--outbase=${T}`),S&&h.push(`--tsconfig=${S}`),v&&h.push(`--packages=${v}`),p&&h.push(`--resolve-extensions=${me(p,"resolve extension")}`),x&&h.push(`--public-path=${x}`),n&&h.push(`--entry-names=${n}`),l&&h.push(`--chunk-names=${l}`),b&&h.push(`--asset-names=${b}`),s&&h.push(`--main-fields=${me(s,"main field")}`),o&&h.push(`--conditions=${me(o,"condition")}`),d)for(let P of d)h.push(`--external:${Y(P,"external")}`);if(_)for(let P in _){if(P.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${P}`);h.push(`--alias:${P}=${Y(_[P],"alias",P)}`)}if(O)for(let P in O){if(P.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${P}`);h.push(`--banner:${P}=${Y(O[P],"banner",P)}`)}if(B)for(let P in B){if(P.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${P}`);h.push(`--footer:${P}=${Y(B[P],"footer",P)}`)}if(w)for(let P of w)h.push(`--inject:${Y(P,"inject")}`);if(c)for(let P in c){if(P.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${P}`);h.push(`--loader:${P}=${Y(c[P],"loader",P)}`)}if(m)for(let P in m){if(P.indexOf("=")>=0)throw new Error(`Invalid out extension: ${P}`);h.push(`--out-extension:${P}=${Y(m[P],"out extension",P)}`)}if(E)if(Array.isArray(E))for(let P=0,se=E.length;P<se;P++){let X=E[P];if(typeof X=="object"&&X!==null){let ee=Object.create(null),ie=i(X,ee,"in",j),K=i(X,ee,"out",j);if(z(X,ee,"in entry point at index "+P),ie===void 0)throw new Error('Missing property "in" for entry point at index '+P);if(K===void 0)throw new Error('Missing property "out" for entry point at index '+P);k.push([K,ie])}else k.push(["",Y(X,"entry point at index "+P)])}else for(let P in E)k.push([P,Y(E[P],"entry point",P)]);if(I){let P=Object.create(null),se=i(I,P,"contents",We),X=i(I,P,"resolveDir",j),ee=i(I,P,"sourcefile",j),ie=i(I,P,"loader",j);z(I,P,'in "stdin" object'),ee&&h.push(`--sourcefile=${ee}`),ie&&h.push(`--loader=${ie}`),X&&(R=X),typeof se=="string"?D=Z(se):se instanceof Uint8Array&&(D=se)}let re=[];if(u)for(let P of u)P+="",re.push(P);return{entries:k,flags:h,write:U,stdinContents:D,stdinResolveDir:R,absWorkingDir:N,nodePaths:re,mangleCache:ze(G)}}function at(e,t,r,a){let g=[],y=Object.create(null);Te(g,t,y,r,a),Ge(g,t,y);let h=i(t,y,"sourcemap",Be),k=i(t,y,"sourcefile",j),f=i(t,y,"loader",j),D=i(t,y,"banner",j),R=i(t,y,"footer",j),C=i(t,y,"mangleCache",Q);return z(t,y,`in ${e}() call`),h&&g.push(`--sourcemap=${h===!0?"external":h}`),k&&g.push(`--sourcefile=${k}`),f&&g.push(`--loader=${f}`),D&&g.push(`--banner=${D}`),R&&g.push(`--footer=${R}`),{flags:g,mangleCache:ze(C)}}function ct(e){const t={},r={didClose:!1,reason:""};let a={},g=0,y=0,h=new Uint8Array(16*1024),k=0,f=S=>{let p=k+S.length;if(p>h.length){let s=new Uint8Array(p*2);s.set(h),h=s}h.set(S,k),k+=S.length;let u=0;for(;u+4<=k;){let s=Ie(h,u);if(u+4+s>k)break;u+=4,M(h.subarray(u,u+s)),u+=s}u>0&&(h.copyWithin(0,u,k),k-=u)},D=S=>{r.didClose=!0,S&&(r.reason=": "+(S.message||S));const p="The service was stopped"+r.reason;for(let u in a)a[u](p,null);a={}},R=(S,p,u)=>{if(r.didClose)return u("The service is no longer running"+r.reason,null);let s=g++;a[s]=(o,d)=>{try{u(o,d)}finally{S&&S.unref()}},S&&S.ref(),e.writeToStdin(Re({id:s,isRequest:!0,value:p}))},C=(S,p)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(Re({id:S,isRequest:!1,value:p}))},V=(S,p)=>le(null,null,function*(){try{if(p.command==="ping"){C(S,{});return}if(typeof p.key=="number"){const u=t[p.key];if(!u)return;const s=u[p.command];if(s){yield s(S,p);return}}throw new Error("Invalid command: "+p.command)}catch(u){const s=[fe(u,e,null,void 0,"")];try{C(S,{errors:s})}catch{}}}),A=!0,M=S=>{if(A){A=!1;let u=String.fromCharCode(...S);if(u!=="0.27.3")throw new Error(`Cannot start service: Host version "0.27.3" does not match binary version ${J(u)}`);return}let p=et(S);if(p.isRequest)V(p.id,p.value);else{let u=a[p.id];delete a[p.id],p.value.error?u(p.value.error,{}):u(null,p.value)}};return{readFromStdout:f,afterClose:D,service:{buildOrContext:({callName:S,refs:p,options:u,isTTY:s,defaultWD:o,callback:d})=>{let v=0;const _=y++,c={},m={ref(){++v===1&&p&&p.ref()},unref(){--v===0&&(delete t[_],p&&p.unref())}};t[_]=c,m.ref(),ut(S,_,R,C,m,e,c,u,s,o,(x,n)=>{try{d(x,n)}finally{m.unref()}})},transform:({callName:S,refs:p,input:u,options:s,isTTY:o,fs:d,callback:v})=>{const _=Je();let c=m=>{try{if(typeof u!="string"&&!(u instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:x,mangleCache:n}=at(S,s,o,Fe),l={command:"transform",flags:x,inputFS:m!==null,input:m!==null?Z(m):typeof u=="string"?Z(u):u};n&&(l.mangleCache=n),R(p,l,(b,w)=>{if(b)return v(new Error(b),null);let O=ge(w.errors,_),B=ge(w.warnings,_),E=1,N=()=>{if(--E===0){let I={warnings:B,code:w.code,map:w.map,mangleCache:void 0,legalComments:void 0};"legalComments"in w&&(I.legalComments=w?.legalComments),w.mangleCache&&(I.mangleCache=w?.mangleCache),v(null,I)}};if(O.length>0)return v(be("Transform failed",O,B),null);w.codeFS&&(E++,d.readFile(w.code,(I,U)=>{I!==null?v(I,null):(w.code=U,N())})),w.mapFS&&(E++,d.readFile(w.map,(I,U)=>{I!==null?v(I,null):(w.map=U,N())})),N()})}catch(x){let n=[];try{Te(n,s,{},o,Fe)}catch{}const l=fe(x,e,_,void 0,"");R(p,{command:"error",flags:n,error:l},()=>{l.detail=_.load(l.detail),v(be("Transform failed",[l],[]),null)})}};if((typeof u=="string"||u instanceof Uint8Array)&&u.length>1024*1024){let m=c;c=()=>d.writeFile(u,m)}c(null)},formatMessages:({callName:S,refs:p,messages:u,options:s,callback:o})=>{if(!s)throw new Error(`Missing second argument in ${S}() call`);let d={},v=i(s,d,"kind",j),_=i(s,d,"color",L),c=i(s,d,"terminalWidth",ue);if(z(s,d,`in ${S}() call`),v===void 0)throw new Error(`Missing "kind" in ${S}() call`);if(v!=="error"&&v!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${S}() call`);let m={command:"format-msgs",messages:ne(u,"messages",null,"",c),isWarning:v==="warning"};_!==void 0&&(m.color=_),c!==void 0&&(m.terminalWidth=c),R(p,m,(x,n)=>{if(x)return o(new Error(x),null);o(null,n.messages)})},analyzeMetafile:({callName:S,refs:p,metafile:u,options:s,callback:o})=>{s===void 0&&(s={});let d={},v=i(s,d,"color",L),_=i(s,d,"verbose",L);z(s,d,`in ${S}() call`);let c={command:"analyze-metafile",metafile:u};v!==void 0&&(c.color=v),_!==void 0&&(c.verbose=_),R(p,c,(m,x)=>{if(m)return o(new Error(m),null);o(null,x.result)})}}}}function ut(e,t,r,a,g,y,h,k,f,D,R){const C=Je(),V=e==="context",A=($,W)=>{const T=[];try{Te(T,k,{},f,Me)}catch{}const S=fe($,y,C,void 0,W);r(g,{command:"error",flags:T,error:S},()=>{S.detail=C.load(S.detail),R(be(V?"Context failed":"Build failed",[S],[]),null)})};let M;if(typeof k=="object"){const $=k.plugins;if($!==void 0){if(!Array.isArray($))return A(new Error('"plugins" must be an array'),"");M=$}}if(M&&M.length>0){if(y.isSync)return A(new Error("Cannot use plugins in synchronous API calls"),"");ft(t,r,a,g,y,h,k,M,C).then($=>{if(!$.ok)return A($.error,$.pluginName);try{F($.requestPlugins,$.runOnEndCallbacks,$.scheduleOnDisposeCallbacks)}catch(W){A(W,"")}},$=>A($,""));return}try{F(null,($,W)=>W([],[]),()=>{})}catch($){A($,"")}function F($,W,T){const S=y.hasFS,{entries:p,flags:u,write:s,stdinContents:o,stdinResolveDir:d,absWorkingDir:v,nodePaths:_,mangleCache:c}=ot(e,k,f,Me,S);if(s&&!y.hasFS)throw new Error('The "write" option is unavailable in this environment');const m={command:"build",key:t,entries:p,flags:u,write:s,stdinContents:o,stdinResolveDir:d,absWorkingDir:v||D,nodePaths:_,context:V};$&&(m.plugins=$),c&&(m.mangleCache=c);const x=(b,w)=>{const O={errors:ge(b.errors,C),warnings:ge(b.warnings,C),outputFiles:void 0,metafile:void 0,mangleCache:void 0},B=O.errors.slice(),E=O.warnings.slice();b.outputFiles&&(O.outputFiles=b.outputFiles.map(ht)),b.metafile&&(O.metafile=JSON.parse(b.metafile)),b.mangleCache&&(O.mangleCache=b.mangleCache),b.writeToStdout!==void 0&&console.log(he(b.writeToStdout).replace(/\n$/,"")),W(O,(N,I)=>{if(B.length>0||N.length>0){const U=be("Build failed",B.concat(N),E.concat(I));return w(U,null,N,I)}w(null,O,N,I)})};let n,l;V&&(h["on-end"]=(b,w)=>new Promise(O=>{x(w,(B,E,N,I)=>{const U={errors:N,warnings:I};l&&l(B,E),n=void 0,l=void 0,a(b,U),O()})})),r(g,m,(b,w)=>{if(b)return R(new Error(b),null);if(!V)return x(w,(E,N)=>(T(),R(E,N)));if(w.errors.length>0)return R(be("Context failed",w.errors,w.warnings),null);let O=!1;const B={rebuild:()=>(n||(n=new Promise((E,N)=>{let I;l=(H,G)=>{I||(I=()=>H?N(H):E(G))};const U=()=>{r(g,{command:"rebuild",key:t},(G,re)=>{G?N(new Error(G)):I?I():U()})};U()})),n),watch:(E={})=>new Promise((N,I)=>{if(!y.hasFS)throw new Error('Cannot use the "watch" API in this environment');const U={},H=i(E,U,"delay",ue);z(E,U,"in watch() call");const G={command:"watch",key:t};H&&(G.delay=H),r(g,G,re=>{re?I(new Error(re)):N(void 0)})}),serve:(E={})=>new Promise((N,I)=>{if(!y.hasFS)throw new Error('Cannot use the "serve" API in this environment');const U={},H=i(E,U,"port",tt),G=i(E,U,"host",j),re=i(E,U,"servedir",j),P=i(E,U,"keyfile",j),se=i(E,U,"certfile",j),X=i(E,U,"fallback",j),ee=i(E,U,"cors",Q),ie=i(E,U,"onRequest",Ne);z(E,U,"in serve() call");const K={command:"serve",key:t,onRequest:!!ie};if(H!==void 0&&(K.port=H),G!==void 0&&(K.host=G),re!==void 0&&(K.servedir=re),P!==void 0&&(K.keyfile=P),se!==void 0&&(K.certfile=se),X!==void 0&&(K.fallback=X),ee){const xe={},pe=i(ee,xe,"origin",Le);z(ee,xe,'on "cors" object'),Array.isArray(pe)?K.corsOrigin=pe:pe!==void 0&&(K.corsOrigin=[pe])}r(g,K,(xe,pe)=>{if(xe)return I(new Error(xe));ie&&(h["serve-request"]=(jt,Pt)=>{ie(Pt.args),a(jt,{})}),N(pe)})}),cancel:()=>new Promise(E=>{if(O)return E();r(g,{command:"cancel",key:t},()=>{E()})}),dispose:()=>new Promise(E=>{if(O)return E();O=!0,r(g,{command:"dispose",key:t},()=>{E(),T(),g.unref()})})};g.ref(),R(null,B)})}}var ft=(e,t,r,a,g,y,h,k,f)=>le(null,null,function*(){let D=[],R=[],C={},V={},A=[],M=0,F=0,$=[],W=!1;k=[...k];for(let p of k){let u={};if(typeof p!="object")throw new Error(`Plugin at index ${F} must be an object`);const s=i(p,u,"name",j);if(typeof s!="string"||s==="")throw new Error(`Plugin at index ${F} is missing a name`);try{let o=i(p,u,"setup",Ne);if(typeof o!="function")throw new Error("Plugin is missing a setup function");z(p,u,`on plugin ${J(s)}`);let d={name:s,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};F++;let _=o({initialOptions:h,resolve:(c,m={})=>{if(!W)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof c!="string")throw new Error("The path to resolve must be a string");let x=Object.create(null),n=i(m,x,"pluginName",j),l=i(m,x,"importer",j),b=i(m,x,"namespace",j),w=i(m,x,"resolveDir",j),O=i(m,x,"kind",j),B=i(m,x,"pluginData",ke),E=i(m,x,"with",Q);return z(m,x,"in resolve() call"),new Promise((N,I)=>{const U={command:"resolve",path:c,key:e,pluginName:s};if(n!=null&&(U.pluginName=n),l!=null&&(U.importer=l),b!=null&&(U.namespace=b),w!=null&&(U.resolveDir=w),O!=null)U.kind=O;else throw new Error('Must specify "kind" when calling "resolve"');B!=null&&(U.pluginData=f.store(B)),E!=null&&(U.with=dt(E,"with")),t(a,U,(H,G)=>{H!==null?I(new Error(H)):N({errors:ge(G.errors,f),warnings:ge(G.warnings,f),path:G.path,external:G.external,sideEffects:G.sideEffects,namespace:G.namespace,suffix:G.suffix,pluginData:f.load(G.pluginData)})})})},onStart(c){let m='This error came from the "onStart" callback registered here:',x=$e(new Error(m),g,"onStart");D.push({name:s,callback:c,note:x}),d.onStart=!0},onEnd(c){let m='This error came from the "onEnd" callback registered here:',x=$e(new Error(m),g,"onEnd");R.push({name:s,callback:c,note:x}),d.onEnd=!0},onResolve(c,m){let x='This error came from the "onResolve" callback registered here:',n=$e(new Error(x),g,"onResolve"),l={},b=i(c,l,"filter",Se),w=i(c,l,"namespace",j);if(z(c,l,`in onResolve() call for plugin ${J(s)}`),b==null)throw new Error("onResolve() call is missing a filter");let O=M++;C[O]={name:s,callback:m,note:n},d.onResolve.push({id:O,filter:Pe(b),namespace:w||""})},onLoad(c,m){let x='This error came from the "onLoad" callback registered here:',n=$e(new Error(x),g,"onLoad"),l={},b=i(c,l,"filter",Se),w=i(c,l,"namespace",j);if(z(c,l,`in onLoad() call for plugin ${J(s)}`),b==null)throw new Error("onLoad() call is missing a filter");let O=M++;V[O]={name:s,callback:m,note:n},d.onLoad.push({id:O,filter:Pe(b),namespace:w||""})},onDispose(c){A.push(c)},esbuild:g.esbuild});_&&(yield _),$.push(d)}catch(o){return{ok:!1,error:o,pluginName:s}}}y["on-start"]=(p,u)=>le(null,null,function*(){f.clear();let s={errors:[],warnings:[]};yield Promise.all(D.map(o=>le(null,[o],function*({name:d,callback:v,note:_}){try{let c=yield v();if(c!=null){if(typeof c!="object")throw new Error(`Expected onStart() callback in plugin ${J(d)} to return an object`);let m={},x=i(c,m,"errors",te),n=i(c,m,"warnings",te);z(c,m,`from onStart() callback in plugin ${J(d)}`),x!=null&&s.errors.push(...ne(x,"errors",f,d,void 0)),n!=null&&s.warnings.push(...ne(n,"warnings",f,d,void 0))}}catch(c){s.errors.push(fe(c,g,f,_&&_(),d))}}))),r(p,s)}),y["on-resolve"]=(p,u)=>le(null,null,function*(){let s={},o="",d,v;for(let _ of u.ids)try{({name:o,callback:d,note:v}=C[_]);let c=yield d({path:u.path,importer:u.importer,namespace:u.namespace,resolveDir:u.resolveDir,kind:u.kind,pluginData:f.load(u.pluginData),with:u.with});if(c!=null){if(typeof c!="object")throw new Error(`Expected onResolve() callback in plugin ${J(o)} to return an object`);let m={},x=i(c,m,"pluginName",j),n=i(c,m,"path",j),l=i(c,m,"namespace",j),b=i(c,m,"suffix",j),w=i(c,m,"external",L),O=i(c,m,"sideEffects",L),B=i(c,m,"pluginData",ke),E=i(c,m,"errors",te),N=i(c,m,"warnings",te),I=i(c,m,"watchFiles",q),U=i(c,m,"watchDirs",q);z(c,m,`from onResolve() callback in plugin ${J(o)}`),s.id=_,x!=null&&(s.pluginName=x),n!=null&&(s.path=n),l!=null&&(s.namespace=l),b!=null&&(s.suffix=b),w!=null&&(s.external=w),O!=null&&(s.sideEffects=O),B!=null&&(s.pluginData=f.store(B)),E!=null&&(s.errors=ne(E,"errors",f,o,void 0)),N!=null&&(s.warnings=ne(N,"warnings",f,o,void 0)),I!=null&&(s.watchFiles=je(I,"watchFiles")),U!=null&&(s.watchDirs=je(U,"watchDirs"));break}}catch(c){s={id:_,errors:[fe(c,g,f,v&&v(),o)]};break}r(p,s)}),y["on-load"]=(p,u)=>le(null,null,function*(){let s={},o="",d,v;for(let _ of u.ids)try{({name:o,callback:d,note:v}=V[_]);let c=yield d({path:u.path,namespace:u.namespace,suffix:u.suffix,pluginData:f.load(u.pluginData),with:u.with});if(c!=null){if(typeof c!="object")throw new Error(`Expected onLoad() callback in plugin ${J(o)} to return an object`);let m={},x=i(c,m,"pluginName",j),n=i(c,m,"contents",We),l=i(c,m,"resolveDir",j),b=i(c,m,"pluginData",ke),w=i(c,m,"loader",j),O=i(c,m,"errors",te),B=i(c,m,"warnings",te),E=i(c,m,"watchFiles",q),N=i(c,m,"watchDirs",q);z(c,m,`from onLoad() callback in plugin ${J(o)}`),s.id=_,x!=null&&(s.pluginName=x),n instanceof Uint8Array?s.contents=n:n!=null&&(s.contents=Z(n)),l!=null&&(s.resolveDir=l),b!=null&&(s.pluginData=f.store(b)),w!=null&&(s.loader=w),O!=null&&(s.errors=ne(O,"errors",f,o,void 0)),B!=null&&(s.warnings=ne(B,"warnings",f,o,void 0)),E!=null&&(s.watchFiles=je(E,"watchFiles")),N!=null&&(s.watchDirs=je(N,"watchDirs"));break}}catch(c){s={id:_,errors:[fe(c,g,f,v&&v(),o)]};break}r(p,s)});let T=(p,u)=>u([],[]);R.length>0&&(T=(p,u)=>{le(null,null,function*(){const s=[],o=[];for(const{name:d,callback:v,note:_}of R){let c,m;try{const x=yield v(p);if(x!=null){if(typeof x!="object")throw new Error(`Expected onEnd() callback in plugin ${J(d)} to return an object`);let n={},l=i(x,n,"errors",te),b=i(x,n,"warnings",te);z(x,n,`from onEnd() callback in plugin ${J(d)}`),l!=null&&(c=ne(l,"errors",f,d,void 0)),b!=null&&(m=ne(b,"warnings",f,d,void 0))}}catch(x){c=[fe(x,g,f,_&&_(),d)]}if(c){s.push(...c);try{p.errors.push(...c)}catch{}}if(m){o.push(...m);try{p.warnings.push(...m)}catch{}}}u(s,o)})});let S=()=>{for(const p of A)setTimeout(()=>p(),0)};return W=!0,{ok:!0,requestPlugins:$,runOnEndCallbacks:T,scheduleOnDisposeCallbacks:S}});function Je(){const e=new Map;let t=0;return{clear(){e.clear()},load(r){return e.get(r)},store(r){if(r===void 0)return-1;const a=t++;return e.set(a,r),a}}}function $e(e,t,r){let a,g=!1;return()=>{if(g)return a;g=!0;try{let y=(e.stack+"").split(`
|
|
7
|
-
`);y.splice(1,1);let h=
|
|
8
|
-
`),"")}catch{}return{id:"",pluginName:g,text:y,location:h,notes:a?[a]:[],detail:r?r.store(e):-1}}function
|
|
6
|
+
`);function Me(e,t){return e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24}function De(e,t,r){e[r++]=t,e[r++]=t>>8,e[r++]=t>>16,e[r++]=t>>24}var J=JSON.stringify,Fe="warning",Ne="silent";function me(e,t){const r=[];for(const a of e){if(Y(a,t),a.indexOf(",")>=0)throw new Error(`Invalid ${t}: ${a}`);r.push(a)}return r.join(",")}var ke=()=>null,L=e=>typeof e=="boolean"?null:"a boolean",j=e=>typeof e=="string"?null:"a string",Se=e=>e instanceof RegExp?null:"a RegExp object",ue=e=>typeof e=="number"&&e===(e|0)?null:"an integer",nt=e=>typeof e=="number"&&e===(e|0)&&e>=0&&e<=65535?null:"a valid port number",Ve=e=>typeof e=="function"?null:"a function",te=e=>Array.isArray(e)?null:"an array",q=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"an array of strings",Q=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"an object",rt=e=>typeof e=="object"&&e!==null?null:"an array or an object",st=e=>e instanceof WebAssembly.Module?null:"a WebAssembly.Module",Be=e=>typeof e=="object"&&!Array.isArray(e)?null:"an object or null",Le=e=>typeof e=="string"||typeof e=="boolean"?null:"a string or a boolean",it=e=>typeof e=="string"||typeof e=="object"&&e!==null&&!Array.isArray(e)?null:"a string or an object",We=e=>typeof e=="string"||Array.isArray(e)&&e.every(t=>typeof t=="string")?null:"a string or an array of strings",ze=e=>typeof e=="string"||e instanceof Uint8Array?null:"a string or a Uint8Array",lt=e=>typeof e=="string"||e instanceof URL?null:"a string or a URL";function i(e,t,r,a){let g=e[r];if(t[r+""]=!0,g===void 0)return;let y=a(g);if(y!==null)throw new Error(`${J(r)} must be ${y}`);return g}function z(e,t,r){for(let a in e)if(!(a in t))throw new Error(`Invalid option ${r}: ${J(a)}`)}function ot(e){let t=Object.create(null),r=i(e,t,"wasmURL",lt),a=i(e,t,"wasmModule",st),g=i(e,t,"worker",L);return z(e,t,"in initialize() call"),{wasmURL:r,wasmModule:a,worker:g}}function Ge(e){let t;if(e!==void 0){t=Object.create(null);for(let r in e){let a=e[r];if(typeof a=="string"||a===!1)t[r]=a;else throw new Error(`Expected ${J(r)} in mangle cache to map to either a string or false`)}}return t}function Te(e,t,r,a,g){let y=i(t,r,"color",L),h=i(t,r,"logLevel",j),k=i(t,r,"logLimit",ue);y!==void 0?e.push(`--color=${y}`):a&&e.push("--color=true"),e.push(`--log-level=${h||g}`),e.push(`--log-limit=${k||0}`)}function Y(e,t,r){if(typeof e!="string")throw new Error(`Expected value for ${t}${r!==void 0?" "+J(r):""} to be a string, got ${typeof e} instead`);return e}function Je(e,t,r){let a=i(t,r,"legalComments",j),g=i(t,r,"sourceRoot",j),y=i(t,r,"sourcesContent",L),h=i(t,r,"target",We),k=i(t,r,"format",j),f=i(t,r,"globalName",j),D=i(t,r,"mangleProps",Se),R=i(t,r,"reserveProps",Se),C=i(t,r,"mangleQuoted",L),V=i(t,r,"minify",L),A=i(t,r,"minifySyntax",L),M=i(t,r,"minifyWhitespace",L),F=i(t,r,"minifyIdentifiers",L),$=i(t,r,"lineLimit",ue),W=i(t,r,"drop",q),T=i(t,r,"dropLabels",q),S=i(t,r,"charset",j),p=i(t,r,"treeShaking",L),u=i(t,r,"ignoreAnnotations",L),s=i(t,r,"jsx",j),o=i(t,r,"jsxFactory",j),d=i(t,r,"jsxFragment",j),v=i(t,r,"jsxImportSource",j),_=i(t,r,"jsxDev",L),c=i(t,r,"jsxSideEffects",L),m=i(t,r,"define",Q),x=i(t,r,"logOverride",Q),n=i(t,r,"supported",Q),l=i(t,r,"pure",q),b=i(t,r,"keepNames",L),w=i(t,r,"platform",j),O=i(t,r,"tsconfigRaw",it),B=i(t,r,"absPaths",q);if(a&&e.push(`--legal-comments=${a}`),g!==void 0&&e.push(`--source-root=${g}`),y!==void 0&&e.push(`--sources-content=${y}`),h&&e.push(`--target=${me(Array.isArray(h)?h:[h],"target")}`),k&&e.push(`--format=${k}`),f&&e.push(`--global-name=${f}`),w&&e.push(`--platform=${w}`),O&&e.push(`--tsconfig-raw=${typeof O=="string"?O:JSON.stringify(O)}`),V&&e.push("--minify"),A&&e.push("--minify-syntax"),M&&e.push("--minify-whitespace"),F&&e.push("--minify-identifiers"),$&&e.push(`--line-limit=${$}`),S&&e.push(`--charset=${S}`),p!==void 0&&e.push(`--tree-shaking=${p}`),u&&e.push("--ignore-annotations"),W)for(let E of W)e.push(`--drop:${Y(E,"drop")}`);if(T&&e.push(`--drop-labels=${me(T,"drop label")}`),B&&e.push(`--abs-paths=${me(B,"abs paths")}`),D&&e.push(`--mangle-props=${Pe(D)}`),R&&e.push(`--reserve-props=${Pe(R)}`),C!==void 0&&e.push(`--mangle-quoted=${C}`),s&&e.push(`--jsx=${s}`),o&&e.push(`--jsx-factory=${o}`),d&&e.push(`--jsx-fragment=${d}`),v&&e.push(`--jsx-import-source=${v}`),_&&e.push("--jsx-dev"),c&&e.push("--jsx-side-effects"),m)for(let E in m){if(E.indexOf("=")>=0)throw new Error(`Invalid define: ${E}`);e.push(`--define:${E}=${Y(m[E],"define",E)}`)}if(x)for(let E in x){if(E.indexOf("=")>=0)throw new Error(`Invalid log override: ${E}`);e.push(`--log-override:${E}=${Y(x[E],"log override",E)}`)}if(n)for(let E in n){if(E.indexOf("=")>=0)throw new Error(`Invalid supported: ${E}`);const N=n[E];if(typeof N!="boolean")throw new Error(`Expected value for supported ${J(E)} to be a boolean, got ${typeof N} instead`);e.push(`--supported:${E}=${N}`)}if(l)for(let E of l)e.push(`--pure:${Y(E,"pure")}`);b&&e.push("--keep-names")}function at(e,t,r,a,g){var y;let h=[],k=[],f=Object.create(null),D=null,R=null;Te(h,t,f,r,a),Je(h,t,f);let C=i(t,f,"sourcemap",Le),V=i(t,f,"bundle",L),A=i(t,f,"splitting",L),M=i(t,f,"preserveSymlinks",L),F=i(t,f,"metafile",L),$=i(t,f,"outfile",j),W=i(t,f,"outdir",j),T=i(t,f,"outbase",j),S=i(t,f,"tsconfig",j),p=i(t,f,"resolveExtensions",q),u=i(t,f,"nodePaths",q),s=i(t,f,"mainFields",q),o=i(t,f,"conditions",q),d=i(t,f,"external",q),v=i(t,f,"packages",j),_=i(t,f,"alias",Q),c=i(t,f,"loader",Q),m=i(t,f,"outExtension",Q),x=i(t,f,"publicPath",j),n=i(t,f,"entryNames",j),l=i(t,f,"chunkNames",j),b=i(t,f,"assetNames",j),w=i(t,f,"inject",q),O=i(t,f,"banner",Q),B=i(t,f,"footer",Q),E=i(t,f,"entryPoints",rt),N=i(t,f,"absWorkingDir",j),I=i(t,f,"stdin",Q),U=(y=i(t,f,"write",L))!=null?y:g,H=i(t,f,"allowOverwrite",L),G=i(t,f,"mangleCache",Q);if(f.plugins=!0,z(t,f,`in ${e}() call`),C&&h.push(`--sourcemap${C===!0?"":`=${C}`}`),V&&h.push("--bundle"),H&&h.push("--allow-overwrite"),A&&h.push("--splitting"),M&&h.push("--preserve-symlinks"),F&&h.push("--metafile"),$&&h.push(`--outfile=${$}`),W&&h.push(`--outdir=${W}`),T&&h.push(`--outbase=${T}`),S&&h.push(`--tsconfig=${S}`),v&&h.push(`--packages=${v}`),p&&h.push(`--resolve-extensions=${me(p,"resolve extension")}`),x&&h.push(`--public-path=${x}`),n&&h.push(`--entry-names=${n}`),l&&h.push(`--chunk-names=${l}`),b&&h.push(`--asset-names=${b}`),s&&h.push(`--main-fields=${me(s,"main field")}`),o&&h.push(`--conditions=${me(o,"condition")}`),d)for(let P of d)h.push(`--external:${Y(P,"external")}`);if(_)for(let P in _){if(P.indexOf("=")>=0)throw new Error(`Invalid package name in alias: ${P}`);h.push(`--alias:${P}=${Y(_[P],"alias",P)}`)}if(O)for(let P in O){if(P.indexOf("=")>=0)throw new Error(`Invalid banner file type: ${P}`);h.push(`--banner:${P}=${Y(O[P],"banner",P)}`)}if(B)for(let P in B){if(P.indexOf("=")>=0)throw new Error(`Invalid footer file type: ${P}`);h.push(`--footer:${P}=${Y(B[P],"footer",P)}`)}if(w)for(let P of w)h.push(`--inject:${Y(P,"inject")}`);if(c)for(let P in c){if(P.indexOf("=")>=0)throw new Error(`Invalid loader extension: ${P}`);h.push(`--loader:${P}=${Y(c[P],"loader",P)}`)}if(m)for(let P in m){if(P.indexOf("=")>=0)throw new Error(`Invalid out extension: ${P}`);h.push(`--out-extension:${P}=${Y(m[P],"out extension",P)}`)}if(E)if(Array.isArray(E))for(let P=0,se=E.length;P<se;P++){let X=E[P];if(typeof X=="object"&&X!==null){let ee=Object.create(null),ie=i(X,ee,"in",j),K=i(X,ee,"out",j);if(z(X,ee,"in entry point at index "+P),ie===void 0)throw new Error('Missing property "in" for entry point at index '+P);if(K===void 0)throw new Error('Missing property "out" for entry point at index '+P);k.push([K,ie])}else k.push(["",Y(X,"entry point at index "+P)])}else for(let P in E)k.push([P,Y(E[P],"entry point",P)]);if(I){let P=Object.create(null),se=i(I,P,"contents",ze),X=i(I,P,"resolveDir",j),ee=i(I,P,"sourcefile",j),ie=i(I,P,"loader",j);z(I,P,'in "stdin" object'),ee&&h.push(`--sourcefile=${ee}`),ie&&h.push(`--loader=${ie}`),X&&(R=X),typeof se=="string"?D=Z(se):se instanceof Uint8Array&&(D=se)}let re=[];if(u)for(let P of u)P+="",re.push(P);return{entries:k,flags:h,write:U,stdinContents:D,stdinResolveDir:R,absWorkingDir:N,nodePaths:re,mangleCache:Ge(G)}}function ct(e,t,r,a){let g=[],y=Object.create(null);Te(g,t,y,r,a),Je(g,t,y);let h=i(t,y,"sourcemap",Le),k=i(t,y,"sourcefile",j),f=i(t,y,"loader",j),D=i(t,y,"banner",j),R=i(t,y,"footer",j),C=i(t,y,"mangleCache",Q);return z(t,y,`in ${e}() call`),h&&g.push(`--sourcemap=${h===!0?"external":h}`),k&&g.push(`--sourcefile=${k}`),f&&g.push(`--loader=${f}`),D&&g.push(`--banner=${D}`),R&&g.push(`--footer=${R}`),{flags:g,mangleCache:Ge(C)}}function ut(e){const t={},r={didClose:!1,reason:""};let a={},g=0,y=0,h=new Uint8Array(16*1024),k=0,f=S=>{let p=k+S.length;if(p>h.length){let s=new Uint8Array(p*2);s.set(h),h=s}h.set(S,k),k+=S.length;let u=0;for(;u+4<=k;){let s=Me(h,u);if(u+4+s>k)break;u+=4,M(h.subarray(u,u+s)),u+=s}u>0&&(h.copyWithin(0,u,k),k-=u)},D=S=>{r.didClose=!0,S&&(r.reason=": "+(S.message||S));const p="The service was stopped"+r.reason;for(let u in a)a[u](p,null);a={}},R=(S,p,u)=>{if(r.didClose)return u("The service is no longer running"+r.reason,null);let s=g++;a[s]=(o,d)=>{try{u(o,d)}finally{S&&S.unref()}},S&&S.ref(),e.writeToStdin(Ue({id:s,isRequest:!0,value:p}))},C=(S,p)=>{if(r.didClose)throw new Error("The service is no longer running"+r.reason);e.writeToStdin(Ue({id:S,isRequest:!1,value:p}))},V=(S,p)=>le(null,null,function*(){try{if(p.command==="ping"){C(S,{});return}if(typeof p.key=="number"){const u=t[p.key];if(!u)return;const s=u[p.command];if(s){yield s(S,p);return}}throw new Error("Invalid command: "+p.command)}catch(u){const s=[fe(u,e,null,void 0,"")];try{C(S,{errors:s})}catch{}}}),A=!0,M=S=>{if(A){A=!1;let u=String.fromCharCode(...S);if(u!=="0.27.3")throw new Error(`Cannot start service: Host version "0.27.3" does not match binary version ${J(u)}`);return}let p=tt(S);if(p.isRequest)V(p.id,p.value);else{let u=a[p.id];delete a[p.id],p.value.error?u(p.value.error,{}):u(null,p.value)}};return{readFromStdout:f,afterClose:D,service:{buildOrContext:({callName:S,refs:p,options:u,isTTY:s,defaultWD:o,callback:d})=>{let v=0;const _=y++,c={},m={ref(){++v===1&&p&&p.ref()},unref(){--v===0&&(delete t[_],p&&p.unref())}};t[_]=c,m.ref(),ft(S,_,R,C,m,e,c,u,s,o,(x,n)=>{try{d(x,n)}finally{m.unref()}})},transform:({callName:S,refs:p,input:u,options:s,isTTY:o,fs:d,callback:v})=>{const _=qe();let c=m=>{try{if(typeof u!="string"&&!(u instanceof Uint8Array))throw new Error('The input to "transform" must be a string or a Uint8Array');let{flags:x,mangleCache:n}=ct(S,s,o,Ne),l={command:"transform",flags:x,inputFS:m!==null,input:m!==null?Z(m):typeof u=="string"?Z(u):u};n&&(l.mangleCache=n),R(p,l,(b,w)=>{if(b)return v(new Error(b),null);let O=ge(w.errors,_),B=ge(w.warnings,_),E=1,N=()=>{if(--E===0){let I={warnings:B,code:w.code,map:w.map,mangleCache:void 0,legalComments:void 0};"legalComments"in w&&(I.legalComments=w?.legalComments),w.mangleCache&&(I.mangleCache=w?.mangleCache),v(null,I)}};if(O.length>0)return v(be("Transform failed",O,B),null);w.codeFS&&(E++,d.readFile(w.code,(I,U)=>{I!==null?v(I,null):(w.code=U,N())})),w.mapFS&&(E++,d.readFile(w.map,(I,U)=>{I!==null?v(I,null):(w.map=U,N())})),N()})}catch(x){let n=[];try{Te(n,s,{},o,Ne)}catch{}const l=fe(x,e,_,void 0,"");R(p,{command:"error",flags:n,error:l},()=>{l.detail=_.load(l.detail),v(be("Transform failed",[l],[]),null)})}};if((typeof u=="string"||u instanceof Uint8Array)&&u.length>1024*1024){let m=c;c=()=>d.writeFile(u,m)}c(null)},formatMessages:({callName:S,refs:p,messages:u,options:s,callback:o})=>{if(!s)throw new Error(`Missing second argument in ${S}() call`);let d={},v=i(s,d,"kind",j),_=i(s,d,"color",L),c=i(s,d,"terminalWidth",ue);if(z(s,d,`in ${S}() call`),v===void 0)throw new Error(`Missing "kind" in ${S}() call`);if(v!=="error"&&v!=="warning")throw new Error(`Expected "kind" to be "error" or "warning" in ${S}() call`);let m={command:"format-msgs",messages:ne(u,"messages",null,"",c),isWarning:v==="warning"};_!==void 0&&(m.color=_),c!==void 0&&(m.terminalWidth=c),R(p,m,(x,n)=>{if(x)return o(new Error(x),null);o(null,n.messages)})},analyzeMetafile:({callName:S,refs:p,metafile:u,options:s,callback:o})=>{s===void 0&&(s={});let d={},v=i(s,d,"color",L),_=i(s,d,"verbose",L);z(s,d,`in ${S}() call`);let c={command:"analyze-metafile",metafile:u};v!==void 0&&(c.color=v),_!==void 0&&(c.verbose=_),R(p,c,(m,x)=>{if(m)return o(new Error(m),null);o(null,x.result)})}}}}function ft(e,t,r,a,g,y,h,k,f,D,R){const C=qe(),V=e==="context",A=($,W)=>{const T=[];try{Te(T,k,{},f,Fe)}catch{}const S=fe($,y,C,void 0,W);r(g,{command:"error",flags:T,error:S},()=>{S.detail=C.load(S.detail),R(be(V?"Context failed":"Build failed",[S],[]),null)})};let M;if(typeof k=="object"){const $=k.plugins;if($!==void 0){if(!Array.isArray($))return A(new Error('"plugins" must be an array'),"");M=$}}if(M&&M.length>0){if(y.isSync)return A(new Error("Cannot use plugins in synchronous API calls"),"");dt(t,r,a,g,y,h,k,M,C).then($=>{if(!$.ok)return A($.error,$.pluginName);try{F($.requestPlugins,$.runOnEndCallbacks,$.scheduleOnDisposeCallbacks)}catch(W){A(W,"")}},$=>A($,""));return}try{F(null,($,W)=>W([],[]),()=>{})}catch($){A($,"")}function F($,W,T){const S=y.hasFS,{entries:p,flags:u,write:s,stdinContents:o,stdinResolveDir:d,absWorkingDir:v,nodePaths:_,mangleCache:c}=at(e,k,f,Fe,S);if(s&&!y.hasFS)throw new Error('The "write" option is unavailable in this environment');const m={command:"build",key:t,entries:p,flags:u,write:s,stdinContents:o,stdinResolveDir:d,absWorkingDir:v||D,nodePaths:_,context:V};$&&(m.plugins=$),c&&(m.mangleCache=c);const x=(b,w)=>{const O={errors:ge(b.errors,C),warnings:ge(b.warnings,C),outputFiles:void 0,metafile:void 0,mangleCache:void 0},B=O.errors.slice(),E=O.warnings.slice();b.outputFiles&&(O.outputFiles=b.outputFiles.map(mt)),b.metafile&&(O.metafile=JSON.parse(b.metafile)),b.mangleCache&&(O.mangleCache=b.mangleCache),b.writeToStdout!==void 0&&console.log(he(b.writeToStdout).replace(/\n$/,"")),W(O,(N,I)=>{if(B.length>0||N.length>0){const U=be("Build failed",B.concat(N),E.concat(I));return w(U,null,N,I)}w(null,O,N,I)})};let n,l;V&&(h["on-end"]=(b,w)=>new Promise(O=>{x(w,(B,E,N,I)=>{const U={errors:N,warnings:I};l&&l(B,E),n=void 0,l=void 0,a(b,U),O()})})),r(g,m,(b,w)=>{if(b)return R(new Error(b),null);if(!V)return x(w,(E,N)=>(T(),R(E,N)));if(w.errors.length>0)return R(be("Context failed",w.errors,w.warnings),null);let O=!1;const B={rebuild:()=>(n||(n=new Promise((E,N)=>{let I;l=(H,G)=>{I||(I=()=>H?N(H):E(G))};const U=()=>{r(g,{command:"rebuild",key:t},(G,re)=>{G?N(new Error(G)):I?I():U()})};U()})),n),watch:(E={})=>new Promise((N,I)=>{if(!y.hasFS)throw new Error('Cannot use the "watch" API in this environment');const U={},H=i(E,U,"delay",ue);z(E,U,"in watch() call");const G={command:"watch",key:t};H&&(G.delay=H),r(g,G,re=>{re?I(new Error(re)):N(void 0)})}),serve:(E={})=>new Promise((N,I)=>{if(!y.hasFS)throw new Error('Cannot use the "serve" API in this environment');const U={},H=i(E,U,"port",nt),G=i(E,U,"host",j),re=i(E,U,"servedir",j),P=i(E,U,"keyfile",j),se=i(E,U,"certfile",j),X=i(E,U,"fallback",j),ee=i(E,U,"cors",Q),ie=i(E,U,"onRequest",Ve);z(E,U,"in serve() call");const K={command:"serve",key:t,onRequest:!!ie};if(H!==void 0&&(K.port=H),G!==void 0&&(K.host=G),re!==void 0&&(K.servedir=re),P!==void 0&&(K.keyfile=P),se!==void 0&&(K.certfile=se),X!==void 0&&(K.fallback=X),ee){const xe={},pe=i(ee,xe,"origin",We);z(ee,xe,'on "cors" object'),Array.isArray(pe)?K.corsOrigin=pe:pe!==void 0&&(K.corsOrigin=[pe])}r(g,K,(xe,pe)=>{if(xe)return I(new Error(xe));ie&&(h["serve-request"]=(Pt,Ot)=>{ie(Ot.args),a(Pt,{})}),N(pe)})}),cancel:()=>new Promise(E=>{if(O)return E();r(g,{command:"cancel",key:t},()=>{E()})}),dispose:()=>new Promise(E=>{if(O)return E();O=!0,r(g,{command:"dispose",key:t},()=>{E(),T(),g.unref()})})};g.ref(),R(null,B)})}}var dt=(e,t,r,a,g,y,h,k,f)=>le(null,null,function*(){let D=[],R=[],C={},V={},A=[],M=0,F=0,$=[],W=!1;k=[...k];for(let p of k){let u={};if(typeof p!="object")throw new Error(`Plugin at index ${F} must be an object`);const s=i(p,u,"name",j);if(typeof s!="string"||s==="")throw new Error(`Plugin at index ${F} is missing a name`);try{let o=i(p,u,"setup",Ve);if(typeof o!="function")throw new Error("Plugin is missing a setup function");z(p,u,`on plugin ${J(s)}`);let d={name:s,onStart:!1,onEnd:!1,onResolve:[],onLoad:[]};F++;let _=o({initialOptions:h,resolve:(c,m={})=>{if(!W)throw new Error('Cannot call "resolve" before plugin setup has completed');if(typeof c!="string")throw new Error("The path to resolve must be a string");let x=Object.create(null),n=i(m,x,"pluginName",j),l=i(m,x,"importer",j),b=i(m,x,"namespace",j),w=i(m,x,"resolveDir",j),O=i(m,x,"kind",j),B=i(m,x,"pluginData",ke),E=i(m,x,"with",Q);return z(m,x,"in resolve() call"),new Promise((N,I)=>{const U={command:"resolve",path:c,key:e,pluginName:s};if(n!=null&&(U.pluginName=n),l!=null&&(U.importer=l),b!=null&&(U.namespace=b),w!=null&&(U.resolveDir=w),O!=null)U.kind=O;else throw new Error('Must specify "kind" when calling "resolve"');B!=null&&(U.pluginData=f.store(B)),E!=null&&(U.with=ht(E,"with")),t(a,U,(H,G)=>{H!==null?I(new Error(H)):N({errors:ge(G.errors,f),warnings:ge(G.warnings,f),path:G.path,external:G.external,sideEffects:G.sideEffects,namespace:G.namespace,suffix:G.suffix,pluginData:f.load(G.pluginData)})})})},onStart(c){let m='This error came from the "onStart" callback registered here:',x=$e(new Error(m),g,"onStart");D.push({name:s,callback:c,note:x}),d.onStart=!0},onEnd(c){let m='This error came from the "onEnd" callback registered here:',x=$e(new Error(m),g,"onEnd");R.push({name:s,callback:c,note:x}),d.onEnd=!0},onResolve(c,m){let x='This error came from the "onResolve" callback registered here:',n=$e(new Error(x),g,"onResolve"),l={},b=i(c,l,"filter",Se),w=i(c,l,"namespace",j);if(z(c,l,`in onResolve() call for plugin ${J(s)}`),b==null)throw new Error("onResolve() call is missing a filter");let O=M++;C[O]={name:s,callback:m,note:n},d.onResolve.push({id:O,filter:Pe(b),namespace:w||""})},onLoad(c,m){let x='This error came from the "onLoad" callback registered here:',n=$e(new Error(x),g,"onLoad"),l={},b=i(c,l,"filter",Se),w=i(c,l,"namespace",j);if(z(c,l,`in onLoad() call for plugin ${J(s)}`),b==null)throw new Error("onLoad() call is missing a filter");let O=M++;V[O]={name:s,callback:m,note:n},d.onLoad.push({id:O,filter:Pe(b),namespace:w||""})},onDispose(c){A.push(c)},esbuild:g.esbuild});_&&(yield _),$.push(d)}catch(o){return{ok:!1,error:o,pluginName:s}}}y["on-start"]=(p,u)=>le(null,null,function*(){f.clear();let s={errors:[],warnings:[]};yield Promise.all(D.map(o=>le(null,[o],function*({name:d,callback:v,note:_}){try{let c=yield v();if(c!=null){if(typeof c!="object")throw new Error(`Expected onStart() callback in plugin ${J(d)} to return an object`);let m={},x=i(c,m,"errors",te),n=i(c,m,"warnings",te);z(c,m,`from onStart() callback in plugin ${J(d)}`),x!=null&&s.errors.push(...ne(x,"errors",f,d,void 0)),n!=null&&s.warnings.push(...ne(n,"warnings",f,d,void 0))}}catch(c){s.errors.push(fe(c,g,f,_&&_(),d))}}))),r(p,s)}),y["on-resolve"]=(p,u)=>le(null,null,function*(){let s={},o="",d,v;for(let _ of u.ids)try{({name:o,callback:d,note:v}=C[_]);let c=yield d({path:u.path,importer:u.importer,namespace:u.namespace,resolveDir:u.resolveDir,kind:u.kind,pluginData:f.load(u.pluginData),with:u.with});if(c!=null){if(typeof c!="object")throw new Error(`Expected onResolve() callback in plugin ${J(o)} to return an object`);let m={},x=i(c,m,"pluginName",j),n=i(c,m,"path",j),l=i(c,m,"namespace",j),b=i(c,m,"suffix",j),w=i(c,m,"external",L),O=i(c,m,"sideEffects",L),B=i(c,m,"pluginData",ke),E=i(c,m,"errors",te),N=i(c,m,"warnings",te),I=i(c,m,"watchFiles",q),U=i(c,m,"watchDirs",q);z(c,m,`from onResolve() callback in plugin ${J(o)}`),s.id=_,x!=null&&(s.pluginName=x),n!=null&&(s.path=n),l!=null&&(s.namespace=l),b!=null&&(s.suffix=b),w!=null&&(s.external=w),O!=null&&(s.sideEffects=O),B!=null&&(s.pluginData=f.store(B)),E!=null&&(s.errors=ne(E,"errors",f,o,void 0)),N!=null&&(s.warnings=ne(N,"warnings",f,o,void 0)),I!=null&&(s.watchFiles=je(I,"watchFiles")),U!=null&&(s.watchDirs=je(U,"watchDirs"));break}}catch(c){s={id:_,errors:[fe(c,g,f,v&&v(),o)]};break}r(p,s)}),y["on-load"]=(p,u)=>le(null,null,function*(){let s={},o="",d,v;for(let _ of u.ids)try{({name:o,callback:d,note:v}=V[_]);let c=yield d({path:u.path,namespace:u.namespace,suffix:u.suffix,pluginData:f.load(u.pluginData),with:u.with});if(c!=null){if(typeof c!="object")throw new Error(`Expected onLoad() callback in plugin ${J(o)} to return an object`);let m={},x=i(c,m,"pluginName",j),n=i(c,m,"contents",ze),l=i(c,m,"resolveDir",j),b=i(c,m,"pluginData",ke),w=i(c,m,"loader",j),O=i(c,m,"errors",te),B=i(c,m,"warnings",te),E=i(c,m,"watchFiles",q),N=i(c,m,"watchDirs",q);z(c,m,`from onLoad() callback in plugin ${J(o)}`),s.id=_,x!=null&&(s.pluginName=x),n instanceof Uint8Array?s.contents=n:n!=null&&(s.contents=Z(n)),l!=null&&(s.resolveDir=l),b!=null&&(s.pluginData=f.store(b)),w!=null&&(s.loader=w),O!=null&&(s.errors=ne(O,"errors",f,o,void 0)),B!=null&&(s.warnings=ne(B,"warnings",f,o,void 0)),E!=null&&(s.watchFiles=je(E,"watchFiles")),N!=null&&(s.watchDirs=je(N,"watchDirs"));break}}catch(c){s={id:_,errors:[fe(c,g,f,v&&v(),o)]};break}r(p,s)});let T=(p,u)=>u([],[]);R.length>0&&(T=(p,u)=>{le(null,null,function*(){const s=[],o=[];for(const{name:d,callback:v,note:_}of R){let c,m;try{const x=yield v(p);if(x!=null){if(typeof x!="object")throw new Error(`Expected onEnd() callback in plugin ${J(d)} to return an object`);let n={},l=i(x,n,"errors",te),b=i(x,n,"warnings",te);z(x,n,`from onEnd() callback in plugin ${J(d)}`),l!=null&&(c=ne(l,"errors",f,d,void 0)),b!=null&&(m=ne(b,"warnings",f,d,void 0))}}catch(x){c=[fe(x,g,f,_&&_(),d)]}if(c){s.push(...c);try{p.errors.push(...c)}catch{}}if(m){o.push(...m);try{p.warnings.push(...m)}catch{}}}u(s,o)})});let S=()=>{for(const p of A)setTimeout(()=>p(),0)};return W=!0,{ok:!0,requestPlugins:$,runOnEndCallbacks:T,scheduleOnDisposeCallbacks:S}});function qe(){const e=new Map;let t=0;return{clear(){e.clear()},load(r){return e.get(r)},store(r){if(r===void 0)return-1;const a=t++;return e.set(a,r),a}}}function $e(e,t,r){let a,g=!1;return()=>{if(g)return a;g=!0;try{let y=(e.stack+"").split(`
|
|
7
|
+
`);y.splice(1,1);let h=Ye(t,y,r);if(h)return a={text:e.message,location:h},a}catch{}}}function fe(e,t,r,a,g){let y="Internal error",h=null;try{y=(e&&e.message||e)+""}catch{}try{h=Ye(t,(e.stack+"").split(`
|
|
8
|
+
`),"")}catch{}return{id:"",pluginName:g,text:y,location:h,notes:a?[a]:[],detail:r?r.store(e):-1}}function Ye(e,t,r){let a=" at ";if(e.readFileSync&&!t[0].startsWith(a)&&t[1].startsWith(a))for(let g=1;g<t.length;g++){let y=t[g];if(y.startsWith(a))for(y=y.slice(a.length);;){let h=/^(?:new |async )?\S+ \((.*)\)$/.exec(y);if(h){y=h[1];continue}if(h=/^eval at \S+ \((.*)\)(?:, \S+:\d+:\d+)?$/.exec(y),h){y=h[1];continue}if(h=/^(\S+):(\d+):(\d+)$/.exec(y),h){let k;try{k=e.readFileSync(h[1],"utf8")}catch{break}let f=k.split(/\r\n|\r|\n|\u2028|\u2029/)[+h[2]-1]||"",D=+h[3]-1,R=f.slice(D,D+r.length)===r?r.length:0;return{file:h[1],namespace:"file",line:+h[2],column:Z(f.slice(0,D)).length,length:Z(f.slice(D,D+R)).length,lineText:f+`
|
|
9
9
|
`+t.slice(1).join(`
|
|
10
10
|
`),suggestion:""}}break}}return null}function be(e,t,r){let a=5;e+=t.length<1?"":` with ${t.length} error${t.length<2?"":"s"}:`+t.slice(0,a+1).map((y,h)=>{if(h===a)return`
|
|
11
11
|
...`;if(!y.location)return`
|
|
12
12
|
error: ${y.text}`;let{file:k,line:f,column:D}=y.location,R=y.pluginName?`[plugin: ${y.pluginName}] `:"";return`
|
|
13
|
-
${k}:${f}:${D}: ERROR: ${R}${y.text}`}).join("");let g=new Error(e);for(const[y,h]of[["errors",t],["warnings",r]])Object.defineProperty(g,y,{configurable:!0,enumerable:!0,get:()=>h,set:k=>Object.defineProperty(g,y,{configurable:!0,enumerable:!0,value:k})});return g}function ge(e,t){for(const r of e)r.detail=t.load(r.detail);return e}function
|
|
13
|
+
${k}:${f}:${D}: ERROR: ${R}${y.text}`}).join("");let g=new Error(e);for(const[y,h]of[["errors",t],["warnings",r]])Object.defineProperty(g,y,{configurable:!0,enumerable:!0,get:()=>h,set:k=>Object.defineProperty(g,y,{configurable:!0,enumerable:!0,value:k})});return g}function ge(e,t){for(const r of e)r.detail=t.load(r.detail);return e}function He(e,t,r){if(e==null)return null;let a={},g=i(e,a,"file",j),y=i(e,a,"namespace",j),h=i(e,a,"line",ue),k=i(e,a,"column",ue),f=i(e,a,"length",ue),D=i(e,a,"lineText",j),R=i(e,a,"suggestion",j);if(z(e,a,t),D){const C=D.slice(0,(k&&k>0?k:0)+(f&&f>0?f:0)+(r&&r>0?r:80));!/[\x7F-\uFFFF]/.test(C)&&!/\n/.test(D)&&(D=C)}return{file:g||"",namespace:y||"",line:h||0,column:k||0,length:f||0,lineText:D||"",suggestion:R||""}}function ne(e,t,r,a,g){let y=[],h=0;for(const k of e){let f={},D=i(k,f,"id",j),R=i(k,f,"pluginName",j),C=i(k,f,"text",j),V=i(k,f,"location",Be),A=i(k,f,"notes",te),M=i(k,f,"detail",ke),F=`in element ${h} of "${t}"`;z(k,f,F);let $=[];if(A)for(const W of A){let T={},S=i(W,T,"text",j),p=i(W,T,"location",Be);z(W,T,F),$.push({text:S||"",location:He(p,F,g)})}y.push({id:D||"",pluginName:R||a,text:C||"",location:He(V,F,g),notes:$,detail:r?r.store(M):-1}),h++}return y}function je(e,t){const r=[];for(const a of e){if(typeof a!="string")throw new Error(`${J(t)} must be an array of strings`);r.push(a)}return r}function ht(e,t){const r=Object.create(null);for(const a in e){const g=e[a];if(typeof g!="string")throw new Error(`key ${J(a)} in object ${J(t)} must be a string`);r[a]=g}return r}function mt({path:e,contents:t,hash:r}){let a=null;return{path:e,contents:t,hash:r,get text(){const g=this.contents;return(a===null||g!==t)&&(t=g,a=he(g)),a}}}function Pe(e){let t=e.source;return e.flags&&(t=`(?${e.flags})${t}`),t}var gt="0.27.3",pt=e=>ve().build(e),yt=e=>ve().context(e),wt=(e,t)=>ve().transform(e,t),bt=(e,t)=>ve().formatMessages(e,t),vt=(e,t)=>ve().analyzeMetafile(e,t),xt=()=>{throw new Error('The "buildSync" API only works in node')},_t=()=>{throw new Error('The "transformSync" API only works in node')},Et=()=>{throw new Error('The "formatMessagesSync" API only works in node')},kt=()=>{throw new Error('The "analyzeMetafileSync" API only works in node')},St=()=>(Oe&&Oe(),Promise.resolve()),de,Oe,Ce,ve=()=>{if(Ce)return Ce;throw de?new Error('You need to wait for the promise returned from "initialize" to be resolved before calling this'):new Error('You need to call "initialize" before calling this')},Tt=e=>{e=ot(e||{});let t=e.wasmURL,r=e.wasmModule,a=e.worker!==!1;if(!t&&!r)throw new Error('Must provide either the "wasmURL" option or the "wasmModule" option');if(de)throw new Error('Cannot call "initialize" more than once');return de=$t(t||"",r,a),de.catch(()=>{de=void 0}),de},$t=(e,t,r)=>le(null,null,function*(){let a,g;const y=new Promise(C=>g=C);if(r){let C=new Blob([`onmessage=((postMessage) => {
|
|
14
14
|
// Copyright 2018 The Go Authors. All rights reserved.
|
|
15
15
|
// Use of this source code is governed by a BSD-style
|
|
16
16
|
// license that can be found in the LICENSE file.
|
|
@@ -691,4 +691,4 @@ ${k}:${f}:${D}: ERROR: ${R}${y.text}`}).join("");let g=new Error(e);for(const[y,
|
|
|
691
691
|
})(postMessage)`],{type:"text/javascript"});a=new Worker(URL.createObjectURL(C))}else{let C=(A=>{var M=(T,S,p)=>new Promise((u,s)=>{var o=_=>{try{v(p.next(_))}catch(c){s(c)}},d=_=>{try{v(p.throw(_))}catch(c){s(c)}},v=_=>_.done?u(_.value):Promise.resolve(_.value).then(o,d);v((p=p.apply(T,S)).next())});let F,$={};for(let T=self;T;T=Object.getPrototypeOf(T))for(let S of Object.getOwnPropertyNames(T))S in $||Object.defineProperty($,S,{get:()=>self[S]});(()=>{const T=()=>{const u=new Error("not implemented");return u.code="ENOSYS",u};if(!$.fs){let u="";$.fs={constants:{O_WRONLY:-1,O_RDWR:-1,O_CREAT:-1,O_TRUNC:-1,O_APPEND:-1,O_EXCL:-1,O_DIRECTORY:-1},writeSync(s,o){u+=p.decode(o);const d=u.lastIndexOf(`
|
|
692
692
|
`);return d!=-1&&(console.log(u.substring(0,d)),u=u.substring(d+1)),o.length},write(s,o,d,v,_,c){if(d!==0||v!==o.length||_!==null){c(T());return}const m=this.writeSync(s,o);c(null,m)},chmod(s,o,d){d(T())},chown(s,o,d,v){v(T())},close(s,o){o(T())},fchmod(s,o,d){d(T())},fchown(s,o,d,v){v(T())},fstat(s,o){o(T())},fsync(s,o){o(null)},ftruncate(s,o,d){d(T())},lchown(s,o,d,v){v(T())},link(s,o,d){d(T())},lstat(s,o){o(T())},mkdir(s,o,d){d(T())},open(s,o,d,v){v(T())},read(s,o,d,v,_,c){c(T())},readdir(s,o){o(T())},readlink(s,o){o(T())},rename(s,o,d){d(T())},rmdir(s,o){o(T())},stat(s,o){o(T())},symlink(s,o,d){d(T())},truncate(s,o,d){d(T())},unlink(s,o){o(T())},utimes(s,o,d,v){v(T())}}}if($.process||($.process={getuid(){return-1},getgid(){return-1},geteuid(){return-1},getegid(){return-1},getgroups(){throw T()},pid:-1,ppid:-1,umask(){throw T()},cwd(){throw T()},chdir(){throw T()}}),$.path||($.path={resolve(...u){return u.join("/")}}),!$.crypto)throw new Error("globalThis.crypto is not available, polyfill required (crypto.getRandomValues only)");if(!$.performance)throw new Error("globalThis.performance is not available, polyfill required (performance.now only)");if(!$.TextEncoder)throw new Error("globalThis.TextEncoder is not available, polyfill required");if(!$.TextDecoder)throw new Error("globalThis.TextDecoder is not available, polyfill required");const S=new TextEncoder("utf-8"),p=new TextDecoder("utf-8");$.Go=class{constructor(){this.argv=["js"],this.env={},this.exit=n=>{n!==0&&console.warn("exit code:",n)},this._exitPromise=new Promise(n=>{this._resolveExitPromise=n}),this._pendingEvent=null,this._scheduledTimeouts=new Map,this._nextCallbackTimeoutID=1;const u=(n,l)=>{this.mem.setUint32(n+0,l,!0),this.mem.setUint32(n+4,Math.floor(l/4294967296),!0)},s=n=>{const l=this.mem.getUint32(n+0,!0),b=this.mem.getInt32(n+4,!0);return l+b*4294967296},o=n=>{const l=this.mem.getFloat64(n,!0);if(l===0)return;if(!isNaN(l))return l;const b=this.mem.getUint32(n,!0);return this._values[b]},d=(n,l)=>{if(typeof l=="number"&&l!==0){if(isNaN(l)){this.mem.setUint32(n+4,2146959360,!0),this.mem.setUint32(n,0,!0);return}this.mem.setFloat64(n,l,!0);return}if(l===void 0){this.mem.setFloat64(n,0,!0);return}let w=this._ids.get(l);w===void 0&&(w=this._idPool.pop(),w===void 0&&(w=this._values.length),this._values[w]=l,this._goRefCounts[w]=0,this._ids.set(l,w)),this._goRefCounts[w]++;let O=0;switch(typeof l){case"object":l!==null&&(O=1);break;case"string":O=2;break;case"symbol":O=3;break;case"function":O=4;break}this.mem.setUint32(n+4,2146959360|O,!0),this.mem.setUint32(n,w,!0)},v=n=>{const l=s(n+0),b=s(n+8);return new Uint8Array(this._inst.exports.mem.buffer,l,b)},_=n=>{const l=s(n+0),b=s(n+8),w=new Array(b);for(let O=0;O<b;O++)w[O]=o(l+O*8);return w},c=n=>{const l=s(n+0),b=s(n+8);return p.decode(new DataView(this._inst.exports.mem.buffer,l,b))},m=(n,l)=>(this._inst.exports.testExport0(),this._inst.exports.testExport(n,l)),x=Date.now()-performance.now();this.importObject={_gotest:{add:(n,l)=>n+l,callExport:m},gojs:{"runtime.wasmExit":n=>{n>>>=0;const l=this.mem.getInt32(n+8,!0);this.exited=!0,delete this._inst,delete this._values,delete this._goRefCounts,delete this._ids,delete this._idPool,this.exit(l)},"runtime.wasmWrite":n=>{n>>>=0;const l=s(n+8),b=s(n+16),w=this.mem.getInt32(n+24,!0);$.fs.writeSync(l,new Uint8Array(this._inst.exports.mem.buffer,b,w))},"runtime.resetMemoryDataView":n=>{this.mem=new DataView(this._inst.exports.mem.buffer)},"runtime.nanotime1":n=>{n>>>=0,u(n+8,(x+performance.now())*1e6)},"runtime.walltime":n=>{n>>>=0;const l=new Date().getTime();u(n+8,l/1e3),this.mem.setInt32(n+16,l%1e3*1e6,!0)},"runtime.scheduleTimeoutEvent":n=>{n>>>=0;const l=this._nextCallbackTimeoutID;this._nextCallbackTimeoutID++,this._scheduledTimeouts.set(l,setTimeout(()=>{for(this._resume();this._scheduledTimeouts.has(l);)console.warn("scheduleTimeoutEvent: missed timeout event"),this._resume()},s(n+8))),this.mem.setInt32(n+16,l,!0)},"runtime.clearTimeoutEvent":n=>{n>>>=0;const l=this.mem.getInt32(n+8,!0);clearTimeout(this._scheduledTimeouts.get(l)),this._scheduledTimeouts.delete(l)},"runtime.getRandomData":n=>{n>>>=0,crypto.getRandomValues(v(n+8))},"syscall/js.finalizeRef":n=>{n>>>=0;const l=this.mem.getUint32(n+8,!0);if(this._goRefCounts[l]--,this._goRefCounts[l]===0){const b=this._values[l];this._values[l]=null,this._ids.delete(b),this._idPool.push(l)}},"syscall/js.stringVal":n=>{n>>>=0,d(n+24,c(n+8))},"syscall/js.valueGet":n=>{n>>>=0;const l=Reflect.get(o(n+8),c(n+16));n=this._inst.exports.getsp()>>>0,d(n+32,l)},"syscall/js.valueSet":n=>{n>>>=0,Reflect.set(o(n+8),c(n+16),o(n+32))},"syscall/js.valueDelete":n=>{n>>>=0,Reflect.deleteProperty(o(n+8),c(n+16))},"syscall/js.valueIndex":n=>{n>>>=0,d(n+24,Reflect.get(o(n+8),s(n+16)))},"syscall/js.valueSetIndex":n=>{n>>>=0,Reflect.set(o(n+8),s(n+16),o(n+24))},"syscall/js.valueCall":n=>{n>>>=0;try{const l=o(n+8),b=Reflect.get(l,c(n+16)),w=_(n+32),O=Reflect.apply(b,l,w);n=this._inst.exports.getsp()>>>0,d(n+56,O),this.mem.setUint8(n+64,1)}catch(l){n=this._inst.exports.getsp()>>>0,d(n+56,l),this.mem.setUint8(n+64,0)}},"syscall/js.valueInvoke":n=>{n>>>=0;try{const l=o(n+8),b=_(n+16),w=Reflect.apply(l,void 0,b);n=this._inst.exports.getsp()>>>0,d(n+40,w),this.mem.setUint8(n+48,1)}catch(l){n=this._inst.exports.getsp()>>>0,d(n+40,l),this.mem.setUint8(n+48,0)}},"syscall/js.valueNew":n=>{n>>>=0;try{const l=o(n+8),b=_(n+16),w=Reflect.construct(l,b);n=this._inst.exports.getsp()>>>0,d(n+40,w),this.mem.setUint8(n+48,1)}catch(l){n=this._inst.exports.getsp()>>>0,d(n+40,l),this.mem.setUint8(n+48,0)}},"syscall/js.valueLength":n=>{n>>>=0,u(n+16,parseInt(o(n+8).length))},"syscall/js.valuePrepareString":n=>{n>>>=0;const l=S.encode(String(o(n+8)));d(n+16,l),u(n+24,l.length)},"syscall/js.valueLoadString":n=>{n>>>=0;const l=o(n+8);v(n+16).set(l)},"syscall/js.valueInstanceOf":n=>{n>>>=0,this.mem.setUint8(n+24,o(n+8)instanceof o(n+16)?1:0)},"syscall/js.copyBytesToGo":n=>{n>>>=0;const l=v(n+8),b=o(n+32);if(!(b instanceof Uint8Array||b instanceof Uint8ClampedArray)){this.mem.setUint8(n+48,0);return}const w=b.subarray(0,l.length);l.set(w),u(n+40,w.length),this.mem.setUint8(n+48,1)},"syscall/js.copyBytesToJS":n=>{n>>>=0;const l=o(n+8),b=v(n+16);if(!(l instanceof Uint8Array||l instanceof Uint8ClampedArray)){this.mem.setUint8(n+48,0);return}const w=b.subarray(0,l.length);l.set(w),u(n+40,w.length),this.mem.setUint8(n+48,1)},debug:n=>{console.log(n)}}}}run(u){return M(this,null,function*(){if(!(u instanceof WebAssembly.Instance))throw new Error("Go.run: WebAssembly.Instance expected");this._inst=u,this.mem=new DataView(this._inst.exports.mem.buffer),this._values=[NaN,0,null,!0,!1,$,this],this._goRefCounts=new Array(this._values.length).fill(1/0),this._ids=new Map([[0,1],[null,2],[!0,3],[!1,4],[$,5],[this,6]]),this._idPool=[],this.exited=!1;let s=4096;const o=x=>{const n=s,l=S.encode(x+"\0");return new Uint8Array(this.mem.buffer,s,l.length).set(l),s+=l.length,s%8!==0&&(s+=8-s%8),n},d=this.argv.length,v=[];this.argv.forEach(x=>{v.push(o(x))}),v.push(0),Object.keys(this.env).sort().forEach(x=>{v.push(o(`${x}=${this.env[x]}`))}),v.push(0);const c=s;if(v.forEach(x=>{this.mem.setUint32(s,x,!0),this.mem.setUint32(s+4,0,!0),s+=8}),s>=12288)throw new Error("total length of command line and environment variables exceeds limit");this._inst.exports.run(d,c),this.exited&&this._resolveExitPromise(),yield this._exitPromise})}_resume(){if(this.exited)throw new Error("Go program has already exited");this._inst.exports.resume(),this.exited&&this._resolveExitPromise()}_makeFuncWrapper(u){const s=this;return function(){const o={id:u,this:this,args:arguments};return s._pendingEvent=o,s._resume(),o.result}}}})(),F=({data:T})=>{let S=new TextDecoder,p=$.fs,u="";p.writeSync=(_,c)=>{if(_===1)A(c);else if(_===2){u+=S.decode(c);let m=u.split(`
|
|
693
693
|
`);m.length>1&&console.log(m.slice(0,-1).join(`
|
|
694
|
-
`)),u=m[m.length-1]}else throw new Error("Bad write");return c.length};let s=[],o,d=0;F=({data:_})=>(_.length>0&&(s.push(_),o&&o()),v),p.read=(_,c,m,x,n,l)=>{if(_!==0||m!==0||x!==c.length||n!==null)throw new Error("Bad read");if(s.length===0){o=()=>p.read(_,c,m,x,n,l);return}let b=s[0],w=Math.max(0,Math.min(x,b.length-d));c.set(b.subarray(d,d+w),m),d+=w,d===b.length&&(s.shift(),d=0),l(null,w)};let v=new $.Go;return v.argv=["","--service=0.27.3"],W(T,v).then(_=>{A(null),v.run(_)},_=>{A(_)}),v};function W(T,S){return M(this,null,function*(){if(T instanceof WebAssembly.Module)return WebAssembly.instantiate(T,S.importObject);const p=yield fetch(T);if(!p.ok)throw new Error(`Failed to download ${JSON.stringify(T)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(p.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(p,S.importObject)).instance;const u=yield p.arrayBuffer();return(yield WebAssembly.instantiate(u,S.importObject)).instance})}return T=>F(T)})(A=>a.onmessage({data:A})),V;a={onmessage:null,postMessage:A=>setTimeout(()=>{try{V=C({data:A})}catch(M){g(M)}}),terminate(){if(V)for(let A of V._scheduledTimeouts.values())clearTimeout(A)}}}let h,k;const f=new Promise((C,V)=>{h=C,k=V});a.onmessage=({data:C})=>{a.onmessage=({data:V})=>D(V),C?k(C):h()},a.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:D,service:R}=
|
|
694
|
+
`)),u=m[m.length-1]}else throw new Error("Bad write");return c.length};let s=[],o,d=0;F=({data:_})=>(_.length>0&&(s.push(_),o&&o()),v),p.read=(_,c,m,x,n,l)=>{if(_!==0||m!==0||x!==c.length||n!==null)throw new Error("Bad read");if(s.length===0){o=()=>p.read(_,c,m,x,n,l);return}let b=s[0],w=Math.max(0,Math.min(x,b.length-d));c.set(b.subarray(d,d+w),m),d+=w,d===b.length&&(s.shift(),d=0),l(null,w)};let v=new $.Go;return v.argv=["","--service=0.27.3"],W(T,v).then(_=>{A(null),v.run(_)},_=>{A(_)}),v};function W(T,S){return M(this,null,function*(){if(T instanceof WebAssembly.Module)return WebAssembly.instantiate(T,S.importObject);const p=yield fetch(T);if(!p.ok)throw new Error(`Failed to download ${JSON.stringify(T)}`);if("instantiateStreaming"in WebAssembly&&/^application\/wasm($|;)/i.test(p.headers.get("Content-Type")||""))return(yield WebAssembly.instantiateStreaming(p,S.importObject)).instance;const u=yield p.arrayBuffer();return(yield WebAssembly.instantiate(u,S.importObject)).instance})}return T=>F(T)})(A=>a.onmessage({data:A})),V;a={onmessage:null,postMessage:A=>setTimeout(()=>{try{V=C({data:A})}catch(M){g(M)}}),terminate(){if(V)for(let A of V._scheduledTimeouts.values())clearTimeout(A)}}}let h,k;const f=new Promise((C,V)=>{h=C,k=V});a.onmessage=({data:C})=>{a.onmessage=({data:V})=>D(V),C?k(C):h()},a.postMessage(t||new URL(e,location.href).toString());let{readFromStdout:D,service:R}=ut({writeToStdin(C){a.postMessage(C)},isSync:!1,hasFS:!1,esbuild:Ee});yield f,Oe=()=>{a.terminate(),de=void 0,Oe=void 0,Ce=void 0},Ce={build:C=>new Promise((V,A)=>{y.then(A),R.buildOrContext({callName:"build",refs:null,options:C,isTTY:!1,defaultWD:"/",callback:(M,F)=>M?A(M):V(F)})}),context:C=>new Promise((V,A)=>{y.then(A),R.buildOrContext({callName:"context",refs:null,options:C,isTTY:!1,defaultWD:"/",callback:(M,F)=>M?A(M):V(F)})}),transform:(C,V)=>new Promise((A,M)=>{y.then(M),R.transform({callName:"transform",refs:null,input:C,options:V||{},isTTY:!1,fs:{readFile(F,$){$(new Error("Internal error"),null)},writeFile(F,$){$(null)}},callback:(F,$)=>F?M(F):A($)})}),formatMessages:(C,V)=>new Promise((A,M)=>{y.then(M),R.formatMessages({callName:"formatMessages",refs:null,messages:C,options:V,callback:(F,$)=>F?M(F):A($)})}),analyzeMetafile:(C,V)=>new Promise((A,M)=>{y.then(M),R.analyzeMetafile({callName:"analyzeMetafile",refs:null,metafile:typeof C=="string"?C:JSON.stringify(C),options:V,callback:(F,$)=>F?M(F):A($)})})}}),jt=Ee})(ye)})(Re)),Re.exports}var Xe=Dt();const Rt=Ct(Xe),It=At({__proto__:null,default:Rt},[Xe]);export{It as b};
|