text: "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");require("@react-three/fiber"),require("@babel/runtime/helpers/extends"),require("@babel/runtime/helpers/objectWithoutPropertiesLoose"),require("react-merge-refs");var t=require("three"),r=require("@babel/runtime/helpers/construct");require("./OrthographicCamera.cjs.js"),require("./useCamera.cjs.js");var n=require("./GizmoHelper.cjs.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(r),i=["right","left","top","bottom","front","back"],c=function(e){return a.default(t.Vector3,e).multiplyScalar(.38)},u=[[1,1,1],[1,1,-1],[1,-1,1],[1,-1,-1],[-1,1,1],[-1,1,-1],[-1,-1,1],[-1,-1,-1]].map(c),s=[.25,.25,.25],l=[[1,1,0],[1,0,1],[1,0,-1],[1,-1,0],[0,1,1],[0,1,-1],[0,-1,1],[0,-1,-1],[-1,1,0],[-1,0,1],[-1,0,-1],[-1,-1,0]].map(c),m=l.map((function(e){return e.toArray().map((function(e){return 0==e?.5:.25}))})),p=function(r){var n=r.hover,o=r.index,a=e.useMemo((function(){var e=document.createElement("canvas");e.width=128,e.height=128;var r=e.getContext("2d");return r.fillStyle="#eee",r.fillRect(0,0,e.width,e.height),r.strokeStyle="#444",r.strokeRect(0,0,e.width,e.height),r.font="28px Arial",r.textAlign="center",r.fillStyle="#222",r.fillText(i[o].toUpperCase(),64,76),new t.CanvasTexture(e)}),[o]);return e.createElement("meshLambertMaterial",{map:a,attachArray:"material",color:n?"hotpink":"white"})},f=function(){var t=n.useGizmoContext(),r=t.tweenCamera,o=t.raycast,a=e.useState(null),i=a[0],c=a[1];return e.createElement("mesh",{raycast:o,onPointerOut:function(e){c(null),e.stopPropagation()},onPointerMove:function(e){c(Math.floor(e.faceIndex/2)),e.stopPropagation()},onPointerDown:function(e){r(e.face.normal),e.stopPropagation()}},[].concat(Array(6)).map((function(t,r){return e.createElement(p,{key:r,index:r,hover:i===r})})),e.createElement("boxBufferGeometry",{attach:"geometry",args:[1,1,1]}))},h=function(t){var r=t.dimensions,o=t.position,a=n.useGizmoContext(),i=a.tweenCamera,c=a.raycast,u=e.useState(!1),s=u[0],l=u[1];return e.createElement("mesh",{position:o,raycast:c,onPointerOver:function(e){l(!0),e.stopPropagation()},onPointerOut:function(e){l(!1),e.stopPropagation()},onPointerDown:function(e){i(o),e.stopPropagation()}},e.createElement("meshBasicMaterial",{color:s?"hotpink":"white",transparent:!0,opacity:.75,visible:s}),e.createElement("boxBufferGeometry",{attach:"geometry",args:r}))};exports.GizmoViewcube=function(){return e.createElement("group",{scale:[60,60,60]},e.createElement(f,null),l.map((function(t,r){return e.createElement(h,{key:r,position:t,dimensions:m[r]})})),u.map((function(t,r){return e.createElement(h,{key:r,position:t,dimensions:s})})),e.createElement("ambientLight",{intensity:.5}),e.createElement("pointLight",{position:[10,10,10],intensity:.5}))};
  