{"version":3,"sources":["webpack:///./src/components/FeedProfileChart.vue","webpack:///./src/components/FeedProfileChart.vue?b5b6","webpack:///./src/components/RegisterSmartFeed.vue?120a","webpack:///./node_modules/@babel/runtime/helpers/esm/objectSpread2.js","webpack:///./src/store/registration.ts","webpack:///./src/utils/feed_acquisition_utils.ts","webpack:///./src/components/RegisterSmartFeed.vue","webpack:///./src/components/RegisterSmartFeed.vue?d5b3","webpack:///./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack:///./node_modules/core-js/modules/es.object.keys.js","webpack:///./node_modules/core-js/modules/es.object.get-own-property-descriptors.js","webpack:///./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"],"names":["props","profile","type","Object","required","setup","__props","mapCurve","values","y","map","value","index","x","siloDimensions","curves","points","sensorPosition","filteredCurve","projectedCurve","correctedCurve","adjustedCurve","chartData","datasets","label","data","backgroundColor","borderColor","showLine","pointRadius","length","push","register","options","responsive","maintainAspectRatio","scales","min","max","plugins","legend","display","labels","boxWidth","scatterChartProps","_ctx","_cache","id","__exports__","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","apply","_objectSpread2","target","i","arguments","source","forEach","key","defineProperty","getOwnPropertyDescriptors","defineProperties","MAIN_STORE","useRegistrationStore","state","foods","actions","getSiloProfile","pk","getFromAPI","siloProfile","getSiloAcquisition","fetchFoods","results","next","concat","registerUser","postOnAPI","user_posted","employee","user","phone_number","company","parseInt","role","associated_farm","registerCompany","name","farms","company_posted","reference_weight_curve","curve","registerSilo","silo_data","getters","getFoods","restructureAcquisitionData","rawData","Array","isArray","distance","_","signal_strength","temperature","imu_angle_x","imu_angle_y","imu_angle_z","servo_angle","console","error","acquisitionData","imuAngularCorrection","imuAngleOffset","dataPoint","processedData","sensorXOffset","angleOffset","pivotingRadius","sensorHeight","angleInRadians","Math","PI","sin","cos","processAndConvertAcquisitionData","conversionParams","restructuredData","n","_hoisted_1","_hoisted_2","class","_hoisted_3","_hoisted_4","_hoisted_5","for","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","isLoading","registrationStore","siloProfilePk","profileData","siloData","fetchSiloProfile","sensorPositionCurve","find","acquisition","sensor_acquisitions","adjustedCurvePoints","point","updateVisualization","newProfileData","$event","onChange","step","number","FeedProfileChart","_defineProperty","obj","configurable","writable","$","toObject","nativeKeys","fails","FAILS_ON_PRIMITIVES","stat","forced","it","DESCRIPTORS","toIndexedObject","getOwnPropertyDescriptorModule","createProperty","sham","descriptor","O","f","result","undefined","nativeGetOwnPropertyDescriptor","FORCED"],"mappings":"kLAW4B,+BAAiB,CAC3CA,MAAO,CACPC,QAAS,CAAEC,KAAMC,OAAwCC,UAAU,IAEnEC,MAJ2C,SAIrCC,GAER,IAAMN,EAAQM,EAIRC,EAAW,SAACC,GAChB,OAAc,MAAVA,EAAuB,GACpBA,EAAOC,EAAEC,KAAI,SAACC,EAAeC,GAClC,MAAO,CAAC,EAAKJ,EAAOK,EAAED,GAAQ,EAAKD,OAIjCG,EAAgD,uBAAS,wBAAMP,EAAQ,UAACP,EAAMC,eAAP,aAAC,EAAec,OAAO,GAAGC,WACjGC,EAAgD,uBAAS,wBAAMV,EAAQ,UAACP,EAAMC,eAAP,aAAC,EAAec,OAAO,GAAGC,WACjGE,EAAgD,uBAAS,wBAAMX,EAAQ,UAACP,EAAMC,eAAP,aAAC,EAAec,OAAO,GAAGC,WACjGG,EAAgD,uBAAS,wBAAMZ,EAAQ,UAACP,EAAMC,eAAP,aAAC,EAAec,OAAO,GAAGC,WACjGI,EAAgD,uBAAS,wBAAMb,EAAQ,UAACP,EAAMC,eAAP,aAAC,EAAec,OAAO,GAAGC,WACjGK,EAA+C,uBAAS,0BAAMd,EAAQ,UAACP,EAAMC,eAAP,iBAAC,EAAec,OAAO,UAAvB,aAAC,EAA0BC,WAEjGM,EAAY,uBAAS,WACzB,IAAIC,EAA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M,WAAce,EAA+B,MACzEC,GAAUX,GAAeJ,EAI7BJ,EAAE,CAAEnH,OAAQ,SAAUwH,MAAM,EAAMC,OAAQa,EAAQP,MAAOJ,GAAe,CACtE/H,yBAA0B,SAAkC8H,EAAIrH,GAC9D,OAAOgI,EAA+BT,EAAgBF,GAAKrH","file":"js/chunk-2149e700.fb4051cc.js","sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, mergeProps as _mergeProps, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport { PropType, computed, ComputedRef } from \"vue\";\nimport { Chart, registerables } from 'chart.js';\nimport { ScatterChart, useScatterChart } from 'vue-chart-3';\nimport { ChartPointType } from \"@/types/chart_point\";\nimport { ProfileType } from \"@/types/profile\";\nimport { PointsType } from \"@/types/profile\";\n\n\nexport default /*#__PURE__*/_defineComponent({\n props: {\n profile: { type: Object as PropType, required: true },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst mapCurve = (values: PointsType | undefined): ChartPointType[] => {\n if (values == null) return []\n return values.y.map((value: number, index: number) => {\n return {\"x\": values.x[index], \"y\": value}\n })\n}\n\nconst siloDimensions: ComputedRef = computed(() => mapCurve(props.profile?.curves[0].points))\nconst sensorPosition: ComputedRef = computed(() => mapCurve(props.profile?.curves[1].points))\nconst filteredCurve: ComputedRef = computed(() => mapCurve(props.profile?.curves[2].points))\nconst projectedCurve: ComputedRef = computed(() => mapCurve(props.profile?.curves[3].points))\nconst correctedCurve: ComputedRef = computed(() => mapCurve(props.profile?.curves[4].points))\nconst adjustedCurve: ComputedRef = computed(() => mapCurve(props.profile?.curves[5]?.points));\n\nconst chartData = computed(() => {\n let datasets = [\n {\n label: \"Sensor\",\n data: sensorPosition.value,\n backgroundColor: '#e91916',\n borderColor: '#e91916',\n showLine: true,\n pointRadius: 5,\n },\n {\n label: \"Filtered Curve\",\n data: filteredCurve.value,\n backgroundColor: '#ffb25e',\n borderColor: '#ffb25e',\n showLine: true,\n },\n {\n label: \"Corrected Curve\",\n data: correctedCurve.value,\n backgroundColor: '#78b843',\n borderColor: '#78b843',\n showLine: true,\n },\n {\n label: \"Projected Curve\",\n data: projectedCurve.value,\n backgroundColor: '#6e6e6e',\n borderColor: '#6e6e6e',\n showLine: true,\n pointRadius: 1,\n },\n {\n label: \"Silo\",\n data: siloDimensions.value,\n backgroundColor: '#404040',\n borderColor: '#404040',\n showLine: true,\n pointRadius: 1,\n },\n ];\n if (adjustedCurve.value && adjustedCurve.value.length > 0) {\n datasets.push({\n label: \"Adjusted Curve\",\n data: adjustedCurve.value,\n backgroundColor: '#FF69B4',\n borderColor: '#FF69B4',\n showLine: true,\n pointRadius: 3,\n });\n }\n return { datasets };\n});\n\nChart.register(...registerables);\nconst { scatterChartProps } = useScatterChart({\n chartData,\n options: {\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n x: {\n min: (() => sensorPosition.value ? (sensorPosition.value[0].y + 2)/-2 : null),\n max: (() => sensorPosition.value ? (sensorPosition.value[0].y + 2)/2 : null),\n },\n y: {\n min: -1,\n max: (() => sensorPosition.value ? sensorPosition.value[0].y + 1 : null),\n },\n },\n plugins: {\n legend: {\n display: true,\n labels: {\n boxWidth: 15,\n }\n }\n }\n },\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_unref(ScatterChart), _mergeProps({\n id: \"chart\",\n min: \"-5\"\n }, _unref(scatterChartProps)), null, 16))\n}\n}\n\n})","import script from \"./FeedProfileChart.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./FeedProfileChart.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/vue-loader-v16/dist/index.js??ref--1-1!./RegisterSmartFeed.vue?vue&type=style&index=0&id=2605c96c&scoped=true&lang=css\"","import defineProperty from \"./defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}","import { defineStore } from \"pinia\";\nimport { useMainStore } from '@/store/main';\nimport { API_URL } from \"@/utils/urls\";\nimport { FoodType } from \"@/types/food\";\n\nconst MAIN_STORE = useMainStore()\n\n\nexport const useRegistrationStore = defineStore(\"registrationStore\", {\n state: () => ({\n foods: null as FoodType[] | null,\n }),\n actions: {\n async getSiloProfile(pk: any): Promise {\n const siloProfile = await MAIN_STORE.getFromAPI(`${API_URL}/silo_profiles/${pk}`)\n return siloProfile\n },\n async getSiloAcquisition(pk: any): Promise {\n const siloProfile = await MAIN_STORE.getFromAPI(`${API_URL}/smartfeed_v0_acquisitions/${pk}`)\n return siloProfile\n },\n async fetchFoods(): Promise {\n let data = await MAIN_STORE.getFromAPI(`${API_URL}/foods/`);\n this.foods = data.results\n while (data?.next != null) {\n data = await MAIN_STORE.getFromAPI(data.next);\n if (this.foods == null) return;\n this.foods.concat(data.results)\n }\n },\n async registerUser(data: any): Promise {\n const user_posted = await MAIN_STORE.postOnAPI(`${API_URL}/users/create_user/`, data)\n \n const employee = {\n user: user_posted.pk,\n phone_number: \"\",\n company: parseInt(data.company),\n role: data.role,\n associated_farm: data.associated_farm === \"null\" ? null : parseInt(data.associated_farm)\n }\n await MAIN_STORE.postOnAPI(`${API_URL}/employees/`, employee)\n },\n async registerCompany(data: any): Promise {\n const company = {name: data.name, farms: [], foods: []}\n const company_posted = await MAIN_STORE.postOnAPI(`${API_URL}/companies/`, company)\n\n const reference_weight_curve = {\n name: `Curva referĂȘncia ${company_posted.name} (fake)`,\n company: company_posted.pk,\n curve: {},\n }\n await MAIN_STORE.postOnAPI(`${API_URL}/reference_weight_curves/`, reference_weight_curve)\n },\n async registerSilo(silo_data: any): Promise {\n await MAIN_STORE.postOnAPI(`${API_URL}/silos/`, silo_data)\n },\n },\n getters: {\n getFoods: state => state.foods,\n },\n});\n","// utils/dataProcessing.ts\nimport { AcquisitionDataPoint, ProcessedDataPoint } from '@/types/feed_processing_datatypes';\n\n// Interface for additional conversion parameters\ninterface CartesianConversionParams {\n sensorXOffset: number;\n angleOffset: number;\n pivotingRadius: number;\n sensorHeight: number;\n}\n\ninterface RawData {\n distance: number[];\n signal_strength: number[];\n temperature: number[];\n imu_angle_x: number[];\n imu_angle_y: number[];\n imu_angle_z: number[];\n servo_angle: number[];\n}\n\n\nexport const restructureAcquisitionData = (rawData: RawData): AcquisitionDataPoint[] => {\n if (rawData && Array.isArray(rawData.distance)) {\n return rawData.distance.map((_: number, index: number) => ({\n distance: rawData.distance[index],\n signal_strength: rawData.signal_strength[index],\n temperature: rawData.temperature[index],\n imu_angle_x: rawData.imu_angle_x[index],\n imu_angle_y: rawData.imu_angle_y[index],\n imu_angle_z: rawData.imu_angle_z[index],\n servo_angle: rawData.servo_angle[index],\n }));\n } else {\n console.error(\"Raw data is not in the expected format:\", rawData);\n return [];\n }\n};\n\n// Process acquisition data and apply IMU corrections\nexport const processAcquisitionData = (\n acquisitionData: AcquisitionDataPoint[],\n imuAngularCorrection: number,\n imuAngleOffset: number\n): AcquisitionDataPoint[] => {\n return acquisitionData.map(dataPoint => ({\n ...dataPoint,\n imu_angle_x: (dataPoint.imu_angle_x * imuAngularCorrection) + imuAngleOffset,\n // Apply similar corrections to other IMU angles if needed\n }));\n};\n\n// Convert polar coordinates to Cartesian coordinates\nexport const convertToCartesian = (\n processedData: AcquisitionDataPoint[],\n { sensorXOffset, angleOffset, pivotingRadius, sensorHeight }: CartesianConversionParams\n): ProcessedDataPoint[] => {\n return processedData.map(dataPoint => {\n const angleInRadians = (Math.PI / 180) * (dataPoint.imu_angle_x - angleOffset);\n return {\n ...dataPoint,\n x: sensorXOffset + Math.sin(angleInRadians) * (dataPoint.distance + pivotingRadius),\n y: sensorHeight - Math.cos(angleInRadians) * (dataPoint.distance + pivotingRadius),\n };\n });\n};\n\nexport const processAndConvertAcquisitionData = (\n rawData: RawData,\n imuAngularCorrection: number,\n imuAngleOffset: number,\n conversionParams: CartesianConversionParams\n): ProcessedDataPoint[] => {\n const restructuredData = restructureAcquisitionData(rawData);\n const processedData = processAcquisitionData(restructuredData, imuAngularCorrection, imuAngleOffset);\n return convertToCartesian(processedData, conversionParams);\n};","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, vModelText as _vModelText, withDirectives as _withDirectives, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-2605c96c\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"h3\", null, \"SmartFeed Calibration\", -1))\nconst _hoisted_2 = { class: \"register-smartfeed-container\" }\nconst _hoisted_3 = { class: \"input-section\" }\nconst _hoisted_4 = { class: \"input-wrapper\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { for: \"siloProfilePk\" }, \"Silo Profile PK:\", -1))\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"tooltip\" }, \"Unique identifier for the silo profile.\", -1))\nconst _hoisted_7 = { class: \"input-wrapper\" }\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { for: \"imuAngularCorrection\" }, \"IMU Angular Correction:\", -1))\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"tooltip\" }, \"Adjusts the IMU angular correction factor.\", -1))\nconst _hoisted_10 = { class: \"input-wrapper\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", { for: \"imuAngleOffset\" }, \"IMU Angle Offset:\", -1))\nconst _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"tooltip\" }, \"Offsets the IMU angle for calibration.\", -1))\nconst _hoisted_13 = {\n key: 0,\n class: \"visualization-section\"\n}\nconst _hoisted_14 = {\n key: 0,\n class: \"chart-container\"\n}\nconst _hoisted_15 = {\n key: 1,\n class: \"loading-indicator\"\n}\n\nimport { ref, watch } from \"vue\";\nimport { useRegistrationStore } from \"@/store/registration\";\nimport FeedProfileChart from \"@/components/FeedProfileChart.vue\";\nimport {\n processAndConvertAcquisitionData\n} from \"@/utils/feed_acquisition_utils\";\n\n\nexport default /*#__PURE__*/_defineComponent({\n setup(__props) {\n\nconst isLoading = ref(false);\nconst registrationStore = useRegistrationStore();\nconst siloProfilePk = ref(\"\");\nconst profileData = ref(null);\nconst siloData = ref(null);\nconst acquisitionData = ref(null);\nconst imuAngularCorrection = ref(1); \nconst imuAngleOffset = ref(0); \nconst sensorXOffset = ref(0); \nconst sensorHeight = ref(0); \n\n// Constants\nconst angleOffset = 0; \nconst pivotingRadius = 0.02240; \n\n\nconst fetchSiloProfile = async () => {\n isLoading.value = true;\n try {\n const profile = await registrationStore.getSiloProfile(siloProfilePk.value);\n profileData.value = profile;\n\n // Extract sensor position from the silo profile\n const sensorPositionCurve = profile.curves.find(curve => curve.name === \"Sensor Position\");\n if (sensorPositionCurve && sensorPositionCurve.points.x.length > 0 && sensorPositionCurve.points.y.length > 0) {\n sensorXOffset.value = sensorPositionCurve.points.x[0];\n sensorHeight.value = sensorPositionCurve.points.y[0];\n }\n\n acquisitionData.value = await registrationStore.getSiloAcquisition(profile.acquisition);\n\n // Use the combined function to get the processed Cartesian data\n siloData.value = processAndConvertAcquisitionData(\n acquisitionData.value.sensor_acquisitions,\n imuAngularCorrection.value,\n imuAngleOffset.value,\n {\n sensorXOffset: sensorXOffset.value,\n angleOffset: angleOffset,\n pivotingRadius: pivotingRadius,\n sensorHeight: sensorHeight.value\n }\n );\n // Convert siloData to the same format as other curves\n const adjustedCurvePoints = { x: [], y: [] };\n siloData.value.forEach(point => {\n adjustedCurvePoints.x.push(point.x);\n adjustedCurvePoints.y.push(point.y);\n });\n\n // Update profileData to include the processed siloData as a new curve\n if (profileData.value && profileData.value.curves) {\n profileData.value = {\n ...profileData.value,\n curves: [...profileData.value.curves, { name: \"Adjusted Curve\", points: adjustedCurvePoints }]\n };\n }\n } catch (error) {\n console.error(\"Error fetching silo profile data:\", error);\n }\n isLoading.value = false;\n};\n\n\nconst updateVisualization = () => {\n isLoading.value = true;\n if (siloData.value && profileData.value) {\n siloData.value = processAndConvertAcquisitionData(\n acquisitionData.value.sensor_acquisitions,\n imuAngularCorrection.value,\n imuAngleOffset.value,\n {\n sensorXOffset: sensorXOffset.value,\n angleOffset: angleOffset,\n pivotingRadius: pivotingRadius,\n sensorHeight: sensorHeight.value\n }\n );\n\n // Convert siloData to the same format as other curves\n const adjustedCurvePoints = { x: [], y: [] };\n siloData.value.forEach(point => {\n adjustedCurvePoints.x.push(point.x);\n adjustedCurvePoints.y.push(point.y);\n });\n\n // Create a new profileData object with updated curves\n const newProfileData = {\n ...profileData.value,\n curves: profileData.value.curves.map((curve, index) => \n index === profileData.value.curves.length - 1 ? \n { name: \"Adjusted Curve\", points: adjustedCurvePoints } : \n curve\n )\n };\n\n // Update profileData to trigger reactivity\n profileData.value = newProfileData;\n }\n isLoading.value = false;\n};\n\nwatch(() => siloProfilePk.value, fetchSiloProfile);\nwatch(() => imuAngularCorrection.value, updateVisualization);\nwatch(() => imuAngleOffset.value, updateVisualization);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _hoisted_1,\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _withDirectives(_createElementVNode(\"input\", {\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((siloProfilePk).value = $event)),\n type: \"text\",\n id: \"siloProfilePk\",\n onChange: fetchSiloProfile,\n required: \"\",\n \"aria-label\": \"Enter Silo Profile PK\"\n }, null, 544), [\n [_vModelText, siloProfilePk.value]\n ]),\n _hoisted_6\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _hoisted_8,\n _withDirectives(_createElementVNode(\"input\", {\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((imuAngularCorrection).value = $event)),\n type: \"number\",\n id: \"imuAngularCorrection\",\n onChange: updateVisualization,\n step: \"0.1\",\n \"aria-label\": \"Adjust IMU Angular Correction\"\n }, null, 544), [\n [\n _vModelText,\n imuAngularCorrection.value,\n void 0,\n { number: true }\n ]\n ]),\n _hoisted_9\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _withDirectives(_createElementVNode(\"input\", {\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => ((imuAngleOffset).value = $event)),\n type: \"number\",\n id: \"imuAngleOffset\",\n onChange: updateVisualization,\n \"aria-label\": \"Adjust IMU Angle Offset\"\n }, null, 544), [\n [\n _vModelText,\n imuAngleOffset.value,\n void 0,\n { number: true }\n ]\n ]),\n _hoisted_12\n ])\n ]),\n (siloData.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_13, [\n (siloData.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_14, [\n _createVNode(FeedProfileChart, { profile: profileData.value }, null, 8, [\"profile\"])\n ]))\n : _createCommentVNode(\"\", true),\n (isLoading.value)\n ? (_openBlock(), _createElementBlock(\"p\", _hoisted_15, \"Updating chart...\"))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ], 64))\n}\n}\n\n})","import script from \"./RegisterSmartFeed.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./RegisterSmartFeed.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./RegisterSmartFeed.vue?vue&type=style&index=0&id=2605c96c&scoped=true&lang=css\"\n\nimport exportComponent from \"/home/runner/work/support-platform/support-platform/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-2605c96c\"]])\n\nexport default __exports__","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","var $ = require('../internals/export');\nvar toObject = require('../internals/to-object');\nvar nativeKeys = require('../internals/object-keys');\nvar fails = require('../internals/fails');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); });\n\n// `Object.keys` method\n// https://tc39.es/ecma262/#sec-object.keys\n$({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {\n keys: function keys(it) {\n return nativeKeys(toObject(it));\n }\n});\n","var $ = require('../internals/export');\nvar DESCRIPTORS = require('../internals/descriptors');\nvar ownKeys = require('../internals/own-keys');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');\nvar createProperty = require('../internals/create-property');\n\n// `Object.getOwnPropertyDescriptors` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptors\n$({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIndexedObject(object);\n var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;\n var keys = ownKeys(O);\n var result = {};\n var index = 0;\n var key, descriptor;\n while (keys.length > index) {\n descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);\n if (descriptor !== undefined) createProperty(result, key, descriptor);\n }\n return result;\n }\n});\n","var $ = require('../internals/export');\nvar fails = require('../internals/fails');\nvar toIndexedObject = require('../internals/to-indexed-object');\nvar nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;\nvar DESCRIPTORS = require('../internals/descriptors');\n\nvar FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); });\nvar FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\n$({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {\n return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);\n }\n});\n"],"sourceRoot":""}