@nqminds/crop-doc-constants
Version:
Cropdoc constants
3 lines (2 loc) • 4.75 kB
JavaScript
import e from"@nqminds/crop-doc-translations";import r from"moment";import t from"shortid";function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function i(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach((function(r){a(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var n,l,h,s,d,c={alert:"alert",advice:"advice"},m={type:c,typeText:(n={},a(n,c.alert,e.alert),a(n,c.advice,e.advice),n)},g={info:"info",alert:"alert",weather:"weather",pest:"pest",event:"event"},u={category:g,categoryText:(l={},a(l,g.info,e.info),a(l,g.alert,e.alert),a(l,g.weather,e.weather),a(l,g.pest,e.pest),a(l,g.event,e.event),l),categoryIcons:(h={},a(h,g.info,"info"),a(h,g.alert,"warning"),a(h,g.weather,"cloud"),a(h,g.pest,"emoji_nature"),a(h,g.event,"event"),h)},f={low:"low",medium:"medium",high:"high"},y={priority:f,priorityText:(s={},a(s,f.low,e.low),a(s,f.medium,e.medium),a(s,f.high,e.high),s),priorityColors:(d={},a(d,f.low,"#4caf50"),a(d,f.medium,"#ffc107"),a(d,f.high,"#f44336"),d)},p={get template(){return{id:t.generate(),createdOn:r().valueOf(),createdBy:"cropdoc-model-databot",recipients:[],message:"",start:r().startOf("day").valueOf(),end:r().endOf("day").valueOf(),header:"",alertType:m.type.alert,alertCategories:u.category.info,priority:y.priority.low}}},v=i(i(i(i({},m),u),y),p),O={longitude:104.1954,latitude:35.8617,zoom:4,maxZoom:20,pitch:0,bearing:0},w={farmer:"farmers",advisor:"advisors",policyMaker:"policyMakers",decisionMaker:"decisionMakers",admin:"sysAdmins"},b={resourceTag:{region:"crop-doc-region",localArea:"crop-doc-local-area"},typeTags:{region:"crop-doc-region",localArea:"crop-doc-local-area",role:"crop-doc-role"}},k={harvestAlertThreshold:r.duration(2,"weeks").valueOf(),blightAlertThreshold:r.duration(4,"weeks").valueOf(),blightSeverityThreshold:{medium:2,high:5},tempThreshold:{low:5,high:25},heatwaveThreshold:{temp:28,days:5},rainThresholdHourlyMm:{moderate:2.5,heavy:10,violent:50},get rainThresholdDailyMm(){return{moderate:this.hoursInDay*this.rainThresholdHourlyMm.moderate,heavy:this.hoursInDay*this.rainThresholdHourlyMm.heavy,violent:this.hoursInDay*this.rainThresholdHourlyMm.violent}},get rainThresholdWeeklyMm(){return{moderate:this.hoursInWeek*this.rainThresholdHourlyMm.moderate,heavy:this.hoursInWeek*this.rainThresholdHourlyMm.heavy,violent:this.hoursInWeek*this.rainThresholdHourlyMm.violent}},humidityThreshold:{low:30,high:70},sensorThresholdKm:50,geoSearchDelta:50/111,pixelSearchDelta:.1,controlThresholdKm:5,blightValidMonths:6,blightForecastStart:-8,blightForecastEnd:7},D={msInDay:r.duration(1,"day").valueOf(),msInYear:r.duration(1,"year").valueOf(),hoursInDay:r.duration(1,"day").as("hours"),hoursInWeek:r.duration(1,"week").as("hours"),dateFormat:"YYYY-MM-DD",timeZone:"Asia/Shanghai",get forecastRangeFilter(){return{$gte:r().startOf("day").valueOf(),$lte:r().startOf("day").add(6,"day").endOf("day").valueOf()}}},T={temp:"°C",precipitation:"mm",humidity:"%",areaLevels:{province:"province",district:"district",county:"county"},geoShapes:{polygon:"Polygon",multiPolygon:"MultiPolygon"}},M={none:e.none,unconfirmed:e.unconfirmed,confirmed:e.confirmed},I={none:e.none,primaryInfection:e.primaryInfection,nearInfection:e.nearInfection},P={missing:e.noData,low:e.riskSafe,moderate:e.riskDanger,high:e.riskHighDanger},j={0:e.noData,1:e.riskSafe,11:e.riskDanger,111:e.riskHighDanger},B={1:e.fieldBlightPredictionMessageSafe,11:e.fieldBlightPredictionMessageRisk,111:e.fieldBlightPredictionMessageHighRisk},S={0:e.noData,1:e.riskSafe,10:e.riskDanger,11:e.riskHighDanger},H={missing:0,low:1,moderate:11,high:111},x={missing:0,low:1,moderate:10,high:11},A={0:"missing",1:"low",10:"moderate",11:"high"},W={confirmedBlight:"confirmedBlight",confirmedNotBlight:"confirmedNotBlight",unconfirmed:"unconfirmed"},Y={confirmedBlight:"confirmedBlight",confirmedNotBlight:"confirmedNotBlight",unconfirmed:"unconfirmed"},F=1e4;export{v as alert,Y as blightConfirmation,I as conditions,W as confirmationStatus,O as defaultMapViewState,F as maxO4DataPoints,w as permissionLevel,P as riskLevels,A as riskLevelsHebau,j as riskO6,H as riskO6Enum,B as riskO6Message,S as riskO7,x as riskO7Enum,M as severityLevels,b as tags,k as thresholds,D as timedate,T as units};
//# sourceMappingURL=index.es.js.map