(function(){"use strict";function n(n){function u(n){t.token=n;o()}function f(){return t.cookie}function e(){return r()}function o(){var n=r();t.cookie=n}function s(){return t.token}function h(){t.token=""}function c(n,t){i.currentUser.role=n;i.currentUser.breederId=t}function r(){var t=n.get("__RequestVerificationToken"),i;return(t==""||t==null)&&(i=n.get("_path"),t=n.get("__RequestVerificationToken_"+i)),t}var t=this,i;return t.token="",t.cookie="",i={deleteToken:h,setToken:u,getToken:s,getCookieFromBag:f,giveMeMyNewCookie:e,roleChangeOwnerToBreeder:c,currentUser:{},time:null,publicUserId:0}}angular.module("app").factory("authdata",["$cookies",n])})(),function(){"use strict";function n(n,t){function r(){if(t.isNull(i.masterData)||t.isUndefined(i.masterData))return u().then(function(n){return i.masterData=n,h("WelcomeAlert")})}function u(){return n.query("api/MasterData/GetReferenceData").then(function(n){return n})}function f(){return n.query("api/MasterData/GetBreeds").then(function(n){return n})}function e(){return n.query("api/account/GetRoutes").then(function(n){return n})}function o(t){return n.query("api/MasterData/GetOccupant",[t]).then(function(n){return n})}function s(t,i){return n.query("api/MasterData/GetSuburbs",[i,t]).then(function(n){return n})}function h(t){return n.query("api/MasterData/GetSystemMessage",[t]).then(function(n){n!=null?(i.system.systemMessage=n,i.system.showSystemMessage=!0):i.system.showSystemMessage=!1})}var i={initilizeReferenceData:r,getBreeds:f,getRoutes:e,getOccupant:o,getSuburbsByUserInput:s,system:{showSystemMessage:!1,systemMessage:null}};return i}angular.module("app").factory("ReferenceData",["datacontext","_",n])}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y){function k(t){return n.post("api/UserData/IsValidRoute",{next:t}).then(function(n){return n})}function d(i){return n.post("api/Account/Login",i).then(function(n){return n.hasError||(sessionStorage.setItem("a_uth",JSON.stringify(n)),o.setToken(n.token),o.currentUser={name:n.name,id:n.userIdEnc,role:n.role,sessionId:n.sessionID,breederId:n.breederId,isRecognisedBreeder:n.isRecognisedBreeder},o.publicUserId=null,p.userloggedIn=!0,document.getElementsByName("__RequestVerificationToken").item(0).value=n.token,p.routes=n.routes,n.routes.forEach(function(n){p.defineRoute(n)}),u.reload(),t.$broadcast(e.config.loginsuccess,n),c.watch()),n})}function w(){var n=JSON.parse(sessionStorage.getItem("a_uth")),t;(n==null||n==undefined)&&(t=localStorage.getItem("a_uth"),t!=null&&window.location!=null&&document.location.toString().indexOf("/secure/pay/")>0&&(n=JSON.parse(t),sessionStorage.setItem("a_uth",t),localStorage.removeItem("a_uth")));a.isNull(n)||a.isUndefined(n)?a.toLower(f.path()).indexOf("secure")>-1&&f.path("/"):a.isNull(n.token)||a.isUndefined(n.token)?f.path("/"):(o.currentUser={name:n.name,id:n.userIdEnc,role:n.role,breederId:n.breederId,isRecognisedBreeder:n.isRecognisedBreeder},p.userloggedIn=!0,p.routes=n.routes,n.routes.forEach(function(n){if(n.config.settings&&n.config.settings.isLandingPage){var t=u.routes["/"];s.remove(t.templateUrl);t.templateUrl=n.config.templateUrl;t.settings.content=n.config.settings.content}p.defineRoute(n)}),u.reload(),f.path()=="/logout"?f.path("/"):f.path()=="/"&&f.path(p.getLandingPageRoute().url))}function g(){return y.spinnerShow(),n.query("api/Account/Signout").then(function(n){o.currentUser={};t.$broadcast(e.config.logoutsuccess,n);c.unwatch();p.userloggedIn=!1;localStorage.clear();var i=f.absUrl();i=i.replace(f.url(),"/logout");v.location=i;v.location.reload(!0)})}function nt(){o.currentUser={};t.$broadcast(e.config.logoutsuccess,{});c.unwatch();p.userloggedIn=!1;localStorage.clear();var n=f.absUrl();n=n.replace(f.url(),"/logout");v.location=n;v.location.reload(!0)}function tt(){t.$broadcast(e.config.logoutsuccess,{status:!0});p.userloggedIn=!1;c.unwatch();w()}function it(n){n.config.templateUrl=r+n.config.templateUrl;ft(n.url,n.config)}function rt(){for(var i=null,t,n=0;n<p.routes.length;n++)if(t=p.routes[n],t.config.settings&&t.config.settings.isLandingPage){i=t;break}return i}function ut(){for(var i=[],n,t=0;t<p.routes.length;t++)n=p.routes[t],n.config.settings&&(n.config.settings.isLandingPage!=!0||a.isUndefined(n.config.settings.isLandingPage))&&i.push(n);return i}function ft(n,t){if(u.routes[n]=angular.extend({reloadOnSearch:!0},t,n&&b(n,t)),n){var i=n[n.length-1]=="/"?n.substr(0,n.length-1):n+"/";u.routes[i]=angular.extend({redirectTo:n},b(i,t))}return this}function b(n,t){var r=t.caseInsensitiveMatch,i={originalPath:n,regexp:n},u=i.keys=[];return n=n.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(n,t,i,r){var f=r==="?"?r:null,e=r==="*"?r:null;return u.push({name:i,optional:!!f}),t=t||"",""+(f?"":t)+"(?:"+(f?t:"")+(e&&"(.+?)"||"([^/]+)")+(f||"")+")"+(f||"")}).replace(/([\/$\*])/g,"\\$1"),i.regexp=new RegExp("^"+n+"$",r?"i":""),i}var et=t.$q,p={login:d,isAllowed:k,logout:g,logoutOnPageLoad:tt,softLogout:nt,userloggedIn:!1,defineRoute:it,getLandingPageRoute:rt,getRoutesForMenu:ut,reloadRoutes:w,routes:[]};return p}angular.module("app").factory("authservice",["datacontext","common","$http","ROOT","$route","$location","commonConfig","authdata","$templateCache","moment","Idle","$routeParams","_","$window","spinner",n])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a){function b(){v.menuexpanded=!v.menuexpanded;i.$broadcast("menuexpanded",v.menuexpanded)}function k(n){h.hash(n);a()}function d(){c.isEmpty(s.currentUser)||(v.showPublicMenu=!1,v.showSecureMenu=!0,v.currentUser=s.currentUser,v.currentUser.role=s.currentUser.role,v.currentUser.registrationId=s.currentUser.registrationId,v.profileIncomplete=JSON.parse(sessionStorage.getItem("a_uth")).profileIncomplete);w();r.activateController([],n)}function p(n){v.isBusy=n}function w(){var n;v.currentUser.role=="Breeder"?(v.showRegistrationId=!0,n=v.currentUser.role):v.currentUser.role=="Veterinary"?n="Veterinarian":(v.showRegistrationId=!1,n=v.currentUser.role);v.popoverhtml="Logged in as: "+n;v.showRegistrationId&&v.currentUser.breederId&&(v.popoverhtml=v.popoverhtml+"<br> Breeder Identification Number: "+v.currentUser.breederId)}var v=this,y=u.events;v.isBusy=!0;v.root=e;v.showPublicMenu=!0;v.showSecureMenu=!1;v.currentUser=s.currentUser;v.showRegistrationId=!1;v.popoverhtml="";v.menuexpanded=!1;v.scrollTo=k;v.spinnerOptions={radius:40,lines:10,length:0,width:30,speed:1.7,corners:1,trail:100,color:"#7EC0EE"};v.redoPopoverAndWelcome=w;v.togglemenu=b;v.profileIncomplete=!1;v.accountCollapse=!1;d();t.$on("$routeChangeStart",function(n,t){l.dismissAll();p(!0);o.userloggedIn?s.getToken()==""?c.isUndefined(t.settings)||c.isUndefined(t.settings.openToAll)||c.isNull(t.settings.openToAll)||t.settings.openToAll==!0||h.path("/"):(JSON.parse(sessionStorage.getItem("a_uth"))!=null&&(v.profileIncomplete=JSON.parse(sessionStorage.getItem("a_uth")).profileIncomplete),t.title=="login"&&h.path(o.getLandingPageRoute().url)):c.toLower(h.path()).indexOf("secure")>-1&&h.path("/")});t.$on(y.controllerActivateSuccess,function(){p(!1)});t.$on(y.spinnerToggle,function(n,t){p(t.show)});t.$on(y.loginsuccess,function(){JSON.parse(sessionStorage.getItem("a_uth"))!=null&&(v.profileIncomplete=JSON.parse(sessionStorage.getItem("a_uth")).profileIncomplete);v.showPublicMenu=!1;v.showSecureMenu=!0;v.currentUser=s.currentUser;w()});t.$on(y.logoutsuccess,function(){v.profileIncomplete=!1;v.showPublicMenu=!0;v.showSecureMenu=!1;v.currentUser=s.currentUser;sessionStorage.removeItem("a_uth")})}var n="shell";angular.module("app").controller(n,["$rootScope","$scope","common","config","commonConfig","ROOT","authservice","authdata","$location","_","$uibModalStack","$anchorScroll",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a){function k(){for(var i,t=1;t<=5;t++)v.addSlide(t,"");i=[];r.activateController(i,n).then(function(){v.routes=h;v.openRoutes=g(h)})}function d(n,t){var r=600+y.length+1,i=v.root+"content/images/"+n+".jpg";y.push({image:i,text:t,id:p++})}function g(){return v.routes.filter(function(n){return n.config.settings.openToAll==!0&&n.visible==!0})}function nt(n){return l.find(v.routes,{url:n})}function tt(n){if(!l.isNull(n)&&!l.isUndefined(n)){if(!n.config.title||!s.current||!s.current.title)return"";var t=n.config.title;return s.current.title.substr(0,t.length)===t?"navactive":""}}function it(n,i){v.isMobileMenu&&(v.collapse=!v.collapse);t.screenTitle=i;c.path(n)}function rt(n){v.isMobileMenu&&(v.collapse=!v.collapse);document.activeElement!=document.body&&document.activeElement.blur();a.open(n,"_blank")}function w(){v.collapse=!v.collapse;v.isMobileMenu=!0}function ut(){var n=s.current;return n.showslider==!0?!0:!1}var b=r.logger.getLogFn,ft=b(n),et=u.events,v=this,y,p;v.menu=[];v.isCurrent=tt;v.openRoutes=[];v.root=o;v.collapse=!0;v.loginUrl=o+"Home/Login";v.getRoute=nt;v.navigate=it;v.navigateToLink=rt;v.addSlide=d;v.referenceData=e;v.myInterval=5e3;v.noWrapSlides=!1;v.active=0;v.showSlider=ut;y=v.slides=[];p=0;v.setCollapse=w;v.isMobileMenu=!1;k();i.$on("menuexpanded",function(){w()})}var n="publictopnav";angular.module("app").controller(n,["$rootScope","$scope","common","config","datacontext","ReferenceData","ROOT","$route","routes","$location","_","$window",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h){function a(){i.activateController([],n).then(function(){c.routes=v()})}function v(){var n=s.getRoutesForMenu();return n.filter(function(n){return n.visible==!0})}function y(n){return o.find(c.routes,{url:n})}function p(n){if(!o.isNull(n)&&!o.isUndefined(n)){if(!n.config.title||!u.current||!u.current.title)return"";var t=n.config.title;return u.current.title.substr(0,t.length)===t?"navactive":""}}function w(){c.collapse=!c.collapse;s.logout()}function b(n){c.collapse=!c.collapse;e.path(n)}function k(n){c.collapse=!c.collapse;document.activeElement!=document.body&&document.activeElement.blur();h.open(n,"_blank")}var l=i.logger.getLogFn,d=l(n),c=this;c.menu=[];c.collapse=!0;c.isCurrent=p;c.openRoutes=[];c.root=r;c.getRoute=y;c.landingPageRoute=s.getLandingPageRoute();c.logout=w;c.navigate=b;c.navigateToLink=k;a();f.$on("menuexpanded",function(){c.collapse=!c.collapse})}var n="securetopnav";angular.module("app").controller(n,["datacontext","common","ROOT","$route","$scope","$location","_","authservice","$window",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l){function w(){r.activateController([],n);v()}function b(){console.log("File upload submit");try{grecaptcha.execute()}catch(n){v();u.spinnerShow();setTimeout(function(){grecaptcha.execute()},1e3)}}function k(n){({}).captchaSecret=n;y(a.file)}function v(){if(typeof grecaptcha!="object"||grecaptcha.render==undefined)return setTimeout(v,250);grecaptcha.render("recaptcha",{sitekey:a.sitekey,size:"invisible",callback:k})}function y(){u.spinnerShow();i.upload({url:"api/ImportUser/ImportUserUpload",data:{file:a.file,username:"username"}}).then(function(n){console.log("Success "+n.config.data.file.name+"uploaded. Response: "+JSON.stringify(n.data));a.userData=n.data.importUsersDTO;u.spinnerHide()},function(n){console.log("Error status: "+n.status)},function(n){var t=parseInt(100*n.loaded/n.total);console.log("progress: "+t+"% "+n.config.data.file.name)})}var p=r.logger.getLogFn,d=p(n),a;l.screenTitle="Buyer Search";a=this;u.spinnerHide();a.sitekey=SITEKEY;a.file=null;a.formSubmit=b;w();a.userData=[]}var n="importUser";angular.module("app").controller(n,["datacontext","Upload","common","spinner","ROOT","$route","$scope","$location","_","authservice","$window",t])}(),function(){"use strict";function t(t,i,r,u,f,e){function h(){i.activateController([],n).then(function(){})}function c(){if(o.chipnumber==null||o.chipnumber==""||typeof o.chipnumber=="undefined")return!1;r.spinnerShow();var n=u(o.chipnumber);return t.query("api/AnimalData/PetStatus/",[o.chipnumber]).then(function(n){o.searchClicked=!0;o.petstatusresult=n;r.spinnerHide()})}function l(){return f.isNull(o.chipnumber)||f.isUndefined(o.chipnumber)||o.chipnumber==""?!1:o.petstatusresult!=null?!0:void 0}var s=i.logger.getLogFn,a=s(n),o=this;o.chipnumber=null;o.petstatusresult=null;o.searchClicked=!1;o.petSearchByChip=c;o.showSearchResult=l;o.root=e;h()}var n="publicpetsearch";angular.module("app").controller(n,["datacontext","common","spinner","$sanitize","_","ROOT",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a){function w(){y();t.activateController([],n).then(function(){})}function b(){l.openTemplate("md",null,null,u+"app/public/forgotpassword/ForgetPassword.tmpl.html","Forget")}function k(){v.authResult.hasError=!1;v.domain.userType?v.domain.userType==="0"?v.usernamePlaceholder="Email address":v.domain.userType==="1"&&(v.usernamePlaceholder="Login Id"):v.usernamePlaceholder="Email address"}function d(){if(v.domain.password!=null&&v.domain.password!=""&&v.domain.password!=undefined)try{grecaptcha.execute()}catch(n){y();o.spinnerShow();setTimeout(function(){grecaptcha.execute()},1e3)}}function g(n){for(var i=0,t=0;t<v.loginAttempts.length;t++)v.loginAttempts[t]===n&&i++;return i}function nt(n){if(v.domain.password!=null&&v.domain.password!=""&&v.domain.password!=undefined)return o.spinnerShow(),v.loginAttempts.push(v.domain.username),v.domain.attemptCount=g(v.domain.username),v.domain.password=a.btoa(v.domain.password),v.domain.captchaSecret=n,e.login(v.domain).then(function(n){o.spinnerHide();grecaptcha.reset();n.hasError?v.authResult=n:f.path(e.getLandingPageRoute().url)})}function y(){if(typeof grecaptcha!="object"||grecaptcha.render==undefined)return setTimeout(y,250);try{grecaptcha.render("recaptcha",{sitekey:v.sitekey,size:"invisible",callback:nt})}catch(n){}}var p=t.logger.getLogFn,tt=p(n),v=this;v.domain={username:"",password:"",userType:"",attemptCount:0};v.usertypes=[{text:"Pet Owner/Breeder",value:"0"},{text:"Authorised Vets/Authorised Identifiers",value:"1"}];v.chipnumber="";v.usernamePlaceholder="Email address";v.userTypeChanged=k;v.authenticate=d;v.forgetpassword=b;v.sitekey=SITEKEY;v.loginAttempts=[];v.authResult={};r.screenTitle="Login";w()}var n="login";angular.module("app").controller(n,["common","$scope","$rootScope","ROOT","$location","authservice","spinner","_","datacontext","commonConfig","modalPopupFactory","$window",t])}(),function(){"use strict";var n=angular.module("app");n.directive("uniquechip",["$q","datacontext",function(n,t){return{require:"ngModel",restrict:"A",link:function(i,r,u,f){f.$asyncValidators.uniquechip=function(i,r){var e=n.defer(),o=u.originalMicrochipNo,f=i||r;return f?o.toUpperCase()!=f.toUpperCase()?t.query("api/animaldata/IsChipUsed",[f]).then(function(t){return t?n.reject("exists"):e.resolve()}):n.when():n.when()}}}}]);n.directive("uniqueBreederMembershipNumber",["$q","datacontext",function(n,t){return{require:"ngModel",restrict:"A",link:function(i,r,u,f){f.$asyncValidators.uniqueBreederMembershipNumber=function(i,r){var e=n.defer(),o=u.originalBreederMembershipNumber,f=i||r;return f?o.toUpperCase()!=f.toUpperCase()?t.query("api/OwnerData/IsBreederMembershipNumberUsed",[f]).then(function(t){return t?n.reject("exists"):e.resolve()}):n.when():n.when()}}}}]);n.directive("uniqueemail",["$q","datacontext",function(n,t){return{require:"ngModel",restrict:"A",link:function(i,r,u,f){f.$asyncValidators.uniqueemail=function(i,r){var f=n.defer(),u=i||r;return u?t.query("api/SystemUser/DoesEmailRegistered",[u]).then(function(t){return t==!0?n.reject("exists"):f.resolve()}):n.when()}}}}]);n.directive("uniquepensionernumber",["$q","datacontext",function(n,t){return{require:"ngModel",restrict:"A",link:function(i,r,u,f){f.$asyncValidators.uniquepensionernumber=function(i,r){var f=n.defer(),u=i||r;return u?t.query("api/OwnerData/DoesPensionerNumberExist",[u]).then(function(t){return t==!0?n.reject("exists"):f.resolve()}):n.when()}}}}]);n.directive("isvalidpensionnumber",function(){function n(n,t,i,r){n&&(r.$validators.isvalidpensionnumber=function(n){if(n==null||n==""||n==undefined)return!0;if(n!=null){var t=/^[0-9]{9}[A-Za-z]{1}$/.test(n),i=/^[A-Za-z]{2}[0-9]{6}$/.test(n),r=/^[A-Za-z]{2}[0-9]{6}[A-Za-z]{1}$/.test(n),u=/^[A-Za-z]{3}[0-9]{5}$/.test(n),f=/^[A-Za-z]{3}[0-9]{5}[A-Za-z]{1}$/.test(n),e=/^[A-Za-z]{3}[0-9]{6}[A-Za-z]{1}$/.test(n);return t==!0||i==!0||r==!0||u==!0||f==!0||e==!0?!0:!1}})}return{restrict:"A",require:"ngModel",link:n,scope:{ngRequired:"=ngRequired"}}});n.directive("isBreederIdExists",["$q","datacontext",function(n,t){return{require:"ngModel",restrict:"A",link:function(i,r,u,f){f.$asyncValidators.isBreederIdExists=function(i,r){var e=n.defer(),o=u.originalBreederMembershipNumber,f=i||r;return f?t.query("api/OwnerData/IsBreederIdExists",[f]).then(function(t){return t==!1?n.reject("exists"):e.resolve()}):n.when()}}}}]);n.directive("microchipclaimed",["$q","datacontext",function(n,t){return{require:"ngModel",restrict:"A",link:function(i,r,u,f){f.$asyncValidators.microchipclaimed=function(i,r){var f=n.defer(),u=i||r;return u?t.query("api/OwnerData/DoesMicorchipClaimed",[u]).then(function(t){return t==!0?n.reject("exists"):f.resolve()}):n.when()}}}}]);n.directive("chippeddobdate",["_","$filter","moment",function(n,t,i){return{restrict:"A",require:"ngModel",link:function(n,t,r,u){u.$setValidity("exceedsDOBDate",!0);n.$watch(r.ngModel,function(){var n,t,f;r.dateofbirth!=""&&r.microchipeddate!=""&&(n=r.dateofbirth.split("/"),n!=null&&n.length==3&&(n=new i(n[2]+"-"+n[0]+"-"+n[1])),t=r.microchipeddate.split("/"),t!=null&&t.length==3&&(t=new i(t[2]+"-"+t[1]+"-"+t[0])),f=n.diff(t,"hours"),f>0&&u.$setValidity("exceedsDOBDate",!1))});n.$watch(r.dateofbirth,function(){var n,t,f;r.dateofbirth!=""&&r.microchipeddate!=""&&(n=r.dateofbirth.split("/"),n!=null&&n.length==3&&(n=new i(n[2]+"-"+n[0]+"-"+n[1])),t=r.microchipeddate.split("/"),t!=null&&t.length==3&&(t=new i(t[2]+"-"+t[1]+"-"+t[0])),f=n.diff(t,"hours"),f>0&&u.$setValidity("exceedsDOBDate",!1))})}}}])}(),function(){"use strict";var n=angular.module("app");n.directive("captchavalue",function(){function n(n,t,i,r){n&&(r.$validators.captchavalue=function(n){var t=n,r=i.captchatext;return t!=r?!1:!0})}return{restrict:"A",require:"ngModel",link:n}});n.directive("captchaimage",function(){return{restrict:"EA",templateUrl:ROOT+"app/common/tmpl/carCaptcha.tmpl.html",link:function(n){function r(){var r,t;if(n.captchaSettings.randomText==!1){for(n.captchaSettings.randomText=null,n.captchaSettings.captchaRender="",r=Math.floor(Math.random()*3+6),t=0;t<r;t++)n.captchaSettings.captchaRender+=i.charAt(Math.floor(Math.random()*i.length));n.captchaSettings.randomText=!0}}function u(){return"rgb(255,255,255)"}var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t={captchaRender:null,randomText:!1,randomColour:!0,width:325,height:30,colour:null,font:'bold 26px "Comic Sans MS", cursive, sans-serif',onSuccess:!1};n.captchaSettings=t;n.drawCaptcha=function(){var i=document.getElementById("captcha"),n,s,f,e,o;i.width=t.width;i.height=t.height;n=i.getContext("2d");t.colour=u();s=n.createLinearGradient(0,0,t.width,0);f=n.createLinearGradient(0,0,t.width,0);f.addColorStop(0,t.colour);n.fillRect(0,0,t.width,t.height);n.font=t.font;n.fillStyle=f;e=i.width/2;o=22;n.textAlign="center";r();n.fillText(t.captchaRender,e,o)};n.newCaptcha=function(){n.captchaSettings.randomText=!1;this.drawCaptcha()}}}});n.directive("reCaptcha",["$q","datacontext","SITEKEY",function(n,t,i){function r(n,t,r,u){function o(n){u.$setViewValue(n);u.$render()}function s(){grecaptcha.reset(f);u.$setViewValue("");u.$render()}function e(){if(typeof grecaptcha!="object"||grecaptcha.render==undefined)return setTimeout(e,250);f=grecaptcha.render(t[0],{sitekey:i,callback:o,"expired-callback":s})}var f;u.$validators.captcha=function(n,t){return!!t};e()}return{restrict:"AE",scope:{},require:"ngModel",link:r}}])}(),function(){"use strict";var n=angular.module("app");n.directive("carDropdown",["_","$compile",function(n,t){return{restrict:"EA",replace:!0,priority:1e3,terminal:!0,scope:{domainRules:"=",dropdownData:"=",shouldValidate:"=",modelVar:"@"},template:function(){return'<select  class="form-control" > <\/select>'},compile:function(n,i){return i.shouldValidate=="true"&&n.attr("selectedvalue","true"),{pre:function(){},post:function(n,i){return t(i)(n)}}}}}]);n.directive("carTextbox",["_",function(n){return{restrict:"EA",require:"ngModel",replace:!0,scope:{domainRules:"=",fieldtype:"=?",disabled:"=?"},template:'<input type="{{fieldtype}}" ng-disabled="{{disabled}}" class="form-control" ng-required="checkValidation(\'required\')" ng-maxlength="checkValidation(\'maxlength\')" ng-minlength="checkValidation(\'minlength\')" ng-pattern="checkValidation(\'regex\')" />',link:function(t,i,r){t.fieldtype=r.fieldtype==null||r.fieldtype==undefined?"text":r.fieldtype;t.disabled=r.disabled==null||r.disabled==undefined?"false":r.disabled;t.checkValidation=function(i){var f=n.get(t.domainRules,r.name+"-"+i),u,e;if(i=="required")return f?!0:!1;if(i=="maxlength"){if(f&&(u=n.get(t.domainRules,r.name+"-"+i+"-max"),u))return u}else if(i=="minlength"){if(f&&(u=n.get(t.domainRules,r.name+"-"+i+"-min"),u))return u}else if(i=="regex"&&f&&(e=n.get(t.domainRules,r.name+"-"+i+"-pattern"),e))return e}}}}]);n.directive("selectedvalue",function(){function n(n,t,i,r){n&&(r.$validators.selectedvalue=function(n){return n===""||n===null||n==undefined||angular.equals({},n)?!1:!0})}return{restrict:"A",require:"ngModel",link:n,scope:{ngRequired:"=ngRequired"}}})}(),function(){"use strict";var n=angular.module("app");n.directive("myDate",["$parse",function(){return{restrict:"EAC",require:"?ngModel",link:function(n,t,i,r){r.$parsers.push(function(n){var t=new moment(n);return t.format("MM/DD/YYYY")})}}}]);n.directive("carDatepicker",["_",function(n){return{restrict:"EA",require:"ngModel",replace:!0,template:'<p class="input-group"> <input type="text" ng-blur="onchange()" placeholder="dd/mm/yyyy"  max-date-validation="" min-date-validation="" class="form-control" id="{{dtid}}" name="{{dtname}}" uib-datepicker-popup="{{format}}" ng-model="ngModel"  is-open="opened" min-date="minDate" max-date="maxDate"  datepicker-options="dateOptions"  ng-required="checkValidation(\'required\')"  ng-pattern="checkValidation(\'regex\')" my-date="" /><span class="input-group-btn"><button name="btn{{name}}" type="button" class="btn btn-default" ng-click="open()" ng-disabled="{{disabled}}"><i class="glyphicon glyphicon-calendar" aria-hidden="true"><\/i><\/button><\/span><\/p>',scope:{ngModel:"=ngModel",dateOptions:"@",dateDisabled:"@",opened:"=",minDate:"=minDate",maxDate:"=maxDate",format:"@",options:"@",dtname:"@",dtid:"@",domainRules:"=",onchange:"&",disabled:"=ngDisabled"},link:function(t,i,r,u){t.disabled=r.disabled==null||r.disabled==undefined?"false":r.disabled;u.$formatters.push(function(){});t.open=function(){t.opened=!0};t.checkValidation=function(i){var f=n.get(t.domainRules,r.dtname+"-"+i),u;return i=="required"?f?!0:!1:i=="regex"&&f&&(u=n.get(t.domainRules,r.dtname+"-"+i+"-pattern"),u)?u:void 0}}}}]);n.directive("maxDateValidation",["_","$filter","moment",function(n,t,i){return{require:"ngModel",restrict:"A",link:function(n,t,r,u){u.$parsers.unshift(function(t){var f,o,e,s,h;if(t==null||t==""||t==undefined)return null;if(u.$setValidity("exceedsMaxDate",!0),f=t.split("/"),f!=null&&f.length==3)if(o=new i(f[2]+"-"+f[1]+"-"+f[0]),o.isValid())if(n.maxDate!=null&&n.maxDate.isValid()?e=n.maxDate:(s=r.maxDate.replace(new RegExp('"',"g"),""),e=i(s)),e.isValid()){if(h=o.diff(e,"hours"),r.maxDate)return h>0?u.$setValidity("exceedsMaxDate",!1):u.$setValidity("exceedsMaxDate",!0),t}else return t;else return undefined;else return undefined})}}}]);n.directive("minDateValidation",["_","$filter","moment",function(n,t,i){return{require:"ngModel",restrict:"A",link:function(n,t,r,u){u.$parsers.unshift(function(t){var f,o,e,s,h;if(t==null||t==""||t==undefined)return null;if(u.$setValidity("exceedsMinDate",!0),f=t.split("/"),f!=null&&f.length==3)if(o=new i(f[2]+"-"+f[1]+"-"+f[0]),o.isValid())if(n.minDate!=null&&n.minDate.isValid()?e=n.minDate:(s=r.minDate.replace(new RegExp('"',"g"),""),e=i(s)),e.isValid()){if(h=o.diff(e,"days"),r.minDate)return h<0?u.$setValidity("exceedsMinDate",!1):u.$setValidity("exceedsMinDate",!0),t}else return t;else return undefined;else return undefined})}}}])}(),function(){"use strict";var n=angular.module("app");n.directive("blink",["$timeout",function(n){function t(t,i){function r(){i.css("visibility","visible");n(u,1e3)}function u(){i.css("visibility","hidden");n(r,1e3)}r()}return{restrict:"E",transclude:!0,scope:{},link:t,template:"<span ng-transclude><\/span>",replace:!0}}]);n.filter("highlight",["$sce",function(n){return function(t,i){if(typeof t=="function")return"";if(i){var r="("+i.split(/\ /).join(" |")+"|"+i.split(/\ /).join("|")+")",u=new RegExp(r,"gi");r.length&&(t=t.replace(u,'<span class="highlight">$1<\/span>'))}return n.trustAsHtml(t)}}]);n.directive("backButton",["$window",function(n){return{restrict:"A",link:function(t,i){i.bind("click",function(){n.history.back()})}}}]);n.directive("registrationSteps",["ROOT",function(n){return{restrict:"E",replace:!0,templateUrl:n+"app/common/tmpl/registrationSteps.tmpl.html",scope:{stagevalue:"@",stagenumber:"@"}}}]);n.directive("setClassWhenAtTop",["$window",function(n){var t=angular.element(n);return{restrict:"A",link:function(i,r,u){var f=u.setClassWhenAtTop,e=parseInt(u.paddingWhenAtTop,0),o=r.prop("offsetTop");t.on("scroll",function(){n.pageYOffset+e>=o?(r.addClass(f),angular.element("perregisterlogo").addClass("petregisterlogovisible")):(r.removeClass(f),angular.element("perregisterlogo").addClass("petregisterlogohidden"))})}}}]);n.directive("ccScrollToTop",["$window",function(n){function t(t,i){function u(){r.scrollTop()>300?i.slideDown():i.slideUp()}var r=$(n);i.addClass("totop");r.scroll(u);i.find("a").click(function(n){n.preventDefault();$("body").animate({scrollTop:0},500)})}return{link:t,template:'<a href="#"><i class="fa fa-chevron-up" aria-hidden="true"><\/i><\/a>',restrict:"A"}}]);n.directive("ccSpinner",["$window",function(n){function t(t,i,r){t.spinner=null;t.$watch(r.ccSpinner,function(r){t.spinner&&t.spinner.stop();t.spinner=new n.Spinner(r);t.spinner.spin(i[0])},!0)}return{link:t,restrict:"A"}}]);n.directive("autocomplete",function(){var n=-1;return{restrict:"E",scope:{searchParam:"=ngModel",suggestions:"=data",onType:"=onType",onSelect:"=onSelect",autocompleteRequired:"="},controller:["$scope",function(n){n.selectedIndex=-1;n.initLock=!0;n.setIndex=function(t){n.selectedIndex=parseInt(t)};this.setIndex=function(t){n.setIndex(t);n.$apply()};n.getIndex=function(){return n.selectedIndex};var t=!0;n.completing=!1;n.$watch("searchParam",function(i,r){if(r!==i&&(r||!n.initLock)&&(t&&typeof n.searchParam!="undefined"&&n.searchParam!==null&&(n.completing=!0,n.searchFilter=n.searchParam,n.selectedIndex=-1),n.onType))n.onType(n.searchParam)});this.preSelect=function(){t=!1;n.$apply();t=!0};n.preSelect=this.preSelect;this.preSelectOff=function(){t=!0};n.preSelectOff=this.preSelectOff;n.select=function(i){if(i&&(n.searchParam=i,n.searchFilter=i,n.onSelect))n.onSelect(i);t=!1;n.completing=!1;setTimeout(function(){t=!0},1e3);n.setIndex(-1)}}],link:function(t,i,r){var e,f,u;setTimeout(function(){t.initLock=!1;t.$apply()},250);e="";t.attrs={placeholder:"start typing...","class":"",id:"",inputclass:"",inputid:""};for(f in r)e=f.replace("attr","").toLowerCase(),f.indexOf("attr")===0&&(t.attrs[e]=r[f]);r.clickActivation&&(i[0].onclick=function(){t.searchParam||setTimeout(function(){t.completing=!0;t.$apply()},200)});u={left:37,up:38,right:39,down:40,enter:13,esc:27,tab:9};document.addEventListener("keydown",function(n){var i=n.keyCode||n.which;switch(i){case u.esc:t.select();t.setIndex(-1);t.$apply();n.preventDefault()}},!0);document.addEventListener("blur",function(){setTimeout(function(){t.select();t.setIndex(-1);t.$apply()},150)},!0);i[0].addEventListener("keydown",function(i){var f=i.keyCode||i.which,r=angular.element(this).find("li").length;if(t.completing&&r!=0)switch(f){case u.up:if(n=t.getIndex()-1,n<-1)n=r-1;else if(n>=r){n=-1;t.setIndex(n);t.preSelectOff();break}t.setIndex(n);n!==-1&&t.preSelect(angular.element(angular.element(this).find("li")[n]).text());t.$apply();break;case u.down:if(n=t.getIndex()+1,n<-1)n=r-1;else if(n>=r){n=-1;t.setIndex(n);t.preSelectOff();t.$apply();break}t.setIndex(n);n!==-1&&t.preSelect(angular.element(angular.element(this).find("li")[n]).text());break;case u.left:break;case u.right:case u.enter:case u.tab:n=t.getIndex();n!==-1?(t.select(angular.element(angular.element(this).find("li")[n]).text()),f==u.enter&&i.preventDefault()):f==u.enter&&t.select();t.setIndex(-1);t.$apply();break;case u.esc:t.select();t.setIndex(-1);t.$apply();i.preventDefault();break;default:return}})},template:'        <div class="autocomplete {{ attrs.class }}" id="{{ attrs.id }}">          <input            type="text"            ng-model="searchParam"            placeholder="{{ attrs.placeholder }}"            class="form-control {{ attrs.inputclass }}"            id="{{ attrs.inputid }}"            autocomplete="off"            ng-required="{{ autocompleteRequired }}" />          <ul ng-show="completing && (suggestions ).length > 0">            <li              suggestion              ng-repeat="suggestion in suggestions | orderBy:\'toString()\' track by $index"              index="{{ $index }}"              val="{{ suggestion }}"              ng-class="{ active: ($index === selectedIndex) }"              ng-click="select(suggestion)"              ng-bind-html="suggestion | highlight:searchParam"><\/li>          <\/ul>        <\/div>'}});n.directive("login",["ROOT",function(n){return{restrict:"E",templateUrl:n+"app/common/tmpl/login.tmpl.html"}}]);n.directive("customOnChange",[function(){function n(n,t){if(n.vm){var i=n.vm.handleFileSelect;t.bind("change",i)}}return{link:n,restrict:"A"}}]);n.directive("pageTitle",["$rootScope",function(n){function t(t,i,r){n.screenTitle=r.pageTitle}return{link:t,restrict:"A"}}])}(),function(){"use strict";var n=angular.module("app");n.directive("suggestion",function(){return{restrict:"A",require:"^autocomplete",link:function(n,t,i,r){t.bind("mouseenter",function(){r.preSelect(i.val);r.setIndex(i.index)});t.bind("mouseleave",function(){r.preSelectOff()})}}});n.directive("carOffenceMessage",["ROOT",function(n){return{restrict:"EA",templateUrl:n+"app/common/tmpl/offence.tmpl.html"}}]);n.directive("vpErrorMessage",["ROOT",function(n){return{restrict:"EA",templateUrl:n+"app/partials/errorMessage.html",scope:{error:"@"}}}]);n.directive("vpRequiredMessage",["ROOT",function(n){return{restrict:"EA",templateUrl:n+"app/partials/requiredMessage.html",scope:{error:"@"}}}]);n.directive("vpObservationHeader",["ROOT",function(n){return{restrict:"EA",templateUrl:n+"app/partials/obsheader.html",scope:{shownavigation:"=",showcopy:"=",showprint:"=",showsave:"=",showdelete:"=",printfn:"&",deletefn:"&",savefn:"&",copyfn:"&",form:"="}}}])}(),function(){"use strict";var n=angular.module("app");n.directive("carValidate",["_",function(){return{restrict:"A",require:"ngModel",scope:{ngRequired:"=ngRequired"},link:function(n){n.isRequired2=function(){}}}}]);n.directive("carStandardValidation",["_",function(n){return{restrict:"EA",replace:!0,compile:function(t,i){function v(n,t,o){if(n!="")return angular.forEach(n,function(n){h==0?(e=t.replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n),r=o.replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n)):(e=e+" || "+t.replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n),r=r+o.replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n).replace("<elementName>",n));r!=""&&(f=i.domainRules,u="{{vm.getProperty("+f+",'"+n+"-required')}}",r=r.replace("<requiredErrorMessage>",u),u="{{vm.getProperty("+f+",'"+n+"-minlength')}}",r=r.replace("<minLengthErrorMessage>",u),u="{{vm.getProperty("+f+",'"+n+"-equals')}}",r=r.replace("<equalsErrorMessage>",u),u="{{vm.getProperty("+f+",'"+n+"-maxlength')}}",r=r.replace("<maxLengthErrorMessage>",u),u="{{vm.getProperty("+f+",'"+n+"-regex')}}",r=r.replace("<patternErrorMessage>",u),u="{{vm.getProperty("+f+",'"+n+"-date')}}",r=r.replace("<dateErrorMessage>",u),u="{{vm.getProperty("+f+",'"+n+"-required')}}",r=r.replace("<selectErrorMessage>",u));h++}),r}function g(n,t){if(n!=""&&i.customValidations.length!=0){var u='<ul data-ng-messages="<formName>.<elementName>.$error" data-ng-show="<formName>.<elementName>.$touched || <formName>.$submitted"> <li data-ng-message="<ruleName>" class="field-validation-error" onClick="document.getElementsByName(\'<elementName>\')[0].focus()" style="cursor: pointer;"><customErrorMessage><\/li><\/ul>';return u=u.replace("<formName>",i.formName).replace("<formName>",i.formName).replace("<formName>",i.formName).replace("<formName>",i.formName),angular.forEach(n,function(n){if(angular.isString(n))var i=JSON.parse(n);h==0?(e=t.replace("<elementName>",i.elementName).replace("<elementName>",i.elementName).replace("<elementName>",i.elementName),r=u.replace("<elementName>",i.elementName).replace("<elementName>",i.elementName).replace("<elementName>",i.elementName),r=r.replace("<ruleName>",i.ruleName),r=r.replace("<customErrorMessage>",i.customErrorMessage)):(e=e+" || "+t.replace("<elementName>",i.elementName).replace("<elementName>",i.elementName).replace("<elementName>",i.elementName).replace("<elementName>",i.elementName),r=r+u.replace("<elementName>",i.elementName).replace("<elementName>",i.elementName).replace("<elementName>",i.elementName),r=r.replace("<ruleName>",i.ruleName),r=r.replace("<customErrorMessage>",i.customErrorMessage));h++}),r}}var s=i.name,w=i.formTextElements.split(";"),b=i.formSelectElements.split(";"),k=i.formDateElements.split(";"),d=i.customValidations.split(";"),f=i.domainRules,e="",r="",u="",h=0,y,o="((<formName>.<elementName>.$touched && <formName>.<elementName>.$invalid)  || <formName>.$submitted)",c,l,a,p;o=o.replace("<formName>",i.formName).replace("<formName>",i.formName).replace("<formName>",i.formName);c='<ul data-ng-messages="<formName>.<elementName>.$error" data-ng-show="((<formName>.<elementName>.$touched && <formName>.<elementName>.$invalid) || <formName>.$submitted)"><li data-ng-message="required" class="field-validation-error" onClick="document.getElementsByName(\'<elementName>\')[0].focus()" style="cursor: pointer;"><requiredErrorMessage><\/label><\/li><li data-ng-message="minlength" class="field-validation-error" onClick="document.getElementsByName(\'<elementName>\')[0].focus()" style="cursor: pointer;"><minLengthErrorMessage><\/label><\/li><li data-ng-message="minlength" class="field-validation-error" onClick="document.getElementsByName(\'<elementName>\')[0].focus()" style="cursor: pointer;"><equalsErrorMessage><\/label><\/li><li data-ng-message="maxlength" class="field-validation-error" onClick="document.getElementsByName(\'<elementName>\')[0].focus()" style="cursor: pointer;"><maxLengthErrorMessage><\/label><\/li><li data-ng-message="pattern" class="field-validation-error" onClick="document.getElementsByName(\'<elementName>\')[0].focus()" style="cursor: pointer;"><patternErrorMessage><\/label><\/li><\/ul>';c=c.replace("<formName>",i.formName).replace("<formName>",i.formName).replace("<formName>",i.formName).replace("<formName>",i.formName);v(w,o,c);l='<ul data-ng-messages="<formName>.<elementName>.$error" data-ng-show="((<formName>.<elementName>.$touched && <formName>.<elementName>.$invalid) || <formName>.$submitted)"><li data-ng-message="required" class="field-validation-error" onClick="document.getElementsByName(\'<elementName>\')[0].focus()" style="cursor: pointer;"><requiredErrorMessage><\/label><\/li><li data-ng-message="date" class="field-validation-error" onClick="document.getElementsByName(\'<elementName>\')[0].focus()" style="cursor: pointer;"><dateErrorMessage><\/label><\/li><\/ul>';l=l.replace("<formName>",i.formName).replace("<formName>",i.formName).replace("<formName>",i.formName).replace("<formName>",i.formName);v(k,o,l);a='<ul data-ng-messages="<formName>.<elementName>.$error" data-ng-show="((<formName>.<elementName>.$touched && <formName>.<elementName>.$invalid) || <formName>.$submitted)"><li data-ng-message="selectedvalue" class="field-validation-error" onClick="document.getElementsByName(\'<elementName>\')[0].focus()" style="cursor: pointer;"><selectErrorMessage><\/label><\/li><\/ul>';a=a.replace("<formName>",i.formName).replace("<formName>",i.formName).replace("<formName>",i.formName).replace("<formName>",i.formName);v(b,o,a);g(d,o);y=n.isUndefined(i.errorHeading)||n.isNull(i.errorHeading)?"":i.errorHeading;p='<div name="top'+s+'" id="top'+s+'"><div name="'+s+'" id="'+s+'" class="alert alert-danger" role="alert" data-ng-show="'+e+'" frmvalidstate="{{'+i.formName+'.$valid}}" standard-validation-visibility><strong><i class="fa fa-exclamation-triangle" aria-hidden="true"><\/i> Please correct following errors '+y+"<\/strong>"+r+"<\/div><\/div>";t.replaceWith(p)}}}]);n.directive("standardValidationVisibility",[function(){return{restrict:"A",link:function(n,t,i){var u=i.name,r="top"+i.name;n.$watch(function(){t.children().find("li").length>0&&i.frmvalidstate?(t.addClass("standardvalidationvisible"),t.removeClass("standardvalidationhidden"),angular.element(document.getElementById(r)).addClass("standardvalidationvisible"),angular.element(document.getElementById(r)).removeClass("standardvalidationhidden")):(t.addClass("standardvalidationhidden"),t.removeClass("standardvalidationvisible"),angular.element(document.getElementById(r)).addClass("standardvalidationhidden"),angular.element(document.getElementById(r)).removeClass("standardvalidationvisible"))})}}}]);n.directive("equals",function(){return{restrict:"A",require:"?ngModel",link:function(n,t,i,r){if(r){n.$watch(i.ngModel,function(){u()});i.$observe("equals",function(){u()});var u=function(){var n=r.$viewValue,t=i.equals;r.$setValidity("equals",!n||!t||n===t)}}}}})}(),function(){"use strict";var n=angular.module("app");n.directive("passwordValidation",["_",function(){return{require:"ngModel",restrict:"A",link:function(n,t,i,r){r.$parsers.unshift(function(n){var t,f,i;if(n==null||n==""||n==undefined)return null;r.$setValidity("asciiInvalid",!0);var u=n,e=u.length;for(t=0;t<e;t++)if(f=u[t],i=f.charCodeAt(),i<33||i>126){r.$setValidity("asciiInvalid",!1);break}return n})}}}])}(),function(){"use strict";var n=angular.module("app");n.filter("atLeastOneFieldSelected",function(){return function(n){for(var t in n)if(n.hasOwnProperty(t)&&n[t]&&n[t].$invalid&&n[t].$dirty)return!0;return!1}});n.filter("propsFilter",function(){return function(n,t){var i=[],r;return angular.isArray(n)?(r=Object.keys(t),n.forEach(function(n){for(var f,e,u=0;u<r.length;u++)f=r[u],e=t[f],n[f]!==e&&i.push(n)})):i=n,i}})}(),function(){"use strict";function t(t){function u(){t.activateController([],n).then(function(){})}var i=t.logger.getLogFn,f=i(n),r=this;r.title="Admin";u()}var n="admin";angular.module("app").controller(n,["common",t])}(),function(){"use strict";function t(t,i,r,u,f,e){function h(){i.activateController([],n).then(function(){})}var s=i.logger.getLogFn,c=s(n),l=i.$q,o;t.screenTitle="Veterinarian Dashboard";o=this;o.referenceData=e;o.title="Dashboard";h()}var n="dashboard";angular.module("app").controller(n,["$rootScope","common","$http","datacontext","spinner","ReferenceData","$window",t])}(),function(){"use strict";function t(t,i,r,u,f,e){function h(){i.activateController([],n).then(function(){localStorage.removeItem("g_search_olg")})}var s=i.logger.getLogFn,c=s(n),l=i.$q,o;t.screenTitle="Admin Dashboard";o=this;o.referenceData=e;o.title="Dashboard";h()}var n="admindashboard";angular.module("app").controller(n,["$rootScope","common","$http","datacontext","spinner","ReferenceData","$window",t])}(),function(){"use strict";function t(t,i,r,u,f,e){function h(){i.activateController([],n).then(function(){})}var s=i.logger.getLogFn,c=s(n),l=i.$q,o;t.screenTitle="Council User Dashboard";o=this;o.referenceData=e;o.title="Dashboard";h()}var n="councildashboard";angular.module("app").controller(n,["$rootScope","common","$http","datacontext","spinner","ReferenceData","$window",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c){function y(){i.activateController([],n).then(function(){})}function a(){f.spinnerShow();var n=h("date")(new Date,"yyyyMMdd");return u.query("api/Breeder/GetBreederOrganisations",[l.breederOrganisationId]).then(function(t){l.breederOrganisations=t;l.verifiedBreeders=_.filter(l.breederOrganisations,function(t){return t.verified==!0&&h("date")(t.expiryDate,"yyyyMMdd")>=n});l.nonVerifiedBreeders=_.filter(l.breederOrganisations,function(t){return t.verified==null||t.verified==!0&&h("date")(t.expiryDate,"yyyyMMdd")<n});l.rowCollectionNonVerified=angular.copy(l.nonVerifiedBreeders);l.rowCollectionVerified=angular.copy(l.verifiedBreeders);f.spinnerHide()})}function p(n){c.openTemplate("md",{domain:l.nonVerifiedBreeders,breederType:"unVerified",recordIndex:n},null,ROOT+"app/verifybreeder/updatebreederstatus.tmpl.html","updatebreederstatuscontroller").then(function(){a()})}function w(n){var t=l.verifiedBreeders[n];c.openTemplate("md",{domain:l.verifiedBreeders,breederType:"verified",recordIndex:n},null,ROOT+"app/verifybreeder/updatebreederstatus.tmpl.html","updatebreederstatuscontroller").then(function(){a()})}function b(n){l.isLoading=!0;var i=n.pagination,r=i.start||0,u=i.number||10;t.getPage(r,u,n,l.breederOrganisationId).then(function(t){l.breederOrganisations=t.data;l.verifiedBreeders=_.filter(l.breederOrganisations,function(n){return n.verified==!0});l.nonVerifiedBreeders=_.filter(l.breederOrganisations,function(n){return n.verified==!1});n.pagination.numberOfPages=t.numberOfPages;l.isLoading=!1})}var v=i.logger.getLogFn,k=v(n),d=i.$q,l=this;l.referenceData=e;l.callServer=b;l.breederOrganisationId=null;l.breederOrganisations=[];l.verifiedBreeders=[];l.nonVerifiedBreeders=[];l.rowCollectionNonVerified=[];l.expiryMaxDate=new moment("31/12/9999","DD/MM/YYYY");l.expiryMinDate=new moment;l.title="Verify Breeder";l.itemsByPage=15;l.rowCollectionVerified=[];l.isLoading=!1;y();l.getBreederOrganisations=a;l.editNonVerifiedBreeder=p;l.editVerifiedBreeder=w}var n="verifybreeder";angular.module("app").controller(n,["breederFactory","common","$http","datacontext","spinner","ReferenceData","$window","$scope","$filter","modalPopupFactory",t])}(),function(){"use strict";function n(n,t,i,r,u){function e(){f.domain=angular.copy(i.data.domain,f.domain);f.recordIndex=angular.copy(i.data.recordIndex,f.recordIndex);f.breederType=angular.copy(i.data.breederType,f.breederType);f.currentRecord=f.domain[f.recordIndex];f.currentRecord.breederType=f.breederType;f.breederType=="verified"&&(f.expiryMinDate=new moment("1900/01/01"))}function o(){t.close()}function s(){if(f.frmChangeBredderStatus.$valid)return u.post("api/Breeder/UpdateBreederMembershipDetails",f.currentRecord).then(function(n){n&&(f.statusUpdated=!0)})}function h(){f.disableNextButton=!1;f.recordIndex<f.domain.length-1?(f.statusUpdated=!1,f.disablePrevButton=!1,f.recordIndex=f.recordIndex+1,f.currentRecord=f.domain[f.recordIndex],f.currentRecord.expiryDate!=null&&(f.currentRecord.expiryDate=new Date(f.currentRecord.expiryDate))):f.disableNextButton=!0}function c(){f.disablePrevButton=!1;f.recordIndex!=0?(f.statusUpdated=!1,f.disableNextButton=!1,f.recordIndex=f.recordIndex-1,f.currentRecord=f.domain[f.recordIndex],f.currentRecord.expiryDate!=null&&(f.currentRecord.expiryDate=new Date(f.currentRecord.expiryDate))):f.disablePrevButton=!0}function l(n,t){return _.get(n,t)}var f=this;f.domain=[];f.currentRecord={};f.recordIndex=null;f.breederType=null;f.domainRules=i.rules;f.saveBreedDetails=s;f.nextBreeder=h;f.prevBreeder=c;f.cancel=o;f.getProperty=l;f.statusUpdated=!1;f.disableNextButton=!1;f.disablePrevButton=!1;f.expiryMinDate=new moment;f.breederValidations={"expiryDate-required":"Expiry Date is required.","expiryDate-date":"The Expirty Date must be a date. Format dd/mm/yyyy."};e()}angular.module("app").controller("updatebreederstatuscontroller",["common","$uibModalInstance","config","ReferenceData","datacontext","$scope","spinner",n])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h){function a(){u.activateController([],n).then(function(){var t=localStorage.getItem("g_search_olg"),n;t!=null&&(n=JSON.parse(t),c.firstName=n.firstName,c.lastName=n.lastName,c.breederId=n.breederId,c.searchType=n.searchType,c.searchresults=n.searchresults,c.searchResultsCount=n.searchResultsCount,c.searchType=n.searchType,c.isSubmitted=n.isSubmitted)})}function v(){var n,t;c.searchType==2?(n={param1:c.breederId,param2:""},t="api/VetData/Searchbreeder"):c.searchType==1&&(n={param1:c.firstName,param2:c.lastName},t="api/SystemUser/SearchSystemUsers");c.isSubmitted=!0;y(n,t).then(function(n){c.searchresults=n;c.searchResultsCount=!o.isUndefined(n)&&!o.isNull(n)?n.length:0;localStorage.setItem("g_search_olg",JSON.stringify(c))})}function y(n,t){return r.post(t,n)}function p(){return c.searchresults}function w(n){var t=c.searchresults[n];h.path("/secure/profile/"+t.systemUserID)}var l=u.logger.getLogFn,b=l(n),c;t.screenTitle="Search Owner-Breeder";c=this;c.firstName=null;c.lastName=null;c.breederId=null;c.searchType=null;c.searchresults=[];c.doSearch=v;c.editUser=w;c.getUsers=p;c.isSubmitted=!1;c.searchResultsCount=0;a()}var n="usersearch";angular.module("app").controller(n,["$rootScope","authdata","datacontext","common","spinner","$sanitize","_","ReferenceData","$location",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a,v){function et(){u.activateController([],n).then(function(){})}function ot(){return y.createdNewPet==!0?!0:c.isUndefined(y.chipId)||c.isNull(y.chipId)||y.chipId==""?!1:y.domain!=null?!0:!1}function p(){y.showAddLitter=!1;y.showAddLitterForm=!1;y.control.createView=y.control.updateView=y.control.searchView=!1;y.control.showResultMessage=!1;y.control.showExistsMessage=!1;y.control.showCreateSuccessfulMessage=!1;y.control.invalidChipId=!1;y.control.failedToCreate=!1;y.control.showServerError=!1;y.control.showDateError=!1;y.control.showDesexedDateError=!1;y.breederDoesnotExists=!1;y.breederAutoPopulated=!1;y.showDesexedPopup=!0;y.showMothersMicrochipField=!1}function st(){y.control.showResultMessage=!1;y.control.showExistsMessage=!1;y.domain=null;y.control.invalidChipId=!1;y.notifications=null;y.control.createView=!1;y.control.updateView=!1;y.control.showDateError=!1;y.control.showDesexedDateError=!1;y.showDesexedPopup=!0}function ht(){y.showDesexedPopup=!0}function ct(n){return!(typeof n=="string"&&!n.trim()||typeof n=="undefined"||n==null)}function tt(){return e.query("api/VetData/GetPetRegisterDefinition").then(function(n){return y.ownerDomainRules=n.ownerValidation,y.petDomainRules=n.petValidation,y.statusupdateRules=n.statusupdatedef,y.otherupdateRules=n.otherupdateddef,n})}function lt(n,t){return c.get(n,t)}function it(n,t){var i=c.find(n,{value:t});if(i!=null)return i.text}function at(n,t){var i=c.find(n,{breedID:t});if(i!=null)return i.breed}function vt(n){return n=="1"?"Male":n=="2"?"Female":"Unknown"}function yt(n){return n=="4"?"Mobile":n=="5"?"Home":n=="6"?"Work":"Not provided"}function pt(n){return!n||/^\s*$/.test(n)}function wt(){return y.domain==null?"Unknown":y.domain.pet==null?"Unknown":y.domain.pet.petDesexedId=="1"||y.domain.pet.desexedAfterRegistration=="1"?"Yes":y.domain.pet.petDesexedId=="0"?"No":y.domain.pet.petDesexedId=="98"?"No - Not Recommended (up to 18 months)":y.domain.pet.petDesexedId=="99"?"No - Not Recommended for life":"Unknown"}function bt(){if(p(),y.chipId==null||y.chipId==""||typeof y.chipId=="undefined"){y.control.invalidChipId=!0;return}return o.spinnerShow(),e.query("api/VetData/SearchPet/",[y.chipId]).then(function(n){y.domain=n;y.isEditable=!1;o.spinnerHide();y.domain!=null?(y.control.showResultMessage=!1,y.originalPetDesexedId=y.domain.pet.petDesexedId,y.control.searchView=!0,k()):y.control.showResultMessage=!0;y.isEditable=y.domain.isWithinOneMonth&&!y.domain.isCreatedbyAnotherVet||y.domain.isWithinOneMonth})}function kt(){if(p(),y.chipId==null||y.chipId==""||typeof y.chipId=="undefined"){y.control.invalidChipId=!0;return}y.showMyLitter=!1;y.actualMicrochipNumber=y.chipId;o.spinnerShow();e.query("api/VetData/SearchPet/",[y.chipId]).then(function(n){if(y.domain=n,console.log("Response",n),y.domain!=null)y.control.showExistsMessage=!0;else return y.control.showExistsMessage=!1,tt().then(function(n){return y.domain=n.data,y.domain.pet.petStatusId=y.referenceData.masterData.animalStatus[0].value,y.domain.pet.petOwnershipStatusId=y.referenceData.masterData.ownerStatus[0].value,y.domain.pet.speciesId=y.referenceData.masterData.species[1].value,y.domain.pet.microchipedDate=null,y.petDOBMinDate=moment().subtract(30,"year"),y.petMinDesexedDate=moment(y.domain.pet.petDOB),y.domain.pet.microchipNo=y.chipId,y.domain.pet.petOutofDate=0,y.domain.pet.petGenderId=null,y.domain.owner.ownerBestContactType=4,y.control.createView=!0,y.isEditable=!0,y.showMothersMicrochipField=!0,y.frmHolder.createnew.$setPristine(),y.frmHolder.createnew.$setUntouched(),nt()})});o.spinnerHide()}function dt(){if(p(),y.chipId==null||y.chipId==""||typeof y.chipId=="undefined"){y.control.invalidChipId=!0;return}return y.createdNewPet=!1,y.actualMicrochipNumber=y.chipId,o.spinnerShow(),e.query("api/VetData/SearchPet/",[y.chipId]).then(function(n){if(y.domain=n,o.spinnerHide(),y.domain!=null)return y.originalPetDesexedId=y.domain.pet.petDesexedId,y.microchipedMinDate=moment(y.domain.pet.petDOB),y.petDOBMinDate=moment().subtract(30,"year"),y.petMinDesexedDate=moment(y.domain.pet.petDOB),y.control.showResultMessage=!1,y.control.updateView=!0,y.domain.litters=y.domain.litterList,y.showMyLitter=er(),k(),y.frmHolder.createnew.$setPristine(),y.domain.isWithinOneMonth?y.domain.isCreatedbyAnotherVet?(y.isEditable=!1,d().then(function(){return nt()})):(y.isEditable=!0,di(),tt().then(function(){return d().then(function(){return nt()})})):(y.isEditable=!1,d().then(function(){return nt()}));y.control.showResultMessage=!0;console.log("vm.domain.pet.interstateTransferVerified",y.domain.pet.interstateTransferVerified)})}function gt(){return w().then(function(){$uibModalInstance.dismiss("cancel")})}function ni(){$uibModalInstance.dismiss("cancel")}function ti(){if(y.domain.pet.petDesexedId==1&&y.showDesexedPopup)if(y.domain.pet.desexed!="Yes"){if(!y.desexedDateCheck()){y.control.showDesexedDateError=!0;return}a.openConfirmMsg("md","Are you sure you want to mark this pet as de-sexed ?").then(function(n){n&&(w(),k())})}else w();else if(y.showMothersMicrochipField){if(o.spinnerShow(),y.domain.pet.motherMicrochipNumber)return e.query("api/VetData/SearchPet/",[y.domain.pet.motherMicrochipNumber]).then(function(n){n?(y.motherAnimalDto=n,y.motherAnimalDto.pet.speciesId!=y.domain.pet.speciesId||y.motherAnimalDto.pet.petOutofDate?y.control.showMotherMicrochipError=!0:(y.control.showMotherMicrochipError=!1,w()),o.spinnerHide()):o.spinnerHide()});w()}else w()}function w(){var n=pi();if(n==!1){y.control.showDateError=!0;return}if(rt()==!1){y.control.showDesexedDateError=!0;return}return(y.control.showDateError=!1,y.control.showDesexedDateError=!1,y.control.createView==!0)?(o.spinnerShow(),y.domain.pet.petDesexedId!=1&&(y.domain.pet.desexedDate=null),e.post("api/VetData/CreatePetRegistration",y.domain).then(function(n){y.lastCommitedMicrochipNumber=y.domain.pet.microchipNo;p();y.serverResponse=n;y.control.showCreateSuccessfulMessage=n.status;y.control.showServerError=!n.status;y.chipId=null;y.control.createView=!0;y.actualMicrochipNumber="";y.createdNewPet=!0;y.frmHolder.createnew.$setPristine();y.frmHolder.createnew.$setUntouched();y.frmHolder.createnew.microchipNo.$touched=!0;y.showDesexedPopup=!1;o.spinnerHide();h.scrollTo(0,0)})):y.control.updateView==!0?(o.spinnerShow(),e.post("api/VetData/UpdatePetRegistration",y.domain).then(function(n){return p(),y.lastCommitedMicrochipNumber=y.domain.pet.microchipNo,y.control.showCreateSuccessfulMessage=!0,y.frmHolder.createnew.$setPristine(),k(),o.spinnerHide(),h.scrollTo(0,0),n})):void 0}function ii(){p()}function ri(){return y.frmHolder.createnew.microchipNo.$touched&&y.frmHolder.createnew.microchipNo.$invalid}function ui(){return tt().then(function(){var n={statusupdateRules:y.statusupdateRules,otherupdateRules:y.otherupdateRules};a.openTemplate("lg",{pet:y.domain.pet,owner:y.domain.owner,notifications:y.petNotifications,registration:y.domain.petRegistrationDetails},n,l+"app/petregistration/changePetStatus.tmpl.html","petstatusController").then(function(){k()})})}function fi(){y.domain.pet.desexedDate=null}function ei(){y.domain.pet.addedByVet=!0;y.showAddLitterForm=!0}function oi(){y.sameAsPetAddress&&(y.domain.owner.ownerStreetAddress1=y.domain.pet.petStreetAddress1,y.domain.owner.ownerStreetAddress2=y.domain.pet.petStreetAddress2,y.domain.owner.ownerSuburb=y.domain.pet.petSuburb,typeof y.domain.pet.petStateId!="undefined"&&(y.domain.owner.ownerStateId=y.domain.pet.petStateId),y.domain.owner.ownerPostCode=y.domain.pet.petPostalCode)}function si(){return y.domain!=undefined?y.domain.pet.petGenderId=="2"&&y.userRole=="Veterinary"&&y.domain.pet.petDesexedId=="0"?!0:!1:!1}function d(){if(y.domain.pet.microchipNo!=null)return e.query("api/VetData/PetNotifications/",[y.domain.pet.microchipNo]).then(function(n){y.petNotifications=n;y.petNotifications!=null&&(y.petNotifications.controlOrders.notificationStatus?y.notifications=!0:y.petNotifications.dangerousDogs.notificationStatus?y.notifications=!0:y.petNotifications.menacingDogs.notificationStatus?y.notifications=!0:y.petNotifications.nuisancePets.notificationStatus?y.notifications=!0:y.petNotifications.restrictedDogs.notificationStatus?y.notifications=!0:y.petNotifications.undesexedCats.notificationStatus&&(y.notifications=!0),y.petNotifications.undesexedCats.notificationStatus||y.petNotifications.undesexedCats.permitStatusID>=1&&y.petNotifications.undesexedCats.permitStatusID<=8&&(y.notifications=!0),y.petNotifications.restrictedDogs.notificationStatus||y.petNotifications.restrictedDogs.permitStatusID==1&&(y.notifications=!0))})}function hi(){var n,t;if(y.domain!=null&&(n=c.find(y.referenceData.masterData.breeds,{breedID:y.domain.pet.breedId}),n!=null))return n.restricted==1?(t=c.find(y.referenceData.masterData.breeds,{breedID:y.domain.pet.crossBreedId}),t!=null?t.restricted==1?!0:!1:!0):!1}function ci(){y.microchipedMinDate=moment(y.domain.pet.petDOB);y.petMinDesexedDate=moment(y.domain.pet.petDOB);y.getDesexedStatus()}function li(){if(y.domain.pet.isOwnerSameAsBreeder==!1)return!0}function ai(){if(y.domain.pet.breederId!=null&&y.domain.pet.breederId!="")return o.spinnerShow(),e.post("api/vetdata/getbreeder",{param1:y.domain.pet.breederId}).then(function(n){y.domain.owner=n;y.domain.owner.systemUserId==0?y.breederDoesnotExists=!0:(y.breederDoesnotExists=!1,y.control.createView==!0&&(y.domain.pet.petStreetAddress1=y.domain.owner.ownerStreetAddress1,y.domain.pet.petSuburb=y.domain.owner.ownerSuburb,y.domain.pet.petStateId=y.domain.owner.ownerStateId,y.domain.pet.petPostalCode=y.domain.owner.ownerPostCode));y.breederAutoPopulated=!0;o.spinnerHide()})}function vi(){y.domain.owner.ownerTitleId=null;y.domain.owner.ownerFirstname=null;y.domain.owner.ownerLastname=null;y.domain.owner.ownerBestContactType=4;y.domain.owner.ownerContactNumber=null;y.domain.owner.ownerEmail=null;y.domain.owner.ownerId=0;y.domain.owner.systemUserId=0;y.domain.owner.breederAddress=null;y.domain.owner.ownerStreetAddress1=null;y.domain.owner.ownerSuburb=null;y.domain.owner.ownerStateId=null;y.domain.owner.ownerPostCode=null;y.domain.pet.petStreetAddress1=null;y.domain.pet.petSuburb=null;y.domain.pet.petStateId=null;y.domain.pet.petPostalCode=null;y.breederAutoPopulated=!1;y.breederDoesnotExists=!1}function yi(){if(y.domain!=null&&y.domain.pet!=null&&(y.domain.pet.petGenderId==null||y.domain.pet.petGenderId==undefined||y.domain.pet.petGenderId==""))return"diverror"}function pi(){var n=new moment(g(y.domain.pet.petDOB)),t=new moment(g(y.domain.pet.microchipedDate)),i=n.diff(t,"hours");return i>0?!1:!0}function rt(){if(y.domain.pet.petDesexedId==0)return!0;if(y.domain.pet.petDesexedId==1&&y.domain.pet.desexedDate==null)return!1;var n=new moment(g(y.domain.pet.petDOB)),t=new moment(g(y.domain.pet.desexedDate)),i=n.diff(t,"hours");return i>0?!1:!0}function g(n){var t,i;if(n!=null){if(Object.prototype.toString.call(n)==="[object Date]")return n;if(n.indexOf("/")>0){if(t=n.split("/"),t!=null&&t.length==3)return i=new moment(t[2]+"-"+t[0]+"-"+t[1]),t[2]+"-"+t[0]+"-"+t[1]}else return n=="0001-01-01T00:00:00"?(new moment).format("DD-MM-YYYY"):n.indexOf("-")>0?n.length>=10?n.substring(0,10):n:moment(n).format("DD-MM-YYYY")}else return(new moment).format("DD-MM-YYYY")}function wi(){p();y.control.createView=!0;y.domain.pet.petColor=null;y.microchipedMaxDate=new moment;y.petDOBMaxDate=new moment;y.petMaxDesexedDate=new moment;y.actualMicrochipNumber="";y.domain.pet.microchipedDate=new Date;y.domain.pet.microchipNo=null;y.domain.pet.interstateTransferVerified=!1;y.domain.pet.petName=null;y.domain.pet.speciesId=1;y.domain.pet.petDesexedId=0;y.domain.pet.breedId=null;y.domain.pet.crossBreedId=null;y.domain.pet.petDOB=null;y.domain.pet.petGenderId=null;y.domain.pet.petColor=null;y.domain.pet.petOutofDate=!1;y.domain.pet.petIdentificationMarks=null;y.domain.pet.petAdditionalComments=null;y.domain.pet.petStreetAddress1=null;y.domain.pet.petStreetAddress2=null;y.domain.pet.petSuburb=null;y.domain.pet.petStateId=null;y.domain.pet.petPostalCode=null;y.domain.pet.isOwnerSameAsBreeder=null;y.domain.pet.originalBreederId=null;y.domain.pet.breederId=null;y.domain.owner.ownerTitleId=null;y.domain.owner.ownerFirstname=null;y.domain.owner.ownerLastname=null;y.domain.owner.ownerBestContactType=4;y.domain.owner.ownerContactNumber=null;y.domain.owner.ownerEmail=null;y.frmHolder.createnew.$setPristine();y.frmHolder.createnew.$setUntouched()}function bi(){return function(n){if(y.domain!=null&&y.domain.pet!=null&&y.domain.pet!=null&&n!=null){var t;return t=y.domain.pet.petDOB!=null?moment().diff(y.domain.pet.petDOB,"months",!0):19,t<=18?n.value==0||n.value==1||n.value==98||n.value==99:n.value==0||n.value==1||n.value==99}}}function ki(){return function(n){return n.value==1||n.value==2||n.value==3}}function di(){var n;n=y.domain.pet.petDOB!=null?moment().diff(y.domain.pet.petDOB,"months",!0):19;(y.domain.pet.speciesId==1||y.domain.pet.speciesId==2)&&n>18&&y.domain.pet.petDesexedId==98&&(y.domain.pet.petDesexedId=null);y.petNotifications!=null&&(y.petNotifications.dangerousDogs.notificationStatus==1||y.petNotifications.menacingDogs.notificationStatus==1||y.petNotifications.nuisancePets.notificationStatus==1||y.petNotifications.restrictedDogs.notificationStatus==1||y.petNotifications.restrictedByBreed.notificationStatus==1||y.petNotifications.soldByPoundShelter.notificationStatus==1)&&y.domain.pet.petDesexedId==99&&(y.domain.pet.petDesexedId=null)}function gi(n){var t=a.openTemplate("md",{domain:y.domain.pet,litter:n,typeOfMode:"edit"},null,l+"app/petprofile/addLitter.html","litterAddController").then(function(){b()})}function nr(n){a.openConfirmMsg("md","Are you sure you want to delete the litter ?").then(function(t){if(t)return e.query("api/AnimalData/RemoveAnimalLitter",[n.litterID]).then(function(n){n&&b()})})}function b(){return o.spinnerShow(),e.query("api/MyLitter/GetAnimalLitterDetails/",[y.domain.pet.encMicrochipNo]).then(function(n){y.domain.litters=n;y.domain.litters!=null&&k();o.spinnerHide()})}function k(){if((y.userRole=="Breeder"||y.userRole=="Veterinary"||y.userRole=="Implanter")&&y.domain.pet.petDesexedId==0&&y.domain.pet.petGenderId==2&&y.domain.pet.petStatusId===1){var t=it(y.referenceData.masterData.species,y.domain.pet.speciesId),n=ut();(t=="Cat"&&n>4||t=="Dog"&&n>6&&n<=120)&&(y.showAddLitter=!0)}else y.showAddLitter=!1}function ut(){var n=moment(y.domain.pet.petDOB),t=moment(),i=moment.duration(t.diff(n));return i.asMonths()}function tr(n,t){var i="add";if(y.domain.selectedOffspringId=t||0,y.domain.selectedLitterId=n||0,y.domain.selectedLitterId>0&&y.domain.selectedOffspringId>0?i="edit":y.domain.selectedLitterId>0&&(y.domain.selectedOffspringId==null||y.domain.selectedOffspringId==0)&&(i="addoffspring"),i!="add"||(y.validateLitterDateAgainstAllLitters(),!y.isLitterAlreadyExistsWithSameDate))return y.domain.editingLitter.litterSpeciesID=y.domain.pet.speciesId,y.domain.editingLitter.motherBreedId=y.domain.pet.breedId,y.domain.editingLitter.motherAnimalID=y.domain.pet.animalId,a.openTemplate("md",{domain:y.domain,typeOfMode:i},null,l+"app/petprofile/addOffspring.html","offspringAddController").then(function(){b()}),!1}function ir(n,t){y.domain.selectedOffspringId=t;y.domain.selectedLitterId=n;a.openTemplate("md",{domain:y.domain,typeOfMode:"delete"},null,l+"app/petprofile/deleteOffspring.tmpl.html","offspringAddController").then(function(){b()})}function rr(){var n=0;return y.domain!=null&&y.domain.litters&&y.domain.litters.length!==0&&y.domain.litters.forEach(function(t){n+=t.offspringCount}),n}function ur(){y.isLitterAlreadyExistsWithSameDate=!1;y.domain.litters!=null&&y.domain.litters.length>0&&y.domain.litters.forEach(function(n){moment(n.dateOfLitter).diff(moment(y.domain.editingLitter.dateOfLitter),"days")==0&&(y.isLitterAlreadyExistsWithSameDate=!0)})}function fr(n){return y.userRole=="Implanter"||y.userRole=="Veterinary"||y.userRole=="Breeder"?n!=null?n.offspringMicrochipNumber!=null&&n.offspringMicrochipNumber.length>0?!0:!1:!0:!0}function nt(){return e.query("api/MyLitter/GetLitterDefinition").then(function(n){y.petLitterDomainRules=n.litterValidation;y.domain.editingLitter=n.data;y.dateMinMax={};y.dateMinMax.maxLitterDOB=moment();y.domain.pet.species=="Cat"?y.dateMinMax.minLitterDOB=moment(y.domain.pet.petDOB).add(4,"months"):y.domain.pet.species=="Dog"&&(y.dateMinMax.minLitterDOB=moment(y.domain.pet.petDOB).add(6,"months"))})}function er(){if(y.domain!=undefined){if(y.domain.litters!=null&&y.domain.litters.length>0)return!0;if(y.domain.pet.petGenderId==2&&(y.userRole=="Veterinary"||y.userRole=="Implanter")&&y.domain.pet.petDesexedId==0&&y.domain.owner.ownerId>0){var t=it(y.referenceData.masterData.species,y.domain.pet.speciesId),n=ut();return t=="Cat"&&n>4||t=="Dog"&&n>6&&n<=120?!0:!1}return!1}return!1}function or(){return y.notifications!=null&&(y.petNotifications.controlOrders.notificationStatus||y.petNotifications.dangerousDogs.notificationStatus||y.petNotifications.menacingDogs.notificationStatus||y.petNotifications.nuisancePets.notificationStatus||y.petNotifications.restrictedDogs.notificationStatus||y.petNotifications.undesexedCats.notificationStatus)}function sr(){return!y.isEditable||y.domain.isCreatedbyAnotherVet&&y.domain.isWithinOneMonth}var ft=u.logger.getLogFn,hr=ft(n),v=u.$q,y;t.screenTitle="Identify / Update Details";y=this;y.testDate=new moment((new moment).format("DD-MM-YYYY"),"DD-MM-YYYY");y.frmHolder={};y.root=l;y.referenceData=s;y.chipId=null;y.title="Vet";y.searchResult=[];y.showIsBreedable=!1;y.petDOBMaxDate=new moment;y.petMaxDesexedDate=new moment;y.petMinDesexedDate=new moment;y.microchipedMaxDate=new moment;y.microchipedMinDate=new moment("01/05/2010","DD/MM/YYYY");y.getMyLitter=b;y.userRole=r.currentUser.role;y.control={showResultMessage:!1,showSearchResult:!1,showExistsMessage:!1,showCreateSuccessfulMessage:!1,createView:!1,searchView:!1,updateView:!1,showMotherMicrochipError:!1,showDesexedDateError:!1};y.actualMicrochipNumber="";y.showStatusChange=ui;y.getProperty=lt;y.doSearch=bt;y.doCreate=kt;y.doUpdate=dt;y.commit=w;y.cancel=ii;y.checkPhoneNumber=ct;y.inputChange=st;y.microchipnoChange=ht;y.isPetInformationCorrect=ri;y.queryBySelectedValue=it;y.getSelectedBreed=at;y.getPetGenderText=vt;y.isEditable=!1;y.breederDoesnotExists=!1;y.getPetDesexedStatus=wt;y.getBestContactType=yt;y.isEmptyString=pt;y.okClick=gt;y.cancelClick=ni;y.commitConfirmation=ti;y.reusePetAddressForOwner=oi;y.showSearchResult=ot;y.getRestrictedBreedStatus=hi;y.petDOBChanged=ci;y.showOriginalBreederId=li;y.getBreederDetails=ai;y.breederIdChanged=vi;y.genderNotSelected=yi;y.getDesexedStatus=bi;y.refresh=wi;y.createdNewPet=!1;y.lastCommitedMicrochipNumber="";y.showIsBreedable=!1;y.showAddLitterPopup=ei;y.editLitter=gi;y.getMyLitter=b;y.deleteLitter=nr;y.shouldDisplayAddLitter=si;y.showAddLitter=!1;y.showAddLitterForm=!1;y.showMyLitter=!1;y.showMothersMicrochipField=!1;y.motherAnimalDto={};y.addEditOffSpring=tr;y.getOffspringCount=rr;y.validateLitterDateAgainstAllLitters=ur;y.disableOffspringEditRemove=fr;y.deleteOffSpring=ir;y.areThereNotificationsForDisplay=or;y.desexedDateCheck=rt;y.petDesexedIdChange=fi;y.getPetStatus=ki;y.canShowEditPopup=sr;et();i.$watch("vm.domain.pet.petDOB",function(n){var t,i;n!=null&&(t=n.split("/"),t!=null&&t.length==3&&(i=new moment(t[2]+"-"+t[0]+"-"+t[1]),y.microchipedMinDate=i,y.petMinDesexedDate=i))});t.$on("addLitter",function(n,t){y.domain.litters.push(t)});t.$on("updateLitter",function(n,t){var i=y.domain.litters.indexOf(t);y.domain.litters[i]=t});t.$on("approveLitter",function(){b()});t.$on("showAddLitter",function(){k()});t.$on("getNotifications",function(){d()})}var n="vet";angular.module("app").controller(n,["$rootScope","$scope","authdata","common","$http","datacontext","spinner","ReferenceData","$window","_","ROOT","modalPopupFactory","$q",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h){function y(){u.activateController([],n).then(function(){localStorage.removeItem("g_search_olg")})}function p(){var t=o.find(c.referenceData.masterData.breeds,{breedID:c.domain.pet.breedId}),n=o.find(c.referenceData.masterData.breeds,{breedID:c.domain.pet.crossBreedId});return t!=null?t.restricted==1?n==null||n==undefined?!0:n.restricted==1?!0:!1:!1:!1}function w(){if(c.notifications=!1,c.restrictedBreed=!1,c.chipId==null||c.chipId==""||typeof c.chipId=="undefined"){c.chipNotExists=!1;c.invalidChipId=!0;return}return c.invalidChipId=!1,f.spinnerShow(),r.query("api/VetData/SearchPet/",[c.chipId]).then(function(n){c.domain=n;c.domain!=null&&(tt(),c.isPureBreed=c.domain.pet.crossBreedId==0||o.isNull(c.domain.pet.crossBreedId)||o.isUndefined(c.domain.pet.crossBreedId)?!0:!1,c.domain.litters=c.domain.litterList,c.domain.litters!=null&&(c.showMyLitter=a(),c.showMyLitter&&c.domain.pet.petDesexedId=="0"&&(c.showAddLitter=!0)));f.spinnerHide();c.chipNotExists=c.domain!=null?!1:!0})}function b(){return o.isUndefined(c.chipId)||o.isNull(c.chipId)||c.chipId==""?!1:c.domain!=null?!0:!1}function k(){return c.domain==null?"Unknown":c.domain.pet==null?"Unknown":c.domain.pet.petDesexedId=="1"?"Yes":c.domain.pet.petDesexedId=="0"?"No":c.domain.pet.petDesexedId=="98"?"No - Not Recommended (up to 18 months)":c.domain.pet.petDesexedId=="99"?"No - Not Recommended for life":"Unknown"}function l(n,t){var i=o.find(n,{value:t});if(i!=null)return i.text}function d(n,t){var i=o.find(n,{breedID:t});if(i!=null)return i.breed}function g(n){return n=="1"?"Male":n=="2"?"Female":"Unknown"}function nt(n){return n=="4"?"Mobile":n=="5"?"Home":n=="6"?"Work":"Not provided"}function tt(){if(c.domain.pet.microchipNo!=null)return r.query("api/VetData/PetNotifications/",[c.domain.pet.microchipNo]).then(function(n){c.petNotifications=n;c.petNotifications!=null&&(c.petNotifications.controlOrders.notificationStatus?c.notifications=!0:c.petNotifications.dangerousDogs.notificationStatus?c.notifications=!0:c.petNotifications.menacingDogs.notificationStatus?c.notifications=!0:c.petNotifications.nuisancePets.notificationStatus?c.notifications=!0:c.petNotifications.restrictedDogs.notificationStatus?c.notifications=!0:c.petNotifications.restrictedByBreed.notificationStatus?c.notifications=!0:c.petNotifications.undesexedCats.notificationStatus&&(c.notifications=!0),c.petNotifications.undesexedCats.notificationStatus||c.petNotifications.undesexedCats.permitStatusID>=1&&c.petNotifications.undesexedCats.permitStatusID<=8&&(c.notifications=!0),c.petNotifications.restrictedDogs.notificationStatus||c.petNotifications.restrictedDogs.permitStatusID==1&&(c.notifications=!0))})}function a(){return c.domain!=undefined?c.domain.pet.petGenderId=="2"&&c.domain.litters.length>0&&(c.userRole=="Implanter"||c.userRole=="Veterinary")?!0:!1:!1}function it(n,t){var i="add";return c.domain.selectedOffspringId=t||0,c.domain.selectedLitterId=n||0,c.domain.selectedLitterId>0&&c.domain.selectedOffspringId>0&&(i="edit"),i=="add"&&(c.domain.selectedLitterId>0&&(i="addoffspring"),c.domain.newLitter={},c.domain.newLitter.motherSpeciesId=c.domain.pet.speciesId,c.domain.newLitter.motherBreedId=c.domain.pet.breedId),h.openTemplate("md",{domain:c.domain,typeOfMode:i},null,ROOT+"app/petprofile/addOffspring.html","offspringAddController").then(function(){ft()}),!1}function rt(){var n=0;return c.domain.litters&&c.domain.litters.length!==0&&c.domain.litters.forEach(function(t){n+=t.offspringCount}),n}function ut(){c.isLitterAlreadyExistsWithSameDate=!1;c.domain.litter&&c.domain.litter.dateOfLitter&&(c.domain.litters.forEach(function(n){moment(n.dateOfLitter).diff(moment(c.domain.litter.dateOfLitter),"days")==0&&(c.isLitterAlreadyExistsWithSameDate=!0)}),c.isLitterAlreadyExistsWithSameDate&&(c.domain.litter.dateOfLitter=null))}function ft(){return f.spinnerShow(),r.query("api/MyLitter/GetAnimalLitterDetails/",[c.domain.pet.encMicrochipNo]).then(function(n){c.domain.litters=n;c.domain.litters!=null&&et();f.spinnerHide()})}function et(){if((c.userRole=="Breeder"||c.userRole=="Veterinarian"||c.userRole=="Implanter")&&c.domain.petDesexedId=="0"&&c.domain.petGenderId=="2"){var t=l(c.referenceData.masterData.species,c.domain.speciesId),n=calculatePetAgeInMonths();(t=="Cat"&&n>4||t=="Dog"&&n>6&&n<=120)&&(c.showAddLitter=!0)}}function ot(){return!0}var v=u.logger.getLogFn,st=v(n),c;t.screenTitle="Search pet by Microchip Number";c=this;c.chipNumber=null;c.isPureBreed=!1;c.referenceData=s;c.userRole=i.currentUser.role;c.doSearch=w;c.showSearchResult=b;c.queryBySelectedValue=l;c.getPetDesexedStatus=k;c.getSelectedBreed=d;c.getPetGenderText=g;c.getBestContactType=nt;c.getRestrictedBreedStatus=p;c.shouldDisplayMyLitter=a;c.domain=null;c.showIsBreedable=!1;c.showMyLitter=!1;c.showAddLitter=!1;c.petNotifications=null;c.chipNotExists=!1;c.invalidChipId=!1;c.notifications=!1;c.restrictedBreed=!1;c.isEditable=!1;c.litters=[];c.addEditOffSpring=it;c.getOffspringCount=rt;c.validateLitterDateAgainstAllLitters=ut;c.disableOffspringEditRemove=ot;y()}var n="petsearch";angular.module("app").controller(n,["$rootScope","authdata","datacontext","common","spinner","$sanitize","_","ReferenceData","modalPopupFactory",t])}(),function(){"use strict";function t(t,i,r,u,f,e){function p(){i.activateController([],n);h()}function c(n){return r.spinnerShow(),n.searchCriteria=o.microchipNumber,t.post("api/Animalwelfare/SearchByMicroChip",n).then(function(n){console.log(n);o.isMicrochipSearchSelected=!0;o.microchipSearchResult=n?n[0]:null;r.spinnerHide();s(1);grecaptcha.reset()})}function l(n){return r.spinnerShow(),n.searchCriteria=o.rehomingbodyNumber,t.post("api/Animalwelfare/SearchByRHBNumber",n).then(function(n){o.isRehomingSearchSelected=!0;o.rehomingSearchResult=n?n[0]:null;r.spinnerHide();s(2);grecaptcha.reset()})}function a(n){return o.breederSearchResult="",o.petMicrochiNumber="",o.petSearchResult="",r.spinnerShow(),n.searchCriteria=o.breederNumber,t.post("api/Animalwelfare/SearchByBreeder",n).then(function(n){if(o.isBreederSearchSelected=!0,n?(console.log("response",n),o.breederSearchResult=n):o.breederSearchResult=null,r.spinnerHide(),o.breederSearchResult!=null&&o.breederSearchResult.length>0){var t=o.breederSearchResult.length/o.itemsBypage,i=o.breederSearchResult.length%o.itemsBypage;o.pageCount=t;i>0&&(o.pageCount+=1)}s(3);grecaptcha.reset()})}function v(n){return o.petSearchResult="",o.noChipNumber="",o.noLitters="",r.spinnerShow(),n.searchCriteria1=o.breederNumber,n.searchCriteria2=o.petMicrochiNumber,t.post("api/Animalwelfare/SearchByPetMicrochipNumber",n).then(function(n){if(console.log("litters",n),o.isPetSearchSelected=!0,n?(console.log("response",n),o.noChipNumber=n.noChipNumber,o.noLitters=n.noLitters,o.petSearchResult=n.petResultList):o.petMicrochipNumberSearchResult=null,r.spinnerHide(),o.petSearchResult!=null&&o.petSearchResult.length>0){var t=o.petSearchResult.length/o.itemsBypage,i=o.petSearchResult.length%o.itemsBypage;o.pageCount=t;i>0&&(o.pageCount+=1)}s(3);grecaptcha.reset()})}function w(n){var t={};t.captchaSecret=n;switch(o.searchType){case 1:c(t);break;case 3:a(t);break;case 2:l(t);break;case 4:v(t)}}function b(n){o.isBreederSearchSelected=!1;o.isMicrochipSearchSelected=!1;o.isRehomingSearchSelected=!1;o.isPetSearchSelected=!1;o.searchType=n;try{grecaptcha.execute()}catch(t){h();r.spinnerShow();setTimeout(function(){grecaptcha.execute()},1e3)}}function k(){return(o.microchipSearchResult==null||o.microchipSearchResult.length==0)&&o.isMicrochipSearchSelected}function d(){return(o.rehomingSearchResult==null||o.rehomingSearchResult.length==0)&&o.isRehomingSearchSelected}function g(){return(o.breederSearchResult==null||o.breederSearchResult.length==0)&&o.isBreederSearchSelected}function h(){if(typeof grecaptcha!="object"||grecaptcha.render==undefined)return setTimeout(h,250);grecaptcha.render("recaptcha",{sitekey:o.sitekey,size:"invisible",callback:w})}function s(n){switch(n){case 1:o.breederSearchResult=null;o.rehomingSearchResult=null;o.rehomingbodyNumber=null;o.breederNumber=null;break;case 2:o.breederSearchResult=null;o.microchipSearchResult=null;o.microchipNumber=null;o.breederNumber=null;break;case 3:o.microchipSearchResult=null;o.rehomingSearchResult=null;o.microchipNumber=null;o.rehomingbodyNumber=null}}function nt(n){var t="";return o.petMicrochiNumber!=undefined&&n.offspringMicrochip!=undefined&&o.petMicrochiNumber==n.offspringMicrochip?(t='<table style="font-size: 0.8em;"><tbody>',t=n.desexed=="1"?t+'<tr><th style="border: 1px solid #dddddd; text-align: left; padding: 8px;">Desexed<\/th><td style="border: 1px solid #dddddd; text-align: left; padding: 8px; font-size: .6em !important;">Yes<\/td><\/tr>':t+'<tr><th style="border: 1px solid #dddddd; text-align: left; padding: 8px;">Desexed<\/th><td style="border: 1px solid #dddddd; text-align: left; padding: 8px;">No<\/td><\/tr>',t=n.dangerousPermitRequired==!0||n.restrictedPermitRequired==!0||n.undesexedPermitRequired==!0?t+'<tr><th style="border: 1px solid #dddddd; text-align: left; padding: 8px;">Permit status<\/th><td style="border: 1px solid #dddddd; text-align: left; padding: 8px;">Permit required - Yes<\/td><\/tr>':t+'<tr><th style="border: 1px solid #dddddd; text-align: left; padding: 8px;">Permit status<\/th><td style="border: 1px solid #dddddd; text-align: left; padding: 8px;">Permit required - No<\/td><\/tr>',t=n.registered=="1"?t+'<tr><th style="border: 1px solid #dddddd; text-align: left; padding: 8px;">Registration status<\/th><td style="border: 1px solid #dddddd; text-align: left; padding: 8px;">Yes<\/td><\/tr>':t+'<tr><th style="border: 1px solid #dddddd; text-align: left; padding: 8px;">Registration status<\/th><td style="border: 1px solid #dddddd; text-align: left; padding: 8px;">No<\/td><\/tr>',t+"<\/tbody><\/table> "):!1}var y=i.logger.getLogFn,tt=y(n),o;f.screenTitle="Buyer Search";o=this;o.microchipNumber=null;o.rehomingbodyNumber=null;o.breederNumber=null;o.petMicrochiNumber=null;o.petSearchResult=null;o.noChipNumber=!1;o.noLitters=!1;o.microchipSearchResult=null;o.rehomingSearchResult=null;o.breederSearchResult=null;o.root=e;o.itemsBypage=10;o.pageCount=1;o.searchType=0;o.isMicrochipSearchSelected=!1;o.isBreederSearchSelected=!1;o.isPetSearchSelected=!1;o.isRehomingSearchSelected=!1;o.sitekey=SITEKEY;o.searchByMicrochipNumber=c;o.searchByRehomingbodyNumber=l;o.searchByBinNumber=a;o.searchByPetMicrochipNumber=v;o.formSubmit=b;o.noResultsForMCSearch=k;o.noResultsForRHBSearch=d;o.noResutlsForBINSearch=g;o.getBreederDetailPopoverHTML=nt;o.registered=0;p()}var n="animalwelfare";angular.module("app").controller(n,["datacontext","common","spinner","$sanitize","$rootScope","ROOT","_","$timeout",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h){function l(){t.activateController([],n).then(function(){c.routes=e})}function a(n){return _.find(c.routes,{url:n})}function v(n){s.path(n)}function y(){o.location.href="http://www.petregistry.nsw.gov.au/car"}var c=this;c.ROOT=h;c.root=h;c.getRoute=a;c.navigate=v;c.linkToCAR=y;c.inquires=["Euthanasia rates and re-homing options for surrendered or abandoned companion animals","The breeding of companion animals including the practices of “puppy farms”","The sale of companion animals","The microchipping and desexing of companion animals","Current education programs on “responsible pet ownership”","Dangerous dogs","Any other high priority companion animal issues that become apparent to the Taskforce."];c.roleId=!_.isUndefined(u.role)&&!_.isNull(u.role)?u.role:0;l()}var n="staticpage";angular.module("app").controller(n,["common","$http","$rootScope","$routeParams","commonConfig","routes","$window","$location","ROOT",t])}(),function(){"use strict";function n(n,t,i,r){n.question_dtls=[{group:"General:",questions:[{question:"Who can use the NSW Pet Registry?",answer:"The majority of cat and dog owners in NSW can pay their registration fee online using the Pet Registry."},{question:"Who can’t use the NSW Pet Registry?",answer:i.trustAsHtml("If you are a registered breeder seeking the discounted registration fee, you will need to visit your local council and take copies of breeder certificates.<br><br>Owners of Assistance animals, working dogs and pensioners (other than aged pensioners) are also not able to use the NSW Pet Registry.")},{question:"My pet is already microchipped and registered, do I have to register again?",answer:i.trustAsHtml("No, you don't need to register again but you should create a 'pet owner' profile on the NSW Pet Registry. You can 'link' your pets, which locks them to your profile. Next, check that your contact details are correct. Up to date details help ensure you and your cat or dog can be reunited should they become lost or injured.<br><br>Your registration is complete when you have paid your once-only, lifetime registration fee.")},]},{group:"Registering your pets:",questions:[{question:"How do I register my pet?",answer:i.trustAsHtml("The Companion Animals Act 1998 (the Act) and the Companion Animals Regulation 2018 (the Regulation) sets out the requirement to identify and register companion animals in NSW and prescribes lifetime registration and annual permit fees.<br><br>All pet owners are encouraged to have their dog or cat desexed before registering it. Under the legislation, the relevant desexing age for a dog is 6-months (refer Regulation clause 18), and 4-months for a cat (refer Act Section 11B(1)).<br><br>Having a dog or cat desexed prior to registration helps to reduce straying, fighting and aggression and antisocial behaviour, such as spraying to mark territory. It also helps to reduce the number of unwanted pets born each year. <br><br>Having a dog or cat desexed prior to registration helps to reduce straying, fighting and aggression and antisocial behaviour, such as spraying to mark territory. It also helps to reduce the number of unwanted pets born each year. <br><br>You can register your pet by using the <a href='https://www.petregistry.nsw.gov.au/' target='_blank'>NSW Pet Registry<\/a>. For step by step instructions on how to set up your account, linking your pet and then paying the relevant fees, please refer to the <a href='https://www.petregistry.nsw.gov.au/content/downloads/NSW_Pet_Registry_User_Guides_Pet_Owners_Breeders.pdf' target='_blank'> User Guide <\/a> for full details.<br><br>Some pets such as Assistance Animals and Working Dogs will require you to register through your Local NSW Council. Contact information for your nearest NSW local council is available on the Local Government Directory page of the <a href='http://www.olg.nsw.gov.au/' target='_blank'>Office of Local Government website<\/a>. ")},{question:"How do I register my Assistance Animal?",answer:i.trustAsHtml("In NSW, all cats and dogs are classified as companion animals under the Act. They must be lifetime registered by the time they reach 6 months of age, which includes being microchipped by 12 weeks of age. There are different classifications of lifetime registration, including registration as an assistance animal. Assistance animals must be microchipped and registered, but their owners do not have to pay a registration fee.<br><br>An assistance animal is an animal that is trained to provide assistance to people with a disability to help alleviate the effect of that disability. In NSW, an assistance animal is an animal that is either:<ol><li>accredited under a law of a State or Territory that provides for the accreditation of animals trained to assist a person with a disability to alleviate the effect of that disability; OR<\/li>  <li>accredited by an animal training organisation prescribed by the Commonwealth; OR<\/li><li>trained to assist a person with a disability to alleviate the effect of that disability, and, to meet standards of hygiene and behaviour appropriate for an animal in a public place.<\/li><\/ol><br><br>This is based on how assistance animals are defined in Commonwealth law (<i>Disability Discrimination Act 1992<\/i>). Currently neither the Commonwealth or NSW laws provide for the accreditation of assistance animals. However other States including South Australia, Queensland and Western Australia have accreditation systems.<br><br>If you are the owner of an animal that you would like to have registered as an assistance animal then you will need liaise with your local council to find out what information you need to provide to establish that the animal is eligible to be registered as such.<br><br>The law recognises that a person with a disability is entitled to train their own animal or to have it trained by any handler or organisation. As at June 2016 there is no assessment or accreditation framework for assistance animals. In considering an application to register an animal as an assistance animal council is entitled to request reasonable proof that the:<ul><li>person/owner has a disability<\/li><li>animal is/has been trained to alleviate the effect of the disability; and<\/li><li>animal is/has been trained to meet standards of hygiene and behaviour appropriate for an animal in a public place.<\/li><\/ul><br><br>It is a matter for each council to decide on the level of proof required, however councils must recognise any animal accredited in other Australian jurisdictions. It is also recommended that councils always accept the following as proof that an animal is eligible to be registered as an assistance animal:<br><br><ul><li>documents that show the animal has passed a Public Access Test (PAT);<\/li><li>documents that show the animal has been accepted as an assistance animal by an Australian government agency, including a State or Territory government-issued access card, transport pass or permit;<\/li><li>an assistance animal identity card, pass or permit issued by a training provider; <\/li><li>an assistance dog badge, medallion, harness, cape, coat or vest supplied by an assistance dog training organisation for that animal – for example:<\/li><li>Guide Dogs Australia (harness/medallion, NSW access card);<\/li><li>Assistance Animals Australia (blue jacket);<\/li><li>Lions Club Hearing Dogs (orange leash/collar/coat, medallion); and<\/li><li>Righteous Pups Australia (green coat).<\/li><li>documents showing completion of a training program that has met the standards of <a href='https://assistancedogsinternational.org/' target='_blank'>Assistance Dogs International<\/a>; and<\/li><li>proof that an animal is recognised as an assistance animal for the purposes of registration by another local council.<\/li><\/ul> <br><br> Other companion animals may be used as therapy animals. A therapy animal is an animal that engages in therapeutic activity to improve a person’s general wellbeing and quality of life, or an animal that is used to facilitate counselling or psychotherapy. However, the companion animals legislation does not provide an exemption from the payment of lifetime registration fees for animals being used as therapy animals.<br><br>Contact information for your nearest NSW local council is available on the Local Government Directory page of the <a href='http://www.olg.nsw.gov.au/' target='_blank'>Office of Local Government website<\/a>.")},{question:"How do I register my pet as a working dog?",answer:i.trustAsHtml("A working dog is defined under Section 5 of the Act as a dog used primarily for droving, tending, working or protecting stock. It includes a dog being trained as a working dog.<br><br>As registration agents, local councils are responsible for processing lifetime registration applications for working dogs at their discretion. The OLG is not in a position to determine whether a dog meets the criteria under the Act for registration as a working dog.<br><br>Please note there are no provisions within the Act that require a working dog to be trained by any particular organisation. It is a matter for Council to determine what proof is required to register a dog as a working dog, which may include a working demonstration.<br><br>Contact information for your nearest NSW local council is available on the Local Government Directory page of the <a href='http://www.olg.nsw.gov.au/' target='_blank'>Office of Local Government website<\/a>.")},{question:"What are the fees for registering my pet",answer:i.trustAsHtml("New registration fees are in accordance with clause 18 of the Regulation.<br /><br />Fee changes from 1 July 2023 are:<br /><br /><table class='table'><thead><tr><th scope='col' style='color: white;'>Registration Type<\/th><th scope='col' style='color: white;'>Registration description<\/th><th scope='col' style='color: white;'>Fee from 1 July 2023<\/th><\/tr><\/thead><tbody><tr><td>Assistance Animal<\/td><td>Animal under 6 months of age training to be an assistance animal. For example: a guide dog<\/td><td>$0.00<\/td><\/tr><tr><td>Cat - Desexed (eligible pensioner)<\/td><td>Desexed animal owned by an eligible pensioner<\/td><td>$32.00<\/td><\/tr><tr><td>Cat - Desexed (eligible pensioner) with Late Fee<\/td><td>Desexed animal owned by an eligible pensioner with Late Fee<\/td><td>$53.00<\/td><\/tr><tr><td>Cat - Desexed (sold by Pound/Shelter)<\/td><td>Desexed cat sold by an eligible pound/shelter.<\/td><td>$0.00<\/td><\/tr><tr><td>Cat - Desexed or Not Desexed<\/td><td>Registration fee<\/td><td>$65.00<\/td><\/tr><tr><td>Cat - Desexed or Not Desexed wth Late Fee<\/td><td>Registration fee with Late Fee<\/td><td>$86.00<\/td><\/tr><tr><td>Cat - Not Desexed (not recommended - eligible pensioner) with Late Fee<\/td><td>Animal owned by an eligible pensioner with written notification from a vet that it should not be desexed with Late Fee. To be paid if registration fee has not been paid within 28 days after the date on which the animal is required to be registered<\/td><td>$53.00<\/td><\/tr><tr><td>Cat - Not Desexed (not recommended)<\/td><td>Animal with written notification from a vet that it should not be desexed<\/td><td>$65.00<\/td><\/tr><tr><td>Cat - Not Desexed (not recommended) with Late Fee<\/td><td>Animal with written notification from a vet that it should not be desexed with Late Fee. To be paid if registration fee has not been paid within 28 days after the date on which the animal is required to be registered with Late Fee.<\/td><td>$86.00<\/td><\/tr><tr><td>Cat - Not Desexed (not recommended- eligible pensioner)<\/td><td>Animal owned by an eligible pensioner with writen notification from a vet that it should not be desexed<\/td><td>$32.00<\/td><\/tr><tr><td>Cat - Not Desexed (recognised breeder)<\/td><td>Animal not desexed and kept by a recognised breeder for breeding purposes<\/td><td>$65.00<\/td><\/tr><tr><td>Cat - Not Desexed (recognised breeder) with Late Fee<\/td><td>Animal not desexed and kept by a recognised breeder for breeding purposes with Late Fee. To be paid if registration fee has not been paid within 28 days after the date on which the animal is required to be registered<\/td><td>$86.00<\/td><\/tr><tr><td>Dog - Desexed (by relevant age - eligible pensioner) with Late Fee<\/td><td>Desexed animal owned by an eligible pensioner with Late Fee<\/td><td>$53.00<\/td><\/tr><tr><td>Dog - Desexed (by relevant age - Pensioner)<\/td><td>Desexed animal owned by an eligible pensioner<\/td><td>$32.00<\/td><\/tr><tr><td>Dog - Desexed (by relevant age)<\/td><td>Registration fee for an animal desexed by the relevant desexing age<\/td><td>$75.00<\/td><\/tr><tr><td>Dog - Desexed (by relevant age) wih Late Fee<\/td><td>Registration fee for an animal desexed by the relevant desexing age with Late Fee<\/td><td>$96.00<\/td><\/tr><tr><td>Dog - Desexed (sold by Pound/Shelter)<\/td><td>Desexed dog sold by an eligible pound/shelter.<\/td><td>$0.00<\/td><\/tr><tr><td>Dog - Not Desexed (not recommended - eligible pensioner)<\/td><td>Animal owned by an eligible pensioner with written notification from a vet that it should not be desexed<\/td><td>$32.00<\/td><\/tr><tr><td>Dog - Not Desexed (not recommended - eligible pensioner) with Late Fee<\/td><td>Animal owned by an eligible pensioner with written notification from a vet that it should not be desexed with Late Fee<\/td><td>$53.00<\/td><\/tr><tr><td>Dog - Not Desexed (not recommended)<\/td><td>Animal with written notification from a vet that it should not be desexed<\/td><td>$75.00<\/td><\/tr><tr><td>Dog - Not Desexed (not recommended) with Late Fee<\/td><td>Animal owned by an eligible pensioner with written notification from a vet that it should not be desexed with Late Fee<\/td><td>96.00<\/td><\/tr><tr><td>Dog - Not Desexed (recognised breeder)<\/td><td>Animal not desexed and kept by a recognised breeder for breeding purposes<\/td><td>$75.00<\/td><\/tr><tr><td>Dog - Not Desexed (recognised breeder) with Late Fee<\/td><td>Animal not desexed and kept by a recognised breeder for breeding purposes with Late Fee<\/td><td>$96.00<\/td><\/tr><tr><td>Dog - Not Desexed or Desexed (after relevant age)<\/td><td>Combined registration fee and additional fee for an animal not desexed by the relevant desexing age<\/td><td>$252.00<\/td><\/tr><tr><td>Dog - Not Desexed or Desexed (after relevant age) with Late Fee<\/td><td>Combined registration fee and additional fee for an animal not desexed by the relevant desexing age with Late Fee<\/td><td>$273.00<\/td><\/tr><tr><td>In Service Of State<\/td><td>Dog in the service of the State. For example: a police dog<\/td><td>$0.00<\/td><\/tr><tr><td>Working Dog<\/td><td>Working dog<\/td><td>$0.00<\/td><\/tr><tr><td>Registration late fee<\/td><td>To be paid if registration fee has not been paid within 28 days after the date on which the animal is required to be registered<\/td><td>$21.00<\/td><\/tr><tbody><\/table><br><br><br><br><table class='table'> <thead><tr><th scope='col' style='color: white;'>Permit Type<\/th><th><\/th><th scope='col' style='color: white;'>Fee from 1 July 2023<\/th><\/tr><\/thead><tbody><tr><td>Dangerous<\/td><td>Dangerous<\/td><td>$221.00<\/td><\/tr><tr><td>Restricted<\/td><td>Restricted<\/td><td>$221.00<\/td><\/tr><tr><td>Non Desexed Cat<\/td><td>Non Desexed Cat - not desexed by four months of age<\/td><td>$92.00<\/td><\/tr><tr><td>Permit late fee<\/td><td>Payable if the permit fee has not been paid 28 days after the date on which a permit was required to own the companion animal<\/td><td>$21.00<\/td><\/tr><\/tbody><\/table>*An eligible pensioner includes a person in receipt of the aged pension, war widow pension or disability pension. If you are unsure whether you are an eligible pensioner, please contact your local council.")},{question:"How do I change my new pet into my name?",answer:i.trustAsHtml("Pets in NSW can be transferred electronically by the previous owner via the NSW Pet Registry (Registry) or via ‘Change of Owner’ paperwork.<br><br>To update your pet’s details on Registry, please download and complete the <b>Change of Owner/Details (C3A)<\/b> form available under the <a href='https://www.olg.nsw.gov.au/public/dogs-cats/nsw-pet-registry/microchipping-and-registration/' target='_blank'>Microchipping and Registration<\/a> page on the Office of Local Government’s website.<br><br><b>The form must have the original signature(s) of the listed owner on the Registry otherwise it cannot be processed<\/b>. If you cannot contact the previous (listed) owner you must establish proof of ownership, for example via a signed sales’ receipt, and complete a statutory declaration which includes the microchip number, a description of your pet and a statement about your claim of ownership. Updated certificate(s) will be forwarded to you confirming the change.<br><br><b>NSW residents must submit the form(s) to their local council for processing within 14 days of the change.<\/b> Any form(s) incorrectly forwarded to the Registry will be returned to the pet owner. <br><br>Contact information for your nearest NSW local council is available on the Local Government Directory page of the <a href='http://www.olg.nsw.gov.au/' target='_blank'>Office of Local Government website<\/a>.")},{question:"How do I update the desexed status on my pet?",answer:i.trustAsHtml("Veterinarians and NSW local councils are responsible for updating the desexing status of a cat or dog.<br><br>Please provide a copy of one of the following to your NSW local council,<b> ensuring that the pet’s microchip number is included,<\/b> requesting that the status of your pet’s microchip number be updated:<br><br><ul><li>The sterilisation certificate<\/li><li>A letter from the vet (with the vet’s V number, as well as the pet’s microchip number included)<\/li>  <li>A statutory declaration<\/li><li>A receipt for the cost of desexing<\/li><\/ul><br><br>Contact information for your nearest NSW local council is available on the Local Government Directory page of the <a href='http://www.olg.nsw.gov.au/' target='_blank'>Office of Local Government website<\/a>.")},{question:"What if I have a medical exemption for desexing my pet?",answer:i.trustAsHtml("The Act and the Regulation set out the requirements to identify and register companion animals in NSW and prescribes lifetime registration and annual permit fees. <br><br>While it is not mandatory, all pet owners are encouraged to have their dog or cat desexed before registering it. Under the legislation, the relevant desexing age for a dog is 6-months, and 4-months for a cat.<br><br>Having a dog or cat desexed prior to registration helps to reduce straying, fighting and aggression and antisocial behaviour, such as spraying to mark territory. It also helps to reduce the number of unwanted pets born each year.<br><br>An additional fee of $165 is payable in the case of a dog being registered that has not been desexed before reaching 6-months of age, while an annual permit ($85) is payable for cats that are not desexed prior to 4-months. <br><br>Cats and dogs that cannot be desexed for medical reasons, either temporarily or permanently, are exempt from the additional registration fee or annual permit fee. <br><br>To enable these exemptions, a vet must make the determination before your cat or dog reaches the relevant desexing age that the animal should not be desexed either:<br><br><ol><li>until it reaches an age specified (temporary exemption up to 18-months), or <\/li><li>that desexing the animal at any time of its life would constitute a serious health risk to the animal (desexing not recommended for life).<\/li><\/ol><br><br>A vet can notify a medical exemption directly on the NSW Pet Registry. Alternately, a certificate can be provided to you that you can give to a council or other registration agent to have them update their animal’s record.<br><br>This certificate should include the following:<ul><li>business letterhead with name and contact details<\/li><li>the date the sterilisation procedure took place<\/li><li>microchip number of the specific cat<\/li><li>name and address of the owner (optional)<\/li><li>medical reasoning<\/li><li><ul><li>Temporary exemption: specify the age from which the cat may<\/li><li>be desexed and its recorded date of birth as set out on the<\/li><li>Registry<\/li><li>Permanent exemption: a statement of medical reasons why the<\/li><li>exemption has been applied.<\/li><\/ul><\/li><\/ul><br><br>Contact information for your nearest NSW local council is available on the Local Government Directory page of the <a href='http://www.olg.nsw.gov.au/' target='_blank'>Office of Local Government website<\/a>.")},{question:"What do I do if my pet was microchipped interstate or overseas?",answer:i.trustAsHtml("The NSW Companion Animals Register (CAR) is a NSW government database provided under the Act 1998 for NSW local councils to record the registration information of cats and dogs resident in NSW. The CAR only records council registrations and is not a national register of microchips.<br><br>As your pet was born and microchipped outside NSW, it was not subject at that time to the registration provisions of the Act that require its details to be recorded or updated on the CAR.<br><br>Now that you live in NSW, you will need to contact your local council who may advise you to have your pet’s microchip number verified by an authorised identifier. The authorised identifier will scan your pet to ensure the microchip is functioning and will record the number on a ‘Verification of Existing Microchip (M1)’ form. You will then be required to present the completed M1 form to your local council for processing, along with following documents:\t\t\t\t    <br><br><ul><li>A copy of the bill of sale (sales’ receipt)<\/li><li>A statutory declaration outlining the circumstances of sale or proof of ownership<\/li><li>Permanent Identification Form (P1A)<\/li><li>Desexing Certificate if applicable<\/li><\/ul><br><br>Local councils are the primary body for managing companion animals in NSW under the Act. Contact information for your nearest NSW local council is available on the Local Government Directory page of the Office of Local Government’s website at <a href='http://www.olg.nsw.gov.au/' target='_blank'>www.olg.nsw.gov.au<\/a>.\t\t\t\t\t  <br><br>Your local council is also responsible for updating the information recorded on the state-wide CAR and can provide and process all appropriate forms and provide you with an updated certificate of identification/registration to confirm any changes.")},{question:"I have moved out of NSW, how do I update my pet’s registration?",answer:i.trustAsHtml("As your pet is no longer living in NSW you will now need to:<br><br><ul><li>contact your local council/authority regarding pet registration requirements within your state<\/li><li>Australian Capital Territory (ACT) residents should contact <b>Transport Canberra and City Services (TCCS) <\/b>for information regarding the listing/registering of cats and dogs within the ACT<b> Transport Canberra and City Services <b> <a href='http://www.tccs.act.gov.au/' target='_blank'>www.tccs.act.gov.au <\/a>or telephone 13 22 81<\/li><li>list your pet’s microchip with a private microchip register to assist with it being returned home should it become lost, stolen or injured. Contact details are listed below for your assistance:<br><br> Australasian Animal Register (02) 9704 1450<br> Central Animal Records (03) 9706 3187<br> HomeSafeID 1300 537 140<br>Petsafe 1800 989 989<br> Global Micro Animal Registry (02) 8338 9063<br><br><\/li><\/ul>   <br><br> <b>Please note<\/b>: all of the private databases are linked together so you only need to list with one to get complete national coverage. Links to each of the national organisations are available through the Pet Address search engine which allows you to search for the microchip number of a pet in various animal databases at <a href='http://www.petaddress.com.au/' target='_blank'>www.petaddress.com.au<\/a>.<br><br>Once you have registered with one of the national registers please contact us and let us know. We will then mark your pet’s record on the CAR as “out-of-date” with a note that it has been listed on a national register. <br><br>To update your pet’s details on the CAR, please download and complete the appropriate form for either Change of Owner / Details (C3A), available under the <a href='https://www.olg.nsw.gov.au/public/dogs-cats/nsw-pet-registry/microchipping-and-registration/' target='_blank'>Microchipping and Registration<\/a> section of the Office of Local Government’s (OLG) website.<br><br>Interstate residents may send the <b>original<\/b> completed form(s) to: <br><br><address>NSW Companion Animals Register<br>Locked Bag 3015<br>NOWRA NSW 2541<br><br>Or<br><br>email them to <a href='mailto:pets@olg.nsw.gov.au' target='_blank'>pets@olg.nsw.gov.au<\/a><\/address><br><p><b>All forms must have the original signature(s) of the listed owner on the CAR in order to be processed.<\/b><\/p> For change of owner, the previous owner (listed owner on the CAR) must sign the form. If you cannot contact the previous (listed) owner you must establish proof of ownership, for example, via a signed sales’ receipt, and complete a statutory declaration including the microchip number, a description of your pet and a statement about your claim of ownership. Updated certificate(s) will be forwarded to you confirming the change.")},{question:"How can I request a refund of a Companion Animal fee paid?",answer:i.trustAsHtml("In accordance with the OLG <a href='https://www.olg.nsw.gov.au/wp-content/uploads/2020/03/NSW-Pet-Registry-Registration-Fee-Refund-Policy-Oct-2017.pdf' target='_blank'>Refund Policy<\/a>, Companion Animal fees are not generally refundable.<br><br>Refunds will not generally be approved in a circumstance where an owner has failed to follow the instructions provided and/or failed to exercise a reasonable level of care, where doing so would have prevented them from paying an incorrect fee. This is because there is work associated with the registration of an animal, which is fully expensed at the time of registration. There is also work associated with initiating a correction of the register.<br><br>If you have extenuating circumstances and would like the OLG to investigate whether you are eligible for a refund, you will need to provide the following:<br><ol type='a'><li>Microchip number of the animal<\/li><li>Transaction/payment date<\/li><li>Transaction/receipt or invoice<\/li><li>Payment type and amount<\/li><li>A reason for reversal of the transaction<\/li><li>Supporting evidence for your request:<br><ol type='i'>  <li>De-sexing/sterilisation certificate – if claiming the registration fee discount for a de-sexed animal<\/li><li>Proof of purchase – if claiming the registration fee discount for an animal purchased from a rehoming organisation – such as a council pound, RSPCA/AWL shelter or an organisation approved under clause 17(1)(c) of the Regulation.<\/li><li>Pension Card – if claiming the registration fee discount for an eligible pensioner<\/li><li>Transaction receipt or invoice/bank statement – confirming the transaction details<\/li><li>Letter/Certificate from your Veterinarian – confirming the date that your pet has sadly passed away (if relevant).<\/li><\/ol><\/li><\/ol><br><br>All information should be emailed to the OLG at <a href='mailto:pets@olg.nsw.gov.au' target='_blank'>pets@olg.nsw.gov.au<\/a>.")},]},{group:"Registering your details - create owner profile:",questions:[{question:"My pet is already microchipped but I've never registered it. Do I also have to register it?",answer:i.trustAsHtml("Yes. All dogs and cats that need to be registered must have their identification (microchip) and registration (owner details etc) recorded on the NSW Pet Registry. If your pet is aged six months or older the registration fee must also be paid.")},{question:"What name should I use to register my pet?",answer:i.trustAsHtml("You need to use your name as it appears on your Driver's Licence, Medicare card or Australian passport. You will need one of these documents to verify your identity. Only one person can be listed as the registered owner.")},{question:"What address should I use to register my pet?",answer:i.trustAsHtml("You should use the street address where your pet lives most of the time. You cannot use a PO Box number. There will also be an opportunity to enter a separate address for postal purposes or a secondary address where your pet lives. When entering the address details, you will need to use the ‘search address' bar to get the official address as recorded with Land and Property Information NSW.")},{question:"My address does not come up on the Pet Registry, what should I do?",answer:i.trustAsHtml("If you are entering a physical address please make sure it is the property address as recorded on the NSW Land and Property Information Register.<br><br>For rural properties, this may mean your official Rural Property Address rather than a property or other name. This is not the same as your lot number. It will include a Rural Road Number, a Road Name and a Locality. If you do not know your Rural Property Address, please contact your local council.<br><br>If you are not able to enter a valid address on the online NSW Pet Registry, you will need to complete the relevant paper form and lodge it with your local council. Forms are available from your council or can be accessed at <a href='https://www.olg.nsw.gov.au/public/dogs-cats/nsw-pet-registry/microchipping-and-registration/' target='_blank'>https://www.olg.nsw.gov.au/public/dogs-cats/nsw-pet-registry/microchipping-and-registration/<\/a>")},{question:"I don't know my pet's microchip number. What should I do?",answer:i.trustAsHtml("The microchip number should be on your pet's vaccination, sterilisation certificate, or other document provided by your vet.<br><br>Contact your vet or local council as they may be able to assist over the phone in cases where you can provide information clearly identifying you as the pet's owner.<br><br>You may need to make arrangements to have your pet scanned by a vet or a council ranger.  They will be able to provide you with a Verification of Existing Microchip Form containing your pet’s microchip number.")},{question:"How does Identity Verification work?",answer:i.trustAsHtml("The identity of the person making the online profile will be validated through a Document Verification Service (DVS). When you make a user profile your Driver's Licence, Medicare or passport number will be validated against the name and date of birth on these documents.<br><br>Your Driver's Licence, Medicare or passport numbers are not stored in the NSW Pet Registry or on the DVS. ")},{question:"When I tried to create an account, the password didn't come through to my email?",answer:i.trustAsHtml("Try checking your junk mail or spam for the email.")}]},{group:"Annual permits:",questions:[{question:"I tried to pay for a permit for my unregistered pet but the system wouldn’t let me?",answer:i.trustAsHtml("An animal must be registered first before a permit can be applied. Register your pet and then pay for the permit.")},{question:"If I get my cat desexed at 5 months, do I still need to get a permit?",answer:i.trustAsHtml("You will be required to pay for one permit in the first year. Permits are not required once an animal is desexed, therefore in the following year you will not be required to renew the permit.")},{question:"If I get my cat desexed, can I get a refund of the annual permit fee?",answer:i.trustAsHtml("Once an annual permit is paid for, it is valid for 12-months. If you then get your cat desexed within that 12-month period, you will not be required to renew the permit. However, no partial refund will be given.")},{question:"Why am I being charged a late fee?",answer:i.trustAsHtml("A late fee of $21 is charged if you do not pay for the annual permit by the “pay by date”, which is 28-days after the requirement for a permit took effect.")},{question:"I just bought a cat that requires a permit, can I be fined for not having one?",answer:i.trustAsHtml("New owners of cats that require a permit have two-months to obtain the permit and cannot be fined during that time. The two-month grace period begins from the date the cat was transferred to you by the previous owner, not the date you link it on your profile.<br><br>Prospective owners of cats can use the Buyer Search function on the Pet Registry to check whether an animal requires an annual permit and if so whether the permit is current or not.This information can be used to inform purchasing decisions and price negotiations.")},{question:"I had my cat desexed before 4 months of age but when I go to register it why does it say I also need to pay for a permit?",answer:i.trustAsHtml("This is because the requirement for vets and local councils to enter the date an animal was desexed was only introduced from 1 July 2020, to allow for the introduction of annual permits. If no desexing date is recorded in the system, the system defaults to a permit being due.<br><br>To avoid paying for an annual permit, you will need to contact your vet and ask them to update the desexed status of your cat with the date the sterilisation procedure took place, or take a copy of the sterilisation certificate to your local council to have your pet’s record updated.If you no longer have a copy of the certificate and cannot contact the vet who performed the procedure, you will need to provide a statutory declaration to your local council stating the cat was desexed by 4 months of age.")},{question:"My vet gave me a letter certifying that my cat shouldn’t be desexed until 18 months old so why is the system is still saying I need to pay for a permit?",answer:i.trustAsHtml("Your vet may not have updated your cat’s record to reflect this assessment. You will need to take this letter to your local council and have them update your cat’s record. You will then have until the cat is 18-months old to get it desexed. If your cat remains undesexed at 18-months of age you will be required to obtain an annual permit.")},{question:"If my dog is restricted and dangerous, do I need two permits?",answer:i.trustAsHtml("If you own an animal that is both a restricted breed and declared dangerous, you will be liable for two permits for that animal.<br><br>A person who owns multiple dangerous or restricted dogs will need a permit for each animal.")},{question:"Can I get the dangerous dog declaration overturned to avoid an annual permit?",answer:i.trustAsHtml("If your dog is currently declared dangerous then you will need to obtain a permit. If you wish, you may organise for a new temperament assessment of your dog, which could result in the declaration being overturned. An annual permit will not be partially refunded if a declaration is overturned, however, you will not be required to renew the annual permit.")},{question:"I’m a recognised breeder, do I need to get a permit for my undesexed cat?",answer:i.trustAsHtml("Cats kept for breeding purposes by members of a recognised breeding body are exempt from annual permits. The Companion Animals Regulation 2018 has been amended to apply this exemption consistent with the current exemption from paying higher registration fees for a cat or dog that has not been desexed by the relevant desexing age, if the animal is kept for breeding purposes.")},]},{group:"Linking a pet:",questions:[{question:"I don't know my pet's microchip number. What should I do?",answer:i.trustAsHtml("The microchip number should be on your pet's vaccination, sterilisation certificate, or other document provided by your vet.<br><br>Contact your vet or local council as they may be able to assist over the phone in cases where you can provide information clearly identifying you as the pet's owner.<br><br>You may need to make arrangements to have your pet scanned by a vet or a council ranger.  They will be able to provide you with a <i>Verification of Existing Microchip Form<\/i> containing your pet’s microchip number.")},{question:"What if I cannot find my pet on the Registry?",answer:i.trustAsHtml("There could be a range of reasons why you cannot find your pet on the NSW Pet Registry. In the first instance you should contact your local council for assistance. <br><br> If you believe your pet’s microchip number has been incorrectly recorded in the Pet Registry please contact your vet and have your pet scanned. They will be able look up your pet's details on the NSW Pet Registry and, if the microchip number is wrong, give you a <i>Verification of Existing Microchip Form<\/i> to lodge at your local council. This will enable council to correct the information on the Registry, allowing you to link your pet.")},{question:"The 'Link Pet' function does not work for me.  What should I do?",answer:i.trustAsHtml("Your pet's microchip number and ownership details must correspond with your details in order to match them to your online profile. Specifically, you must match the name and contact number you used when your pet's record was entered or updated in the Pet Registry.<br><br>For example, Mr Mathew Smith is the owner of ‘Jed' a Labrador cross.  As the owner of ‘Jed' is recorded as Matt Smith on the Registry, Mr Smith will not be able to link ‘Jed' to his profile.<br><br>If your profile details do not match the name and contact number on the Registry for your pet, you will need to update the Registration by completing an <i>update details form<\/i>, available at the Forms tab on the left-hand side of this page (or obtained from your local council) and lodge it with your local council.<br><br>You will also need to know your pet's microchip number.<br><br>If you are still not able to ‘link' your pet please call the NSW Pet Registry Technical Assistance Line on 1300 134 460 between 9:00am – 4:30pm Monday to Friday.")},]},{group:"Transferring your pet to a new owner:",questions:[{question:"What happens if a new owner does not 'accept' the pet?",answer:i.trustAsHtml("A pet's details remain visible in the old owner's profile until the pet is linked to the new owner profile. The status of a transferred pet changes from 'Home' to 'Home-Transfer' until the new owner links the pet online. Once linked the pet is removed from the old owner's profile and locked to the new owner's profile with status ‘Home'.<br><br>You may wish to contact the new owner to remind them to link their new pet online or contact a local council for assistance. Local councils can change the status of a pet in certain circumstances.<br><br>Owners should create profiles so their pets can be returned home if lost, stolen or injured.")},{question:"My dog is declared menacing, dangerous, or is a restricted breed. Can I transfer ownership?",answer:i.trustAsHtml("No. Selling or giving away a dog that has been declared menacing, dangerous or restricted is prohibited under the Companion Animals Act 1998 and penalties apply. Owners of these dogs should contact their local council for further information.")},{question:"What are the registration fees for pets?",answer:i.trustAsHtml('All cats and dogs should be registered by six months of age. Registration fees are valid for the lifetime of each pet and do not need to be renewed each year. A list of current registration fees is available on the Office of Local Government website at <a target="_blank" class="underline" href="https://www.olg.nsw.gov.au/public/dogs-cats/nsw-pet-registry/microchipping-and-registration/">https://www.olg.nsw.gov.au/public/dogs-cats/nsw-pet-registry/microchipping-and-registration/<\/a>')},{question:"Is there a charge for making an online payment?",answer:i.trustAsHtml("A small charge of 0.40% is levied for online registration. This covers bank service transaction costs.")},]},{group:"Updating your pet's details:",questions:[{question:"How do I report my pet as missing or that he/she has passed away?",answer:i.trustAsHtml("To report a missing pet online, the owner needs to update the pet's details using the ‘update' link on the \"My Pets\" page. The 'update' link should also be used to notify that your pet has passed away.<br><br>Vets can also make these notifications on the Registry on your behalf.<br><br>Please refer to ‘Update your pet details' in the Pet Owner & Breeder User Guide and FAQs.")},{question:"How can you tell if a pet’s registration has been paid before you buy it?",answer:i.trustAsHtml("All cats and dogs should be microchipped and registered when you buy them, but the registration fees may not be paid. You can search on the NSW Pet Registry using a microchip number found in the advertisement or ask the seller for the registration certificate.<br><br>A registration certificate cannot be obtained until payment has been made. In NSW registration is a once off payment valid for the lifetime of the pet, which transfers between owners.")},{question:"I have been given a kitten/puppy, what do I need to do?",answer:i.trustAsHtml("In NSW, all cats and dogs must be microchipped and the registration information entered on the NSW Pet Registry by 12 weeks of age or before being sold or given away, whichever happens first.<br><br>You'll need to know the microchip number to update the pet's details on the Registry. If you don't know the number or if it is not microchipped take the puppy or kitten to your vet.<br><br>To complete the registration of your pet you will need to update the ownership details and pay the once only lifetime registration fee. The registration fee is required to be paid by the time your pet reaches six months of age.<br><br>If your pet is already registered it is important to update the owner and contact details on the Registry. See FAQ “General questions” about how to link your pet online.<br><br>The NSW Pet Registry can be accessed at <a href='https://www.petregistry.nsw.gov.au/' target='_blank'>www.petregistry.nsw.gov.au<\/a> <br><br>If you do not have access to a computer you can register your pet at your local council. ")},]},{group:"Troubleshooting:",questions:[{question:"Why won't the NSW Pet Registry work on my computer?",answer:i.trustAsHtml("The NSW Pet Registry has been developed to work on Chrome, Firefox, Internet Explorer and Safari. However, the Registry website won’t work on versions of Internet Explorer and Safari that are no longer supported by Microsoft, meaning you may have to switch browsers.")},]},{group:"Information for vets and authorised identifiers:",questions:[{question:"Are you a vet or authorised identifier?",answer:i.trustAsHtml("Veterinarians and authorised identifiers (AIs) can access the NSW Pet Registry using their existing Companion Animals Register (CAR) username and password.<br><br>If you don’t already have a log-in, please contact the Office of Local Government at <a href='mailto:pets@olg.nsw.gov.au' target='_top'>pets@olg.nsw.gov.au<\/a> <br><br>For more information <a href='https://www.olg.nsw.gov.au/public/dogs-cats/information-for-professionals/information-for-vets-and-identifiers/' target='_blank'>click here<\/a>  ")},]}];t.screenTitle="Frequently Asked Questions";n.currentQuestion={};n.updateQuestion=function(t,i){n.currentQuestion.group==t&&n.currentQuestion.question==i?(n.currentQuestion.group="",n.currentQuestion.question=""):(n.currentQuestion.group=t,n.currentQuestion.question=i)};n.isCurrentQuestion=function(t,i){return n.currentQuestion.group==t&&n.currentQuestion.question==i?!0:!1};r.spinnerHide()}angular.module("app").controller("faqsController",["$scope","$rootScope","$sce","spinner",n])}(),function(){"use strict";function t(t,i,r,u,f,e){function h(){i.activateController([],n).then(function(){})}var s=i.logger.getLogFn,c=s(n),l=i.$q,o;t.screenTitle="AI Dashboard";o=this;o.referenceData=e;o.title="Dashboard";h()}var n="aidashboard";angular.module("app").controller(n,["$rootScope","common","$http","datacontext","spinner","ReferenceData","$window",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a,v){function nt(){tt();r.activateController([],n).then(function(){return et().then(function(){return it().then(function(){return w()})})})}function tt(){y.userRole=h.currentUser.role;y.userRole=="Implanter"?y.userRole="Authorised Identifier":y.userRole=="Veterinary"&&(y.userRole="Veterinarian")}function it(){return f.query("api/SystemUser/GetSystemUserQuestions").then(function(n){y.systemUserQuestions=n})}function rt(){}function p(){y.control.createView=y.control.searchView=!1;y.control.showResultMessage=!1;y.control.showExistsMessage=!1;y.control.showCreateSuccessfulMessage=!1;y.control.showCreateSuccessfulMessageQuestion=!1;y.control.showCreateSuccessfulMessagePassword=!1}function ut(){y.control.showResultMessage=!1;y.control.showExistsMessage=!1}function ft(n){return!(typeof n=="string"&&!n.trim()||typeof n=="undefined"||n==null)}function et(){return e.spinnerShow(),f.query("api/Account/GetUserProfileDefinition").then(function(n){y.profileDomainRules=n.profileValidation;y.businessDomainRules=n.businessValidation;y.securityDomainRules=n.securityValidationDef;y.control.createView=!0;y.isEditable=!0;e.spinnerHide()})}function ot(n,t){return a.get(n,t)}function st(n,t){var i=a.find(n,{value:t});if(i!=null)return i.text}function ht(n){return n=="4"?"Mobile":n=="5"?"Home":n=="6"?"Work":"Not provided"}function ct(n){return n=="4"?"Mobile":n=="6"?"Work":"Not provided"}function lt(n){return n=="5"?"Both Home and Work addresses are same":n=="2"?"Work":n=="1"?"Home":"Not provided"}function at(n){return!n||/^\s*$/.test(n)}function w(){return e.spinnerShow(),p(),f.query("api/Account/GetUserProfile/",[y.currentUserId]).then(function(n){y.domain=n.profile;y.domain.security=n.security;var t=a.find(y.systemUserQuestions,{systemUserQuestionID:y.domain.security.systemUserQuestionID});y.domain.security.selectedQuestion=t==null?{}:t;y.domain.challengeAnswer=n.security.challengeAnswer;y.domain.userName=n.security.userName;y.domain!=null?(y.domain.userProfile.userDOB=="0001-01-01T00:00:00"&&(y.domain.userProfile.userDOB=null),y.domain.userProfile.userBestContactType==0&&(y.domain.userProfile.userBestContactType=4),y.domain.userBusiness.businessBestContactType==0&&(y.domain.userBusiness.businessBestContactType=4),y.control.showResultMessage=!1,y.isEditable=!0,y.hideControls=!0,y.control.updateView=!0,y.domain.userBusiness.lastModifiedBy=0,l.scrollTo(0,0)):(y.control.showResultMessage=!0,l.scrollTo(0,0));e.spinnerHide()})}function k(){return e.spinnerShow(),p(),f.query("api/Account/GetUserProfile/",[y.currentUserId]).then(function(n){y.domain.security.userName=n.security.userName;y.domain.security=n.security;var t=a.find(y.systemUserQuestions,{systemUserQuestionID:y.domain.security.systemUserQuestionID});y.domain.security.selectedQuestion=t==null?{}:t;y.domain.security.challengeAnswer=n.security.challengeAnswer;y.domain!=null?(y.control.showResultMessage=!1,y.isEditableQuestion=!1,y.hideControls=!0,y.control.searchView=!0):y.control.showResultMessage=!0;e.spinnerHide()})}function d(){return e.spinnerShow(),p(),f.query("api/Account/GetUserProfile/",[y.currentUserId]).then(function(n){y.domain.security.userName=n.security.userName;y.domain.security.newPassword="";y.domain.security.confirmPassword="";y.domain!=null?(y.control.showResultMessage=!1,y.isEditablePassword=!1,y.hideControls=!0,y.control.searchView=!0):y.control.showResultMessage=!0;e.spinnerHide()})}function vt(){return e.spinnerShow(),p(),f.query("api/Account/GetUserProfile/",[y.currentUserId]).then(function(n){if(y.domain=n.profile,y.domain.security=n.security,y.domain!=null){y.control.showResultMessage=!1;y.isEditable=!0;y.control.updateView=!0;var t=a.find(y.systemUserQuestions,{systemUserQuestionID:y.domain.security.systemUserQuestionID});y.domain.security.selectedQuestion=t==null?{}:t;y.domain.security.challengeAnswer=n.security.challengeAnswer;y.domain.userProfile.userDOB=="0001-01-01T00:00:00"&&(y.domain.userProfile.userDOB=null);y.domain.userProfile.userBestContactType==0&&(y.domain.userProfile.userBestContactType=4);y.domain.userBusiness.businessBestContactType==0&&(y.domain.userBusiness.businessBestContactType=4)}else y.control.showResultMessage=!0;e.spinnerHide()})}function yt(){return e.spinnerShow(),p(),f.query("api/Account/GetUserProfile/",[y.currentUserId]).then(function(n){y.domain.security.userName=n.security.userName;y.domain.security=n.security;y.domain.security.systemUserQuestionID=n.security.systemUserQuestionID;y.domain.security.selectedQuestion=a.find(y.systemUserQuestions,{systemUserQuestionID:y.domain.security.systemUserQuestionID});y.domain.security.challengeAnswer=n.security.challengeAnswer;y.domain!=null?(y.control.showResultMessage=!1,y.isEditableQuestion=!0,y.control.updateView=!0,y.domain.userProfile.userDOB=="0001-01-01T00:00:00"&&(y.domain.userProfile.userDOB=null),y.domain.userBusiness.businessBestContactType==0&&(y.domain.userBusiness.businessBestContactType=4)):y.control.showResultMessage=!0;e.spinnerHide()})}function pt(){return e.spinnerShow(),p(),f.query("api/Account/GetUserProfile/",[y.currentUserId]).then(function(n){if(y.domain.security.userName=n.security.userName,y.domain!=null){y.control.showResultMessage=!1;y.isEditablePassword=!0;y.control.updateView=!0;var t=a.find(y.systemUserQuestions,{systemUserQuestionID:y.domain.security.systemUserQuestionID});y.domain.security.selectedQuestion=t==null?{}:t;y.domain.security.challengeAnswer=n.security.challengeAnswer;y.domain.userProfile.userDOB=="0001-01-01T00:00:00"&&(y.domain.userProfile.userDOB=null);y.domain.userBusiness.businessBestContactType==0&&(y.domain.userBusiness.businessBestContactType=4)}else y.control.showResultMessage=!0;e.spinnerHide()})}function wt(){if(y.control.updateView==!0)return f.post("api/Account/UpdateUserProfile",y.domain).then(function(n){return p(),w(),y.control.showCreateSuccessfulMessage=!0,y.control.showCreateSuccessfulMessageQuestion=!1,y.control.showCreateSuccessfulMessagePassword=!1,l.scrollTo(0,0),i.createnew.$setPristine,n})}function bt(){y.domain.security.newPassword="";y.domain.security.confirmPassword="";var n={};return angular.copy(y.domain,n),n.security.systemUserQuestionID=y.domain.security.selectedQuestion.systemUserQuestionID,n.security.userName=y.domain.userProfile.userName,f.post("api/Account/UpdateUserSecurityProfile",n.security).then(function(n){return p(),k(),y.control.showCreateSuccessfulMessageQuestion=!0,y.control.showCreateSuccessfulMessagePassword=!1,y.control.showCreateSuccessfulMessage=!1,n})}function kt(){if(y.control.updateView==!0)return f.post("api/Account/UpdateUserSecurityProfile",y.domain.security).then(function(n){return p(),d(),y.control.showCreateSuccessfulMessageQuestion=!1,y.control.showCreateSuccessfulMessagePassword=!0,y.control.showCreateSuccessfulMessage=!1,n})}var g=r.logger.getLogFn,dt=g(n),gt=r.$q,y=this,b;y.root=v;y.referenceData=o;y.chipId=null;y.title="User Profile";t.screenTitle="User Profile";y.searchResult=[];y.getProperty=ot;y.currentUserId=h.currentUser.id;b=new c;y.userDOBMaxDate=b.add(-18,"years");y.userDOBMinDate=new c("1900/01/01");y.isEditable=!0;y.isEditableQuestion=!1;y.isEditablePassword=!1;y.hideControls=!1;y.control={showResultMessage:!1,showSearchResult:!1,showExistsMessage:!1,showCreateSuccessfulMessage:!1,showCreateSuccessfulMessageQuestion:!1,showCreateSuccessfulMessagePassword:!1,createView:!1,searchView:!1,updateView:!0,isOpen1:!0,isOpen2:!1,isOpen3:!1};y.getProfile=w;y.getProfileQuestion=k;y.getProfilePassword=d;y.updateProfile=vt;y.updateSecurityQuestion=yt;y.updateSecurityPassword=pt;y.commitProfile=wt;y.commitusersecurityQuestion=bt;y.commitusersecurityPassword=kt;y.checkPhoneNumber=ft;y.inputChange=ut;y.queryBySelectedValue=st;y.getBestContactType=ct;y.getBestContactTypePersonal=ht;y.getAddressType=lt;y.changeQuestion=rt;y.isEmptyString=at;nt();i.$watch("createnew.$invalid",function(){y.control.showCreateSuccessfulMessage=!1},!1)}var n="userprofile";angular.module("app").controller(n,["$rootScope","$scope","common","$http","datacontext","spinner","ReferenceData","authservice","authdata","moment","$window","_","ROOT",t])}(),function(){"use strict";function n(n,t,i){n.popupTitle=i.popupTitle;n.message=i.message;n.type=typeof i.type=="undefined"?"alert":i.type;n.data=i.data;n.yes=function(){t.close(!0)};n.no=function(){t.close(!1)};n.save=function(){t.close(n.data)};n.cancel=function(){t.dismiss("cancel")}}angular.module("app").controller("modalPopupController",["$scope","$uibModalInstance","config",n])}(),function(){"use strict";function n(n,t){function u(n,t){return i(n,"confirm",t).then(function(n){return n})}function f(n,t){return i(n,"alert",t)}function e(n,t){return i(n,"success",t)}function o(n,t){return r("lg","alert",n,t)}function s(n,t){return r("sm","confirm",n,t)}function i(i,r,u){var f=n.open({animation:!0,templateUrl:t+"app/common/tmpl/modal-popup-box.html",controller:"modalPopupController",backdrop:"static",size:i,resolve:{config:function(){return{message:u,type:r}}}});return f.result}function r(t,i,r,u){var f=n.open({animation:!0,template:'<div class="modal-header"><h3 ng-if="type === \'confirm\'" class="modal-title" >Confirm&nbsp;<i class="fa fa-question-circle"><\/i><\/h3><h3 ng-if="type !== \'confirm\'" class="modal-title">Alert&nbsp;<i class="fa fa-exclamation-circle"><\/i><\/h3><\/div><div class="modal-body">'+u+'<\/div><div class="modal-footer"> <div style="text-align:center" ng-if="type === \'confirm\'" class="row">        <button class="btn btn btn-primary btn-auto" ng-click="yes()">&nbsp;Yes&nbsp;<\/button>        <button class="btn btn btn-primary btn-auto" ng-click="no()">&nbsp;No&nbsp;&nbsp;<\/button> <\/div> <div ng-if="type !== \'confirm\'" class="row">     <div class="col-sm-4"><\/div>    <div class="col-sm-4">        <button class="btn btn btn-primary btn-auto btn-block" cc-focus="true" ng-click="yes()" >Ok<\/button>    <\/div>     <div class="col-sm-4"><\/div>  <\/div><\/div>',controller:"modalPopupController",backdrop:"static",size:t,resolve:{config:function(){return{type:i,data:r}}}});return f.result}function h(t,i,r,u,f){var e=n.open({animation:!0,templateUrl:u,controller:f,controllerAs:"vm",backdrop:"static",size:t,resolve:{config:function(){return{data:i,rules:r}}}});return e.result}return{openAlertMsg:f,openSuccessMsg:e,openConfirmMsg:u,openMsgCustomHTML:o,openConfirmCustomHTML:s,openTemplate:h}}angular.module("app").factory("modalPopupFactory",["$uibModal","ROOT",n])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h){function l(){s.dismissAll();h.softLogout()}function a(){s.dismissAll();h.logout()}function v(){s.dismissAll();o.path("/contactus")}var c=this;c.goToHome=l;c.gotoContactus=v;c.goToHomeUnHandledException=a}var n="exceptionpopup";angular.module("app").controller(n,["common","$uibModalInstance","config","datacontext","$scope","ROOT","$location","$uibModalStack","authservice",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l){function p(){var t=[b(),et()];i.activateController(t,n).then(function(){})}function w(){a.dateMinMax={};a.dateMinMax={petDiedMinDate:new h(u.data.pet.petDOB),petDiedMaxDate:new h,petFoundMinDate:new h(a.currentLostDate),petFoundMaxDate:new h,petLostMinDate:new h(u.data.pet.petDOB),petLostMaxDate:new h,petDesexedMinDate:new h(u.data.pet.petDOB),petDesexedMaxDate:new h}}function b(){return e.query("api/VetData/GetPetRegisterDefinition").then(function(n){return a.ownerDomainRules=n.ownerValidation,a.petDomainRules=n.petValidation,n})}function k(){return e.post("api/VetData/UpdatePetStatus",a.pet).then(function(n){n?(a.currentStatusId=a.pet.petStatusId,a.statusUpdated=!0,a.statusUpdateFailed=!1,a.pet.petStatusId==1&&(a.currentFoundDate=a.pet.petFoundDate),a.pet.petStatusId==2&&(a.currentDateDied=a.pet.dateDied),a.pet.petStatusId==3&&(a.currentLostDate=a.pet.petLostDate),a.currentOwnerComments=a.pet.ownerComments,a.frmPetStatus.$setPristine()):(a.statusUpdated=!1,a.statusUpdateFailed=!0,a.frmPetStatus.$setPristine())})}function d(){a.pet.petDesexedId==1&&a.currentDesexedStatusId!=a.pet.petDesexedId?c.openConfirmMsg("md","Are you sure you want to mark this pet as desexed ?").then(function(n){n&&(v(),t.$emit("showAddLitter",null))}):v()}function v(){return a.pet.petDesexedId!=1&&(a.pet.desexedDate=null),console.log("vm.pet",a.pet),e.post("api/VetData/UpdatePetOtherDetails",a.pet).then(function(n){n?(a.pet.originalPetStatusId=a.pet.petStatusId,a.otherDetailsUpdated=!0,a.otherDetailsUpdateFailed=!1,(a.currentDesexedStatusId!=a.pet.petDesexedId||a.currentDesexedDate!=a.pet.desexedDate)&&t.$emit("getNotifications",null),a.currentDesexedStatusId=a.pet.petDesexedId,a.currentDesexedStatusId==1&&(a.showIsBreedable=!1,a.currentDesexedDate=a.pet.desexedDate,a.pet.desexedDate=new h(a.pet.desexedDate).format("DD/MM/YYYY")),a.frmOther.$setPristine()):(a.otherDetailsUpdated=!1,a.otherDetailsUpdateFailed=!0,a.frmOther.$setPristine())})}function g(){a.pet.petStatusId=a.currentStatusId;a.pet.originalPetStatusId=a.pet.petStatusId;a.pet.ownerComments=a.currentOwnerComments;a.pet.petStatusId==1&&(a.pet.dateDied=null,a.pet.petFoundDate=null,a.pet.petLostDate=null);a.pet.petStatusId==2&&(a.pet.dateDied=a.currentDateDied,a.pet.petFoundDate=null,a.pet.petLostDate=null);a.pet.petStatusId==3&&(a.pet.dateDied=null,a.pet.petFoundDate=null,a.pet.petLostDate=a.currentLostDate);a.otherDetailsUpdated==!1&&(a.pet.petDesexedId=a.currentDesexedStatusId,a.pet.petOutofDate=a.currentOutofDate,a.pet.petIdentificationMarks=a.currentIdentificationMarks,a.pet.petAdditionalComments=a.currentAdditionalComments,a.pet.desexedDate=a.currentDesexedDate,a.pet.desexedNotRecommendedComments=a.desexedNotRecommendedComments);r.close()}function nt(n,t){var i=_.find(n,{value:t});if(i!=null)return i.text}function tt(n,t){return _.get(n,t)}function it(){return a.currentDesexedStatusId=="1"?"Yes":a.currentDesexedStatusId=="0"?"No":a.currentDesexedStatusId=="98"?"No - Not recommended (up to 18 months)":a.currentDesexedStatusId=="99"?"No - Not recommended for life":"Unknown"}function y(n){var t,i;if(n!=null){if(Object.prototype.toString.call(n)==="[object Date]")return n;if(n.indexOf("/")>0){if(t=n.split("/"),t!=null&&t.length==3)return i=new h(t[2]+"-"+t[0]+"-"+t[1]),t[2]+"-"+t[0]+"-"+t[1]}else return n=="0001-01-01T00:00:00"?(new h).format("DD-MM-YYYY"):n.indexOf("-")>0?n.length>=10?n.substring(0,10):n:h(n).format("DD-MM-YYYY")}else return(new h).format("DD-MM-YYYY")}function rt(){a.dateMinMax.petDiedMinDate=h(u.data.pet.petDOB);a.dateMinMax.petLostMinDate=h(u.data.pet.petDOB);a.dateMinMax.petFoundMinDate=h(a.currentLostDate);a.pet.originalPetStatusId==1?(a.pet.petLostDate=new Date,a.pet.dateDied=new Date,a.pet.ownerComments=""):a.pet.originalPetStatusId==2?(a.pet.petLostDate=new Date,a.pet.petFoundDate=new Date,a.pet.ownerComments=""):a.pet.originalPetStatusId==3?(a.pet.petFoundDate=new Date,a.pet.dateDied=new Date,a.pet.ownerComments=""):a.pet.originalPetStatusId==5&&(a.pet.petLostDate=new Date,a.pet.dateDied=new Date,a.pet.ownerComments="");a.pet.originalPetStatusId==a.pet.petStatusId&&(a.pet.ownerComments=a.currentOwnerComments)}function ut(){return function(n){if(a.pet!=null&&a.pet!=null&&n!=null){var t;return t=a.pet.petDOB!=null?h().diff(a.pet.petDOB,"months",!0):19,t<=18?n.value==0||n.value==1||n.value==98||n.value==99:n.value==0||n.value==1||n.value==99}}}function ft(){a.pet.desexedDate=null}function et(){var n;n=a.pet.petDOB!=null?h().diff(a.pet.petDOB,"months",!0):19;(a.pet.speciesId==1||a.pet.speciesId==2)&&n>18&&a.pet.petDesexedId==98&&(a.pet.petDesexedId=null);a.notifications!=null&&(a.notifications.dangerousDogs.notificationStatus==1||a.notifications.menacingDogs.notificationStatus==1||a.notifications.nuisancePets.notificationStatus==1||a.notifications.restrictedDogs.notificationStatus==1||a.notifications.restrictedByBreed.notificationStatus==1||a.notifications.soldByPoundShelter.notificationStatus==1)&&a.pet.petDesexedId==99&&(a.pet.petDesexedId=null)}function ot(){return a.pet.petDesexedId==1}function st(){return a.pet.petDesexedId!=null&&a.pet.petDesexedId!=0&&a.pet.petDesexedId!=99&&a.pet.petDesexedId!=98?a.pet.desexedDate==null?!0:a.frmOther.$invalid||!a.frmOther.$dirty?!0:!1:a.frmOther.$invalid||!a.frmOther.$dirty?!0:!1}function ht(){return a.notifications!=null&&(a.notifications.controlOrders.notificationStatus||a.notifications.dangerousDogs.notificationStatus||a.notifications.menacingDogs.notificationStatus||a.notifications.nuisancePets.notificationStatus||a.notifications.restrictedDogs.notificationStatus||a.notifications.undesexedCats.notificationStatus)}var a=this;a.pet=u.data.pet;console.log(u.data.pet);a.registration=u.data.registration;a.notifications={};a.notifications=u.data.notifications;a.currentOwnerComments=u.data.pet.ownerComments;a.currentDateDied=u.data.pet.dateDied;a.currentFoundDate=u.data.pet.petFoundDate;a.currentLostDate=u.data.pet.petLostDate;a.pet.originalPetStatusId=u.data.pet.petStatusId;a.currentStatusId=u.data.pet.petStatusId;a.currentDesexedStatusId=u.data.pet.petDesexedId;a.currentOutofDate=u.data.pet.petOutofDate;a.currentIdentificationMarks=u.data.pet.petIdentificationMarks;a.currentAdditionalComments=u.data.pet.petAdditionalComments;a.currentDesexedDate=u.data.pet.desexedDate;a.confirmationforUpdateOtherPetDetails=d;a.userRole=l.currentUser.role;a.pet.ownerId=u.data.owner!=null?u.data.owner.ownerId:-1;a.domainRules=u.rules;a.referenceData=f;a.maxDateDied=new h;a.pet.dateDied=y(a.pet.dateDied);a.pet.petFoundDate=y(a.pet.petFoundDate);a.pet.petLostDate=y(a.pet.petLostDate);a.dateDiedMinDate=new h(u.data.pet.petDOB);a.statusUpdated=!1;a.otherDetailsUpdated=!1;a.showIsBreedable=!1;a.updatePetStatus=k;a.updatePetOtherDetails=v;a.cancel=g;a.queryBySelectedValue=nt;a.getProperty=tt;a.petStatusChange=rt;a.getPetDesexedStatus=it;a.getDesexedStatus=ut;a.petDesexedIdChange=ft;a.enableDesexedDate=ot;a.validateFormOnSave=st;a.areThereNotificationsForDisplay=ht;w();p()}var n="petstatusController";angular.module("app").controller(n,["$rootScope","common","$uibModalInstance","config","ReferenceData","datacontext","$scope","$filter","moment","modalPopupFactory","authdata",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l){function p(){var i=[w()];t.activateController(i,n).then(function(){return h.logoutOnPageLoad(),g()})}function w(){return u.query("api/SystemUser/GetResetPasswordDefinition").then(function(n){a.domain=n.data;a.securityDomainRules=n.securityValidation})}function b(n,t){return l.get(n,t)}function k(){a.showFailureMessage=!1;a.showSuccessMessage=!1}function d(){return c.spinnerShow(),a.domain.key=a.code,u.post("api/SystemUser/ResetSystemUserPassword",a.domain).then(function(n){c.spinnerHide();n?(i.publicUserId=n,a.showSuccessMessage=!0):a.showFailureMessage=!0})}function g(){c.spinnerShow();var n=a.code;if(typeof n!="undefined"&&n!==null&&n!=="")return u.query("api/SystemUser/GetResetPassword",[n]).then(function(n){c.spinnerHide();n==="undefined"||n===null||n===""?(y("Fetching the code is not successful, redirecting to Home page..."),$timeout(s.path("/"),2e3)):a.domain=n})}var v=t.logger.getLogFn,y=v(n),a=this;a.code=r.code;a.getProperty=b;a.changepassword=d;a.frmResetPassword={};a.domain={username:"",password:"",usertype:"",attemptCount:0};a.chipnumber="";a.showFailureMessage=!1;a.showSuccessMessage=!1;a.clearmessages=k;a.loginAttempts=[];a.authResult={};p()}var n="reset";angular.module("app").controller(n,["common","authdata","$routeParams","datacontext","config","$scope","ROOT","$location","authservice","spinner","_","commonConfig",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a,v,y){function d(){p.question_dtls=[{group:"Frequently asked questions:",questions:[{question:" My cat or dog is missing - what should I do?",answer:y.trustAsHtml("If your cat or dog has been missing for more than 72 hours, you must notify your local council within 24 hours. If your dog is a restricted dog or a declared dangerous or menacing dog and it is missing, you must notify your local council within 24 hours. <br><br> To help you be reunited with your pet, take the following steps: <ul><li>Log into the NSW Pet Registry and change the status of your cat or dog on the NSW Pet Registry to 'missing'. This will prevent a person who is claiming to be your cat or dog's owner, for example, where it has been stolen, from transferring ownership.<\/li> <li>Check that your contact details are correct, so that you can be contacted when your cat or dog is found.<\/li> <li>Make sure you have made a note of your pet’s microchip number.<\/li> <li>Consider contacting local vets and approved animal welfare organisations, such as the <a href='https://www.rspcansw.org.au/' target='_blank'>RSPCA<\/a>, the <a href='https://www.awlnsw.com.au/' target='_blank'>Animal Welfare League<\/a> and the <a href='http://catcare.org.au/'  target='_blank' >Cat Protection Society<\/a>, to check if a cat or dog with your cat or dog's microchip number or matching your cat or dog's description has been found.<\/li><\/ul>")},{question:"My cat or dog has been found - what do I need to do?",answer:y.trustAsHtml("You must notify your local council within 72 hours of your cat or dog being returned to you. This enables your local council to update the NSW Companion Animals Register.")},{question:"I have found a stray dog - what should I do?",answer:y.trustAsHtml("If you have found a dog, you should first check if it is wearing a collar and tag. If it is, use the contact details to contact the owner.<br><br>If it is not wearing a collar and tag, you must by law, take the dog to a council pound, an approved animal welfare organisation or an approved premises (usually a veterinary practice). The dog can then be scanned for a microchip, the owner's contact details obtained from the NSW Pet Registry and the owner contacted and re-united with their dog.<br><br>While councils are not obliged to collect stray animals, many councils offer this service. However, councils are obliged to accept animals that are seized by members of the public and are taken to the council’s holding facility/pound.")},{question:"I have found a stray cat - what should I do?",answer:y.trustAsHtml("Anyone can legally seize a cat, owned or un-owned, if that action is reasonable and necessary for the protection of a person or animal (other than vermin) from injury or death, providing that action meets the requirements of the Prevention of Cruelty to Animals Act 1979.<br><br>While councils are not obliged to collect stray animals, many councils offer this service. However, councils are obliged to accept animals that are seized by members of the public and are taken to the council’s holding facility/pound.")}]}];p.petFoundDateMax=new s;p.domain.petFoundDate=(new s).toDate();t.activateController([g()],n).then(function(){});p.currentUserId!=null&&b()}function w(){grecaptcha.render("recaptcha",{sitekey:p.sitekey,size:"invisible",callback:function(n){p.domain.captchaSecret=n;rt()}})}function g(){return l.query("api/reportfoundpet/GetReportFoundPetDefinition").then(function(n){p.reportFoundPetDomainRules=n.foundPetValidation})}function nt(){if(p.frmReportFoundPet.$valid)try{grecaptcha.execute()}catch(n){w();h.spinnerShow();setTimeout(function(){grecaptcha.execute()},1e3)}}function tt(){p.domain={microchipNumber:"",petFoundDate:"",phoneNumber:"",canSharePhoneNumber:!1};p.domain.petFoundDate=(new s).toDate();p.currentUserId!=null&&b();p.showFailureMessage=!1;p.showSuccessMessage=!1;p.showWarnignMessage=!1;p.showCouncilLink=!1;p.errorMessage="";p.frmReportFoundPet.$setPristine();p.frmReportFoundPet.$setUntouched();try{grecaptcha.reset()}catch(n){}}function it(n,t){return c.get(n,t)}function b(){return l.query("api/OwnerData/GetLoggedInUserProfileForReportFoundPet",[p.currentUserId]).then(function(n){p.domain.userProfile=n;p.domain.userProfile!=null&&(p.domain.userProfile.publicUserAdditionalProfileModel.mobilePhone!=null?p.domain.phoneNumber=p.domain.userProfile.publicUserAdditionalProfileModel.mobilePhone:p.domain.userProfile.publicUserAdditionalProfileModel.homePhone!=null?p.domain.phoneNumber=p.domain.userProfile.publicUserAdditionalProfileModel.homePhone:p.domain.userProfile.publicUserAdditionalProfileModel.workPhone!=null&&(p.domain.phoneNumber=p.domain.userProfile.publicUserAdditionalProfileModel.workPhone));h.spinnerHide()})}function rt(){return h.spinnerShow(),l.post("api/reportfoundpet/ValidateandSubmitMissingPet",p.domain).then(function(n){if(h.spinnerHide(),n)if(n.microchipNumber!=null)if(n.isEmailValid==!0){if(n.isReported==!0)p.showSuccessMessage=!0,grecaptcha.reset(),(n.restrictedBreedFlag==!0||n.restrictedFlag==!0)&&(p.showWarnignMessage=!0,p.warningMessage=" The dog with this microchip number is of a breed that is considered dangerous.",grecaptcha.reset()),(n.dangerousFlag==!0||n.menacingFlag==!0||n.controlOrdersFlag==!0||n.nuisanceFlag==!0)&&(p.showWarnignMessage=!0,p.warningMessage=" The dog with this microchip number has a known history of violent or menacing behaviour.",grecaptcha.reset());else if(n.reason=="owners pet")p.showFailureMessage=!0,p.errorMessage="The pet with microchip number "+p.domain.microchipNumber+" seems to be belonging to you. You cannot report your own pet as found. Please contact your local council if this is an error.",grecaptcha.reset();else if(n.isPetMissing==!1){var t="The pet with microchip number "+p.domain.microchipNumber+" has not been reported missing by its owner. Please check the microchip number again and confirm it is correct. Do you still want to proceed?";v.openConfirmMsg("md",t).then(function(n){n?ut():grecaptcha.reset()})}}else p.showFailureMessage=!0,p.errorMessage="Cannot proceed with the process as there is no valid e-mail associated with pet's owner account. Please contact your local council or You may surrender the pet to your local pound at any time.";else p.showFailureMessage=!0,p.errorMessage="This microchip number is not listed in the NSW Pet Registry. Please contact your local NSW Council office. Contact details for your local council can be found at ",p.showCouncilLink=!0;else p.showFailureMessage=!0,p.errorMessage="Sorry some error occured, please try again later."})}function ut(){return h.spinnerShow(),l.post("api/reportfoundpet/SaveAndReportFoundPet",p.domain).then(function(n){h.spinnerHide();n?n.isReported==!0?(p.showSuccessMessage=!0,grecaptcha.reset(),(n.restrictedBreedFlag==!0||n.restrictedFlag==!0)&&(p.showWarnignMessage=!0,p.warningMessage=" The dog with this microchip number is of a breed that is considered dangerous."),(n.dangerousFlag==!0||n.menacingFlag==!0||n.controlOrdersFlag==!0||n.nuisanceFlag==!0)&&(p.showWarnignMessage=!0,p.warningMessage=" The dog with this microchip number has a known history of violent or menacing behaviour.")):(p.showFailureMessage=!0,p.errorMessage="Sorry some error occured, please try again later."):(p.showFailureMessage=!0,p.errorMessage="Sorry some error occured, please try again later.")})}function ft(n,t){p.currentQuestion.group==n&&p.currentQuestion.question==t?(p.currentQuestion.group="",p.currentQuestion.question=""):(p.currentQuestion.group=n,p.currentQuestion.question=t)}function et(n,t){return p.currentQuestion.group==n&&p.currentQuestion.question==t?!0:!1}function ot(n){f.path(n)}var k=t.logger.getLogFn,st=k(n),p;r.screenTitle="Lost and Found";p=this;p.getProperty=it;p.domain={microchipNumber:"",petFoundDate:"",phoneNumber:"",canSharePhoneNumber:!1};p.submitForm=nt;p.resetForm=tt;p.showSuccessMessage=!1;p.showFailureMessage=!1;p.showCouncilLink=!1;p.grecaptchaloaded=!1;p.sitekey=SITEKEY;p.currentUserId=o.currentUser.id;p.userRole=o.currentUser.role;p.frmReportFoundPet={};p.question_dtls=[];p.currentQuestion={};p.updateQuestion=ft;p.isCurrentQuestion=et;p.navigate=ot;d();window.onloadCallback=function(){w()}}var n="reportFoundPet";angular.module("app").controller(n,["common","$scope","$rootScope","ROOT","$location","authservice","authdata","moment","spinner","_","datacontext","commonConfig","modalPopupFactory","$sce",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a){function w(){t.activateController([],n).then(function(){return c.logoutOnPageLoad(),g()})}function b(n,t){return a.get(n,t)}function k(){v.showFailureMessage=!1;v.showSuccessMessage=!1}function d(){return l.spinnerShow(),f.post("api/OwnerData/ResetSystemUserEmail",v.domain).then(function(n){l.spinnerHide();n.status?v.showSuccessMessage=!0:(v.showFailureMessage=!0,v.domain.reason=n.message)})}function g(){var n=v.code;if(typeof n!="undefined"&&n!==null&&n!=="")return f.query("api/OwnerData/GetResetEmail",[n]).then(function(n){n==="undefined"||n===null||n===""?(p("Fetching the code is not successful, redirecting to Home page..."),$timeout(h.path("/"),2e3)):v.domain=n})}var y=t.logger.getLogFn,p=y(n),v;u.screenTitle="Email Reset";v=this;v.code=r.code;v.getProperty=b;v.changeEmail=d;v.expired="";v.invalid="";v.reason="";v.frmResetEmail={};v.showFailureMessage=!1;v.showSuccessMessage=!1;v.clearmessages=k;v.authResult={};w()}var n="emailreset";angular.module("app").controller(n,["common","authdata","$routeParams","$rootScope","datacontext","config","$scope","ROOT","$location","authservice","spinner","_","commonConfig",t])}(),function(){"use strict";function t(t,i,r,u,f,e){function s(){t.activateController([],n).then(function(){})}function h(){i.dismiss("cancel")}function c(){o.domain.termsAccepted=!0;i.dismiss("cancel")}function l(){o.domain.termsAccepted=!1;i.dismiss("cancel")}function a(){f.openTemplate("lg",null,null,e+"app/public/registerstep1/privacy.tmpl.html","registerpopup")}var o=this;o.domain=r.data;o.cancel=h;o.IAgree=c;o.IDontAgree=l;o.popupPrivacy=a;o.sitekey=SITEKEY;s()}var n="registerpopup";angular.module("app").controller(n,["common","$uibModalInstance","config","$scope","modalPopupFactory","ROOT",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h){function a(){g();i.activateController([w()],n).then(function(){c.domain.email=null;c.domain.termsAccepted=!1;c.showSuccessMessage=!1;c.showFailureMessage=!1})}function v(n,t){return e.get(n,t)}function y(){c.frmEmail.$valid&&grecaptcha.execute()}function p(){return c.showSuccessMessage=!1,c.showFailureMessage=!1,c.disableSubmit=!0,c.formSubmitted=!1,f.spinnerShow(),t.post("api/SystemUser/SendVerificationEmail",c.domain).then(function(n){c.formSubmitted=!0;c.disableSubmit=!1;f.spinnerHide();n?(c.domain.captchaSecret=null,grecaptcha.reset(),c.showSuccessMessage=!0,c.emailCopy=c.domain.email):c.showFailureMessage=!0})}function w(){return t.query("api/SystemUser/GetSystemUserEmailDefinition").then(function(n){c.domain=n.data;c.systemUserEmailRules=n.systemUserEmailValidation})}function b(){s.openTemplate("lg",null,null,o+"app/public/registerstep1/privacy.tmpl.html","registerpopup")}function k(){s.openTemplate("lg",c.domain,null,o+"app/public/registerstep1/terms.tmpl.html","registerpopup")}function d(){c.domain.email!=undefined&&c.formSubmitted&&grecaptcha.reset();c.showSuccessMessage=!1;c.showFailureMessage=!1}function g(){h(function(){grecaptcha.render("recaptcha",{sitekey:c.sitekey,size:"invisible",callback:c.callback})},1200)}var l=i.logger.getLogFn,nt=l(n),c;u.screenTitle="Registration Step 1";c=this;c.disableSubmit=!1;c.formSubmitted=!1;c.getProperty=v;c.submitEmail=p;c.popupPrivacy=b;c.popupTerms=k;c.emailChanged=d;c.grecaptchaloaded=!1;c.sitekey=SITEKEY;c.submitForm=y;a();c.callback=function(n){c.domain.captchaSecret=n;c.submitEmail()}}var n="registerStep1";angular.module("app").controller(n,["datacontext","common","$scope","$rootScope","spinner","_","ROOT","modalPopupFactory","$timeout",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a,v,y){function k(){i.activateController([ut()],n).then(function(){rt();p.dateOfBirthMin=new s("01/01/1900","DD/MM/YYYY");p.dateOfBirthMax=s().add(-18,"years");p.referenceData=e;p.showSuccessMessage=!1;p.showFailureMessage=!1});t.query("api/SystemUser/GetGreenIDConfiguration/").then(function(n){p.greenIDEnvironmentCode=n.greenIDEnvironmentCode;p.greenIDAccountID=n.greenIDAccountID;p.greenIDAPICode=n.greenIDAPICode;tt(p.greenIDEnvironmentCode)})}function d(){return p.stagevalue="30",p.stagenumber=3,!0}function g(){var t,n;if(p.domain!=null&&(t=p.domain.dateOfBirth,t!=null))return n=t.split("/"),n[1]+"/"+n[0]+"/"+n[2]}function nt(n,t){return f.get(n,t)}function tt(n){greenidConfig.setOverrides({intro_title:"<h1>Verify your Identity<\/h1>"});greenidConfig.setOverrides({intro_introText0:"<h4>To verify your identity, you will be required to provide certain credentials from your chosen identification source.<\/h4><br/><h4>Get started with your first ID source below.<\/h4>"});greenidConfig.setOverrides({enable_save_and_complete_later:!1});greenidConfig.setOverrides({dl_short_title:"Driver's Licence"});greenidConfig.setOverrides({dl_title:"Driver's Licence"});greenidConfig.setOverrides({source_title_heading_label:"Driver's Licence"});greenidConfig.setOverrides({actrego_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({actrego_givenname_label:"First Name"});greenidConfig.setOverrides({actrego_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({actrego_surname_label:"Surname"});greenidConfig.setOverrides({actrego_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({actregodvs_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({actregodvs_givenname_label:"First Name"});greenidConfig.setOverrides({actregodvs_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({actregodvs_surname_label:"Surname"});greenidConfig.setOverrides({actregodvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({nswrego_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({nswrego_givenname_label:"First Name"});greenidConfig.setOverrides({nswrego_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({nswrego_surname_label:"Surname"});greenidConfig.setOverrides({nswrego_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({nswregodvs_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({nswregodvs_givenname_label:"First Name"});greenidConfig.setOverrides({nswregodvs_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({nswregodvs_surname_label:"Surname"});greenidConfig.setOverrides({nswregodvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({qldrego_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({qldrego_givenname_label:"First Name"});greenidConfig.setOverrides({qldrego_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({qldrego_surname_label:"Surname"});greenidConfig.setOverrides({qldrego_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({qldregodvs_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({qldregodvs_givenname_label:"First Name"});greenidConfig.setOverrides({qldregodvs_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({qldregodvs_surname_label:"Surname"});greenidConfig.setOverrides({qldregodvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({vicrego_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({vicrego_givenname_label:"First Name"});greenidConfig.setOverrides({vicrego_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({vicrego_surname_label:"Surname"});greenidConfig.setOverrides({vicrego_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({vicregodvs_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({vicregodvs_givenname_label:"First Name"});greenidConfig.setOverrides({vicregodvs_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({vicregodvs_surname_label:"Surname"});greenidConfig.setOverrides({vicregodvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({sarego_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({sarego_givenname_label:"First Name"});greenidConfig.setOverrides({sarego_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({sarego_surname_label:"Surname"});greenidConfig.setOverrides({sarego_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({saregodvs_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({saregodvs_givenname_label:"First Name"});greenidConfig.setOverrides({saregodvs_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({saregodvs_surname_label:"Surname"});greenidConfig.setOverrides({saregodvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({warego_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({warego_givenname_label:"First Name"});greenidConfig.setOverrides({warego_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({warego_surname_label:"Surname"});greenidConfig.setOverrides({warego_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({waregodvs_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({waregodvs_givenname_label:"First Name"});greenidConfig.setOverrides({waregodvs_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({waregodvs_surname_label:"Surname"});greenidConfig.setOverrides({waregodvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({tasrego_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({tasrego_givenname_label:"First Name"});greenidConfig.setOverrides({tasrego_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({tasrego_surname_label:"Surname"});greenidConfig.setOverrides({tasrego_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({tasregodvs_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({tasregodvs_givenname_label:"First Name"});greenidConfig.setOverrides({tasregodvs_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({tasregodvs_surname_label:"Surname"});greenidConfig.setOverrides({tasregodvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({ntrego_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({ntrego_givenname_label:"First Name"});greenidConfig.setOverrides({ntrego_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({ntrego_surname_label:"Surname"});greenidConfig.setOverrides({ntrego_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({ntregodvs_number_label:"Driver's Licence Number"});greenidConfig.setOverrides({ntregodvs_givenname_label:"First Name"});greenidConfig.setOverrides({ntregodvs_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({ntregodvs_surname_label:"Surname"});greenidConfig.setOverrides({ntregodvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({passport_number_label:"Passport Number"});greenidConfig.setOverrides({passport_givenname_label:"First Name"});greenidConfig.setOverrides({passport_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({passport_surname_label:"Surname"});greenidConfig.setOverrides({passport_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({passportdvs_number_label:"Passport Number"});greenidConfig.setOverrides({passportdvs_givenname_label:"First Name"});greenidConfig.setOverrides({passportdvs_middlename_label:"Middle Name(s)"});greenidConfig.setOverrides({passportdvs_surname_label:"Surname"});greenidConfig.setOverrides({passportdvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({medicare_short_title:"Medicare Card"});greenidConfig.setOverrides({medicare_title:"Medicare Card"});greenidConfig.setOverrides({medicare_number_label:"Medicare Card Number"});greenidConfig.setOverrides({medicare_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({medicare_nameOnCard_label:"Full Name <span class='help-block'>(as it appears on the card)<\/span>"});greenidConfig.setOverrides({medicare_expiry_label_green:"Card Expiry Date <span class='help-block'>(MM/YYYY)<\/span>"});greenidConfig.setOverrides({medicare_refno_label:"Individual Reference Number"});greenidConfig.setOverrides({medicaredvs_short_title:"Medicare Card"});greenidConfig.setOverrides({medicaredvs_title:"Medicare Card"});greenidConfig.setOverrides({medicaredvs_number_label:"Medicare Card Number"});greenidConfig.setOverrides({medicaredvs_dob_label:"Date of Birth <span class='help-block'>(DD/MM/YYYY)<\/span>"});greenidConfig.setOverrides({medicaredvs_nameOnCard_label:"Full Name <span class='help-block'>(as it appears on the card)<\/span>"});greenidConfig.setOverrides({medicaredvs_expiry_label_green:"Card Expiry Date <span class='help-block'>(MM/YYYY)<\/span>"});greenidConfig.setOverrides({medicaredvs_individualReferenceNumber_label:"Individual Reference Number"});greenidConfig.setOverrides({visadvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({actregodvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({nswregodvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({qldregodvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({vicregodvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({saregodvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({waregodvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({tasregodvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({ntregodvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({passportdvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});greenidConfig.setOverrides({medicaredvs_tandc_label:"I give consent for the above information to be verified with the issuing authority or official record holder"});v("document").ready(function(){y.setup({environment:n,formId:"frmIdentity",frameId:"divGreenId",debug:!1,country:"country",errorCallback:function(n,t){return p.showFailureMessage=!0,p.errorMessage="An unexpected error occurred during the identity verification: "+t,!1},sessionCancelledCallback:function(n,t){return p.showFailureMessage=!0,p.errorMessage="Your identity verification session was cancelled, Please try again later. Last status: "+t,!1},preSubmitValidationCallback:function(){return p.frmIdentity.$invalid?!1:(p.showGreenIdDiv=!0,!0)},registerCallback:function(n){return n!==null&&n!=="undefined"&&n!==""&&(p.domain.greenIDReference=n),!0},sessionCompleteCallback:function(){return!0},submitCallback:function(){return p.submitIdentity(),!1}})})}function it(){return u.spinnerShow(),t.post("api/SystemUser/SaveSystemUserIdentity",p.domain).then(function(n){u.spinnerHide();p.saveResponse=n;var t=n.status;p.errorMessage=n.message;t?(o.publicUserId=n.returnData,p.showSuccessMessage=!0,c.path("/registerstep3")):p.showFailureMessage=!0})}function rt(){var n=p.code;if(typeof n!="undefined"&&n!==null&&n!=="")return t.query("api/SystemUser/VerifyEmail/"+n).then(function(n){n==="undefined"||n===null||n===""?(b("Fetching the code is not successful, redirecting to Home page..."),a(c.path("/registerstep1"),2e3)):(p.domain.email=n.email,p.domain.verified=n.status,p.domain.reason=n.reason)})}function ut(){return t.query("api/SystemUser/GetSystemUserIdentityDefinition").then(function(n){p.domain=n.data;p.systemUserIdentityRules=n.systemUserIdentityValidation})}var w=i.logger.getLogFn,b=w(n),p;r.screenTitle="Registration Step 2";p=this;p.code=l.code;o.currentUser.registrationCode=p.code;p.stagevalue="20";p.stagenumber=2;p.getProperty=nt;p.submitIdentity=it;p.getDOB=g;p.dummySubmit=d;k()}var n="registerStep2";angular.module("app").controller(n,["datacontext","common","$rootScope","spinner","_","ReferenceData","authdata","moment","$scope","$location","$routeParams","$timeout","greenidjq","greenid",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c){function y(){i.activateController([nt()],n).then(function(){tt();l.referenceData=e;l.addressList=[];l.addressListMoniker=[];l.showSuccessMessage=!1;l.showFailureMessage=!1})}function p(n,t){return f.get(n,t)}function w(){return u.spinnerShow(),t.post("api/SystemUser/SaveSystemUserContact",l.domain).then(function(n){u.spinnerHide();n?(l.showSuccessMessage=!0,c(h.path("/registerstep4"),4e3)):l.showFailureMessage=!0})}function b(n){if(typeof n!="undefined"&&n!==null&&n!==""){var t=n.split(" "),i=t[t.length-1],r=n.replace(" "+i,"");return[r,i]}return["",""]}function k(n){return typeof n!="undefined"&&n!==null&&n!==""?n.substring(3):""}function d(n){for(var t=0;t<l.referenceData.masterData.states.length;t++)if(l.referenceData.masterData.states[t].text===n)return l.referenceData.masterData.states[t].value;return null}function g(n){if(u.spinnerShow(),typeof n!="undefined"&&n!==null&&n!==""){var r=l.addressList.indexOf(n),i=[];return i.push(l.addressListMoniker[r]),i.push(l.addressList[r]),t.post("api/Address/FillTheForm",{address:i}).then(function(n){u.spinnerHide();(n[0]==null||n[0]=="")&&(l.domain.streetNumber=n[0]);l.domain.streetNumber=(n[0]==null||n[0]==""?"":n[0]+" ")+(n[1]==null||n[1]==""?"":n[1]+" ")+n[2];l.domain.streetName=l.splitStreet(n[3])[0];l.domain.streetType=l.splitStreet(n[3])[1];l.domain.suburb=n[4];l.domain.state=n[5];l.domain.stateID=l.getStateId(n[5]);l.domain.postCode=n[6];l.domain.localCouncilCode=n[7];l.domain.localCouncilName=n[8]})}return null}function nt(){return t.query("api/SystemUser/GetSystemUserContactDefinition").then(function(n){l.domain=n.data;l.systemUserContactRules=n.systemUserContactValidation})}function tt(){o.publicUserId==="undefined"||o.publicUserId===null||o.publicUserId===0?(v("Registration steps not complete, redirecting to Step 1..."),c(h.path("/registerstep1"),2e3)):l.domain.systemUserID=o.publicUserId}var a=i.logger.getLogFn,v=a(n),l;r.screenTitle="Registration Step 3";l=this;l.getProperty=p;l.submitContact=w;l.splitStreet=b;l.splitCouncil=k;l.getStateId=d;l.fillAddress=g;y();s.$watch("vm.domain.streetAddress",function(n){if(!f.isNull(n)&&!f.isUndefined(n)&&n!="")return t.post("api/Address/SearchAddress",{address:n}).then(function(n){l.addressList=[];l.addressListMoniker=[];for(var t=0;t<n.length;t++)l.addressList.push(n[t].address),l.addressListMoniker.push(n[t].moniker)})})}var n="registerStep3";angular.module("app").controller(n,["datacontext","common","$rootScope","spinner","_","ReferenceData","authdata","$scope","$location","$timeout",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s){function l(){i.activateController([y()],n).then(function(){p();w();h.showSuccessMessage=!1;h.showFailureMessage=!1})}function a(n,t){return f.get(n,t)}function v(){u.spinnerShow();var n={};return angular.copy(h.domain,n),n.systemUserQuestion1=h.domain.systemUserQuestion1.systemUserQuestionID,n.systemUserQuestion2=h.domain.systemUserQuestion2.systemUserQuestionID,n.systemUserQuestion3=h.domain.systemUserQuestion3.systemUserQuestionID,n.registrationCode=e.currentUser.registrationCode,t.post("api/SystemUser/SaveSystemUserSecurity",n).then(function(n){u.spinnerHide();n>0?(h.showSuccessMessage=!0,s(o.path("/registerstep5"),4e3)):h.showFailureMessage=!0})}function y(){return t.query("api/SystemUser/GetSystemUserSecurityDefinition").then(function(n){h.domain=n.data;h.systemUserSecurityRules=n.systemUserSecurityValidation})}function p(){e.publicUserId==="undefined"||e.publicUserId===null||e.publicUserId===0?s(o.path("/registerstep1"),2e3):h.domain.systemUserID=e.publicUserId}function w(){return t.query("api/SystemUser/GetSystemUserQuestions").then(function(n){h.systemUserQuestions=n})}function b(n){return n.systemUserQuestionID!=h.domain.systemUserQuestion2&&n.systemUserQuestionID!=h.domain.systemUserQuestion3}function k(n){return n.systemUserQuestionID!=h.domain.systemUserQuestion1&&n.systemUserQuestionID!=h.domain.systemUserQuestion3}function d(n){return n.systemUserQuestionID!=h.domain.systemUserQuestion2&&n.systemUserQuestionID!=h.domain.systemUserQuestion1}var c=i.logger.getLogFn,g=c(n),h;r.screenTitle="Registration Step 4";h=this;h.getProperty=a;h.submitSecurity=v;h.filterQ1=b;h.filterQ2=k;h.filterQ3=d;l()}var n="registerStep4";angular.module("app").controller(n,["datacontext","common","$rootScope","spinner","_","authdata","$location","$timeout",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c){function y(){l.currentUser=r.currentUser;u.activateController([],n).then(function(){})}function p(n){var t="";return n.specie=="Dog"&&(n.dangerousPermitRequired||n.restrictedPermitRequired)&&(t=t+"&#8226; Dangerous and Restricted dogs require permit"),n.specie=="Cat"&&n.undesexedPermitRequired&&(t=t+"&#8226; Undesexed cats require permit"),n.specie!="Cat"||n.undesexedPermitRequired||(n.undesexedPermitStatusCode==1&&(t=t+"&#8226; Desexing is not recommended until this cat is 18 months old"),n.undesexedPermitStatusCode==2&&(t=t+"&#8226; Desexing is not recommended for this cat (for life)"),n.undesexedPermitStatusCode==3&&(t=t+"&#8226; Breeders exemption applies"),n.undesexedPermitStatusCode==4&&(t=t+"&#8226; This cat was registered prior to 01 July 2020"),n.undesexedPermitStatusCode==5&&(t=t+"&#8226; This cat is still under 4 months of age"),n.undesexedPermitStatusCode==6&&(t=t+"&#8226; This cat has been desexed within the required 4 months of age"),n.undesexedPermitStatusCode==7&&(t=t+"&#8226; This undesexed cat is not registered"),n.undesexedPermitStatusCode==8&&(t=t+"&#8226; This cat is exempted from undesexed cat annual permit"),n.undesexedPermitStatusCode==9&&(t=t+"&#8226; This cat was desexed prior to 01 July 2020"),n.undesexedPermitStatusCode==10&&(t=t+"&#8226; Pensioners exemption applies")),t}function w(n){var t="";return n.specie=="Dog"&&n.dangerousPermitRequired&&(t=t+"&#8226; <b>Dangerous dogs<\/b>",n.dangerousPermitStatusCode=="50"?t=t+" - Permit due now":n.dangerousPermitStatusCode=="30"?t=t+" - Expired on "+moment(n.dangerousPermitEndDate).format("DD/MM/YYYY"):n.dangerousPermitStatusCode=="20"&&(t=t+" - Current"),t=t+"<br>"),n.specie=="Dog"&&n.restrictedPermitRequired&&(t=t+"&#8226; <b>Restricted dogs<\/b>",n.restrictedPermitStatusCode=="50"?t=t+" - Permit due now":n.restrictedPermitStatusCode=="30"?t=t+" - Expired on "+moment(n.restrictedPermitEndDate).format("DD/MM/YYYY"):n.restrictedPermitStatusCode=="20"&&(t=t+" - Current")),n.specie=="Cat"&&n.undesexedPermitRequired&&(t="&#8226; <b>Undesexed cats<\/b>",n.undesexedPermitStatusCode=="50"?t=t+" - Permit due now":n.undesexedPermitStatusCode=="30"?t=t+" - Expired on "+moment(n.undesexedPermitEndDate).format("DD/MM/YYYY"):n.undesexedPermitStatusCode=="20"&&(t=t+" - Current")),t}function b(n,t){var i="";return n.specie=="Dog"&&n.dangerousPermitRequired&&t=="DNG"&&(i="DNG",n.dangerousPermitStatusCode=="50"?i=i+" - Permit due now":n.dangerousPermitStatusCode=="30"?i=i+" - Expired on "+moment(n.dangerousPermitEndDate).format("DD/MM/YYYY"):n.dangerousPermitStatusCode=="20"&&(i=i+" - Current")),n.specie=="Dog"&&n.restrictedPermitRequired&&t=="RESTR"&&(i="RESTR",n.restrictedPermitStatusCode=="50"||n.restrictedPermitStatusCode==1?i=i+" - Permit due now":n.restrictedPermitStatusCode=="30"?i=i+" - Expired on "+moment(n.restrictedPermitEndDate).format("DD/MM/YYYY"):n.restrictedPermitStatusCode=="20"&&(i=i+" - Current")),n.specie=="Cat"&&n.undesexedPermitRequired&&t=="UNDSXD"&&(i="UNDSXD",n.undesexedPermitStatusCode=="50"?i=i+" - Permit due now":n.undesexedPermitStatusCode=="30"?i=i+" - Expired on "+moment(n.undesexedPermitEndDate).format("DD/MM/YYYY"):n.undesexedPermitStatusCode=="20"&&(i=i+" - Current")),i}function k(n){var t="";t=t+"Click here to pay online and register your pet. ";var i=new Date,r=new Date(n.registerationDueDate),u=moment(r).add(28,"days");return u<i&&(t=t+"Late fee applies."),t}function d(n){l.isLoading=!0;var t=n.pagination,r=t.start||0,u=t.number||l.noOfItemsPerPage;i.getPage(r,u,n).then(function(t){l.displayed=t.data;l.litterWithNoMicrochip=_.find(l.displayed,function(n){return n.needsChip});l.needsChip=l.litterWithNoMicrochip?!0:!1;n.pagination.numberOfPages=t.numberOfPages;l.isLoading=!1})}function g(n,t){var i=nt(t);return n=="Cat"&&i>4||n=="Dog"&&i>6&&i<=120?!0:!1}function nt(n){var t=moment(n),i=moment(),r=moment.duration(i.diff(t));return r.asMonths()}function tt(n){return location.href=l.root+"Report/GetRegisterationCertificate/"+n,!1;var t}var a=u.logger.getLogFn,it=a(n),v=u.$q,l;t.screenTitle="My Pets";l=this;l.referenceData=s;l.callServer=d;l.RegisterationCertificate=tt;l.canHaveLitter=g;l.getPermitStatusPopoverHTML=p;l.getPermitStatusPopoverHTMLOLD=w;l.getPermitStatusLabel=b;l.domain=[];l.title="Dashboard";l.restrictedBreedHtml='You are not allowed to transfer ownership of this pet for one of the following reasons<br>&#8226; status may not be set as "Home" <br>&#8226; is a dog restricted by breed <br>&#8226; is a dangerous or menacing dog<br>&#8226; is a dog subject to a control order';l.restrictedUpdateHtml="You are not allowed to update this pet. Reason is: <br>&#8226; This pet is in Home - Transfer status. ";l.denyTransfer="You cannot transfer ownership of a pet with an offspring that has not been microchipped.";l.catTransferRestricted='You are not allowed to transfer ownership of this pet for one of the following reasons<br>&#8226; status may not be set as "Home" <br>';l.root=c;l.userRole=r.currentUser.role;y();l.getRegisterStatusLabel=k;l.noOfItemsPerPage=10;l.isOpen=!0;l.needsChip=!1;l.hasPermit=!1;l.displayed=[]}var n="ownerdashboard";angular.module("app").controller(n,["$rootScope","OwnerFactory","authdata","common","$http","datacontext","spinner","ReferenceData","$window","ROOT",t])}(),function(){"use strict";var n=angular.module("app");n.factory("OwnerFactory",["$q","$filter","datacontext","$timeout",function(n,t,i,r){function f(f,e,o){var s=n.defer();return i.query("api/OwnerData/GetOwnerAnimals").then(function(n){var i,h;u.domain=n;i=u.domain;o.sort.predicate&&(i=t("orderBy")(i,o.sort.predicate,o.sort.reverse));h=i.slice(f,f+e);r(function(){s.resolve({data:h,numberOfPages:Math.ceil(i.length/e)})},1500)}),s.promise}var u=this;return u.domain=[],{getPage:f}}])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g){function vt(){i.activateController([],n).then(function(){return ii().then(function(){return ri().then(function(){return rt().then(function(){return pt().then(function(){return ht()})})})})})}function yt(){rt();nt.frmHolder.createnew.$setPristine();nt.frmHolder.createnew.$setUntouched()}function pt(){return o.spinnerShow(),e.query("api/SystemUser/GetSystemUserQuestions").then(function(n){nt.systemUserQuestions=n;o.spinnerHide()})}function wt(){g.openTemplate("md",{domain:nt.domain.publicUserPersonalProfileModel},nt.profileDomainRules,y+"app/owner/changeemail.tmpl.html","emailaddresschangecontroller")}function bt(n){if(n!="undefined"){o.spinnerShow();var i=nt.addressPet.indexOf(n),t=[];return t.push(nt.addressPetMoniker[i]),t.push(nt.addressPet[i]),e.post("api/Address/FillTheForm",{address:t}).then(function(n){for(var t=0;t<nt.referenceData.masterData.states.length;t++)nt.referenceData.masterData.states[t].text==n[5]&&(nt.domain.publicUserAdditionalProfileModel.petStateID=nt.referenceData.masterData.states[t].value);nt.domain.publicUserAdditionalProfileModel.petLocalCouncilName=n[8];nt.domain.publicUserAdditionalProfileModel.petLocalCouncilCode=n[7];nt.domain.publicUserAdditionalProfileModel.petPostCode=n[6];nt.domain.publicUserAdditionalProfileModel.petStreetType=null;nt.domain.publicUserAdditionalProfileModel.petStreetNumber=(n[0]==null||n[0]==""?"":n[0]+" ")+(n[1]==null||n[1]==""?"":n[1]+" ")+n[2];nt.domain.publicUserAdditionalProfileModel.petStreetName=n[3];nt.domain.publicUserAdditionalProfileModel.petSuburb=n[4];nt.domain.publicUserAdditionalProfileModel.petDpid=n[9];o.spinnerHide()})}}function kt(n){if(n!="undefined"){o.spinnerShow();var i=nt.addressPersonal.indexOf(n),t=[];return t.push(nt.addressPersonalMoniker[i]),t.push(nt.addressPersonal[i]),e.post("api/Address/FillTheForm",{address:t}).then(function(n){for(var t=0;t<nt.referenceData.masterData.states.length;t++)nt.referenceData.masterData.states[t].text==n[5]&&(nt.addressChange.stateID=nt.referenceData.masterData.states[t].value);nt.addressChange.localCouncilName=n[8];nt.addressChange.localCouncilCode=n[7];nt.addressChange.postCode=n[6];nt.addressChange.streetNumber=(n[0]==null||n[0]==""?"":n[0]+" ")+(n[1]==null||n[1]==""?"":n[1]+" ")+n[2];nt.addressChange.streetName=n[3];nt.addressChange.streetType=null;nt.addressChange.suburb=n[4];nt.addressChange.dpid=n[9];o.spinnerHide()})}}function dt(n){if(n!="undefined"){o.spinnerShow();var i=nt.addressAdditional.indexOf(n),t=[];return t.push(nt.addressAdditionalMoniker[i]),t.push(nt.addressAdditional[i]),e.post("api/Address/FillTheForm",{address:t}).then(function(n){for(var t=0;t<nt.referenceData.masterData.states.length;t++)nt.referenceData.masterData.states[t].text==n[5]&&(nt.domain.publicUserAdditionalProfileModel.postalStateId=nt.referenceData.masterData.states[t].value);nt.domain.publicUserAdditionalProfileModel.postalLocalCouncilName=n[8];nt.domain.publicUserAdditionalProfileModel.postalLocalCouncilCode=n[7];nt.domain.publicUserAdditionalProfileModel.postalPostCode=n[6];nt.domain.publicUserAdditionalProfileModel.postalStreetType=null;nt.domain.publicUserAdditionalProfileModel.postalStreetNumber=(n[0]==null||n[0]==""?"":n[0]+" ")+(n[1]==null||n[1]==""?"":n[1]+" ")+n[2];nt.domain.publicUserAdditionalProfileModel.postalStreetName=n[3];nt.domain.publicUserAdditionalProfileModel.postalSuburb=n[4];nt.domain.publicUserAdditionalProfileModel.postalDpid=n[9];o.spinnerHide()})}}function gt(n){if(n!="undefined"){o.spinnerShow();var i=nt.addressBusiness.indexOf(n),t=[];return t.push(nt.addressBusinessMoniker[i]),t.push(nt.addressBusiness[i]),e.post("api/Address/FillTheForm",{address:t}).then(function(n){for(var t=0;t<nt.referenceData.masterData.states.length;t++)nt.referenceData.masterData.states[t].text==n[5]&&(nt.domain.publicUserBusinessProfileModel.businessStateId=nt.referenceData.masterData.states[t].value);nt.domain.publicUserBusinessProfileModel.businessLocalCouncilName=n[8];nt.domain.publicUserBusinessProfileModel.businessLocalCouncilCode=n[7];nt.domain.publicUserBusinessProfileModel.businessPostCode=n[6];nt.domain.publicUserBusinessProfileModel.businessStreetType=null;nt.domain.publicUserBusinessProfileModel.businessStreetNumber=(n[0]==null||n[0]==""?"":n[0]+" ")+(n[1]==null||n[1]==""?"":n[1]+" ")+n[2];nt.domain.publicUserBusinessProfileModel.businessStreetName=n[3];nt.domain.publicUserBusinessProfileModel.businessSuburb=n[4];nt.domain.publicUserBusinessProfileModel.businessDpid=n[9];o.spinnerHide()})}}function tt(){nt.control.createView=nt.control.updateView=nt.control.searchView=!1;nt.control.showResultMessage=!1;nt.control.showExistsMessage=!1;nt.control.showCreateSuccessfulMessage=!1;nt.control.showCreateSuccessfulMessageQuestion=!1;nt.control.showCreateSuccessfulMessagePassword=!1}function ni(){nt.control.showResultMessage=!1;nt.control.showExistsMessage=!1}function ti(n){return!(typeof n=="string"&&!n.trim()||typeof n=="undefined"||n==null)}function ii(){return o.spinnerShow(),e.query("api/OwnerData/GetUserProfileDefinition").then(function(n){console.log("d.data",n.data);nt.domain=n.data;nt.profileDomainRules=n.profileValidation;nt.additionalDomainRules=n.additionalValidation;nt.businessDomainRules=n.businessValidation;nt.securityDomainRules=n.securityValidation;nt.control.createView=!0;nt.isEditable=!0;o.spinnerHide()})}function ri(){return o.spinnerShow(),e.query("api/SystemUser/GetSystemUserSecurityDefinition").then(function(n){nt.domain=n.data;nt.systemUserSecurityRules=n.systemUserSecurityValidation;o.spinnerHide()})}function ui(n,t){return v.get(n,t)}function fi(n,t){var i=v.find(n,{value:t});if(i!=null)return i.text}function ei(n){return n=="4"?"Mobile":n=="5"?"Home":n=="6"?"Work":"Not provided"}function oi(n){return!n||/^\s*$/.test(n)}function rt(){return tt(),o.spinnerShow(),c.publicUserId==="undefined"||c.publicUserId===null||c.publicUserId===0||v.isEmpty(c.publicUserId)?c.currentUser.id==="undefined"||c.currentUser.id===null||c.currentUser.id===0?b(w.path("/registerstep1"),2e3):(nt.callFromRegistration=!1,nt.isEditable=!0,nt.systemUserId=c.currentUser.id==it?"L":it):(nt.callFromRegistration=!0,nt.isEditable=!0,nt.systemUserId=c.publicUserId),e.query("api/OwnerData/GetPublicUserProfile",[nt.systemUserId]).then(function(n){nt.domain=n;nt.domain!=null?(ut(),nt.control.showResultMessage=!1,nt.isEditable=!0,nt.callFromRegistration==!0&&(nt.isEditable=!0),nt.hideControls=!0,nt.control.searchView=!0,ft(),et(),JSON.parse(sessionStorage.getItem("a_uth"))!=null&&JSON.parse(sessionStorage.getItem("a_uth")).profileIncomplete?(nt.profileIncomplete=!0,nt.domain.publicUserAdditionalProfileModel.bestContactType=4,nt.domain.publicUserAdditionalProfileModel.isPersonalAddressChange=1):nt.profileIncomplete=!1):nt.control.showResultMessage=!0;o.spinnerHide()})}function st(){var n;nt.domain.publicUserAdditionalProfileModel.areYouABreeder==1?nt.domain.publicUserAdditionalProfileModel.isBreederOrgNumber==0?(nt.domain.publicUserAdditionalProfileModel.breederMembershipVerified=null,c.currentUser.role!="OLGAdmin"&&(n=sessionStorage.getItem("a_uth"),c.currentUser.isRecognisedBreeder=!1,sessionStorage.setItem("a_uth",JSON.stringify(n)))):(nt.originalMembershipNumber!=nt.domain.publicUserAdditionalProfileModel.breederOrgMembershipNumber||nt.originalBreederGroupId!=nt.domain.publicUserAdditionalProfileModel.breederGroupId||nt.originalBreederMembershipExpiryDate!=nt.domain.publicUserAdditionalProfileModel.breederMembershipExpiryDate)&&(nt.domain.publicUserAdditionalProfileModel.breederMembershipVerified=null,c.currentUser.role!="OLGAdmin"&&(n=sessionStorage.getItem("a_uth"),c.currentUser.isRecognisedBreeder=!1,sessionStorage.setItem("a_uth",JSON.stringify(n)))):nt.domain.publicUserAdditionalProfileModel.breederMembershipVerified=null}function ut(){nt.domain.publicUserAdditionalProfileModel.areYouABreeder&&nt.domain.publicUserAdditionalProfileModel.isBreederOrgNumber&&(nt.domain.publicUserAdditionalProfileModel.breederMembershipExpiryDate=="0001-01-01T00:00:00"&&(nt.domain.publicUserAdditionalProfileModel.breederMembershipExpiryDate=null),c.currentUser.role!="OLGAdmin"&&c.roleChangeOwnerToBreeder("Breeder",nt.domain.publicUserAdditionalProfileModel.registrationNumber));nt.originalAreYouABreeder=nt.domain.publicUserAdditionalProfileModel.areYouABreeder;nt.originalMembershipNumber=nt.domain.publicUserAdditionalProfileModel.breederOrgMembershipNumber;nt.originalBreederGroupId=nt.domain.publicUserAdditionalProfileModel.breederGroupId;nt.originalBreederMembershipExpiryDate=nt.domain.publicUserAdditionalProfileModel.breederMembershipExpiryDate;nt.originalBreederMembershipVerified=nt.domain.publicUserAdditionalProfileModel.breederMembershipVerified;nt.domain.publicUserAdditionalProfileModel.isPersonalAddressChange=0;nt.domain.publicUserAdditionalProfileModel.petAddressChangeOptions=null;nt.domain.publicUserPersonalProfileModel.publicUserDOB=="0001-01-01T00:00:00"&&(nt.domain.publicUserPersonalProfileModel.publicUserDOB=null);nt.domain.publicUserAdditionalProfileModel.localCouncilCode=="0"&&(nt.domain.publicUserAdditionalProfileModel.localCouncilCode=null);nt.domain.publicUserAdditionalProfileModel.pensionerNumber=="0"&&(nt.domain.publicUserAdditionalProfileModel.pensionerNumber=null);nt.domain.publicUserAdditionalProfileModel.pensionerCardTypeID=="0"&&(nt.domain.publicUserAdditionalProfileModel.pensionerCardTypeID=null);nt.domain.publicUserBusinessProfileModel.businessLocalCouncilCode=="0"&&(nt.domain.publicUserBusinessProfileModel.businessLocalCouncilCode=null);nt.domain.publicUserAdditionalProfileModel.postalLocalCouncilCode=="0"&&(nt.domain.publicUserAdditionalProfileModel.postalLocalCouncilCode=null);nt.domain.publicUserAdditionalProfileModel.breederMembershipExpiryDate=="0001-01-01T00:00:00"&&(nt.domain.publicUserAdditionalProfileModel.breederMembershipExpiryDate=null)}function ht(){return o.spinnerShow(),tt(),e.query("api/OwnerData/GetSystemUserAnswersBySystemUserId",[nt.systemUserId]).then(function(n){n.length>0&&(nt.domainSecureQuestions.systemUserId=nt.systemUserId,nt.domainSecureQuestions.systemUserAnswer1=n[0].answerContent,nt.domainSecureQuestions.systemUserAnswer2=n[1].answerContent,nt.domainSecureQuestions.systemUserAnswer3=n[2].answerContent,nt.domainSecureQuestions.systemUserQuestion1=n[0],nt.domainSecureQuestions.systemUserQuestion2=n[1],nt.domainSecureQuestions.systemUserQuestion3=n[2]);ct();o.spinnerHide()})}function ct(){nt.domainSecureQuestions!=null?(nt.control.showResultMessage=!1,nt.isEditableQuestion=!1,nt.hideControls=!0,nt.control.searchView=!0):(nt.control.showResultMessage=!0,nt.isEditableQuestion=!0)}function lt(){return o.spinnerShow(),tt(),e.query("api/OwnerData/GetPublicUserProfile",[nt.systemUserId]).then(function(){nt.domain!=null?(nt.control.showResultMessage=!1,nt.isEditablePassword=!1,nt.hideControls=!0,nt.control.searchView=!0):(nt.control.showResultMessage=!0,nt.isEditablePassword=!0);o.spinnerHide()})}function si(){return tt(),o.spinnerShow(),e.query("api/OwnerData/GetPublicUserProfile",[nt.systemUserId]).then(function(n){nt.domain=n;nt.domain.publicUserPersonalProfileModel.originalEmailAddress=nt.domain.publicUserPersonalProfileModel.email;nt.domain!=null?(nt.control.showResultMessage=!1,nt.isEditable=!0,nt.control.updateView=!0,ut(),et()):nt.control.showResultMessage=!0;o.spinnerHide()})}function hi(){return o.spinnerShow(),tt(),e.query("api/OwnerData/GetSystemUserAnswersBySystemUserId",[nt.systemUserId]).then(function(n){n.length>0&&(nt.domainSecureQuestions.systemUserId=nt.systemUserId,nt.domainSecureQuestions.systemUserAnswer1=n[0].answerContent,nt.domainSecureQuestions.systemUserAnswer2=n[1].answerContent,nt.domainSecureQuestions.systemUserAnswer3=n[2].answerContent,nt.domainSecureQuestions.systemUserQuestion1=n[0],nt.domainSecureQuestions.systemUserQuestion2=n[1],nt.domainSecureQuestions.systemUserQuestion3=n[2]);nt.domain!=null?(nt.control.showResultMessage=!1,nt.isEditableQuestion=!0,nt.control.updateView=!0):nt.control.showResultMessage=!0;o.spinnerHide()})}function ci(){return o.spinnerShow(),tt(),e.query("api/OwnerData/GetPublicUserProfile",[nt.systemUserId]).then(function(){nt.domain!=null?(nt.control.showResultMessage=!1,nt.isEditablePassword=!0,nt.control.updateView=!0):nt.control.showResultMessage=!0;o.spinnerHide()})}function li(){return o.spinnerShow(),nt.domain.publicUserAdditionalProfileModel.isPersonalAddressChange==1&&(nt.domain.publicUserAdditionalProfileModel.streetNumber=nt.addressChange.streetNumber,nt.domain.publicUserAdditionalProfileModel.streetName=nt.addressChange.streetName,nt.domain.publicUserAdditionalProfileModel.streetType=nt.addressChange.streetType,nt.domain.publicUserAdditionalProfileModel.suburb=nt.addressChange.suburb,nt.domain.publicUserAdditionalProfileModel.stateID=nt.addressChange.stateID,nt.domain.publicUserAdditionalProfileModel.postCode=nt.addressChange.postCode,nt.domain.publicUserAdditionalProfileModel.localCouncilCode=nt.addressChange.localCouncilCode,nt.domain.publicUserAdditionalProfileModel.localCouncilName=nt.addressChange.localCouncilName,nt.domain.publicUserAdditionalProfileModel.dpid=nt.addressChange.dpid),nt.domain.publicUserAdditionalProfileModel.isPostalAddressDifferent==0,st(),e.post("api/OwnerData/UpdatePublicUserProfile",nt.domain).then(function(n){if(tt(),nt.serverResponse=n,nt.callFromRegistration==!0)return yi().then(function(){return o.spinnerHide(),n});if(nt.control.showCreateSuccessfulMessage=n.status,nt.control.showServerError=!n.status,nt.control.ServerError=n.message,a.scrollTo(0,0),nt.control.showCreateSuccessfulMessageQuestion=!1,nt.control.showCreateSuccessfulMessagePassword=!1,ut(),nt.control.showResultMessage=!1,nt.isEditable=!0,nt.callFromRegistration==!0&&(nt.isEditable=!0),nt.hideControls=!0,nt.control.searchView=!0,ft(),et(),o.spinnerHide(),nt.profileIncomplete&&JSON.parse(sessionStorage.getItem("a_uth"))!=null&&JSON.parse(sessionStorage.getItem("a_uth")).profileIncomplete){var n=JSON.parse(sessionStorage.getItem("a_uth"));n.profileIncomplete=!1;nt.profileIncomplete=!1;sessionStorage.setItem("a_uth",JSON.stringify(n));i.$broadcast(r.config.loginsuccess,n)}return n})}function ai(){o.spinnerShow();var n={};return angular.copy(nt.domainSecureQuestions,n),n.systemUserQuestion1=nt.domainSecureQuestions.systemUserQuestion1.systemUserQuestionID,n.systemUserQuestion2=nt.domainSecureQuestions.systemUserQuestion2.systemUserQuestionID,n.systemUserQuestion3=nt.domainSecureQuestions.systemUserQuestion3.systemUserQuestionID,e.post("api/SystemUser/SaveSystemUserQuestion",n).then(function(n){return tt(),ct(),nt.control.showCreateSuccessfulMessageQuestion=!0,nt.control.showCreateSuccessfulMessagePassword=!1,nt.control.showCreateSuccessfulMessage=!1,o.spinnerHide(),n})}function vi(){if(nt.control.updateView==!0)return o.spinnerShow(),e.post("api/SystemUser/UpdateSystemUserPassword",nt.domain).then(function(n){return tt(),lt().then(function(){return nt.control.showCreateSuccessfulMessageQuestion=!1,nt.control.showCreateSuccessfulMessagePassword=!0,nt.control.showCreateSuccessfulMessage=!1,o.spinnerHide(),n})})}function yi(){return o.spinnerShow(),nt.userDetails.username=nt.systemUserId,nt.userDetails.usertype=2,nt.userDetails.password="__USER_REGISTRATION_FINISHED__",nt.userDetails.password=a.btoa(nt.userDetails.password),nt.userDetails.attemptCount=0,w.path("/login"),h.login(nt.userDetails).then(function(n){o.spinnerHide();n.hasError?nt.authResult=n:(c.publicUserId=null,w.path("/secure/petClaim"))})}function pi(){nt.showPetAddress=!1;nt.domain.publicUserAdditionalProfileModel.petAddressChangeOptions==2&&(nt.showPetAddress=!0)}function wi(){return nt.domain.publicUserAdditionalProfileModel.petAddressChangeOptions==null?(nt.frmHolder.createnew.petAddressChangeOptions.$setTouched(),!1):!0}function ft(){nt.domain.publicUserAdditionalProfileModel.isPersonalAddressChange==1;nt.domain.publicUserAdditionalProfileModel.isPersonalAddressChange==0&&(nt.addressChange.streetNumber=null,nt.addressChange.streetName=null,nt.addressChange.suburb=null,nt.addressChange.stateID=null,nt.addressChange.postCode=null,nt.addressChange.localCouncilCode=null,nt.addressChange.localCouncilName=null,nt.addressChange.dpid=null,nt.userSearchaddressPersonal="",nt.domain.publicUserAdditionalProfileModel.petAddressChangeOptions=null,nt.showPetAddress=!1)}function bi(n){return n.systemUserQuestionID!=nt.domain.systemUserQuestion2&&n.systemUserQuestionID!=nt.domain.systemUserQuestion3}function ki(n){return n.systemUserQuestionID!=nt.domain.systemUserQuestion1&&n.systemUserQuestionID!=nt.domain.systemUserQuestion3}function di(n){return n.systemUserQuestionID!=nt.domain.systemUserQuestion2&&n.systemUserQuestionID!=nt.domain.systemUserQuestion1}function et(){var n=l().diff(nt.domain.publicUserAdditionalProfileModel.breederMembershipExpiryDate,"days",!0);nt.isBreederMemberExpired=Math.round(n)>0?!0:!1}var at=i.logger.getLogFn,gi=at(n),nr=i.$q,nt,it,ot;t.screenTitle="User Profile";nt=this;nt.petSearchaddress;nt.addressPet=[];nt.addressPetMoniker=[];nt.userSearchaddressPersonal;nt.addressPersonal=[];nt.addressPersonalMoniker=[];nt.petSearchaddressAdditional;nt.addressAdditional=[];nt.addressAdditionalMoniker=[];nt.petSearchaddressBusiness;nt.addressBusiness=[];nt.addressBusinessMoniker=[];nt.root=y;nt.referenceData=s;nt.chipId=null;nt.title="Owner Profile";nt.searchResult=[];nt.currentUserId=c.currentUser.id;it=!v.isUndefined(f.param)&&!v.isNull(f.param)?f.param:c.currentUser.id;nt.userRole=c.currentUser.role;ot=new l;nt.userDOBMaxDate=ot.add(-18,"years");nt.isEditable=!0;nt.isEditableQuestion=!1;nt.isEditablePassword=!1;nt.isEnable=!0;nt.hideControls=!1;nt.showPetAddress=!1;nt.frmHolder={};nt.userDetails={};nt.domainSecureQuestions={};nt.filterQ1=bi;nt.filterQ2=ki;nt.filterQ3=di;nt.isUsertoModify=nt.currentUserId==it||nt.userRole=="OLGAdmin";nt.dateMinMax={membershipExpiryMinDate:new l};nt.isBreederMemberExpired=!1;nt.control={showResultMessage:!1,showSearchResult:!1,showExistsMessage:!1,showCreateSuccessfulMessage:!1,showCreateSuccessfulMessageQuestion:!1,showCreateSuccessfulMessagePassword:!1,createView:!1,searchView:!1,updateView:!1,showServerError:!1,isOpen1:!0,isOpen2:!1,isOpen3:!1};nt.addressChange={streetNumber:null,streetName:null,suburb:null,stateID:null,postCode:null,localCouncilCode:null,localCouncilName:null,dpid:null};nt.getProperty=ui;nt.getProfile=rt;nt.getProfileQuestion=ht;nt.getProfilePassword=lt;nt.updateProfile=si;nt.updateSecurityQuestion=hi;nt.updateSecurityPassword=ci;nt.commitProfile=li;nt.commitusersecurityQuestion=ai;nt.commitusersecurityPassword=vi;nt.checkPhoneNumber=ti;nt.inputChange=ni;nt.queryBySelectedValue=fi;nt.getBestContactType=ei;nt.onPetAddressSelection=pi;nt.checkPetAddressSelection=wi;nt.checkHomeAddress=ft;nt.isEmptyString=oi;nt.FillTheFormPet=bt;nt.FillTheFormPersonal=kt;nt.FillTheFormAdditional=dt;nt.FillTheFormBusiness=gt;nt.showChangeEmailPopup=wt;nt.verifyBreederMembershipChanges=st;nt.cancel=yt;nt.profileIncomplete=!1;vt();p.$watch("vm.frmHolder.createnew.$invalid",function(){nt.control.showCreateSuccessfulMessage=!1},!1);p.$watch("vm.petSearchaddress",function(n){if(!v.isNull(n)&&!v.isUndefined(n)&&n!="")return e.post("api/Address/SearchAddress",{address:n}).then(function(n){nt.addressPet=[];nt.addressPetMoniker=[];for(var t=0;t<n.length;t++)nt.addressPet.push(n[t].address),nt.addressPetMoniker.push(n[t].moniker)})});p.$watch("vm.userSearchaddressPersonal",function(n){if(!v.isNull(n)&&!v.isUndefined(n)&&n!="")return e.post("api/Address/SearchAddress",{address:n}).then(function(n){nt.addressPersonal=[];nt.addressPersonalMoniker=[];for(var t=0;t<n.length;t++)nt.addressPersonal.push(n[t].address),nt.addressPersonalMoniker.push(n[t].moniker)})});p.$watch("vm.petSearchaddressAdditional",function(n){if(!v.isNull(n)&&!v.isUndefined(n)&&n!="")return e.post("api/Address/SearchAddress",{address:n}).then(function(n){nt.addressAdditional=[];nt.addressAdditionalMoniker=[];for(var t=0;t<n.length;t++)nt.addressAdditional.push(n[t].address),nt.addressAdditionalMoniker.push(n[t].moniker)})});p.$watch("vm.petSearchaddressBusiness",function(n){if(!v.isNull(n)&&!v.isUndefined(n)&&n!="")return e.post("api/Address/SearchAddress",{address:n}).then(function(n){nt.addressBusiness=[];nt.addressBusinessMoniker=[];for(var t=0;t<n.length;t++)nt.addressBusiness.push(n[t].address),nt.addressBusinessMoniker.push(n[t].moniker)})});p.onPensionCategoryChange=function(){(nt.domain.publicUserAdditionalProfileModel.pensionerCardTypeID=="36"||nt.domain.publicUserAdditionalProfileModel.pensionerCardTypeID==""||nt.domain.publicUserAdditionalProfileModel.pensionerCardTypeID==null)&&(nt.domain.publicUserAdditionalProfileModel.pensionerNumber="")}}var n="ownerprofile";angular.module("app").controller(n,["$rootScope","common","commonConfig","$http","$routeParams","datacontext","spinner","ReferenceData","authservice","authdata","moment","$window","_","ROOT","$scope","$location","$timeout","$interval","$sce","modalPopupFactory",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a,v,y,p){function g(){var t=[rt()];i.activateController(t,n).then(function(){})}function nt(){}function tt(n){if(n!="undefined"){e.spinnerShow();var i=w.address.indexOf(n),t=[];return t.push(w.addressMoniker[i]),t.push(w.address[i]),f.post("api/Address/FillTheForm",{address:t}).then(function(n){for(var t=0;t<w.referenceData.masterData.states.length;t++)w.referenceData.masterData.states[t].text==n[5]&&(w.domainClaim.petStateID=w.referenceData.masterData.states[t].value);w.domainClaim.petLocalCouncil=n[8];w.domainClaim.petCouncilCode=n[7];w.domainClaim.petPostCode=n[6];w.domainClaim.petStreetNumber=(n[0]==null||n[0]==""?"":n[0]+" ")+(n[1]==null||n[1]==""?"":n[1]+" ")+n[2];w.domainClaim.petStreetName=n[3];w.domainClaim.petSuburb=n[4];w.domainClaim.PetDpid=n[9];e.spinnerHide()})}}function b(){w.control.createView=w.control.updateView=w.control.searchView=!1;w.control.showResultMessage=!1;w.control.showFailedMessage=!1;w.control.showCreateSuccessfulMessage=!1}function it(){w.control.showResultMessage=!1;w.control.showFailedMessage=!1;w.control.claimView=!1;w.showResults=!1}function rt(){return f.query("api/OwnerData/GetPetClaimDefinition").then(function(n){w.domainClaim=n.data;w.domainDisplay=n.data;w.petClaimSearchDomainRules=n.petClaimSearchValidation;w.petClaimAddressDomainRules=n.petClaimAddressValidation})}function ut(n,t){return a.get(n,t)}function ft(n,t){var i=a.find(n,{value:t});if(i!=null)return i.text}function et(n,t){var i=a.find(n,{breedID:t});if(i!=null)return i.breed}function ot(n){return n=="1"?"Male":n=="2"?"Female":"Unknown"}function st(n){return w.domainDisplay==null?"Unknown":n=="1"?"Yes":n=="0"?"No":n=="98"?"No - Not Recommended (up to 18 months)":n=="99"?"No - Not Recommended for life":"Unknown"}function ht(){return b(),e.spinnerShow(),f.post("api/OwnerData/ClaimPetSearch",w.domainSearch).then(function(n){w.domainClaim=n;w.domainDisplay=n;w.domainDisplay!=null?w.domainDisplay.animalId!=0?(w.showResults=!0,w.control.showCreateSuccessfulMessage=!1,w.control.showFailedMessage=!1,w.control.showOwnerToBreederMessage=!1,w.control.claimView=!0):(w.showResults=!1,w.control.showCreateSuccessfulMessage=!1,w.control.showFailedMessage=!0):w.control.showResultMessage=!0;e.spinnerHide()})}function ct(){w.domainDisplay.shouldAskConvertToBreeder?(w.domainClaim.shouldConvertOwnerToBreeder=!0,k()):k()}function k(){return e.spinnerShow(),f.post("api/OwnerData/ClaimPet",w.domainClaim).then(function(n){return b(),w.domainClaim=null,w.domainDisplay=null,w.domainSearch=null,w.showResults=!1,w.control.showCreateSuccessfulMessage=!0,n!=1?w.breedId=n:(w.control.showOwnerToBreederMessage=!1,w.breedId=null),w.control.showFailedMessage=!1,w.frmHolder.createnew.$setPristine(),w.frmHolder.createnew.$setUntouched(),e.spinnerHide(),l.scrollTo(0,0),n})}function lt(){b();w.domainClaim=null;w.domainDisplay=null;w.showResults=!1;w.control.showCreateSuccessfulMessage=!1;w.control.showFailedMessage=!1;w.control.showOwnerToBreederMessage=!1;w.domainSearch!=null&&(w.domainSearch.microchipNumber=null,w.domainSearch.bestContactNumber=null,w.domainSearch.eMail=null);w.frmHolder.createnew.$setPristine();w.frmHolder.createnew.$setUntouched()}var d=i.logger.getLogFn,at=d(n),vt=i.$q,w;t.screenTitle="Link Pet";w=this;w.petSearchaddress;w.address=[];w.addressMoniker=[];w.root=y;w.referenceData=o;w.title="Pet Claim";w.searchResult=[];w.currentUserId=h.currentUser.id;w.userRole=h.currentUser.role;w.petClaimSearch={};w.frmHolder={};w.breedId;w.control={showResultMessage:!1,showSearchResult:!1,showFailedMessage:!1,showCreateSuccessfulMessage:!1,showOwnerToBreederMessage:!1};w.getProperty=ut;w.getPetDetails=ht;w.claimPet=ct;w.inputChange=it;w.queryBySelectedValue=ft;w.isEditable=!1;w.showResults=!1;w.isOpen=!0;w.cancelClaimProcess=lt;w.getSelectedBreed=et;w.getPetGenderText=ot;w.getPetDesexedStatus=st;w.FillTheForm=tt;w.addressChanged=nt;w.profileIncomplete=JSON.parse(sessionStorage.getItem("a_uth")).profileIncomplete;g();p.$watch("vm.petSearchaddress",function(n){if(!a.isNull(n)&&!a.isUndefined(n)&&n!="")return f.post("api/Address/SearchAddress/",{address:n}).then(function(n){w.address=[];w.addressMoniker=[];for(var t=0;t<n.length;t++)w.address.push(n[t].address),w.addressMoniker.push(n[t].moniker)})})}var n="petclaim";angular.module("app").controller(n,["$rootScope","common","$timeout","$http","datacontext","spinner","ReferenceData","authservice","authdata","moment","$window","_","modalPopupFactory","ROOT","$scope",t])}(),function(){"use strict";function t(t,i){function f(){i.activateController([],n).then(function(){})}var u=i.logger.getLogFn,e=u(n),o=i.$q,r;t.screenTitle="Transfer Pet";r=this;r.title="Transfer";f()}var n="transfer";angular.module("app").controller(n,["$rootScope","common","$http","datacontext","spinner","ReferenceData","$window",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a,v){function b(){var i=[nt()];t.activateController(i,n).then(function(){})}function k(){y.dateMinMax={};y.dateMinMax={minDate:new c(y.domain.birthDate),maxDate:new c}}function d(){y.control.createView=y.control.updateView=y.control.searchView=!1;y.control.showResultMessage=!1;y.control.showFailedMessage=!1;y.control.showCreateSuccessfulMessage=!1}function g(){y.control.showResultMessage=!1;y.control.showFailedMessage=!1}function nt(){return e.spinnerShow(),f.query("api/OwnerData/GetPetTransferDefinition",[u.param1,u.param2]).then(function(n){y.domain=n.data;y.domain.isOwnerBreederKnown=0;y.petTransferDomainRules=n.petTransferValidation;y.petNotifications=n.petNotifications;k();y.petNotifications!=null&&(y.petNotifications.controlOrders.notificationStatus?y.notifications=!0:y.petNotifications.dangerousDogs.notificationStatus?y.notifications=!0:y.petNotifications.menacingDogs.notificationStatus?y.notifications=!0:y.petNotifications.nuisancePets.notificationStatus?y.notifications=!0:y.petNotifications.restrictedDogs.notificationStatus?y.notifications=!0:y.petNotifications.undesexedCats.notificationStatus&&(y.notifications=!0),y.petNotifications.undesexedCats.notificationStatus||y.petNotifications.undesexedCats.permitStatusID>=1&&y.petNotifications.undesexedCats.permitStatusID<=8&&(y.notifications=!0),y.petNotifications.restrictedDogs.notificationStatus||y.petNotifications.restrictedDogs.permitStatusID==1&&(y.notifications=!0));e.spinnerHide()})}function tt(n,t){return a.get(n,t)}function it(n,t){var i=a.find(n,{value:t});if(i!=null)return i.text}function rt(){return e.spinnerShow(),f.post("api/OwnerData/PetTransfer",y.domain).then(function(n){return y.control.isWithinNSW=y.domain.isWithinNSW==1,d(),y.domain=null,y.showResults=!1,y.control.showCreateSuccessfulMessage=!0,y.control.showFailedMessage=!1,y.petTransferSuccess=!0,y.frmHolder.createnew.$setPristine(),y.frmHolder.createnew.$setUntouched(),e.spinnerHide(),n})}function ut(){p();y.domain!=null&&(y.domain.isOwnerBreederKnown=0);y.showResults=!1;y.control.showCreateSuccessfulMessage=!1;y.control.showFailedMessage=!1;y.frmHolder.createnew.$setPristine();y.frmHolder.createnew.$setUntouched()}function p(){y.domain!=null&&(y.domain.breederId=null,y.domain.userTitleId=null,y.domain.userFirstName=null,y.domain.userLastName=null,y.domain.bestContactNumber=null)}function ft(){return y.petNotifications==null?!1:!y.petNotifications.dangerousDogs.isPermitRequired&&!y.petNotifications.restrictedDogs.isPermitRequired}var w=t.logger.getLogFn,et=w(n),ot=t.$q,y=this;y.petSearchaddress;y.address=[];y.root=v;y.referenceData=o;y.title="Pet Claim";y.searchResult=[];y.currentUserId=h.currentUser.id;y.userRole=h.currentUser.role;y.petClaimSearch={};y.frmHolder={};y.petTransferSuccess=!1;y.isEditable=!1;y.showResults=!1;y.control={showResultMessage:!1,showSearchResult:!1,showFailedMessage:!1,showCreateSuccessfulMessage:!1,isWithinNSW:!0};y.getProperty=tt;y.clearFields=p;y.transferPet=rt;y.inputChange=g;y.queryBySelectedValue=it;y.cancelTransferProcess=ut;y.canTransfer=ft;b()}var n="pettransfer";angular.module("app").controller(n,["common","$timeout","$http","$routeParams","datacontext","spinner","ReferenceData","authservice","authdata","moment","$window","_","ROOT","$scope",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a,v){function it(){v.openTemplate("md",{domain:y.domain},null,a+"app/petprofile/photoUpload.tmpl.html","photouploadController").then(function(){k()})}function rt(){var t=[ft(),et()];u.activateController(t,n).then(function(){})}function ut(n){if(n!="undefined"){s.spinnerShow();var i=y.addressPersonal.indexOf(n),t=[];return t.push(y.addressPersonalMoniker[i]),t.push(y.addressPersonal[i]),o.post("api/Address/FillTheForm",{address:t}).then(function(n){for(var t=0;t<y.referenceData.masterData.states.length;t++)y.referenceData.masterData.states[t].text==n[5]&&(y.domain.petStateId=y.referenceData.masterData.states[t].value);y.domain.petLocalCouncil=n[8];y.domain.petCouncilCode=n[7];y.domain.petPostalCode=n[6];y.domain.petStreetAddress1=(n[0]==null||n[0]==""?"":n[0]+" ")+(n[1]==null||n[1]==""?"":n[1]+" ")+(n[2]==null||n[2]==""?"":n[2]+" ")+n[3];y.domain.petSuburb=n[4];y.domain.petDpid=n[9];s.spinnerHide()})}}function w(){y.domain.litters=[];y.control.createView=y.control.updateView=y.control.searchView=!1;y.control.showResultMessage=!1;y.control.showExistsMessage=!1;y.control.showCreateSuccessfulMessage=!1;y.showAddLitter=!1}function ft(){if(y.chipId=e.param,y.chipId==null||y.chipId==""||typeof y.chipId=="undefined"){y.control.invalidChipId=!0;return}return o.query("api/OwnerData/GetPetProfileDefinition").then(function(n){return y.petDomainRules=n.petValidation,gt(),n})}function et(){return o.query("api/MyLitter/GetLitterDefinition").then(function(n){y.petLitterDomainRules=n.litterValidation;y.domain.editingLitter=n.data})}function ot(n,t){return l.get(n,t)}function b(n,t){var i=l.find(n,{value:t});if(i!=null)return i.text}function st(n,t){var i=l.find(n,{breedID:t});if(i!=null)return i.breed}function ht(n){return n=="1"?"Male":n=="2"?"Female":"Unknown"}function ct(n){return!n||/^\s*$/.test(n)}function lt(){return y.domain==null?"Unknown":y.domain.pet.petDesexedId=="1"?"Yes":y.domain.pet.petDesexedId=="0"?"No":y.domain.pet.petDesexedId=="98"?"No - Not Recommended (up to 18 months)":y.domain.pet.petDesexedId=="99"?"No - Not Recommended for life":"Unknown"}function at(){y.isLitterAlreadyExistsWithSameDate=!1;y.domain.litters!=null&&y.domain.litters.length>0&&y.domain.litters.forEach(function(n){moment(n.dateOfLitter).diff(moment(y.domain.editingLitter.dateOfLitter),"days")==0&&(y.isLitterAlreadyExistsWithSameDate=!0)})}function vt(){var n=0;return y.domain.litters&&y.domain.litters.length!==0&&y.domain.litters.forEach(function(t){n+=t.offspringCount}),n}function k(){if(w(),y.chipId=e.param,y.chipId==null||y.chipId==""||typeof y.chipId=="undefined"){y.control.invalidChipId=!0;return}return s.spinnerShow(),o.query("api/OwnerData/GetPetProfile/",[y.chipId]).then(function(n){if(y.domain=n,y.domain!=null){y.control.showResultMessage=!1;y.isEditable=y.domain.originalPetStatusId==2||y.domain.originalPetStatusId==4||y.domain.originalPetStatusId==5||y.petNotifications.restrictedDogs.notificationStatus||y.petNotifications.dangerousDogs.notificationStatus||y.petNotifications.menacingDogs.notificationStatus||y.petNotifications.controlOrders.notificationStatus||y.petNotifications.restrictedByBreed.notificationStatus?!1:!0;y.dateMinMax.petDiedMinDate=moment(y.domain.petDOB);y.dateMinMax.petLostMinDate=moment(y.domain.petDOB);y.dateMinMax.petFoundMinDate=moment(y.domain.petLostDate);y.dateMinMax.maxLitterDOB=moment();var t=b(y.referenceData.masterData.species,y.domain.speciesId);t=="Cat"?y.dateMinMax.minLitterDOB=moment(y.domain.petDOB).add(4,"months"):t=="Dog"&&(y.dateMinMax.minLitterDOB=moment(y.domain.petDOB).add(6,"months"));y.originalPetStatusComments=y.domain.petStatusComments;g();p()}else y.control.showResultMessage=!0;s.spinnerHide()})}function yt(){if(w(),y.chipId=e.param,y.chipId==null||y.chipId==""||typeof y.chipId=="undefined"){y.control.invalidChipId=!0;return}return s.spinnerShow(),y.actualMicrochipNumber=y.chipId,s.spinnerShow(),o.query("api/OwnerData/GetPetProfile/",[y.chipId]).then(function(n){y.domain=n;y.domain!=null?(y.control.showResultMessage=!1,y.isEditable=y.domain.originalPetStatusId==2||y.domain.originalPetStatusId==4||y.domain.originalPetStatusId==5||y.petNotifications.restrictedDogs.notificationStatus||y.petNotifications.dangerousDogs.notificationStatus||y.petNotifications.menacingDogs.notificationStatus||y.petNotifications.controlOrders.notificationStatus||y.petNotifications.restrictedByBreed.notificationStatus?!1:!0,y.dateMinMax.petDiedMinDate=moment(y.domain.petDOB),y.dateMinMax.petLostMinDate=moment(y.domain.petDOB),y.dateMinMax.petFoundMinDate=moment(y.domain.petLostDate),y.originalPetStatusComments=y.domain.petStatusComments,p(),y.frmHolder.createnew.$setPristine()):y.control.showResultMessage=!0;s.spinnerHide()})}function d(){if(y.domain!=undefined){if(y.domain.litters!=null&&y.domain.litters.length>0)return!0;if(y.domain.petGenderId==2&&y.userRole=="Breeder"&&y.domain.petDesexedId==0){var t=b(y.referenceData.masterData.species,y.domain.speciesId),n=nt();return t=="Cat"&&n>4||t=="Dog"&&n>6&&n<=120?!0:!1}return!1}return!1}function p(){return s.spinnerShow(),o.query("api/MyLitter/GetAnimalLitterDetails/",[y.chipId]).then(function(n){var i,t;y.domain.litters=n;y.domain.litters!=null&&(i=l.find(y.domain.litters,function(n){return n.needsChip}),y.needsChip=i?!0:!1,y.showMyLitter=d(),g(),e.param1=="l"&&(t=document.getElementsByClassName("littersPage"),t.length>0&&t[0].scrollIntoView()));s.spinnerHide()})}function g(){if((y.userRole=="Breeder"||y.userRole=="Veterinary"||y.userRole=="Implanter")&&y.domain.petDesexedId=="0"&&y.domain.petGenderId=="2"&&y.domain.petStatusId===1){var t=b(y.referenceData.masterData.species,y.domain.speciesId),n=nt();(t=="Cat"&&n>4||t=="Dog"&&n>6&&n<=120)&&(y.showAddLitter=!0)}else y.showAddLitter=!1}function nt(){var n=moment(y.domain.petDOB),t=moment(),i=moment.duration(t.diff(n));return i.asMonths()}function pt(n){var t=v.openTemplate("md",{domain:y.domain,litter:n,typeOfMode:"edit"},null,a+"app/petprofile/addLitter.html","litterAddController").then(function(){p()})}function wt(n){v.openConfirmMsg("md","Are you sure you want to delete the litter ?").then(function(t){if(t)return o.query("api/AnimalData/RemoveAnimalLitter",[n.litterID]).then(function(n){n&&p()})})}function bt(){y.domain.addedByVet=!1;y.showAddLitterForm=!0}function kt(n,t){var i="add";if(y.domain.selectedOffspringId=t||0,y.domain.selectedLitterId=n||0,y.domain.selectedLitterId>0&&y.domain.selectedOffspringId>0?i="edit":y.domain.selectedLitterId>0&&(y.domain.selectedOffspringId==null||y.domain.selectedOffspringId==0)&&(i="addoffspring"),i!="add"||(y.validateLitterDateAgainstAllLitters(),!y.isLitterAlreadyExistsWithSameDate))return y.domain.editingLitter==null&&(y.domain.editingLitter={}),y.domain.editingLitter.litterSpeciesID=y.domain.speciesId,y.domain.editingLitter.motherBreedId=y.domain.breedId,y.domain.editingLitter.motherAnimalID=y.domain.animalId,v.openTemplate("md",{domain:y.domain,typeOfMode:i},null,a+"app/petprofile/addOffspring.html","offspringAddController").then(function(){p()}),!1}function dt(n,t){y.domain.selectedOffspringId=t;y.domain.selectedLitterId=n;v.openTemplate("md",{domain:y.domain,typeOfMode:"delete"},null,a+"app/petprofile/deleteOffspring.tmpl.html","offspringAddController").then(function(){p()})}function gt(){if(y.chipId!=null){var n=y.chipId;return o.query("api/OwnerData/PetNotifications/",[n]).then(function(n){y.petNotifications=n;y.petNotifications!=null&&(y.petNotifications.controlOrders.notificationStatus?y.notifications=!0:y.petNotifications.dangerousDogs.notificationStatus?y.notifications=!0:y.petNotifications.menacingDogs.notificationStatus?y.notifications=!0:y.petNotifications.nuisancePets.notificationStatus?y.notifications=!0:y.petNotifications.restrictedDogs.notificationStatus?y.notifications=!0:y.petNotifications.restrictedByBreed.notificationStatus?y.notifications=!0:y.petNotifications.undesexedCats.notificationStatus&&(y.notifications=!0),y.petNotifications.undesexedCats.notificationStatus||y.petNotifications.undesexedCats.permitStatusID>=1&&y.petNotifications.undesexedCats.permitStatusID<=9&&(y.notifications=!0),console.log(y.petNotifications),y.petNotifications.restrictedDogs.notificationStatus||y.petNotifications.restrictedDogs.permitStatusID==1&&(y.notifications=!0));k()})}}function ni(){return s.spinnerShow(),o.post("api/OwnerData/UpdatePetProfile",y.domain).then(function(n){return w(),k(),y.control.showCreateSuccessfulMessage=!0,y.isEditable=!1,y.frmHolder.createnew.$setPristine(),y.frmHolder.createnew.$setPristine(),y.frmHolder.createnew.$setUntouched(),s.spinnerHide(),n})}function ti(){w()}function ii(){y.dateMinMax.petDiedMinDate=moment(y.domain.petDOB);y.dateMinMax.petLostMinDate=moment(y.domain.petDOB);y.dateMinMax.petFoundMinDate=moment(y.domain.petLostDate);y.domain.originalPetStatusId==3?(y.domain.petFoundDate=new Date,y.domain.petDiedDate=new Date,y.petStatusPlaceholder="Comment"):y.domain.originalPetStatusId==1&&(y.domain.petLostDate=new Date,y.domain.petDiedDate=new Date,y.petStatusPlaceholder="Pet Status Comments allows owners to include information relevant to the disappearance of their pet.");y.domain.originalPetStatusId==y.domain.petStatusId&&(y.domain.petStatusComments=y.originalPetStatusComments);y.domain.petStatusId==2&&(y.petStatusPlaceholder="Comment",v.openAlertMsg(2,"You are marking this pet as deceased. Once saved, it will be removed from your profile."))}function ri(n){return y.userRole=="Implanter"||y.userRole=="Veterinary"||y.userRole=="Breeder"?n!=null?n.offspringMicrochipNumber!=null&&n.offspringMicrochipNumber.length>0?!0:!1:!0:!0}var tt=u.logger.getLogFn,ui=tt(n),fi=u.$q,y;t.screenTitle="Pet Profile";y=this;y.domain={};y.frmHolder={};y.root=a;y.referenceData=h;y.petSearchAddress;y.addressPersonal=[];y.addressPersonalMoniker=[];y.chipId=null;y.title="Pet Profile";y.searchResult=[];y.userRole=r.currentUser.role;y.isRecognisedBreeder=r.currentUser.isRecognisedBreeder;y.isEditable=!1;y.isBreedable=!1;y.showIsBreedable=!1;y.showMyLitter=!1;y.showAddLitter=!1;y.needsChip=!1;y.notifications=!1;y.control={showResultMessage:!1,showSearchResult:!1,showExistsMessage:!1,showCreateSuccessfulMessage:!1};y.dateMinMax={petDiedMinDate:new moment,petDiedMaxDate:new moment,petFoundMinDate:new moment,petFoundMaxDate:new moment,petLostMinDate:new moment,petLostMaxDate:new moment};y.getProperty=ot;y.getPetProfile=k;y.doUpdate=yt;y.commit=ni;y.cancel=ti;y.shouldDisplayMyLitter=d;y.getMyLitter=p;y.editLitter=pt;y.deleteLitter=wt;y.showAddLitterPopup=bt;y.queryBySelectedValue=b;y.getSelectedBreed=st;y.getPetGenderText=ht;y.getPetDesexedStatus=lt;y.isEmptyString=ct;y.FillTheFormPet=ut;y.petStatusChange=ii;y.showPhotoUpload=it;y.getOffspringCount=vt;y.addEditOffSpring=kt;y.deleteOffSpring=dt;y.validateLitterDateAgainstAllLitters=at;y.disableOffspringEditRemove=ri;rt();i.$watch("vm.frmHolder.createnew.$invalid",function(){y.control.showCreateSuccessfulMessage=!1},!1);t.$on("addLitter",function(n,t){y.domain.litters.push(t)});t.$on("updateLitter",function(n,t){var i=y.domain.litters.indexOf(t);y.domain.litters[i]=t});i.$watch("vm.petSearchAddress",function(n){if(!l.isNull(n)&&!l.isUndefined(n)&&n!="")return o.post("api/Address/SearchAddress",{address:n}).then(function(n){y.addressPersonal=[];y.addressPersonalMoniker=[];for(var t=0;t<n.length;t++)y.addressPersonal.push(n[t].address),y.addressPersonalMoniker.push(n[t].moniker)})})}var n="petprofile";angular.module("app").controller(n,["$rootScope","$scope","authdata","common","$http","$routeParams","datacontext","spinner","ReferenceData","$window","_","ROOT","modalPopupFactory",t])}(),function(){"use strict";function n(n,t,i,r,u,f,e,o,s){function c(n){var t,i;h.showErrorMessage=!1;h.errorMessage="";n&&(t=n.currentTarget.files[0],t.type=="image/png"||t.type=="image/jpeg"||t.type=="image/jpg"||t.type=="image/tif"||t.type=="image/tiff"||t.type=="image/bmp"?(i=new FileReader,i.onload=function(n){f.$apply(function(){h.myImage=n.target.result})},i.readAsDataURL(t)):(t.type!="image/png"||t.type!="image/jpeg"||t.type!="image/jpg"||t.type!="image/tif"||t.type!="image/tiff"||t.type!="image/bmp")&&f.$apply(function(){h.showErrorMessage=!0;h.errorMessage="File type not allowed. Please upload photo in .JPEG, .PNG, .BMP or .TIF"}))}function l(){if(h.domain.ImageData=h.myCroppedImage,h.myImage!=null){if(h.domain.ImageData.length<=524288)return s.spinnerShow(),u.post("api/AnimalData/UploadPetPhoto",h.domain).then(function(n){h.showUploadSuccessfulMessage=n;s.spinnerHide()});h.showErrorMessage=!0;h.errorMessage="The file size of the photo you are trying to upload is too large. Please either crop the photo or upload a photo with a file size of 512KB or smaller."}else h.showErrorMessage=!0,h.errorMessage="Please choose a valid image file to proceed."}function a(){i.close()}var h=this;h.domain=r.data.domain;h.myImage=null;h.myCroppedImage="";h.savePetPhoto=l;h.cancel=a;h.showUploadSuccessfulMessage=!1;h.handleFileSelect=c}angular.module("app").controller("photouploadController",["$rootScope","common","$uibModalInstance","config","datacontext","$scope","modalPopupFactory","$document","spinner",n])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c){function a(){var i=[y()];t.activateController(i,n).then(function(){})}function v(){l.dateMinMax={};l.dateMinMax={litterDOBMinDate:new s(l.parentDOB),litterDOBMaxDate:new s};l.microChipedMaxDate=new s;l.microchipedMinDate=new s(l.parentDOB)}function y(){return f.query("api/AnimalData/GetLitterDefinition").then(function(n){return l.litterDomainRules=n.litterValidation,n})}function p(n){if(n==undefined)l.isRestricted=!1;else{var t=_.find(l.referenceData.masterData.breeds,{breedID:n});t!=null&&(l.isRestricted=t.restricted==1?!0:!1)}}function w(){l.microchipedMinDate=s(l.litter.litterDOB)}function b(){l.dateMinMax.litterDOBMaxDate=s(l.litter.litterMicrochipedDate)}function k(){return l.litter.parentAnimalID=l.parentAnimalID,l.litter.status=0,l.litter.breederNumber=l.typeOfMode=="edit"?l.currentBreederID:l.breederNumber,f.post("api/AnimalData/SaveAnimalLitter",l.litter).then(function(n){if(n){if(l.typeOfMode=="edit")l.statusUpdated=!0,e.$emit("updateLitter",l.litter);else{l.statusAdded=!0;l.litter.litterName!=undefined&&(l.addedLitterName=l.addedLitterName+l.litter.litterName+", ");l.savedMessage=l.litter.litterName==undefined||l.litter.litterName.trim()==""?"Litter added successfully.":"Litter added successfully. - "+l.addedLitterName.slice(0,-2);var t={};angular.copy(l.litter,t);t.litterID=n;e.$emit("addLitter",t)}l.statusUpdateFailed=!1;l.frmLitterAdd.$setPristine()}else l.statusAdded=!1,l.statusUpdated=!1,l.statusUpdateFailed=!0,l.frmLitterAdd.$setPristine()})}function d(){l.typeOfMode=="edit"&&(l.litter.litterMicrochipNo=l.currentLitterMicrochipNo,l.litter.litterName=l.currentLitterName,l.litter.identificationMarks=l.currentIdentificationMarks,l.litter.comments=l.currentComments,l.litter.litterID=l.litter.litterID,l.litter.breedId=l.currentBreedId,l.litter.crossBreedId=l.currentCrossBreedId,l.litter.parentAnimalID=l.currentParentAnimalID,l.litter.breederNumber=l.currentBreederID,l.litter.registeredAnimalID=l.currentRegisteredAnimalID,l.litter.litterDOB=l.currentLitterDOB,l.litter.genderId=l.litter.currentGenderId,l.litter.color=l.litter.currentColor,l.litter.litterMicrochipedDate=l.currentMicrochipedDate,l.litter.litterDesexedStatus=l.currentlitterDesexedStatus);i.close()}function g(n,t){var i=_.find(n,{value:t});if(i!=null)return i.text}function nt(n,t){return _.get(n,t)}function tt(){l.litterApproveDto.pet={};l.litterApproveDto.pet.microchipNo=l.litter.litterMicrochipNo;l.litterApproveDto.pet.petName=l.litter.litterName;l.litterApproveDto.pet.microchipedDate=new s;l.litterApproveDto.pet.petStatusId=1;l.litterApproveDto.pet.petOwnershipStatusId=1;l.litterApproveDto.pet.petDesexedId=0;l.litterApproveDto.pet.breedId=l.litter.breedId;l.litterApproveDto.pet.crossBreedId=l.litter.crossBreedId;l.litterApproveDto.pet.petDOB=l.litter.litterDOB;l.litterApproveDto.pet.petGenderId=l.litter.genderId;l.litterApproveDto.pet.petColor=l.litter.color;l.litterApproveDto.pet.petIdentificationMarks=l.litter.identificationMarks;l.litterApproveDto.pet.petAdditionalComments=l.litter.comments;l.litterApproveDto.pet.petOutofDate=!1;l.litterApproveDto.pet.isOwnerSameAsBreeder=!0;it()}function it(){return l.litter.breederNumber?f.post("api/vetdata/getbreeder",{param1:l.litter.breederNumber}).then(function(n){return l.litterApproveDto.owner=n,l.litterApproveDto.owner.systemUserId==0?l.breederDoesnotExists=!0:(l.breederDoesnotExists=!1,l.litterApproveDto.pet.petStreetAddress1=l.litterApproveDto.owner.ownerStreetAddress1,l.litterApproveDto.pet.petSuburb=l.litterApproveDto.owner.ownerSuburb,l.litterApproveDto.pet.petStateId=l.litterApproveDto.owner.ownerStateId,l.litterApproveDto.pet.petPostalCode=l.litterApproveDto.owner.ownerPostCode,l.litterApproveDto.pet.originalBreederId=l.litter.breederNumber,l.litterApproveDto.pet.breederId=l.litter.breederNumber,l.litterApproveDto.pet.litterId=l.litter.litterID),f.query("api/VetData/GetPetProfileByAnimalID/",[l.litter.parentAnimalID]).then(function(n){return l.parentAnimalDto=n,l.litterApproveDto.pet.speciesId=l.parentAnimalDto.pet.speciesId,f.post("api/VetData/CreatePetRegistration",l.litterApproveDto).then(function(n){n&&n.status?(l.serverResponse=n,l.statusApproved=!0,l.statusApprovedFailed=!1,l.frmLitterAdd.$setPristine(),e.$emit("approveLitter",l.litter)):(l.statusApproved=!1,l.statusApprovedFailed=!0,l.frmLitterAdd.$setPristine())})})}):f.query("api/VetData/GetPetProfileByAnimalID/",[l.litter.parentAnimalID]).then(function(n){return l.parentAnimalDto=n,l.litterApproveDto.pet.speciesId=l.parentAnimalDto.pet.speciesId,l.litterApproveDto.owner=l.parentAnimalDto.owner,l.litterApproveDto.owner.systemUserId==0?(l.litterApproveDto.pet.petStreetAddress1=l.parentAnimalDto.pet.petStreetAddress1,l.litterApproveDto.pet.petSuburb=l.parentAnimalDto.pet.petSuburb,l.litterApproveDto.pet.petStateId=l.parentAnimalDto.pet.petStateId,l.litterApproveDto.pet.petPostalCode=l.parentAnimalDto.pet.petPostalCode):(l.litterApproveDto.pet.petStreetAddress1=l.litterApproveDto.owner.ownerStreetAddress1,l.litterApproveDto.pet.petSuburb=l.litterApproveDto.owner.ownerSuburb,l.litterApproveDto.pet.petStateId=l.litterApproveDto.owner.ownerStateId,l.litterApproveDto.pet.petPostalCode=l.litterApproveDto.owner.ownerPostCode),l.parentAnimalDto.pet.breederId?(l.litterApproveDto.pet.shouldGenerateBreederId=!1,l.litterApproveDto.pet.breederId=l.parentAnimalDto.pet.breederId):l.litterApproveDto.pet.shouldGenerateBreederId=!0,l.litterApproveDto.pet.litterId=l.litter.litterID,f.post("api/VetData/CreatePetRegistration",l.litterApproveDto).then(function(n){n&&n.status?(l.serverResponse=n,l.statusApproved=!0,l.statusApprovedFailed=!1,l.frmLitterAdd.$setPristine(),e.$emit("approveLitter",l.litter)):(l.statusApproved=!1,l.statusApprovedFailed=!0,l.frmLitterAdd.$setPristine())})})}var l=this;l.speciesId=r.data.domain.speciesId;l.parentAnimalID=r.data.domain.animalId;l.parentDOB=r.data.domain.petDOB;l.userRole=c.currentUser.role;l.currentUserId=c.currentUser.id;l.breederNumber=c.currentUser.breederId;l.parentAnimalDto={};l.typeOfMode=r.data.typeOfMode;l.needsChip=!1;l.typeOfMode=="edit"?(l.litter=r.data.litter,l.currentLitterMicrochipNo=r.data.litter.litterMicrochipNo,l.currentLitterName=r.data.litter.litterName,l.litter.currentGenderId=r.data.litter.genderId,l.litter.currentColor=r.data.litter.color,l.currentIdentificationMarks=r.data.litter.identificationMarks,l.currentComments=r.data.litter.comments,l.litter.litterID=r.data.litter.litterID,l.currentBreedId=r.data.litter.breedId,l.currentCrossBreedId=r.data.litter.crossBreedId,l.currentBreederID=r.data.litter.breederNumber,l.currentRegisteredAnimalID=r.data.litter.registeredAnimalID,l.currentLitterDOB=l.microchipedMinDate=r.data.litter.litterDOB,l.currentMicrochipedDate=r.data.litter.litterMicrochipedDate,l.currentlitterDesexedStatus=r.data.litter.litterDesexedId,l.userRole=="Breeder"&&(l.currentLitterMicrochipNo==undefined||l.currentLitterMicrochipNo==""||l.currentLitterMicrochipNo==null)&&(l.needsChip=!0)):(l.currentLitterMicrochipNo="",l.needsChip=!1);l.referenceData=u;l.statusAdded=!1;l.statusUpdated=!1;l.addedLitterName="";l.savedMessage="";l.statusApproved=!1;l.statusApprovedFailed=!1;l.isRestricted=!1;l.litterDOBChanged=w;l.litterMicrochipedDateChanged=b;l.checkRestricted=p;l.saveLitter=k;l.cancel=d;l.queryBySelectedValue=g;l.getProperty=nt;l.doApprove=tt;l.litterApproveDto={};v();a();e.$watch("vm.litter.litterDOB",function(n){var t,i;n!=null&&(t=n.split("/"),t!=null&&t.length==3&&(i=new s(t[2]+"-"+t[0]+"-"+t[1]),l.microChipedMinDate=s(i)))})}var n="litterAddController";angular.module("app").controller(n,["common","$uibModalInstance","config","ReferenceData","datacontext","$scope","$filter","moment","modalPopupFactory","authdata",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l){function b(){var i=[d()];t.activateController(i,n).then(function(){})}function k(){a.microchipedMaxDate=new s;a.microchipedMinDate=new s(a.domain.editingLitter.dateOfLitter)}function d(){return f.query("api/MyLitter/GetOffspringDefinition").then(function(n){return a.offspringDomainRules=n.offspringValidation,n})}function g(){w()}function nt(){if(a.offspring.status=0,a.userRole=="Implanter"||a.userRole=="Veterinary"){if((a.offspring.implantDate==null||a.offspring.implantDate=="")&&a.offspring.offspringMicrochipNumber!=null&&a.offspring.offspringMicrochipNumber.length>0){a.showValidationMessage=!0;a.valMessage="Implant Date is required when Microchip number is entered.";return}if(a.offspring.implantDate!=null&&(a.offspring.offspringMicrochipNumber==null||a.offspring.offspringMicrochipNumber.length==0)){a.showValidationMessage=!0;a.valMessage="Microchip number is required when when Implant date is entered.";return}a.showValidationMessage=!1}if(a.offspring.litterID=r.data.domain.selectedLitterId,a.offspring.userRole=a.userRole,a.userRole=="Implanter"||a.userRole=="Veterinary"?a.offspring.offspringMicrochipNumber!=null&&a.offspring.offspringMicrochipNumber!=""&&(a.offspring.shouldImplant=!0):a.offspring.shouldImplant=!1,a.typeOfMode=="add"){var n={};return n.offsprings=[],a.offspring.dateOfLitter=a.domain.editingLitter.dateOfLitter,a.offspring.speciesId=a.domain.editingLitter.litterSpeciesID,a.offspring.ownerSystemUserID=a.userRole=="Implanter"?a.domain.pet.ownerSystemUserID:a.userRole=="Veterinary"?a.domain.owner.systemUserId:a.domain.ownerSystemUserID,n.offsprings.push(a.offspring),n.litterID=a.offspring.litterID==0?null:a.offspring.litterID,n.dateOfLitter=a.domain.editingLitter.dateOfLitter,n.motherAnimalID=a.domain.editingLitter.motherAnimalID,n.fatherMicrochipNumber=a.domain.editingLitter.fatherMicrochipNumber,n.litterSpeciesID=a.domain.editingLitter.litterSpeciesID,n.litterStatus=null,f.post("api/MyLitter/CreateLitter/",n).then(function(n){n&&(a.statusAdded=!0,a.addedOffspringName=a.offspring.offspringName==null?"":a.offspring.offspringName,r.data.domain.selectedLitterId=n,a.typeOfMode="edit",a.savedMessage=a.offspring.shouldImplant?"Offspring has been saved and implanted successfully. "+a.addedOffspringName:"Offspring saved successfully. "+a.addedOffspringName,y())})}return a.offspring.motherAnimalID=a.domain.editingLitter.motherAnimalID,a.offspring.dateOfLitter=a.domain.editingLitter.dateOfLitter,a.offspring.ownerSystemUserID=a.userRole=="Implanter"?a.domain.pet.ownerSystemUserID:a.userRole=="Veterinary"?a.domain.owner.systemUserId:a.domain.ownerSystemUserID,f.post("api/MyLitter/SaveOffspring/",a.offspring).then(function(n){var t,i;n?(a.typeOfMode=="edit"?(a.statusUpdated=!0,a.statusAdded=!1,a.addedOffspringName=a.offspring.offspringName==null?"":a.offspring.offspringName,a.savedMessage=a.offspring.shouldImplant?"Offspring has been saved and implanted successfully. - "+a.addedOffspringName:"Offspring saved successfully. - "+a.addedOffspringName,e.$emit("updateOffspring",a.offspring)):(a.statusAdded=!0,a.statusUpdated=!1,a.addedOffspringName=a.offspring.offspringName,a.savedMessage=a.offspring.shouldImplant?"Offspring has been saved and implanted successfully. - "+a.addedOffspringName:"Offspring saved successfully. - "+a.addedOffspringName,t={},angular.copy(a.offspring,t),e.$emit("addOffspring",t)),y(),i=a.savedMessage):(a.statusAdded=!1,a.statusUpdated=!1,a.statusUpdateFailed=!0,a.frmOffspringAdd.$setPristine())})}function tt(){a.typeOfMode=="edit";i.close()}function it(n,t){var i=l.find(n,{value:t});if(i!=null)return i.text}function rt(n,t){return l.get(n,t)}function ut(){return p().then(function(){i.dismiss("cancel")})}function ft(){i.dismiss("cancel")}function et(){if(!a.offspring.reasonForDeletionID||a.offspring.reasonForDeletionID==0){a.invalidReasonForDeletionID=!0;return}h.openConfirmMsg("md","You are about to permanently delete this offspring. Are you sure you want to proceed?").then(function(n){n&&(a.invalidReasonForDeletionID=!1,a.offspring.isDeleted=!0,p())})}function y(){a.offspring.offspringID=0;a.offspring.offspringName="";a.offspring.genderID=null;a.offspring.identificationMarks="";a.offspring.comments="";a.offspring.offspringMicrochipNumber=null;a.statusUpdateFailed=!1;a.frmOffspringAdd.$setPristine()}function p(){return f.post("api/MyLitter/SaveOffspring/",a.offspring).then(function(n){if(n){var t=new s(a.offspring.dateOfLitter).format("DD/MM/YYYY"),r=a.offspring.offspringName+" has been successfully deleted from litter with DOB "+t;h.openAlertMsg(2,r);i.close()}})}function w(){if(a.userRole=="Implanter"||a.userRole=="Veterinary"){if(a.offspring.offspringMicrochipNumber!=null&&a.offspring.offspringMicrochipNumber.length>0&&a.offspring.implantDate==null){a.showValidationMessage=!0;a.valMessage="Implant Date is required when Microchip number is entered.";return}a.showValidationMessage=!1}}function ot(){a.invalidReasonForDeletionID=a.offspring.reasonForDeletionID&&a.offspring.reasonForDeletionID!=0?!1:!0}var a=this,v;a.domain=r.data.domain;a.speciesId=r.data.domain.speciesId;a.userRole=c.currentUser.role;a.currentUserId=c.currentUser.id;a.breederNumber=c.currentUser.breederId;a.litter={};a.invalidReasonForDeletionID=!1;a.offspring={};a.offspring.userRole=a.userRole;a.typeOfMode=r.data.typeOfMode;a.deleteReasonChanged=ot;a.typeOfMode=="edit"||a.typeOfMode=="delete"||a.typeOfMode=="addoffspring"?(r.data.domain.selectedLitterId!==0&&r.data.domain.litters.length>0&&(v=l.filter(r.data.domain.litters,{litterID:r.data.domain.selectedLitterId}),v!=null&&v.length==1&&(a.domain.editingLitter=v[0]),a.offspring.breed1ID=a.domain.editingLitter.motherBreedID,a.offspring.breed2ID=a.domain.editingLitter.motherBreed2ID),r.data.domain.selectedOffspringId!==0&&r.data.domain.litters.length>0&&(v=l.filter(a.domain.editingLitter.offsprings,{offspringID:r.data.domain.selectedOffspringId}),v!=null&&v.length==1&&(a.offspring=v[0],a.offspring.reasonForDeletionID=""))):a.typeOfMode=="add"&&(a.currentOffspringMicrochipNo="",a.offspring.breed1ID=r.data.domain.editingLitter.motherBreedId,a.offspring.motherAnimalID=r.data.domain.editingLitter.motherAnimalID);a.referenceData=u;a.statusAdded=!1;a.statusUpdated=!1;a.savedMessage="";a.isRestricted=!1;a.implantDateDateChanged=g;a.saveOffspring=nt;a.cancel=tt;a.queryBySelectedValue=it;a.getProperty=rt;a.okClick=ut;a.cancelClick=ft;a.commitConfirmation=et;a.resetValidationMessage=w;k();b();e.$watch("vm.offspring.litterDOB",function(n){var t,i;n!=null&&(t=n.split("/"),t!=null&&t.length==3&&(i=new s(t[2]+"-"+t[0]+"-"+t[1]),a.microChipedMinDate=s(i)))})}var n="offspringAddController";angular.module("app").controller(n,["common","$uibModalInstance","config","ReferenceData","datacontext","$scope","$filter","moment","modalPopupFactory","authdata","_",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l){function y(){var i=[p()];t.activateController(i,n).then(function(){})}function p(){if(a.animalId!=null)return i.query("api/payment/GetPetRegistrationFee/",[a.animalId]).then(function(n){a.domain=n;a.domain.animalId=a.animalId})}function w(n){var f,t,u;if(a.animalId!=null){if(a.isEnable=!1,f=sessionStorage.getItem("a_uth"),localStorage.setItem("a_uth",f),t=o("filter")(a.domain.feeLines,{feeIdEnc:n}),(a.domain.feeHeader.desexed==null||a.domain.feeHeader.desexed=="0"||a.domain.feeHeader.desexed=="99")&&(u=r.filter(a.domain.feeLines,function(n){return n.fee>t[0].fee}),u==null||u.length==0)){s.openTemplate("md",{paymentDetails:t[0]},null,c+"app/payment/desexStatusConfirm.tmpl.html","payNonDesexPetController");a.isEnable=!0;return}return i.post("api/payment/Pay/",t[0]).then(function(n){a.response=n;a.response.status==!0&&(e.location.href=a.response.url)})}a.isEnable=!0}function b(){return a.domain==null||a.domain.feeHeader==null?"Unknown":(console.log(a.domain.feeHeader),console.log(a.domain.feeLines),a.domain.feeHeader.desexed=="1")?"Yes":a.domain.feeHeader.desexed=="0"?"No":a.domain.feeHeader.desexed=="99"?a.domain.feeHeader.dnr18==1?"Not Recommened (up to 18 months)":a.domain.feeHeader.dnrLife==1?"Not Recommened (for life)":"Not Recommended":"Unknown"}function k(){return l.spinnerShow(),i.post("api/payment/Pay/",a.domain.feeLines[0]).then(function(n){l.spinnerHide();a.response=n;a.response.status==!0&&(e.location.href=a.response.url)})}var v=t.logger.getLogFn,d=v(n),g=t.$q,a=this;a.animalId=f.param;a.getPetDesexedStatus=b;a.paynow=w;a.isEnable=!0;a.register=k;y()}var n="animalregistration";angular.module("app").controller(n,["common","datacontext","_","ReferenceData","$routeParams","$window","$filter","modalPopupFactory","$uibModalStack","ROOT","spinner",t])}(),function(){"use strict";function t(t,i,r,u,f,e){function h(){var i=[c()];t.activateController(i,n).then(function(){})}function c(){if(o.animalId!=null){var n="api/payment/GetPermitFee/"+o.animalId;return i.query(n,[o.permitType]).then(function(n){o.domain=n;o.domain.animalId=o.animalId;o.domain.permitType=o.permitType;o.isEnable=o.domain.feeLine.isPaymentORRenewalRequired})}}function l(){var n,t;if(o.animalId!=null)return o.isEnable=!1,n=sessionStorage.getItem("a_uth"),localStorage.setItem("a_uth",n),t=o.domain.feeLine,i.post("api/payment/PayPermit/",t).then(function(n){o.response=n;o.response.status==!0&&(e.location.href=o.response.url)});o.isEnable=o.domain.feeLine.isPaymentORRenewalRequired}function a(){return o.domain==null||o.domain.feeHeader==null?"Unknown":o.domain.feeHeader.desexed=="1"?"Yes":o.domain.feeHeader.desexed=="0"?"No":o.domain.feeHeader.desexed=="98"?"No - Not Recommended (up to 18 months)":o.domain.feeHeader.desexed=="99"?"No - Not Recommended for life":"Unknown"}var s=t.logger.getLogFn,v=s(n),y=t.$q,o=this;o.animalId=f.param1;o.permitType=f.param2;o.getPetDesexedStatus=a;o.paynow=l;o.isEnable=!0;h()}var n="permitpayment";angular.module("app").controller(n,["common","datacontext","_","ReferenceData","$routeParams","$window","$filter","modalPopupFactory","$uibModalStack","ROOT",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h){function a(){t.activateController([],n).then(function(){})}function v(){return h.spinnerShow(),i.post("api/SystemUser/SendPasswordResetEmail",c.domain).then(function(n){h.spinnerHide();c.reason=n.message;n.status?(c.showSuccessMessage=!0,c.showFailureMessage=!1):(c.showFailureMessage=!0,c.showSuccessMessage=!1)})}function y(){r.dismiss("cancel")}function p(){c.showSuccessMessage=!1;c.showFailureMessage=!1;c.isEnabled=c.domain.username=="undefined"||c.domain.username==null||c.domain.username==""?!1:!0}var l=t.logger.getLogFn,w=l(n),c=this;c.frmForgotPassword={};c.usertypes=[{text:"Pet Owner/Breeder",value:"0"},{text:"Authorised Vets/Authorised Identifiers",value:"1"}];c.domain={username:"",password:"",userType:"",attemptCount:0};c.chipnumber="";c.usernamePlaceholder="Email address";c.sendmail=v;c.cancel=y;c.showFailureMessage=!1;c.showSuccessMessage=!1;c.loginAttempts=[];c.authResult={};c.reason="";c.isEnabled="";c.usernameChanged=p;a()}var n="Forget";angular.module("app").controller(n,["common","datacontext","$uibModalInstance","config","$scope","ROOT","$location","authservice","spinner","_","commonConfig","modalPopupFactory",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o){function h(){c();t.activateController([],n).then(function(){o.path("/secure/home")})}function c(){var n=localStorage.getItem("a_uth"),t=sessionStorage.getItem("a_uth");(t==null||t==undefined)&&n!=null&&(sessionStorage.setItem("a_uth",n),localStorage.removeItem("a_uth"))}var s=t.logger.getLogFn,l=s(n),a=t.$q,v=this;h()}var n="paymentreturn";angular.module("app").controller(n,["common","datacontext","_","ReferenceData","$routeParams","$window","$location",t])}(),function(){"use strict";function t(t,i,r,u,f,e){function s(){t.activateController([],n).then(function(){})}function h(){return e.spinnerShow(),u.post("api/payment/Pay/",o.paymentDetails).then(function(n){e.spinnerHide();o.response=n;o.response.status==!0&&(f.location.href=o.response.url)})}function c(){i.dismiss("cancel")}var o=this;o.paymentDetails=r.data.paymentDetails;o.okClicked=h;o.cancelClicked=c;s()}var n="payNonDesexPetController";angular.module("app").controller(n,["common","$uibModalInstance","config","datacontext","$window","spinner",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){function g(){var i=[nt()];t.activateController(i,n).then(function(){b.userDOBMinDate=new c("01/01/1900","DD/MM/YYYY")})}function k(){b.control.createView=b.control.updateView=b.control.searchView=!1;b.control.showResultMessage=!1;b.control.showFailedMessage=!1;b.control.showCreateSuccessfulMessage=!1}function nt(){return f.query("api/SystemUser/getRecoverUserDefinition").then(function(n){b.domain.verifyUserCredentials=n.verifyUserCredentials;b.domain.securityQuestions=n.securityQuestions;b.domain.verifySecurityQuestions=n.verifySecurityQuestions;b.domainRules.verifyUserCredentialsDomainRules=n.verifyUserCredentialsValidation;b.domainRules.securityQuestionDomainRules=n.securityQuestionValidation;b.domainRules.verifySecurityQuestionDomainRules=n.verifySecurityQuestionValidation})}function tt(n,t){return a.get(n,t)}function it(n,t){var i=a.find(n,{value:t});if(i!=null)return i.text}function rt(){return k(),e.spinnerShow(),f.post("api/SystemUser/VerifyUserRetrieveSecretQuestions",b.domain.verifyUserCredentials).then(function(n){b.domain.securityQuestions=n;b.domain.securityQuestions!=null?b.domain.securityQuestions.multipleAccountsFound?(b.multipleAccountsFound=!0,b.showResults=!1,b.isEditable=!1,b.showMCTextbox=!0):b.domain.securityQuestions.userExists==1?(b.showMCTextbox=!1,b.domain.securityQuestions.systemUserQuestion1Description!=null&&b.domain.securityQuestions.systemUserQuestion2Description!=null&&b.domain.securityQuestions.systemUserQuestion3Description!=null?(b.isEditable=!1,b.showResults=!0,b.control.showCreateSuccessfulMessage=!0,b.control.showFailedMessage=!1,setTimeout(function(){angular.element("#systemUserAnswer1").trigger("focus")},300)):(b.isEditable=!0,b.showResults=!1,b.control.showCreateSuccessfulMessage=!1,b.control.showFailedMessage=!0)):(b.isEditable=!0,b.showResults=!1,b.control.showCreateSuccessfulMessage=!1,b.control.showFailedMessage=!0):b.control.showResultMessage=!0;e.spinnerHide()})}function ut(){if(b.domain.verifySecurityQuestions!=null){if(b.domain.verifySecurityQuestions.systemUserAnswer3!=null&&b.domain.verifySecurityQuestions.systemUserAnswer2!=null&&b.domain.verifySecurityQuestions.systemUserAnswer1!=null)return e.spinnerShow(),f.post("api/SystemUser/VerifySecurityQuestions",b.domain).then(function(n){if(e.spinnerHide(),n==!0){b.showResults=!0;b.isEditable=!1;b.showMCTextbox=!1;b.control.showCreateSuccessfulMessage=!0;b.control.showFailedMessage=!1;var t=w.openTemplate("md",{info:b.domain.securityQuestions},null,v+"app/public/recoverusername/recoversuccessmsg.tmpl.html","recoversuccessmsg")}else b.domain.securityQuestions=null,b.domain.verifySecurityQuestions=null,b.showResults=!1,b.isEditable=!1,b.showMCTextbox=!1,b.control.showCreateSuccessfulMessage=!1,b.control.showFailedMessage=!0,b.frmHolder.recoverUserName.$submitted=!1});angular.element("#systemUserAnswer1").trigger("focus")}}function ft(){k();et();b.isEditable=!0;b.showResults=!1;b.control.showCreateSuccessfulMessage=!1;b.control.showFailedMessage=!1;b.frmHolder.recoverUserName.$setPristine();b.frmHolder.recoverUserName.$setUntouched();b.multipleAccountsFound=!1}function et(){b.domain.verifyUserCredentials!=null&&(b.domain.verifyUserCredentials.userFirstName=null,b.domain.verifyUserCredentials.userLastName=null,b.domain.verifyUserCredentials.dateOfBirth=null,b.domain.verifyUserCredentials.contactNumber=null,b.domain.verifyUserCredentials.microchipNumber=null);b.domain.securityQuestions=null;b.domain.verifySecurityQuestions=null}function ot(){var n=b.domain.verifyUserCredentials.dateOfBirth.split("/"),t;return n!=null&&n.length==3&&(t=new c(n[2]+"-"+n[0]+"-"+n[1]),b.domain.verifyUserCredentials.dateOfBirth=n[2]+"-"+n[0]+"-"+n[1]),c(b.domain.verifyUserCredentials.dateOfBirth).format("DD/MM/YYYY")}var d=t.logger.getLogFn,st=d(n),ht=t.$q,b;i.screenTitle="Recover Username";b=this;b.petSearchaddress;b.address=[];b.root=v;b.referenceData=o;b.title="Recover User Name";b.currentUserId=h.currentUser.id;b.userRole=h.currentUser.role;b.frmHolder={};b.domain={};b.domainRules={};b.userDetails={};b.breedId;b.control={showResultMessage:!1,showSearchResult:!1,showFailedMessage:!1,showCreateSuccessfulMessage:!1};b.getProperty=tt;b.verifyUserCredentialsRetrieveSecretQuestions=rt;b.verifyUserSecurityQuestion=ut;b.queryBySelectedValue=it;b.isEditable=!0;b.showResults=!1;b.cancelVerificationProcess=ft;b.formatDate=ot;b.multipleAccountsFound=!1;b.showMCTextbox=!1;g()}var n="recoverusername";angular.module("app").controller(n,["common","$rootScope","$timeout","$http","datacontext","spinner","ReferenceData","authservice","authdata","moment","$window","_","ROOT","$scope","$location","modalPopupFactory",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c){function v(){t.activateController([],n).then(function(){})}function y(){return r.spinnerShow(),l.userDetails.username=l.info.systemUserID,l.userDetails.usertype=2,l.userDetails.password="test",l.userDetails.password="__USER_REGISTRATION_FINISHED__",l.userDetails.password=h.btoa(l.userDetails.password),l.userDetails.attemptCount=0,e.login(l.userDetails).then(function(n){r.spinnerHide();n.hasError?l.authResult=n:(o.publicUserId=null,c.path(e.getLandingPageRoute().url))})}function p(){return y().then(function(){i.dismiss("cancel")})}var a=t.logger.getLogFn,w=a(n),l=this;l.root=s;l.title="Recover User Name Success Message";l.currentUserId=o.currentUser.id;l.userRole=o.currentUser.role;l.info=u.data.info;l.okClick=p;l.userDetails={};v()}var n="recoversuccessmsg";angular.module("app").controller(n,["common","$uibModalInstance","spinner","config","ReferenceData","authservice","authdata","ROOT","$window","$location",t])}(),function(){"use strict";function t(t,i,r,u,f,e,o){function h(){s.domain=angular.copy(r.data.domain,s.domain);t.activateController([],n).then(function(){})}function c(){i.dismiss("cancel")}function l(){return o.spinnerShow(),f.post("api/OwnerData/SendEmailConfirmationForChangeEmail",s.domain).then(function(n){s.changeEmailResult=n;o.spinnerHide()})}function a(n,t){return _.get(n,t)}var s=this;s.domain={};s.changeEmailResult={};s.domainRules=r.rules;s.cancel=c;s.changeEmailAddress=l;s.getProperty=a;h()}var n="emailaddresschangecontroller";angular.module("app").controller(n,["common","$uibModalInstance","config","ReferenceData","datacontext","$scope","spinner",t])}(),function(){"use strict";function t(t,i,r,u,f,e){function h(){i.activateController([],n).then(function(){})}var s=i.logger.getLogFn,c=s(n),l=i.$q,o;t.screenTitle="Approved Person Dashboard";o=this;o.referenceData=e;o.title="Dashboard";h()}var n="apdashboard";angular.module("app").controller(n,["$rootScope","common","$http","datacontext","spinner","ReferenceData","$window",t])}(),function(){"use strict";function n(n,t,i){function r(){var n="___test___",t=window.sessionStorage;try{t.setItem(n,"1");t.removeItem(n)}catch(r){window.location=i+"Error/PrivateBrowsing"}}var u=t.$q;return{redirectOnPrivateBrowsing:r}}angular.module("app").factory("environmentservice",["datacontext","common","ROOT","authdata","_",n])}(),function(){"use strict";var n=angular.module("app");n.factory("breederFactory",["$q","$filter","datacontext","$timeout",function(n,t,i,r){function f(f,e,o,s){var h=n.defer();return s!=null&&i.query("api/Breeder/GetBreederOrganisations",[s]).then(function(n){var i,s;u.domain=n;i=u.domain;o.sort.predicate&&(i=t("orderBy")(i,o.sort.predicate,o.sort.reverse));s=i.slice(f,f+e);r(function(){h.resolve({data:s,numberOfPages:Math.ceil(i.length/e)})},1500)}),h.promise}var u=this;return u.domain=[],{getPage:f}}])}(),function(){"use strict";function t(t,i,r,u,f,e,o,s,h,c,l,a){function p(){u.activateController([],n).then(function(){})}function w(){return s.spinnerShow(),v.resetBreederSearch(),o.query("api/AnimalData/GetAnimalsLitterReportData",[v.reportTypeId]).then(function(n){v.reportData=n;v.rowCollectionReportData=angular.copy(v.reportData);s.spinnerHide()})}function b(){return s.spinnerShow(),v.isSubmitted=!0,o.post("api/VetData/SearchBreedersForReport",v.breederSearchDto).then(function(n){v.reportData=n;v.rowCollectionReportData=angular.copy(v.reportData);v.searchResultsCount=n.length;v.parentAnimalsReportData=[];v.showBreederAnimalsSection=!1;s.spinnerHide()})}function k(n){return v.selectedBreederId=n.breederId,v.selectedBreederName=n.name,v.selectedBreederId!=""&&v.selectedBreederId!=undefined?(v.showBreederAnimalsSection=!0,s.spinnerShow(),o.query("api/VetData/GetBreedersAnimals",[v.selectedBreederId]).then(function(n){v.breedersAnimals=n;d();v.parentAnimalsReportData=v.breedersAnimals.parentAnimals;v.parentAnimalsRowCollection=angular.copy(v.parentAnimalsReportData);v.litterOffSpringsReportData=n.litterSummary;v.litterOffSpringsRowCollection=angular.copy(v.litterOffSpringsReportData);s.spinnerHide()})):void 0}function d(){l.forEach(v.breedersAnimals.parentAnimals,function(n){n.speciesText=v.queryBySelectedValue(v.referenceData.masterData.species,n.speciesID);n.breed1Text=v.getSelectedBreed(v.referenceData.masterData.breeds,n.breed1);n.breed2Text=v.getSelectedBreed(v.referenceData.masterData.breeds,n.breed2)})}function g(){v.isSubmitted=!1;v.breederSearchDto={};v.breederSearchResults={};v.searchResultsCount=-1;v.showBreederAnimalsSection=!1}function nt(n,t){var i=l.find(n,{value:t});if(i!=null)return i.text}function tt(n,t){var i=l.find(n,{breedID:t});if(i!=null)return i.breed}function it(n){n.preventDefault();var t=o.getByteArray("api/Report/GetAnimalsLitterReport",v.reportTypeId);return s.spinnerShow(),t.then(function(n){var t=new Blob([n.data],{type:"application/pdf"}),i=n.headers("content-disposition").split("=")[1];c.saveAs(t,i)}),t.finally(function(){s.spinnerHide()}),t}function rt(n){n.preventDefault();var t=o.getCSVContent("api/Report/GetAnimalsLitterCSVReport",v.reportTypeId);return s.spinnerShow(),t.then(function(n){var t=new Blob([n.data],{type:"text/csv"}),i=n.headers("content-disposition").split("=")[1];c.saveAs(t,i)}),t.finally(function(){s.spinnerHide()}),t}function ut(n,t){n.preventDefault();var i=o.getByteArray("api/Report/GetBreederAnimalReport/"+t,v.selectedBreederId);return s.spinnerShow(),i.then(function(n){var t=new Blob([n.data]),i=n.headers("content-disposition").split("=")[1];c.saveAs(t,i)}),i.finally(function(){s.spinnerHide()}),i}var y=u.logger.getLogFn,ft=y(n),et=u.$q,v;t.screenTitle="Reports";v=this;v.root=a;v.referenceData=h;v.reportTypeId=null;v.reportData=[];v.rowCollectionReportData=[];v.parentAnimalsReportData=[];v.parentAnimalsRowCollection=[];v.litterOffSpringsReportData=[];v.litterOffSpringsRowCollection=[];v.searchType=1;v.doSearchBreeders=b;v.resetBreederSearch=g;v.breederSearchResults={};v.searchResultsCount=0;v.isSubmitted=!1;v.viewBreederAnimals=k;v.showBreederAnimalsSection=!1;v.queryBySelectedValue=nt;v.getSelectedBreed=tt;v.downloadBreederAnimalReport=ut;v.selectedBreederId="";v.selectedBreederName="";v.title="View Reports";v.itemsByPage=15;v.isLoading=!1;p();v.getReportData=w;v.generateReport=it;v.generateCSVReport=rt}var n="viewReports";angular.module("app").controller(n,["$rootScope","$scope","authdata","common","$http","$routeParams","datacontext","spinner","ReferenceData","$window","_","ROOT","modalPopupFactory",t])}()