1var Q=Object.defineProperty;var Y=(g,r,e)=>r in g?Q(g,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):g[r]=e;var A=(g,r,e)=>(Y(g,typeof r!="symbol"?r+"":r,e),e);import{u as W,p as ee,a as T}from"./index.75286c5a.js";import{g as oe,r as te,u as ne,a as ae}from"./index.esm2017.aa2b231e.js";import"./CustWalls.24551b66.js";import{_ as R,r as s,w as I,c as O,d as E,e as f,t as k,h as le,u as h,f as se,F as V,o as ie,i as re,m as $}from"./_plugin-vue_export-helper.f09dc1ee.js";import"./ToolUI.ebc298a2.js";import"./TopLeftMenu.vue_vue_type_style_index_0_scoped_f4dbed34_lang.809c15c5.js";import"./morecapbutton.44e58599.js";import"./qrcode.vue.esm.4be65f4b.js";import{u as ce}from"./vue-router.51ed5a46.js";import{v as ue}from"./runtime-dom.esm-bundler.0e07a42a.js";import{T as de,d as F,s as pe,h as ve,q as ge,A as be,K as fe}from"./index.bf278bd0.js";import{M as me}from"./MainUI.1f50680a.js";import"./MaxSetUI.41b16848.js";/* empty css */import"./TopLeftMenuListProd2.e043b58c.js";const ye={class:"airwallbutton8"},we={key:0,class:"airwall-source"},Se={__name:"AddCuratedBranding",props:{proposalID:{type:String,required:!0}},setup(g){const r=g,e=W(),c=s(null);I(()=>e.selectedModel,()=>{console.log("model swap, reset wallscenObject:",e.selectedModel,e.brandingSceneObject),e.brandingSceneObject&&(e.brandingSceneObject.stop(),e.brandingSceneObject=null)});const d=s(0);function N(){d.value<3?(d.value++,u.value.inputs.selection=a.value[P.value]):d.value=0,console.log("aircontrol",d.value),d.value===0?u.value.inputs.selection=null:d.value===1?u.value.inputs.mode="translate":d.value===2?u.value.inputs.mode="scale":d.value===3&&(u.value.inputs.mode="rotate"),console.log("mode",u.value.inputs.mode)}const D=s(),u=s(),a=s([]);s([]),s([]);const P=s(0);s(5),s(),s("https://firebasestorage.googleapis.com/v0/b/selfwalksigniabonnetcreek-dev.appspot.com/o/airwallfilled.glb?alt=media&token=013adf65-b7b3-4ff1-8575-14e3aac7ea82"),s(),s(),s(),s(),s(1),s(1),s(5),s(5);const w=s(5),S=s(-10);class L{constructor(t,n){this.path=t,this.node=n}onEvent(t){t.input.type=="hover",t.input.type=="unhover"?e.inputComponent.inputs.userNavigationEnabled=!0:t.input.type=="click"?console.log("Clicked emit"):t.input.type==="dragend"&&console.log("Drag ended")}}const U=de(F,"curated",r.proposalID,"branding"),z=s("createdAt"),M=s("asc");x(),I(z,x),I(M,x);function x(){const o=pe(U,ve(z.value,M.value));ge(o,t=>{e.siteProInfo.curatedBranding=t.docs.map(n=>({...n.data(),id:n.id}))})}async function v(){let o=e.siteProInfo.curatedBranding.filter(n=>n.model===e.selectedModel);console.log("showBranding",o,e.siteProInfo.curatedBranding),a.value=[];let t=[];if(e.brandingSceneObject)console.log("brandingSceneObject.stop()"),e.brandingSceneObject.stop(),e.brandingSceneObject=null,t.forEach(n=>n.cancel()),t=[];else{await e.mpSdk.Scene.registerComponents([{factory:ee(e.mpSdk),name:T}]),console.log("creating wallsceneobj"),e.brandingSceneObject=(await e.mpSdk.Scene.createObjects(1))[0],console.log("creating wallsceneobj");for(let l=0;l<o.length;l++){a.value[l]=e.brandingSceneObject.addNode();const i=o[l];a.value[l].obj3D.position.set(i.position.x,i.position.y,i.position.z),a.value[l].obj3D.scale.set(i.scale.x,i.scale.y,i.scale.z),i.rotation&&a.value[l].obj3D.rotation.set(i.rotation.x,i.rotation.y,i.rotation.z),a.value[l].model=i.model,a.value[l].docid=i.id,D[l]={pos:a.value[l].obj3D.position,rot:a.value[l].obj3D.rotation,scale:a.value[l].obj3D.scale},console.log("wall"+l,D[l]),console.log("registering gltf");const y=a.value[l].addComponent(T,{type:i.type,textureSrc:i.textureSrc,aspectRatio:1});console.log("wallnodecomp",y);const C=await e.brandingSceneObject.addEmitPath(y,"planeEvents"),j=e.brandingSceneObject.spyOnEvent(new L(C,a.value[l]));t.push(j);const p=await e.brandingSceneObject.addEmitPath(y,"planeEvents","wallNodeComp_"+l);class B{constructor(){A(this,"path",p)}onEvent(_){console.log("click evnet12 log"),_.input.type=="hover",_.input.type=="unhover"&&(console.log("userNavigationEnabled = true"),e.inputComponent.inputs.userNavigationEnabled=!0),_.input.type=="click"&&(console.log("click evnet log"),u.value.inputs.mode="translate",u.value.inputs.selection==null?(u.value.inputs.selection=a.value[l],c.value=a.value[l].docid,m.value=(a.value[l].obj3D.rotation.y*(180/Math.PI)).toFixed(2),P.value=l):u.value.inputs.selection=null,e.inputComponent.inputs.userNavigationEnabled=!0)}}const J=e.brandingSceneObject.spyOnEvent(new B);t.push(J),console.log("registered gltf")}const n=e.brandingSceneObject.addNode();u.value=n.addComponent("mp.transformControls",{mode:"scale",selection:null,size:1}),e.brandingSceneObject.addNode().addComponent("mp.ambientLight",{intensity:1,color:{r:1,g:1,b:1}}),e.brandingSceneObject.start()}u.value.inputs.selection=null,d.value=0}async function q(){return new Promise((o,t)=>{let n=document.createElement("input");n.type="file",n.onchange=b=>{let l=b.target.files[0],i=l.type;i.startsWith("image/")?i="image":i.startsWith("video/")?i="video":console.log("The file is neither an image nor a video");const y=oe();let C=te(y,"images/"+l.name);const j=ne(C,l);j.on("state_changed",p=>{const B=p.bytesTransferred/p.totalBytes*100;console.log("Upload is "+B+"% done")},p=>{console.error("Error uploading file to Firebase:",p),t(p)},()=>{ae(j.snapshot.ref).then(p=>{console.log("File available at",p),o({fileType:i,downloadURL:p})})})},n.click()})}const m=s(0);async function Z(){try{let o=await q();if(!o)return;let t=o.downloadURL,n=o.fileType;console.log("addWall",e.selectedModel);let b=w.value,l=S.value;w.value=e.currentSweep.position.x,S.value=e.currentSweep.position.z;let i={position:{x:w.value,y:.1,z:S.value},scale:{x:1,y:1,z:1},rotation:{x:0,y:0,z:0},collapse:!1,extendedSizeZ:1,textureSrc:t,type:n,model:e.selectedModel};await e.addCuratedBrand(i,r.proposalID),console.log("New wall params added:",i),w.value=b,S.value=l,v(),v()}catch(o){console.error("Error in addWall function:",o)}}async function K(o){const t=e.siteProInfo.curatedBranding.findIndex(n=>n.id===o);t!==-1?(await e.addCuratedBrand(e.siteProInfo.curatedBranding[t],r.proposalID),v(),v()):console.log("No wall found with docid:",o)}async function X(o){window.confirm("Are you sure you want to remove this location?")&&(await e.removeCuratedBrand(o,r.proposalID),v(),c.value=null,v())}function G(o){const t=e.siteProInfo.curatedBranding.findIndex(b=>b.id===o);if(t===-1){console.error(`No wall found with id: ${o}`);return}const n=a.value.findIndex(b=>b.docid===o);if(n===-1){console.error(`No wall node found with id: ${o}`);return}m.value&&(e.siteProInfo.curatedBranding[t].rotation.y=m.value*(Math.PI/180),a.value[n].obj3D.rotation.y=m.value*(Math.PI/180)
1),v(),v()}async function H(){for(let o=0;o<a.value.length;o++){let t={position:{x:a.value[o].obj3D.position.x,y:a.value[o].obj3D.position.y,z:a.value[o].obj3D.position.z},rotation:{x:a.value[o].obj3D.rotation.x,y:a.value[o].obj3D.rotation.y,z:a.value[o].obj3D.rotation.z},scale:{x:a.value[o].obj3D.scale.x,y:a.value[o].obj3D.scale.y,z:a.value[o].obj3D.scale.z},extendedSizeZ:a.value[o].obj3D.scale.z,collapse:!1,model:a.value[o].model};try{const n=be(F,"curated",r.proposalID,"branding",a.value[o].docid);await fe(n,t),console.log("Brand successfully updated!")}catch(n){console.error("Error updating brand: ",n)}}}return(o,t)=>(O(),E(V,null,[f("button",{onClick:N,id:"airwallcontrol",class:"airwallbutton2"},"S/R/T"),f("button",{onClick:t[0]||(t[0]=n=>v()),class:"airwallbutton"},"Branding"),f("button",{onClick:t[1]||(t[1]=n=>Z()),class:"airwallbutton3"},"Add Branding"),f("button",{onClick:t[2]||(t[2]=n=>K(c.value)),class:"airwallbutton4"},"Copy "+k(c.value?c.value.substring(0,3):""),1),f("button",{onClick:t[3]||(t[3]=n=>X(c.value)),class:"airwallbutton6"},"Delete "+k(c.value?c.value.substring(0,3):""),1),f("div",ye,[le(f("input",{onChange:t[4]||(t[4]=n=>G(c.value)),style:{height:"20px",width:"40px","border-radius":"10px"},id:"rotateDeg",type:"number","onUpdate:modelValue":t[5]||(t[5]=n=>m.value=n)},null,544),[[ue,m.value]])]),f("button",{onClick:t[6]||(t[6]=n=>H()),class:"airwallbutton5"},"Save All"),h(e).spaceInfo[h(e).selectedSpace]?(O(),E("div",we,"Current Source: "+k(h(e).spaceInfo[h(e).selectedSpace].name),1)):se("",!0)],64))}},je=R(Se,[["__scopeId","data-v-2442bf67"]]);const he={__name:"CuratedBrandingView",setup(g){const r=ce(),e=s(r.params.proposalID.toUpperCase()),c=W();ie(async()=>{await c.readCuratedBrandingFromFire(e.value)}),s(c.siteProInfo.mapLink);const d=s();return s(0),re(()=>{console.log("navlinks",d),console.log("selectedspace",c.selectedSpace)}),(N,D)=>(O(),E(V,null,[$(me),$(je,{proposalID:e.value},null,8,["proposalID"])],64))}},We=R(he,[["__scopeId","data-v-b230f329"]]);export{We as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.