PageSourceSearch

https://fittyai-demo-web.netlify.app/static/js/main.71251f9a.chunk.js

js fittyai-demo-web.netlify.app collected 2026-10-03 10:44:13 UTC 6,996 bytes, 2 lines download raw bytes

1(this["webpackJsonpdemo-web"]=this["webpackJsonpdemo-web"]||[]).push([[0],{206:function(e,t,n){},208:function(e,t,n){},251:function(e,t){},253:function(e,t){},266:function(e,t){},268:function(e,t){},296:function(e,t){},297:function(e,t){},302:function(e,t){},304:function(e,t){},311:function(e,t){},330:function(e,t){},393:function(e,t,n){"use strict";n.r(t);var s=n(1),r=n.n(s),a=n(190),c=n.n(a),i=(n(206),n(4)),o=n.n(i),u=n(48),l=n(101),d=n(196),f=n(13),h=n(17),p=n(24),b=n(23),m=n(195),v=n(100),j=n(99),x=n(194),g=n(98),O=n.n(g),w=(n(208),n(400)),y=n(191),k=n.n(y),N=n(394),C=n.p+"static/media/FittyAI_logo_text_right_2_white.b73d6e83.svg",S=n(49),L=(n(246),n(9)),_="Endpoint=https://fiaas-pubsub-channel.webpubsub.azure.com;AccessKey=Bh3vZI3JJ6QNONv7PwtOLGHRj0eGVu2AJohC9Yh7qmw=;Version=1.0;",E="HUB_NAME_".concat(Object(N.a)().replaceAll("-","_")),I=896,R=504,A=function(e){Object(p.a)(n,e);var t=Object(b.a)(n);function n(){var e;return Object(f.a)(this,n),(e=t.call(this)).state={loaded:!1,engagementScores:[],repCount:null,poseLandmarks:null,frameIndex:0,squatHeelsRaised:!1},e.onResults=function(t){e.setState((function(e){var n,s=e.loaded,r=e.frameIndex,a={poseLandmarks:null!==(n=t.poseLandmarks)&&void 0!==n?n:[],frameIndex:(r+1)%4};return s||(a.loaded=!0),a}),(function(){t.poseLandmarks&&(1===e.state.frameIndex&&e.publish(t),e.draw(t))}))},e.onMessage=function(t){var n=t.data;console.log(n);var s=JSON.parse(n),r=s.engagement_score,a=s.rep_count,c=s.squat_heels_raised;e.setState((function(e){var t=e.engagementScores,n=Number.parseInt(a),s={squatHeelsRaised:c};return Number.isNaN(n)||(s.repCount=n),(t.length>0||r>0)&&(s.engagementScores=[].concat(Object(d.a)(t),[r])),s}))},e.refVideo=r.a.createRef(),e.refCanvas=r.a.createRef(),e}return Object(h.a)(n,[{key:"draw",value:function(e){var t=e.poseLandmarks.map((function(e,t){return t>10?e:Object(l.a)(Object(l.a)({},e),{},{visibility:0})})),n=j.POSE_CONNECTIONS.filter((function(e){return e.every((function(e){return e>10}))})),s=this.refCanvas.current.getContext("2d");s.save(),s.clearRect(0,0,this.refCanvas.current.width,this.refCanvas.current.height),s.drawImage(e.image,0,0,this.refCanvas.current.width,this.refCanvas.current.height),Object(v.drawConnectors)(s,t,n,{color:"#F1F1F1",lineWidth:4}),Object(v.drawLandmarks)(s,t,{color:"#131D47",lineWidth:2}),s.restore()}},{key:"publish",value:function(e){var t={timestamp:new Date,landmarks:e.poseLandmarks};try{this.state.publisher(t)}catch(n){console.log(n)}}},{key:"setupSubscriber",value:function(){var e=Object(u.a)(o.a.mark((function e(){var t,n,s;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new w.a(_,"".concat(E,"_in_out")),e.next=3,t.getAuthenticationToken();case 3:return n=e.sent,(s=new WebSocket(n.url)).addEventListener("open",(function(){return console.log("socket connected")})),s.addEventListener("error",(function(e){return console.error("socket error:",e)})),s.addEventListener("close",(function(){return console.log("socket closed")})),e.abrupt("return",(function(e){return s.addEventListener("message",e)}));case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"setupPublisher",value:function(){var e=new w.a(_,"".concat(E,"_in"));return function(t){return e.sendToAll(t,{contentType:"application/json"})}}},{key:"setupConnection",value:function(){var e=Object(u.a)(o.a.mark((function e(){var t,n,s=this;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,k.a.get("https://fitnessintelligence.azurewebsites.net/session/".concat(E,"/start"));case 2:return e.next=4,this.setupSubscriber();case 4:return t=e.sent,n=this.setupPublisher(),e.next=8,new Promise((function(e){return s.setState({subscriber:t,publisher:n},e)}));case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"componentDidMount",value:function(){var e=Object(u.a)(o.a.mark((function e(){var t,n=this;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.setupConnection();case 2:this.state.subscriber(this.onMessage),(t=new j.Pose({locateFile:function(e){return"https://cdn.jsdelivr.net/npm/@mediapipe/pose@".concat(x.a,"/").concat(e)}})).setOptions({modelComplexity:1,smoothLandmarks:!0,minDetectionConfidence:.5,minTrackingConfidence:.5,selfieMode:!0}),t.onResults(this.onResults),new m.Camera(this.refVideo.current,{onFrame:function(){var e=Object(u.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.send({image:n.refVideo.current});case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),width:I,height:R}).start();case 8:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getStatusText",value:function(){var e=this.state,t=e.engagementScores,n=e.poseLandmarks,s=e.squatHeelsRaised;return(null===n||void 0===n?void 0:n.slice(11).filter((function(e){return e.visibility>.1})).length)<14?"Move farther away from the camera!":s?"Keep your heels on the ground!":0===t.length?"No Data!":"Good job! Keep it up!"}},{key:"render",value:function(){var e=this.state,t=e.loaded,n=e.engagementScores,s=e.repCount,r=n.map((function(e,t){return{x:t,y:e}}));return Object(L.jsx)("div",{className:"App",children:Object(L.jsxs)("header",{className:"App-header flex",children:[Object(L.jsx)("div",{className:"flex justify-content",children:Object(L.jsx)("img",{src:C,alt:"Logo",width:"400px"})}),Object(L.jsxs)("div",{className:"flex justify-content",children:[Object(L.jsxs)("div",{className:"flex justify-content flex-1",children:[Object(L.jsx)("video",{ref:this.refVideo,className:O()("selfie",t?"video-hidden":"blur")}),Object(L.jsx)("canvas",{ref:this.refCanvas,width:"896px",height:"504px",className:O()({"video-hidden":!t})})]}),Object(L.jsxs)("div",{className:"flex justify-content flex-1",style:{position:"relative"},children:[r.length?Object(L.jsx)("div",{style:{position:"absolute",top:-30,fontSize:48},children:"Engagement Level"}):null,r.length?Object(L.jsxs)(S.c,{height:R,width:I,style:{paddingTop:40},children:[Object(L.jsx)(S.b,{color:"#f1f1f1",tickValues:[]}),Object(L.jsx)(S.d,{color:"#f1f1f1",fill:"f1f1f1",tickValues:[],style:{text:{fill:"#f1f1f1"}}}),Object(L.jsx)(S.a,{data:r,color:"#f1f1f1"})]}):Object(L.jsx)("div",{className:"blur",style:{height:R,width:I,backgroundColor:"#202c6b"}})]})]}),Object(L.jsxs)("div",{className:"flex justify-content",children:[Object(L.jsx)("div",{className:"flex-1",children:Object(L.jsx)("span",{className:"status-text",children:this.getStatusText()})}),Object(L.jsx)("div",{className:"flex-1",children:Object(L.jsx)("span",{className:"status-text",children:"".concat(null!==s&&void 0!==s?s:0," rep(s)")})})]})]})})}}]),n}(r.a.Component);
1c.a.render(Object(L.jsx)(r.a.StrictMode,{children:Object(L.jsx)(A,{})}),document.getElementById("root"))}},[[393,1,2]]]);
2//# sourceMappingURL=main.71251f9a.chunk.js.map

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.