1"use strict";(globalThis["webpackChunkogor"]=globalThis["webpackChunkogor"]||[]).push([[374],{178:(e,t,r)=>{var s=r(1605),o=r(2929),i=r(4601),n=r(3938);s({target:"Iterator",proto:!0,real:!0,forced:!0},{every:function(e){return n(this),i(e),!o(this,(function(t,r){if(!e(t))return r()}),{IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}})},1760:(e,t,r)=>{e.exports=r.p+"img/hovered.98fd06d8.svg"},2542:(e,t,r)=>{e.exports=r.p+"img/default.65db7a2c.svg"},4441:(e,t,r)=>{e.exports=r.p+"img/parcel-list.4b712ce2.svg"},5552:(e,t,r)=>{r.d(t,{F:()=>o,V:()=>s});r(1339),r(3725),r(9838);class s{constructor(e,t,r){Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"googleMaps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"jsts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.map=e,this.googleMaps=t,this.jsts=r,this.mounted&&this.mounted()}emit(e,t){var r;null===(r=this._listeners[e])||void 0===r||r.forEach((e=>e(t)))}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}setGoogleMaps(e){this.googleMaps=e}setJsts(e){this.jsts=e}destroy(){this.beforeDestroy&&this.beforeDestroy()}}class o extends s{constructor(){super(...arguments),Object.defineProperty(this,"isEnabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}toggle(...e){this.isEnabled?this.stop():this.start(...e)}}},6111:(e,t,r)=>{e.exports=r.p+"img/shadow.35ef0f63.svg"},6352:(e,t,r)=>{e.exports=r.p+"img/selected.5f9ab42c.svg"},6561:(e,t,r)=>{r.d(t,{A:()=>i});r(3725),r(9838);var s=function(e,t,r,s){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function n(e){try{c(s.next(e))}catch(t){i(t)}}function a(e){try{c(s["throw"](e))}catch(t){i(t)}}function c(e){e.done?r(e.value):o(e.value).then(n,a)}c((s=s.apply(e,t||[])).next())}))};function o(e){return"true"===String(e).toLowerCase()}function i(e,t=!0){const r={};return[...Object.entries(e)].forEach((([e,i])=>{let n;null===i&&(i=""),"object"!==typeof i?i={type:String,default:n}:n=i,n.type===Boolean&&(n.type=o),r[e]={get:function(){return n.type(this.$route.query[e]||n.default)},set:function(r){return s(this,void 0,void 0,(function*(){const s={query:Object.assign({},this.$route.query)},o=n.type(n.default),i=n.type(r);i!==this[e]&&(i===o?delete s.query[e]:s.query[e]=i,t?yield this.$router.replace(s):yield this.$router.push(s))}))}}})),r}},6854:(e,t,r)=>{r.d(t,{A:()=>g});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("multi-select",{staticClass:"larger-ogor-select",attrs:{unique:"id",label:"label","group-label":"group",options:e.farmOptions,value:e.currentFarmId,"drop-down-direction":e.dropDownDirection,searchable:""},on:{input:e.changeFarm}}),e.showModal?t("update-farm-modal",{on:{close:function(t){e.showModal=!1}}}):e._e()],1)},o=[],i=(r(1339),r(3725),r(5019),r(5208)),n=r(8215),a=r(5289),c=r(9442),l=function(e,t,r,s){var o,i=arguments.length,n=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(i<3?o(n):i>3?o(t,r,n):o(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n};const u=(0,c.g_)({toRoute:{type:String,required:!1,default:null},dropDownDirection:{type:String,required:!1,default:"left"},fullAccessRequired:{type:Boolean,required:!1,default:!0}}),d=(0,c.cn)(["userFarms","sharedFarms","currentFarmId"]);let p=class extends((0,a.vE)(a.Y5,u,d)){constructor(){super(...arguments),Object.defineProperty(this,"showModal",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get farmOptions(){return[...this.userFarms.map((e=>({id:e.id,label:this.getFarmName(e),group:this.$gettext("Your farms")}))),...this.sharedFarms.filter((e=>!e.licenseExpired&&(!this.fullAccessRequired||"full_access"===e.shared_farm))).map((e=>({id:e.id,label:this.getFarmName(e),group:this.$gettext("Shared with you")}))),{id:"null",label:this.$gettext("Add farm"),group:""}]}changeFarm(e){"null"!==e.id?this.$router.push({name:this.toRoute||this.$route.name,params:{farmId:e.id},query:Object.assign({},this.$route.query)}):this.showModal=!0}};p=l([(0,a.uA)({name:"FarmPicker",components:{MultiSelect:i.A,UpdateFarmModal:n.A}})],p);const h=p,m=h;var v=r(1656),f=(0,v.A)(m,s,o,!1,null,null,null);const g=f.exports},6935:(e,t,r)=>{e.exports=r.p+"img/mouse-cursor.75063de1.svg"},7146:(e,t,r)=>{r.d(t,{L:()=>o,V:()=>i});const s=e=>({default:{icon:{url:r(5575),size:new e.Size(36,44),origin:new e.Point(0,0),anchor:new e.Point(18,44)},zIndex:4},solved:{icon:{url:r(7343),size:new e.Size(36,44),origin:new e.Point(0,0),anchor:new e.Point(18,44)},zIndex:3},solved_hovered:{icon:{url:r(5275),size:new e.Size(36,44),origin:new e.Point(0,0),anchor:new e.Point(18,44)},zIndex:506}
1,hovered:{icon:{url:r(7105),size:new e.Size(36,44),origin:new e.Point(0,0),anchor:new e.Point(18,44)},zIndex:506},focused:{icon:{url:r(5555),size:new e.Size(36,44),origin:new e.Point(0,0),anchor:new e.Point(18,44)},zIndex:505}}),o=e=>({default:{url:r(2542),size:new e.Size(24,24),origin:new e.Point(0,0),anchor:new e.Point(12,12)},hover:{url:r(1760),size:new e.Size(24,24),origin:new e.Point(0,0),anchor:new e.Point(12,12)},selected:{url:r(6352),size:new e.Size(24,24),origin:new e.Point(0,0),anchor:new e.Point(12,12)},shadow:{url:r(6111),size:new e.Size(24,24),origin:new e.Point(0,0),anchor:new e.Point(12,12)}});function i(e,t){return s(e)[t]}},9200:(e,t,r)=>{r.d(t,{A:()=>b});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"crop-overview"},[t("div",{staticClass:"header text-bold"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Crops")]),!e.isMobile&&e.userHasFullAccessToFarm?t("router-link",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"text-action",attrs:{to:{name:"map-draw",params:{farmId:e.season.farm,seasonId:e.season.id},query:{tab:"crop"}}}},[e._v("Change")]):e._e()],1),t("div",{staticClass:"progress-bar"},e._l(e.selectedCropsProgress.individual,(function(r,s){return t("div",{directives:[{name:"tooltip",rawName:"v-tooltip.notDismissable.allowHTML",value:`<div class='small'>\n <b>${r.cropName}</b><br/>\n (${(r.hectares/e.selectedCropsProgress.total.hectares*100).toFixed(2)}%)\n </div>`,expression:"\n `<div class='small'>\n <b>${cropProgress.cropName}</b><br/>\n (${((cropProgress.hectares / selectedCropsProgress.total.hectares) * 100).toFixed(2)}%)\n </div>`\n ",modifiers:{notDismissable:!0,allowHTML:!0}}],key:r.cropId+s,staticClass:"progress",style:{width:r.hectares/e.selectedCropsProgress.total.hectares*100+"%",backgroundColor:r.cropColor}})})),0),e.userHasFullAccessToFarm?[e.selectedCropsProgress.total.remainingParcels?t("div",{key:"remaining",staticClass:"remaining-parcels-notice"},[t("span",{staticClass:"material-icons"},[e._v("error_outline")]),t("span",{directives:[{name:"translate",rawName:"v-translate",value:{n:e.selectedCropsProgress.total.remainingParcels},expression:"{ n: selectedCropsProgress.total.remainingParcels }"}],staticClass:"text",attrs:{"translate-n":e.selectedCropsProgress.total.remainingParcels,"translate-plural":"Crop to be set on %{ n } parcels"}},[e._v(" Crop to be set on %{ n } parcel ")])]):t("div",{key:"not-remaining",staticClass:"remaining-parcels-notice success"},[t("span",{staticClass:"material-icons"},[e._v("check_circle")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"text"},[e._v(" All parcels have the crop set. ")])])]:e._e(),t("div",{staticClass:"crop-list"},e._l(e.selectedCropsProgress.individual,(function(r,s){return t("div",{directives:[{name:"tooltip",rawName:"v-tooltip",value:r.cropName.length>25?r.cropName:null,expression:"cropProgress.cropName.length > 25 ? cropProgress.cropName : null"}],key:r.cropId+s,staticClass:"crop-item",class:{clickable:e.cropsClickable},on:{click:function(t){e.cropsClickable&&e.$emit("crop-click",r.cropId||"null")}}},[t("div",{staticClass:"crop-color",style:{color:r.cropColor}}),t("div",{staticClass:"crop-name text-bold"},[e._v(e._s(r.cropName))]),t("div",{staticClass:"crop-hectares muted"},[e._v(e._s(e.formatFloat(r.hectares,2))+" ha")])])})),0)],2)},o=[],i=(r(1339),r(3725),r(9471),r(2598),r(8517)),n=r(9442),a=r(5289),c=r(4820),l=function(e,t,r,s){var o,i=arguments.length,n=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(i<3?o(n):i>3?o(t,r,n):o(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n},u=function(e,t,r,s){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function n(e){try{c(s.next(e))}catch(t){i(t)}}function a(e){try{c(s["throw"](e))}catch(t){i(t)}}function c(e){e.done?r(e.value):o(e.value).then(n,a)}c((s=s.apply(e,t||[])).next())}))};const d=(0,n.g_)({season:{type:Object,required:!0},parcels:{type:Array,required:!1,default:null},cropsClickable:{type:Boolean,required:!1,default:!1},cropLimit:{type:Number,required:!1,default:5}}),p=(0,n.cn)(["userHasFullAccessToFarm"]);let h=class extends((0,a.vE)(a.Y5,d,p)){constructor(){super(...arguments),Object.defineProperty(this,"$emit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"overview",{enumerable:!0,configurable:!0,writable:!0,value:[]})}created(){this.loadOverview()}loadOverview(){return u(this,void 0,void 0,(function*(){if(!this.season||!this.season.id)return;if(this.parcels){const e=(0,n.sX)(this.parcels,(e=>{const t=this.getCropIntervalCrop(e.crop_intervals);return t?[...this.getCrop(t).cropIds][0]:"null"}));return void(this.overview=Object.keys(e).map((t=>({crop_id:"null"==t?null:t,total_hectares:e[t].reduce(((e,t)=>e+t.hectares),0).toFixed(2),parcel_count:e[t].length}))))}const e=`/farm/${this.season.farm}/season/${this.season.id}/crop_simple_overview/`;this.overview=yield(0,i.H2)("GET",e),this.$nextTick((()=>{this.$emit("rendered")}))}))}get narrowedOverview(){const e=this.overview.map((e=>{var t;return{cropId:e.crop_id,cropName:this.getCropName(e.crop_id)||"",cropColor:null===(t=this.getCrop(e.crop_id))||void 0===t?void 0:t.color,parcelCount:e.parcel_count,hectares:parseFloat(e.total_hectares)}})).sort(((e,t)=>e.cropId?t.cropId?t.hectares-e.hectares:-1:1));if(this.overview.length<=this.cropLimit)return e;const t=e.slice(this.cropLimit).reduce(((e,t)=>Object.assign(Object.assign({},e),{parcelCount:e.parcelCount+t.parcelCount,hectares:e.hectares+t.hectares})),{cropId:"other",cropName:this.$gettext("Others"),cropColor:"#464646",parcelCount:0,hectares:0});return e.slice(0,5).concat(t)}get selectedCropsProgress(){var e;const t=this.narrowedOverview,r=(null===(e=t.find((e=>!e.cropId)))||void 0===e?void 0:e.parcelCount)||0;return{individual:t,total:{parcelCount:t.reduce(((e,t)=>e+t.parcelCount),0),remainingParcels:r,hectares:t.reduce(((e,t)=>e+t.hectares),0)}}}};l([(0,c.ox)("season"),(0,c.ox)("parcels")],h.prototype,"loadOverview",null),h=l([(0,a.uA)({name:"ManageFarmCropOverview"})],h);const m=h,v=m;var f=r(1656),g=(0,f.A)(v,s,o,!1,null,"60d8e29a",null);const b=g.exports},9264:(e,t,r)=>{r.d(t,{A:()=>v});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"map-controls"},[t("div",{staticClass:"material-icons",attrs:{id:"zoom-in"},on:{click:function(t){return e.zoom(1)}}},[e._v("add")]),t("div",{staticClass:"material-icons",attrs:{id:"zoom-out"},on:{click:function(t){return e.zoom(-1)}}},[e._v("remove")])])}
1,o=[],i=(r(1339),r(9442)),n=r(5289),a=r(2024),c=function(e,t,r,s){var o,i=arguments.length,n=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(i<3?o(n):i>3?o(t,r,n):o(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n};const l=(0,i.g_)({map:{type:Object,required:!0}});let u=class extends((0,n.vE)(n.Y5,l)){mounted(){this.$nextTick((()=>{(0,a.Ay)(this.$el.querySelector("#zoom-in"),{content:`<div>${this.$gettext("Zoom in")}</div><div class="text-center muted-inverted">${this.$gettext("'+' key")}</div>`,allowHTML:!0,placement:"left"}),(0,a.Ay)(this.$el.querySelector("#zoom-out"),{content:`<div>${this.$gettext("Zoom out")}</div><div class="text-center muted-inverted">${this.$gettext("'-' key")}</div>`,allowHTML:!0,placement:"left"})}))}zoom(e){this.map&&this.map.setZoom(this.map.getZoom()+e)}};u=c([(0,n.uA)({name:"ZoomControls"})],u);const d=u,p=d;var h=r(1656),m=(0,h.A)(p,s,o,!1,null,"3a59298f",null);const v=m.exports},9288:(e,t,r)=>{r.d(t,{A:()=>f});var s=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{ref:"sidebarHolder",staticClass:"sidebar-holder"},[t("div",{staticClass:"sidebar-opener",class:{"bordered-sidebar":!e.compact},on:{click:e.showSidebar}},[t("i",{staticClass:"material-icons hamburger-icon",attrs:{title:e.appVersion}},[e._v(" menu ")]),!e.compact&&e.displayName?t("div",{staticClass:"current-farm",attrs:{title:e.appVersion}},[e._v(" "+e._s(e.displayName)+" ")]):e._e()])])},o=[],i=(r(3725),r(2598),r(8119)),n=r(5289),a=r(9442),c=function(e,t,r,s){var o,i=arguments.length,n=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,r):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)n=Reflect.decorate(e,t,r,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(i<3?o(n):i>3?o(t,r,n):o(t,r))||n);return i>3&&n&&Object.defineProperty(t,r,n),n};const l=(0,a.g_)({compact:{type:Boolean,default:!1,required:!1}}),u=(0,a.cn)(["currentFarm","user","farmsWithSeasons"]);let d=class extends((0,n.vE)(n.Y5,l,u)){constructor(){super(...arguments),Object.defineProperty(this,"appVersion",{enumerable:!0,configurable:!0,writable:!0,value:i.KJ.VUE_APP_VERSION})}get displayName(){const e=this.$route.matched.find((e=>e.meta.displayName));return e?e.meta.displayName(this):this.getFarmName(this.currentFarm)}showSidebar(){this.$store.commit("setShowAppSidebar",!0)}};d=c([(0,n.uA)({name:"SidebarOpener"})],d);const p=d,h=p;var m=r(1656),v=(0,m.A)(h,s,o,!1,null,"33b387b8",null);const f=v.exports}}]); 2//# sourceMappingURL=374.db7e29f9.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.