(function(){var a="sproutcore/standard_theme";if(!SC.BUNDLE_INFO){throw"SC.BUNDLE_INFO is not defined!"
}if(SC.BUNDLE_INFO[a]){return}SC.BUNDLE_INFO[a]={requires:["sproutcore/empty_theme"],styles:["/static/sproutcore/standard_theme/en/B00001/stylesheet-packed.css","/static/sproutcore/standard_theme/en/B00001/stylesheet.css"],scripts:["/static/sproutcore/standard_theme/en/B00001/javascript-packed.js"]}
})();SC.stringsFor("English",{_Audio:"Audio",_Bitrate:"Bitrate",_Connection:"Connection",_Date:"Date",_DBM:"dBm",_DNSServer:"DNS server",_DNSServer1:"DNS server 1",_DNSServer2:"DNS server 2",_Event:"Event",_FPS:"fps",_Framerate:"Framerate",_Ipv4Address:"IPv4 address",_Kbit:"kBit/s",_Lens1:"Lens1",_Lens2:"Lens2",_MB:"MB",_min:"min",_minutes:"minutes",_MotionDetection:"Motion detection",_ms:"ms",_Name:"Name",_Network:"Network",_NTPServer:"Server address",_Password:"Password",_PleaseWait:"Please wait",_PX:"px",_Quality:"Quality",_Resolution:"Resolution",_s:"s",_seconds:"seconds",_Samplerate:"Sample rate",_Size:"Size",_SubnetMask:"Subnet mask",_Time:"Time",_Uptime:"Uptime",_User:"User",_Video:"Video",_Delete:"Delete",_Cancel:"Cancel",_StartRecord:"Start recording",_StopRecord:"Stop recording",_TriggerEvent:"Trigger event",_TriggerEventProgress:"Trigger event...",_WindowTitle:"Everec 221",_Liveview:"Live view",_Setup:"Configuration",_Records:"Recorded videos",_Info:"System information",_Maintenance:"Maintenance",_Service:"Service",_Stream:"Stream","_MPEG-4":"MPEG-4",_MJPG:"MJPG",_disabled:"disabled",_Connected:"Connected",_Camera:"Camera",_Version:"Version",_Build:"Build",_Upstreamrate:"Upstream",_Downstreamrate:"Downstream",_SignalStrength:"Signal strength",_WirelessConnection:"Wireless connection",_PPPIP:"PPP address",_MPEG4Stream:"MPEG-4 stream",_Duration:"Duration",_Length:"Length",_StartTime:"Start time",_Modified:"Modified",_FrameCount:"Frame count",_Pcount:"P-Frame count",_FrameDrops:"Frame drops",_SampleCount:"Sample count",_Channels:"Channels",_DeleteVideoTitle:"Delete selected videos?",_DeleteVideoText:"The videos cannot be restored after deleting. Are you sure you want to proceed?",_Refresh:"Refresh",_Export:"Download","_n.a.":"n.a.",_Repair:"Repair",_Incomplete:"Incomplete",_NoCard:"No card inserted",_Free:"Free",_InternalFlashMemory:"Internal flash memory",_RepairingSucceeded:"Successfully repaired file '%1'.",_RepairingFailed:"Failed to repair file '%1'.",_FormatMMCTitle:"Erase internal flash memory",_FormatMMCText:"All data on the internal flash memory will be deleted.",_FormatMMC:"Erase flash memory",_FormatMMCDialogTitle:"Are you sure you want to erase the internal flash memory?",_FormatMMCDialogText1:"All videos and data on the flash memory will be deleted.",_FormatMMCDialogText2:" ",_FormatMMC_Progress:"Erasing internal flash memory...",_ResetDefaultsTitle:"Reset factory settings",_ResetDefaultsText:"Current configuration settings will be deleted. A camera restart is required for this operation to complete.",_ResetDefaults:"Reset configuration",_ResetDefaultsDialogTitle:"Are you sure you want to reset the configuration?",_ResetDefaultsDialogText1:"Camera will be restarted after resetting factory defaults. Current configuration settings will be deleted.",_ResetDefaultsDialogText2:" ",_FirmwareUploadTitle:"Firmware update",_FirmwareUploadText:"Select firmware file to upload. A camera restart will be required for the firmware update to complete.",_UploadSucceededTitle:"Firmware upload successful",_UploadSucceededText:"A camera restart is required to execute the firmware update.",_UploadFailedTitle:"Uploading firmware failed",_UploadFailedWrongFormat:"Wrong file format",_UploadFailedUnexpectedError:"Firmware upload failed",_UploadFailedCRCFailed:"Firmware image corrupt",_UploadingFirmwareProgress:"Uploading firmware, this can take approx. 3 minutes",_RestartSystem:"Restart camera",_StartMaintenanceText:"Enter the maintenace mode to format flash memory, reset factory defaults or update firmware. The video chain - streaming and recording - will be stopped and configuration pages are not available while in this mode.",_StartMaintenanceMode:"Enter maintenance mode",_StartMaintenanceModeProgress:"Stopping the video chain...",_StopMaintenanceText:"Leave the maintenace mode and restart the video chain.",_StopMaintenanceMode:"Leave maintenance mode",_StopMaintenanceModeProgress:"Restarting the video chain...",_Upload:"Upload firmware",_SerialNumber:"Serial number",_EnterSerialTitle:"Enter serial",_EnterSerialText:"8 numeric characters required",_SaveSerialNumber:"Save serial number",_SetSerialProgress:"Set serial...",_Streams:"Streams",_PrivacyMasks:"Privacy Masks",_Overlay:"Overlay",_Recording:"Recording",_System:"System",_UMTS:"UMTS",_NVR:"NVR",_Image:"Image",_Login:"Login",_Logout:"Logout",_Reset:"Reset",_Save:"Save",_Discard:"Discard",_Cancel:"Cancel",_Save_Dialog_Title:"Configuration changes have been made",_Save_Dialog_Text1:"You can choose to save or discard changes.",_Save_Dialog_Text2:"To review changes without saving now press cancel.",_MPEG4Stream1Title:"MPEG-4 (1280x720)",_MPEG4Stream2Title:"MPEG-4 (640x352 / max. 5fps)",_MPEG4Stream3Title:"MPEG-4 (320x176)",_JPEGStream1Title:"JPEG (1280x720)",_JPEGStream2Title:"JPEG (640x352)",_JPEGStream3Title:"JPEG (320x176)",_Stream1Resolution1:"1280x720",_Stream1Resolution2:"640x480",_Stream3Resolution1:"640x352",_Stream3Resolution2:"640x480",_Stream3Title:"MPEG-4 (Lo-Res)",_Stream2Title:"MJPG (640x352)",_SensorTitle:"Camera",_FlipImage:"Rotate camera image 180 degrees",_MaximalExposureTime:"Maximum exposure time",_MaximumFramerate:"Maximum framerate",_FrameInterval:"Frame interval",_CommonOptions:"Common options",_FramerateComment:"(range depends on maximum exposure time)",_TimeScale:"Base framerate",_Privacy_Mask_Title:"Privacy mask configuration",_Privacy_Mask_Text:"Create, move, resize or remove privacy masks.",_Remove_Mask:"Remove mask",_Overlay_Title:"Video overlay configuration",_Overlay_Text:"Enable or disable overlays in the video streams.",_Overlay_Type:"Overlay type",_Position:"Position",_Text:"Text",_Overlay_Text_Hint:"Overlay Text",_Top:"Top",_Bottom:"Bottom",_ImageRecMode:"Image recording (jpeg)",_VideoRecMode:"Video recording (mov/mpeg4)",_Store:"Store",_Options:"Options",_LongTime:"Long time recording",_Alarm:"Alarm recording",_Input:"Input",_PreDuration:"Pre alarm duration",_PostDuration:"Post alarm duration",_sec:"sec",_Internal:"Internal flash memory",_Samba:"Network attached storage (NAS/SMB)",_ServerAddress:"Server address",_SizeInMB:"Maximum storage size to use (megabytes)",_AutoDelete:"Auto delete oldest files when storage limit is reached",_ContainerFormat:"Video file format",_MaxDuration:"Split file after",_Mov:"MOV (Quicktime)",_Avi:"AVI",_Off:"Off",_Ftp:"File transfer protocol (ftp)",_Nvr:"Network video recorder (nvr)",_Path:"Path",_Port:"Port",_SendPictureInterval:"Send picture interval",_SambaShare:"Share",_SendInterval:"Send interval (%@)",_Audio_Title:"Audio configuration",_Audio_Text:"Enable or disable the audio stream and select volume.","_Audio/MP3":"Audio recording enabled",_HZ:"Hz",_Volume:"Volume",_Motion_Detection_Title:"Motion detection configuration",_Motion_Detection_Text:"Create, move, resize and remove areas of interest. With no areas defined the whole picture is analyzed.",_Remove_Motion:"Remove mask",_Sensitivity:"Sensitivity",_EnableMotionDisplay:"Display motion",_Network_Title:"Network configuration",_Network_Text:"Setup IP networking",_Bonjour:"Bonjour",_DHCP:"DHCP",_Manual:"Manual configuration",_Gateway:"Default gateway",_DNS:"Domain name system",_Dyndns:"DynDNS",_UMTS_Enabled:"UMTS enabled",_UMTS_Title:"UMTS configuration",_UMTS_Text:"Setup access data for UMTS connection",_SimCard:"Sim card",_Access_Point:"Access point",_APN:"APN",_Pin:"PIN",_Time_Title:"Time and date configuration",_Time_Text:"Setup the camera clock and timezone",_Server:"Server",_Client:"Client",_SynchCameraTime:"Synchronize camera time",_SetCameraTime:"Set camera time",_Timezone:"Timezone",_CameraTime:"Camera time",_LocalTime:"Local time",_ManualTimeSetupTitle:"Setup the camera clock manually",_ManualDateSetupFormat:"(Format: yyyy-mm-dd)",_ManualTimeSetupFormat:"(Format: hh:mm:ss)",_LocalTimeSetupTitle:"Synchronize the camera clock with local time",_NtpTimeSetupTitle:"Synchronize the camera clock with ntp server time",_NTPServerATU:"Automatic time update (ntp)",_User_Title:"User configuration",_User_Text:"Add, edit or remove administrators and guests",_Group:"Group",_Admin:"Admin",_Guest:"Guest",_Accept:"Accept",_Confirm:"Confirm",_User_Dialog_Title:"Add new user",_User_Dialog_Text:"Associate a group to the user and set a password",_Add:"Add",_Edit:"Edit",_AnonymousUser:"Anonymous guest login",_NVR_Title:"Network video recorder",_NVR_Text:"...",_NVRServerAddress:"Server address",_LoadRecords:"Loading video data...",_DeleteRecords:"Deleting selected video files...",_RepairRecordProgress:"Repairing video file...",_SaveDataProgress:"Saving data...",_StartRecordProgress:"Starting recording...",_StopRecordProgress:"Stopping recording...",_SetTimeProgress:"Setting camera time...",_SyncNTPTimeProgress:"Synchronizing with NTP server...",_CancelUploadProgress:"Cancel firmare update...",_CancelRepairProgress:"Cancel repairing video...",_Bad_Request_Title:"Bad request",_Bad_Request_Text:"An error is occurred. You will be redirected to the start page.",_Session_Expired_Title:"Session expired",_Session_Expired_Text:"Your session has expired. You will be redirected to the start page.",_ServiceUnavailable_Title:"Server is unavailable",_ServiceUnavailable_Text:"You will be redirected to the start page.",_Unautorized_Title:"Unauthorized request",_Unautorized_Text:"You will be redirected to the start page.",_LoginFailed_Title:"Authentication failure",_UserNotFound_Text:" ",_PasswordFailed_Text:" ",_Synch_NTP_Time_Title:"Synchronizing with NTP server failed",_Synch_NTP_Time_Text:" ",_LoginGuestMaintanaceFailed_Text:"Guest login is not available in maintenance mode.",_LoginAdminSessionFound_Text:"Only one admin login allowed at the same time."});
NC=SC.Object.create({NAMESPACE:"NC",VERSION:"0.1.0",store:SC.Store.create().from(SC.Record.fixtures)});
NC.DATA_DELIMITER=":";NC.StrToIntBinding=SC.Binding.oneWay().transform(function(a,b){return SC.typeOf(a)==SC.T_STRING?parseInt(a):0
});NC.IntToStrBinding=SC.Binding.oneWay().transform(function(a,b){return SC.typeOf(a)==SC.T_NUMBER?""+a:"0"
});NC.ResWidthToBoolBinding=SC.Binding.oneWay().transform(function(a,b){return(a===1280?true:false)
});NC.ResMJPGHeightToBoolBinding=SC.Binding.oneWay().transform(function(a,b){return(a===352?true:false)
});require("core");NC.ajax=SC.Object.create({errorBadSession:"ERROR::BAD_SESSION",sid:null,webserverRestart:NO,webserverRestartExpected:NO,navigator:function(){if(navigator.appName.indexOf("Netscape")>-1){return"Netscape"
}if(navigator.appName.indexOf("Explorer")>-1){return"Explorer"}return"Unknown"},getXmlHttp:function(){var a=null;
if(typeof XMLHttpRequest!="undefined"){a=new XMLHttpRequest()}if(!a){try{a=new ActiveXObject("Msxml2.XMLHTTP")
}catch(b){try{a=new ActiveXObject("Microsoft.XMLHTTP")}catch(b){a=null}}}return a
},transferData:function(e,c,d){var b="sid="+this.get("sid")+"&";var f="/main?"+(d?b:"")+e;
var a=this.getXmlHttp();if(a){a.open("GET",f,this.navigator()!=="Explorer");a.setRequestHeader("Cache-Control","no-cache");
a.onreadystatechange=c;a.send(null)}},loadData:function(b,a){this.transferData(b,a,true)
},defaultErrorHandler:function(a){if(a==503||a==500||a==0){console.log("NC.ajax.defaultErrorHandler: service unavailable");
NC.mainController.showErrorDialog("_ServiceUnavailable_Title".loc(),"_ServiceUnavailable_Text".loc())
}else{if(a==401){console.log("NC.ajax.defaultErrorHandler: unauthorized");NC.mainController.showErrorDialog("_Unautorized_Title".loc(),"_Unautorized_Text".loc())
}else{if(a==403){console.log("NC.ajax.defaultErrorHandler: session expired");NC.mainController.showErrorDialog("_Session_Expired_Title".loc(),"_Session_Expired_Text".loc())
}else{if(a==400){console.log("NC.ajax.defaultErrorHandler: bad request");NC.mainController.showErrorDialog("_Bad_Request_Title".loc(),"_Bad_Request_Text".loc())
}}}}},loginErrorHandler:function(a){if(a==503||a==500||a==0){console.log("NC.ajax.loginErrorHandler: service unavailable");
NC.mainController.showLoginErrorDialog("_ServiceUnavailable_Title".loc(),"_ServiceUnavailable_Text".loc())
}else{if(a==470){console.log("NC.ajax.loginErrorHandler: service unavailable");NC.mainController.showLoginErrorDialog("_LoginFailed_Title".loc(),"_UserNotFound_Text".loc())
}else{if(a==471){console.log("NC.ajax.loginErrorHandler: unauthorized");NC.mainController.showLoginErrorDialog("_LoginFailed_Title".loc(),"_PasswordFailed_Text".loc())
}else{if(a==472){console.log("NC.ajax.loginErrorHandler: login failed --> not available for guests in maintenance mode");
NC.mainController.showLoginErrorDialog("_LoginFailed_Title".loc(),"_LoginGuestMaintanaceFailed_Text".loc())
}else{if(a==474){console.log("NC.ajax.loginErrorHandler: login failed --> admin already logged in");
NC.mainController.showLoginErrorDialog("_LoginFailed_Title".loc(),"_LoginAdminSessionFound_Text".loc())
}}}}}},checkStatus:function(b,a){if(b.readyState==4){if(this.webserverRestart){if(b.status==0){this.webserverRestartExpected=YES;
return true}else{if(b.status==200){if(this.webserverRestartExpected){this.webserverRestart=NO;
this.webserverRestartExpected=NO}return true}else{this.webserverRestart=NO;this.webserverRestartExpected=NO
}}}if(b.status==200){return true}else{if(typeof a==="undefined"){console.log("start defaultErrorHandler:"+typeof a);
this.defaultErrorHandler(b.status)}else{console.log("start errorHandler:"+typeof a);
a.call(this,b.status)}}}return false},loginHandler:function(){if(NC.ajax.checkStatus(this,NC.ajax.loginErrorHandler)){console.log("loginHandler="+this.responseText);
NC.mainController.doLogin(this.responseText)}},logoutHandler:function(){if(NC.ajax.checkStatus(this)){console.log("logoutHandler="+this.responseText);
NC.mainController.doLogout()}},keepAliveHandler:function(){if(NC.ajax.checkStatus(this)){NC.mainController.keepAliveDone(this.responseText)
}},stateHandler:function(){if(NC.ajax.checkStatus(this)){console.log("stateHandler="+this.responseText);
NC.mainController.stateLoaded(this.responseText)}},menuHandler:function(){if(NC.ajax.checkStatus(this)){var json=this.responseText;
var records=eval("("+json+")");var items=new Array();var groups=new Array();for(var i=0;
i<records.length;i++){records[i].name=records[i].name.loc();if(records[i].recordType===NC.SetupGroup){groups.push(records[i])
}else{items.push(records[i])}}var store=NC.mainController.get("store");store.loadRecords(NC.SetupMenuItem,items);
store.loadRecords(NC.SetupGroup,groups);NC.mainController.menuLoaded()}},userHandler:function(){if(NC.ajax.checkStatus(this)){NC.usersController.usersLoaded(this.responseText)
}},emptyHandler:function(){if(NC.ajax.checkStatus(this)){console.log("emptyHandler="+this.responseText)
}},emptyProgressHandler:function(){if(NC.ajax.checkStatus(this)){console.log("emptyProgressHandler="+this.responseText);
NC.mainController.hideProgressDialog()}},addUserHandler:function(){if(NC.ajax.checkStatus(this)){console.log("addUserHandler="+this.responseText);
NC.usersController.doAcceptUser()}},removeUserHandler:function(){if(NC.ajax.checkStatus(this)){console.log("removeUserHandler="+this.responseText);
NC.usersController.doRemoveUser()}},dataHandler:function(){if(NC.ajax.checkStatus(this)){console.log("dataHandler="+this.responseText);
var json=this.responseText.replace(/Test.Data/g,"NC.Data");var records=eval("("+json+")");
console.log(records);NC.mainController.dataLoaded(records[0])}},resolutionHandler:function(){if(NC.ajax.checkStatus(this)){console.log("resolutionHandler=%s",this.responseText);
var a=this.responseText.split("|");for(var b=0;b<a.length;b++){var c="menuItem"+(b+1);
NC.dataController.set(c,a[b])}NC.dataController.set("menuCount",a.length)}},sendHandler:function(){if(NC.ajax.checkStatus(this)){console.log("data sent: "+this.responseText);
NC.mainController.hideProgressDialog();NC.mainController.pauseTimer("keepAliveTimer",false)
}},sendTimeHandler:function(){if(NC.ajax.checkStatus(this)){console.log("sendTimeHandler="+this.responseText);
NC.mainController.hideProgressDialog()}},setNtpTimeHandler:function(){if(NC.ajax.checkStatus(this)){console.log("setNtpTimeHandler="+this.responseText);
NC.mainController.hideProgressDialog();if(this.responseText==="failed"){SC.AlertPane.error("_Synch_NTP_Time_Title".loc(),"_Synch_NTP_Time_Text".loc(),"",this)
}}},maskHandler:function(){if(NC.ajax.checkStatus(this)){console.log("maskHandler="+this.responseText);
NC.privacyMaskController.loadRecords(this.responseText)}},motionHandler:function(){if(NC.ajax.checkStatus(this)){console.log("motionHandler="+this.responseText);
NC.motionController.loadRecords(this.responseText)}},sendMaskHandler:function(){if(NC.ajax.checkStatus(this)){console.log("sendMaskHandler="+this.responseText)
}},sendMotionHandler:function(){if(NC.ajax.checkStatus(this)){console.log("sendMotionHandler="+this.responseText)
}},loadRecordFilesHandler:function(){if(NC.ajax.checkStatus(this)){var d=this.responseText.split("|");
var b=d[0];var c=d[1];var a=d[2];console.log("size=%u free=%u",b,c);NC.recordsController.set("storeSize",parseInt(b));
NC.recordsController.set("storeFree",parseInt(c));NC.recordsController.recordsLoaded(a)
}},removeRecordFilesHandler:function(){if(NC.ajax.checkStatus(this)){console.log("removeRecordFilesHandler="+this.responseText);
NC.recordsController.recordsLoaded(this.responseText)}},timezoneHandler:function(){if(NC.ajax.checkStatus(this)){NC.timeController.loadTimezones(this.responseText)
}},startStreamHandler:function(){if(NC.ajax.checkStatus(this)){console.log("startStreamHandler="+this.responseText);
if(this.responseText==="succeeded"){NC.mainController.streamingStarted()}NC.mainController.hideProgressDialog()
}},stopStreamHandler:function(){if(NC.ajax.checkStatus(this)){console.log("stopStreamHandler="+this.responseText);
if(this.responseText==="succeeded"){NC.mainController.streamingStopped()}NC.mainController.hideProgressDialog()
}},mmcHandler:function(){if(NC.ajax.checkStatus(this)){NC.mainController.hideProgressDialog()
}},checkUploadHandler:function(){if(NC.ajax.checkStatus(this)){console.log("checkUploadHandler="+this.responseText);
if(this.responseText==="true"){NC.mainController.continueUpload()}else{NC.mainController.stopUpload(parseInt(this.responseText))
}}},getProgressHandler:function(){if(NC.ajax.checkStatus(this)){console.log("getProgressHandler="+this.responseText);
var a=this.responseText.match(/\b(\d+):(\d+)\b/);if(a!=null){NC.mainController.continueProgress(parseInt(a[1]),parseInt(a[2]))
}else{NC.mainController.stopProgress(this.responseText==="succeeded")}}},resetDefaultsHandler:function(){if(NC.ajax.checkStatus(this)){NC.maintenanceController.defaultsResetDone()
}},setSerialHandler:function(){if(NC.ajax.checkStatus(this)){console.log("setSerialHandler="+this.responseText);
NC.mainController.hideProgressDialog();NC.dataSrcController.set("info_serial_number",this.responseText);
NC.mainController.updateMenuItems(false,false)}},});NC.dataController=SC.ObjectController.create({ftpInterval:1,ftpIntervalUnit:1,webserverRestartProps:["users_anonymous_enabled"],data_changed:function(c){var e=NC.setupMenuController.get("currentView");
if(typeof e==="undefined"||e==null){return}var d=e.get("properties");var a=false;
for(var b=0;b<d.length&&!a;b++){if(this.get(d[b])!=NC.dataSrcController.get(d[b])){a=true
}}this.set("saveEnabled",a||NC.usersController.get("changed")||NC.privacyMaskController.get("changed")||NC.motionController.get("changed"))
},isDigits:function(a){return(/\D/.test(a)==false)},checkIpAddress:function(g,i){if(SC.none(g)||typeof g!="string"){return NO
}else{if(g.length==0){return i}}var d=g.indexOf(".");var b=g.indexOf(".",d+1);var a=g.indexOf(".",b+1);
if(d===-1||b===-1||a===-1){return false}var h=g.substr(0,d);var f=g.substr(d+1,b-d-1);
var e=g.substr(b+1,a-b-1);var c=g.substr(a+1,g.length);return this.isDigits(h)&&this.isDigits(f)&&this.isDigits(e)&&this.isDigits(c)&&h<256&&f<256&&e<256&&c<256
},checkTimeString:function(a){return false},checkProp:function(d){var b=["network_dns0_ip","network_dns1_ip"];
var c=["network_eth0_ipv4_address","network_eth0_ipv4_subnetmask","network_eth0_ipv4_defaultgw"];
for(var a=0;a<b.length;a++){if(b[a]===d){return this.checkIpAddress(this.get(b[a]),YES)
}}for(var a=0;a<c.length;a++){if(c[a]===d){return this.checkIpAddress(this.get(c[a]),NO)
}}return true},encodingRequired:function(a){return a==="network/dyndns/password"||a==="recording/video/store/samba/share"||a==="recording/video/store/samba/user"||a==="recording/video/store/samba/password"||a==="recording/video/store/samba/path"||a==="recording/image/store/ftp/server"||a==="recording/image/store/ftp/user"||a==="recording/image/store/ftp/password"||a==="recording/image/store/ftp/path"||a==="recording/image/store/nvr/server"
},encodeValue:function(d){var a="";for(var b=0;b<d.length;b++){var c=d.charCodeAt(b);
a+=(a.length==0?"":"x")+c;if(c==92){a+=(a.length==0?"":"x")+c}}return a},save:function(){var c=NC.setupMenuController.get("currentView").get("properties");
var f=new Array();for(var b=0;b<c.length;b++){var e=this.get(c[b]);if(e!=NC.dataSrcController.get(c[b])){if(this.checkProp(c[b])){NC.dataSrcController.set(c[b],e);
f.push(c[b]);if(NC.util.arrayIncludeElem(this.webserverRestartProps,c[b])){NC.ajax.set("webserverRestart",YES);
NC.ajax.set("webserverRestartExpected",NO)}else{}}else{var e=NC.dataSrcController.get(c[b]);
this.set(c[b],e)}}}var g="";for(b=0;b<f.length;b++){var a=f[b].replace(/[_]/g,"/");
var d=NC.dataSrcController.get(f[b]);if(this.encodingRequired(a)){d=this.encodeValue(d)
}if(g.length>0){g+=NC.DATA_DELIMITER}g+="/"+a+"="+d}if(g.length>0){NC.mainController.showProgressDialog("_SaveDataProgress".loc());
NC.mainController.pauseTimer("keepAliveTimer",true);NC.ajax.transferData("data="+g,NC.ajax.sendHandler,true)
}NC.privacyMaskController.save();NC.motionController.save();NC.usersController.save();
this.set("saveEnabled",false)},removePropObserver:function(c){if(typeof c!=="undefined"){var a=c.getView().get("properties");
for(var b=0;b<a.length;b++){this.removeObserver(a[b],this,this.data_changed)}}},reset:function(){console.log("reset...");
var b=NC.setupMenuController.get("currentView").get("properties");console.log("reset props=%s",b);
this.beginPropertyChanges();for(var a=0;a<b.length;a++){var c=NC.dataSrcController.get(b[a]);
if(this.get(b[a])!=c){this.set(b[a],c)}this.addObserver(b[a],this,this.data_changed)
}console.log("reset endPropertyChanges...");this.endPropertyChanges();console.log("reset endPropertyChanges...done");
NC.privacyMaskController.reset();NC.motionController.reset();NC.usersController.reset();
this.set("saveEnabled",false);console.log("reset...done")},dlgSave:function(){this.save();
if(this.get("saveDlgSource")==="logout"){NC.mainController.doLogout()}else{if(this.get("saveDlgSource")==="setupMenuChanged"){NC.setupMenuController.updateSetupView();
this.reset()}}},dlgDiscard:function(){if(this.get("saveDlgSource")==="logout"){NC.mainController.doLogout()
}else{if(this.get("saveDlgSource")==="setupMenuChanged"){NC.setupMenuController.updateSetupView();
this.reset()}}},dlgCancel:function(){if(this.get("saveDlgSource")==="logout"){}else{if(this.get("saveDlgSource")==="setupMenuChanged"){NC.setupMenuController.resetSelection()
}}},alertPaneDidDismiss:function(b,a){switch(a){case SC.BUTTON1_STATUS:this.dlgSave();
break;case SC.BUTTON2_STATUS:this.dlgDiscard();break;case SC.BUTTON3_STATUS:this.dlgCancel();
break}},showSaveDialog:function(a){this.set("saveDlgSource",a);SC.AlertPane.warn("_Save_Dialog_Title".loc(),"_Save_Dialog_Text1".loc(),"_Save_Dialog_Text2".loc(),"_Save".loc(),"_Discard".loc(),"_Cancel".loc(),this)
},hideSaveDialog:function(){},audio_main_modeObserver:function(){var a=this.get("audio_main_mode");
if(a==="pcm"||a==="mp3"){this.setIfChanged("audioEnabled",true)}else{if(a==="off"){this.setIfChanged("audioEnabled",false)
}}}.observes("audio_main_mode"),audioEnabledObserver:function(){var a=this.get("audioEnabled");
if(a===true){this.setIfChanged("audio_main_mode","mp3")}else{if(a===false){this.setIfChanged("audio_main_mode","off")
}}}.observes("audioEnabled"),network_bonjour_nameValidator:function(){var b=this.get("network_bonjour_name");
if(SC.none(b)){return}var a=b.match(/[-\w]*/)[0].replace(/_/g,"");if(b!=a){this.set("network_bonjour_name",a)
}}.observes("network_bonjour_name"),videoSensorFrameintervalObserver:function(){var a=this.get("video_sensor_frameinterval");
if(SC.none(a)){return}NC.streamController.updateSensorFrameInterval(this.get("video_sensor_frameinterval"))
}.observes("video_sensor_frameinterval"),updateSensorFrameInterval:function(a){this.removeObserver("video_sensor_frameinterval",this,this.videoSensorFrameintervalObserver);
this.setIfChanged("video_sensor_frameinterval",a);NC.streamController.updateDivider();
this.addObserver("video_sensor_frameinterval",this,this.videoSensorFrameintervalObserver)
},});NC.dataSrcController=SC.ObjectController.create({videoTimeScale:30,layoutLiveView:function(){var c=NC.LV_IMG_TOP;
var d=this.get("video_mjpg_resolution_width");var a=this.get("video_mjpg_resolution_height");
if(SC.none(d)||SC.none(a)){return}var e=c+a+5;var b=e+NC.LABEL_HEIGHT+15;var f=b+NC.LABEL_HEIGHT+15;
NC.getPath("liveViewPage.liveView.imageView").set("layout",{centerX:0,top:c,width:d,height:a});
NC.getPath("liveViewPage.liveView.infoLabel").set("layout",{centerX:0,top:e,width:d,height:NC.LABEL_HEIGHT});
NC.getPath("liveViewPage.liveView.rtspHighLink").set("layout",{centerX:0,top:b,width:NC.LV_LINK_HIGH_WIDTH,height:NC.LABEL_HEIGHT});
NC.getPath("liveViewPage.liveView.rtspLowLink").set("layout",{centerX:0,top:f,width:NC.LV_LINK_LOW_WIDTH,height:NC.LABEL_HEIGHT});
NC.privacyMaskController.doLayout(d,a);NC.motionController.doLayout(d,a)}.observes("video_mjpg_resolution_width","video_mjpg_resolution_height"),mjpgResolution:function(){var b=this.get("video_mjpg_resolution_width");
var a=this.get("video_mjpg_resolution_height");if(SC.none(b)||SC.none(a)){return"undefined"
}return"%@ x %@".fmt(b,a)}.property("video_mjpg_resolution_width","video_mjpg_resolution_height").cacheable(),liveViewLabel:function(){var e=this.get("mjpgResolution");
var c=this.get("video_mjpg_framerate_divider");var f=this.get("video_sensor_frameinterval");
var i=this.get("video_sensor_timescale");var j=NC.streamController.get("stream2");
var h=this.get("video_mjpg_quality_value");if(SC.none(c)||SC.none(f)||SC.none(i)||SC.none(j)||SC.none(h)){return"undefined"
}var d=j.displayFramerate(j.calculateFramerate(f,c,i));var g=["_Framerate".loc()+":",d,"_FPS".loc()].join(" ");
var b=["_Quality".loc()+":",h].join(" ");var a=["_Resolution".loc()+":",e,"_PX".loc()].join(" ");
return[a,g,b].join(" | ")}.property("mjpgResolution","video_mjpg_framerate_divider","video_mjpg_quality_value","video_sensor_frameinterval","video_sensor_timescale").cacheable(),mpeg4highResolution:function(){var b=this.get("video_mpeg4high_resolution_width");
var a=this.get("video_mpeg4high_resolution_height");if(SC.none(b)||SC.none(a)){return""
}return"%@ x %@".fmt(b,a)}.property("video_mpeg4high_resolution_width","video_mpeg4high_resolution_height").cacheable(),mpeg4highRtspLink:function(){return"rtsp://"+location.hostname+"/"+this.get("video_mpeg4high_rtp_name")
}.property("video_mpeg4high_rtp_name").cacheable(),mpeg4highInfo:function(){var d=this.get("mpeg4highResolution");
var g=this.get("video_mpeg4high_framerate_divider");var e=this.get("video_mpeg4high_bitrate_value");
var c=this.get("mpeg4highRtspLink");var b=this.get("video_sensor_frameinterval");
var a=this.get("video_sensor_timescale");var h=NC.streamController.get("stream1");
if(SC.none(g)||SC.none(b)||SC.none(a)||SC.none(h)||SC.none(e)){return"undefined"}var f=h.displayFramerate(h.calculateFramerate(b,g,a));
e=h.displayBitrate(e,f,a);return["_MPEG-4".loc(),d,f+" "+"_FPS".loc(),e+" "+"_Kbit".loc()," "].join(", ")
}.property("video_sensor_timescale","video_sensor_frameinterval","video_mpeg4high_framerate_divider","video_mpeg4high_bitrate_value","mpeg4highResolution","mpeg4highRtspLink").cacheable(),mpeg4lowResolution:function(){var b=this.get("video_mpeg4low_resolution_width");
var a=this.get("video_mpeg4low_resolution_height");if(SC.none(b)||SC.none(a)){return""
}return"%@ x %@".fmt(b,a)}.property("video_mpeg4low_resolution_width","video_mpeg4low_resolution_height").cacheable(),mpeg4lowRtspLink:function(){return"rtsp://"+location.hostname+"/"+this.get("video_mpeg4low_rtp_name")
}.property("video_mpeg4low_rtp_name").cacheable(),mpeg4lowInfo:function(){var a=this.get("video_mpeg4low_enabled")=="true";
var d=this.get("mpeg4lowResolution");var g=this.get("video_mpeg4low_bitrate_value");
var c=this.get("mpeg4lowRtspLink");var e=this.get("video_sensor_frameinterval");var i=NC.streamController.get("stream1");
var h=this.get("video_sensor_timescale");if(SC.none(d)||SC.none(e)||SC.none(h)||SC.none(i)||SC.none(g)){return"undefined"
}var b=i.displayFramerate(5);g=i.displayBitrate(g,b,h);var f=["_MPEG-4".loc(),d,b+"_FPS".loc(),g+" "+"_Kbit".loc()," "].join(", ");
return a?f:"_disabled".loc()}.property("video_sensor_timescale","video_mpeg4low_enabled","mpeg4lowResolution","video_mpeg4low_bitrate_value","mpeg4lowRtspLink").cacheable(),mjpgLink:function(){return"http://"+location.hostname+""+this.get("video_mjpg_serverpush_path")
}.property("video_mjpg_serverpush_path").cacheable(),mjpgInfo:function(){var b=this.get("video_mjpg_enabled")=="true";
var e=this.get("mjpgResolution");var c=this.get("video_mjpg_framerate_divider");var h=this.get("video_mjpg_quality_value");
var i=this.get("mjpgLink");var f=this.get("video_sensor_frameinterval");var j=this.get("video_sensor_timescale");
var k=NC.streamController.get("stream2");if(SC.none(c)||SC.none(f)||SC.none(j)||SC.none(k)||SC.none(h)){return"undefined"
}var a=["_Quality".loc()+":",h].join(" ");var d=k.displayFramerate(k.calculateFramerate(f,c,j));
var g=["_MJPG".loc(),e,d+"_FPS".loc(),a," "].join(", ");return b?g:"_disabled".loc()
}.property("video_sensor_timescale","video_mjpg_enabled","mjpgResolution","video_sensor_frameinterval","video_mjpg_framerate_divider","video_mjpg_quality_value","mjpgLink").cacheable(),camera_version:function(){var a=this.get("info_version_main");
var b=this.get("info_version_build");if(SC.none(a)||SC.none(b)){return"undefined"
}return"%@ %@ %@".fmt(a,"_Build".loc(),b)}.property("info_version_main","info_version_build").cacheable(),serialValid:function(){var a=NC.dataSrcController.get("info_serial_number");
if(SC.none(a)){return NO}return a.length==8&&/^\d+$/.test(a)}.property("info_serial_number").cacheable(),displayDnsServer:function(){var b=this.get("network_dns0_ip");
var a=this.get("network_dns1_ip");if(SC.none(b)||SC.none(a)){return""}return""+b+(b.length>0?", ":"")+a
}.property("network_dns0_ip","network_dns1_ip").cacheable()});NC.maintenanceController=SC.Object.create({enabledBinding:SC.Binding.oneWay().from("NC.mainController.maintenanceEnabled"),startBtnTitle:function(){var a=this.get("enabled");
return a===true?"_StopMaintenanceMode".loc():"_StartMaintenanceMode".loc()}.property("enabled").cacheable(),startBtnAction:function(){var a=this.get("enabled");
return a===true?"stopMaintenance":"startMaintenance"}.property("enabled").cacheable(),startMaintenanceText:function(){var a=this.get("enabled");
return a===true?"_StopMaintenanceText".loc():"_StartMaintenanceText".loc()}.property("enabled").cacheable(),startMaintenance:function(){console.log("startMaintenance");
NC.mainController.showProgressDialog("_StartMaintenanceModeProgress".loc());NC.ajax.transferData("stopstream",NC.ajax.stopStreamHandler,true)
},stopMaintenance:function(){console.log("stopMaintenance");NC.mainController.showProgressDialog("_StopMaintenanceModeProgress".loc());
NC.ajax.transferData("startstream",NC.ajax.startStreamHandler,true)},formatMMC:function(){console.log("formatMMC");
NC.mainController.showProgressDialog("_FormatMMC_Progress".loc());NC.ajax.transferData("formatmmc",NC.ajax.mmcHandler,true)
},checkMMC:function(){console.log("checkMMC");NC.mainController.showProgressDialog("_CheckMMC_Progress".loc());
NC.ajax.transferData("checkmmc",NC.ajax.mmcHandler,true)},resetDefaultConfiguration:function(){console.log("resetDefaultConfiguration");
NC.ajax.transferData("resetdefaults",NC.ajax.emptyHandler,true);NC.mainController.doLogout()
},defaultsResetDone:function(){console.log("defaultsResetDone");NC.mainController.reloadData()
},alertPaneDidDismiss:function(b,a){switch(a){case SC.BUTTON1_STATUS:if(this.get("mode")==="reset"){this.resetDefaultConfiguration()
}else{if(this.get("mode")==="format"){this.formatMMC()}}break;case SC.BUTTON2_STATUS:break;
case SC.BUTTON3_STATUS:break}},uploadFileChanged:function(a){if(typeof a==="string"&&a.length>0){document.firmware.Upload_Send_Button.disabled=false
}},showFormatDialog:function(){this.set("mode","format");SC.AlertPane.warn("_FormatMMCDialogTitle".loc(),"_FormatMMCDialogText1".loc(),"_FormatMMCDialogText2".loc(),"_FormatMMC".loc(),"_Cancel".loc(),this)
},showResetDialog:function(){this.set("mode","reset");SC.AlertPane.warn("_ResetDefaultsDialogTitle".loc(),"_ResetDefaultsDialogText1".loc(),"_ResetDefaultsDialogText2".loc(),"_ResetDefaults".loc(),"_Cancel".loc(),this)
},transferSerialNumber:function(){var a=NC.dataSrcController.get("info_serial_number");
console.log("transferSerialNumber: %s",a);NC.mainController.showProgressDialog("_SetSerialProgress".loc());
NC.ajax.transferData("setserial="+a,NC.ajax.setSerialHandler,true)}});NC.maskController=SC.Object.extend({img_delta_x:10,img_delta_y:10,savedRecords:null,records:[],mask:null,started:false,changed:false,state_moving:0,state_creating:1,state_idle:2,state:2,maxMaskCount:10,getImageWidth:function(){return NC.dataSrcController.get("video_mjpg_resolution_width")
},getImageHeight:function(){return NC.dataSrcController.get("video_mjpg_resolution_height")
},doStartHandler:function(){this.maskController.doStart()},preventDefault:function(a){if(!a){a=window.event
}if(a.preventDefault){a.preventDefault()}},createMaskHandler:function(a){if(!a){a=window.event
}this.maskController.preventDefault(a);this.maskController.createMask(a)},endResizingHandler:function(a){if(!a){a=window.event
}this.maskController.preventDefault(a);this.maskController.endResizing(a)},performResizingHandler:function(a){if(!a){a=window.event
}this.maskController.preventDefault(a);this.maskController.performResizing(a)},endMovingHandler:function(a){if(!a){a=window.event
}this.maskController.preventDefault(a);this.maskController.endMoving(a,this)},mouseMovingHandler:function(a){if(!a){a=window.event
}this.maskController.preventDefault(a);this.maskController.mouseMoving(a)},performMovingHandler:function(a){if(!a){a=window.event
}this.maskController.preventDefault(a);this.maskController.performMoving(a)},mouseMoving:function(b){var a=this.translateX(b.clientX);
var e=this.translateY(b.clientY);var c=this.findMask(a,e);if(c!=null){var d=this.getCursor(c,a,e);
this.getElement().style.cursor=d}else{this.getElement().style.cursor="normal"}},createMask:function(b){console.log("createMask this="+this);
if(this.state!=this.state_idle){return}var a=this.translateX(b.clientX);var d=this.translateY(b.clientY);
console.log("createMask: clientX=%d clientY=%d x=%d y=%d",b.clientX,b.clientY,a,d);
var c=this.findMask(a,d);if(c!=null){console.log("mask found -> start moving mask=%s",c);
this.startMoving(b,c);return}if(this.getRecords().length>=this.get("maxMaskCount")){this.selectMask(null);
return}this.state=this.state_creating;console.log("createMask do it!");var c=this.createRecord(null);
this.getRecords().push(c);this.addMask(c);c.set("left",this.translateX(b.clientX));
c.set("top",this.translateY(b.clientY));c.set("width",null);c.set("height",null);
c.set("startX",c.get("left"));c.set("startY",c.get("top"));this.selectMask(c);this.getElement().onmousemove=this.performResizingHandler;
this.getElement().style.cursor="normal"},performResizing:function(c){if(this.state!=this.state_creating){return
}var e=this.get("mask");this.getElement().style.cursor="normal";var b=this.translateX(c.clientX);
var f=this.translateY(c.clientY);var d=e.get("startX");var a=e.get("startY");if(d<b){e.set("left",d);
e.set("width",b-d)}else{e.set("left",b);e.set("width",d-b)}if(a<f){e.set("top",a);
e.set("height",f-a)}else{e.set("top",f);e.set("height",a-f)}this.paintMask(e)},endResizing:function(a){if(this.state!=this.state_creating){return
}var b=this.get("mask");if(b.get("width")<10||b.get("height")<10){this.removeMask(b)
}else{this.set("changed",true)}this.getElement().onmousemove=this.mouseMovingHandler;
this.state=this.state_idle},startMoving:function(a,b){console.log("startMoving this="+this);
if(this.state!=this.state_idle){return}var d=b.get("element");var c=this.getElement();
this.selectMask(b);if(c.style.cursor.search("move")==-1){this.state=this.state_creating;
console.log("do resizing");var b=this.get("mask");if(c.style.cursor.search("nw-resize")==0){b.set("startX",b.get("left")+b.get("width"));
b.set("startY",b.get("top")+b.get("height"))}else{if(c.style.cursor.search("sw-resize")==0){b.set("startX",b.get("left")+b.get("width"));
b.set("startY",b.get("top"))}else{if(c.style.cursor.search("ne-resize")==0){b.set("startX",b.get("left"));
b.set("startY",b.get("top")+b.get("height"))}else{if(c.style.cursor.search("se-resize")==0){b.set("startX",b.get("left"));
b.set("startY",b.get("top"))}}}}c.onmousemove=this.performResizingHandler;this.getElement().style.cursor="normal";
return}console.log("startMoving set moving");this.state=this.state_moving;c.onmousemove=this.performMovingHandler;
c.onmouseup=this.endMovingHandler;this.movX=a.clientX;this.movY=a.clientY},performMoving:function(b){if(this.state!=this.state_moving){return
}var d=b.clientX-this.movX;var a=b.clientY-this.movY;var c=this.get("mask");c.move(d,a,this.getImageWidth(),this.getImageHeight());
this.paintMask(c);this.movX=b.clientX;this.movY=b.clientY;this.set("changed",true)
},endMoving:function(a,b){if(this.state!=this.state_moving){return}this.state=this.state_idle;
this.getElement().onmousemove=this.mouseMovingHandler;this.getElement().onmouseup=this.endResizingHandler
},getCursor:function(i,g,e){var b=i.get("left");var f=i.get("top");var a=i.get("width");
var h=i.get("height");var d=15;var c=15;if(g-b<d&&e-f<c){return"nw-resize"}else{if(g-b<d&&f+h-e<c){return"sw-resize"
}else{if(b+a-g<d&&f+h-e<c){return"se-resize"}else{if(b+a-g<d&&e-f<c){return"ne-resize"
}else{return"move"}}}}},changedObserver:function(){console.log("changedObserver: changed="+this.get("changed"));
NC.dataController.data_changed()}.observes("changed"),getImageLayerPath:function(){return""
},getLayerPath:function(){return""},getElement:function(){return NC.getPath(this.getLayerPath()).layer()
},isValid:function(){console.log("isValid");return this.get("savedRecords")!=null&&this.getElement()!=null
},clearCurrentRecords:function(){var a=this.getRecords();for(var b=0;b<a.length;b++){this.getElement().removeChild(a[b].get("element"));
a[b].destroy()}this.set("records",[]);this.set("mask",null)},reset:function(){if(!this.started||!this.isValid()){return
}console.log("NC.maskController reset");this.resetCurrentRecords();console.log("NC.maskController reset records loaded");
this.set("changed",false)},start:function(){if(!this.started){this.started=true;this.set("mask",null);
this.set("changed",false);window.maskController=this;this.interval=window.setInterval(this.doStartHandler,100)
}},stop:function(){this.started=false;this.clearCurrentRecords();this.set("mask",null);
this.set("changed",false)},clear:function(){this.stop();this.clearCurrentRecords();
this.clearRecords(this.get("savedRecords"))},test:function(){console.log("maskTEST=%s",this.getRecords()[0])
},doStart:function(){console.log("doStart element=%s",this.getElement());if(this.isValid()){console.log("doStart valid this="+this);
window.clearInterval(this.interval);this.reset();console.log("doStart set event handler");
this.getElement().maskController=this;this.getElement().onmousedown=this.createMaskHandler;
this.getElement().onmouseup=this.endResizingHandler;this.getElement().onmousemove=this.mouseMovingHandler
}},addMask:function(a){console.log("addMask:"+a);var b=this.createRectElement();a.set("element",b);
b.mask=a;this.paintMask(a);console.log("mask added")},findMask:function(a,d){var b=this.getRecords();
for(var c=0;c<b.length;c++){if(b[c].includes(a,d)){return b[c]}}return null},getScrollOffsetX:function(){return -1*(NC.mainController.get("scrollOffsetX")||0);
var a=window.pageYOffset;if(!a){a=document.body.scrollTop}return -1*a},getScrollOffsetY:function(){return -1*(NC.mainController.get("scrollOffsetY")||0);
var a=window.pageYOffset;if(!a){a=document.body.scrollTop}return -1*a},translateX:function(b){var d=this.img_delta_x;
var a=b-this.getX(this.getElement())-3-d-this.getScrollOffsetX();var c=this.getImageWidth();
a=a<0?0:a;a=a>=c?c-1:a;return a},translateY:function(b){var c=this.img_delta_y;var d=b-this.getY(this.getElement())-3-c-this.getScrollOffsetY();
var a=this.getImageHeight();d=d<0?0:d;d=d>=a?a-1:d;return d},removeMask:function(b){console.log("removeMask");
this.getElement().removeChild(b.get("element"));this.set("mask",null);var c=[];var a=this.getRecords();
for(var d=0;d<a.length;d++){if(a[d]!==b){c.push(a[d])}}b.destroy();this.set("records",c)
},paintMask:function(a){var h=this.img_delta_x;var g=this.img_delta_y;var b=a.get("left")+h;
var e=b+a.get("width");var c=a.get("top")+g;var f=c+a.get("height");var d=a.get("element");
d.style.top=""+(c<f?c:f)+"px";d.style.left=""+(b<e?b:e)+"px";d.style.width=""+(b<e?e-b:b-e)+"px";
d.style.height=""+(c<f?f-c:c-f)+"px"},createRectElement:function(){var a=document.createElement("div");
a.id="blubb";a.style.backgroundColor="rgb(0%,0%,0%)";a.style.borderWidth="1px";a.style.borderStyle="solid";
a.style.borderColor="rgb(150, 150, 150)";a.style.filter="Alpha(Opacity=50)";a.style.opacity=".50";
a.style.position="absolute";a.style.zIndex=2;a.style.top="0px";a.style.left="0px";
a.style.width="0px";a.style.height="0px";this.getElement().appendChild(a);a.maskController=this;
a.onmouseup=this.endMovingHandler;return a},getX:function(b){var a=b.offsetLeft;if(!b.offsetParent){return a
}else{return(a+this.getX(b.offsetParent))}},getY:function(a){var b=a.offsetTop;if(!a.offsetParent){return b
}else{return(b+this.getY(a.offsetParent))}},removeCurrentMask:function(){this.removeMask(this.get("mask"));
this.set("changed",true)},removeButtonEnabled:function(){var a=this.get("mask");return typeof a=="object"&&a!=null
}.property("mask").cacheable(),selectMask:function(a){var b=this.get("mask");if(typeof b=="object"&&b!=null){var c=b.get("element");
c.style.borderColor="rgb(150, 150, 150)";c.style.borderWidth="1px"}if(a!=null){var c=a.get("element");
c.style.borderColor="rgb(0, 0, 255)";c.style.borderWidth="1px"}this.set("mask",a)
},getRecords:function(){return this.get("records")},clearRecords:function(a){if(a==null||typeof a==="undefined"){return
}while(a.length>0){var b=a.pop();b.destroy()}},loadRecords:function(recordHash){var recordArray=eval("("+recordHash+")");
if(this.get("savedRecs")!=null){this.clearRecords(this.get("savedRecs"))}var savedRecs=[];
for(var i=0;i<recordArray.length;i++){savedRecs.push(this.createRecord(recordArray[i]))
}this.set("savedRecords",savedRecs);console.log("loadRecords: createRecords done")
},resetCurrentRecords:function(){this.clearCurrentRecords();var d=this.get("savedRecords");
var c=this.getRecords();for(var b=0;b<d.length;b++){var a=this.createRecord(d[b]);
c.push(a);this.addMask(a)}},saveCurrentRecords:function(){this.clearRecords(this.get("savedRecords"));
var d=this.get("savedRecords");var c=this.getRecords();for(var b=0;b<c.length;b++){var a=this.createRecord(c[b]);
d.push(a)}}});NC.privacyMaskController=NC.maskController.create({menuItem1:"Black",menuItem2:"Grey",menuItem3:"Red",menuItem4:"White",currentColor:"Black",maxMaskCountBinding:SC.Binding.oneWay().from("NC.dataSrcController.video_masks_max"),createRecords:function(a){return NC.mainController.get("store").createRecords(NC.PrivacyMask,a)
},createRecord:function(a){return NC.PrivacyMask.create({left:a==null?0:a.left,top:a==null?0:a.top,height:a==null?0:a.height,width:a==null?0:a.width})
},doLayout:function(c,a){var b=NC.MSK_IMG_TOP;var e=10;NC.getPath("maskPage.privacyView.imageView").set("layout",{centerX:0,top:b,width:c+e*2,height:a+e*2});
NC.getPath("maskPage.privacyView.imageView.imageView").set("layout",{top:e,left:e,width:c,height:a});
var d=NC.BUTTON_WIDTH;NC.getPath("maskPage.privacyView.removeButton").set("layout",{top:b+a+e*2,centerX:(c-d)/2,width:d,height:NC.BUTTON_HEIGHT})
},getImageLayerPath:function(){return"maskPage.privacyView.imageView.imageView"},getLayerPath:function(){return"maskPage.privacyView.imageView"
},getRecordType:function(){return NC.PrivacyMask},getRecordTypeString:function(){return"NC.PrivacyMask"
},save:function(){if(!this.started||!this.get("changed")){return}console.log("NC.privacyMaskController save");
var g=this.getRecordTypeString();var l=this.getRecords();var f="";console.log("save type=%s masks=%s",g,l);
for(var e=0;e<l.length;e++){var b=l[e].get("left");var h=l[e].get("top");var a=l[e].get("width");
var k=l[e].get("height");var c=100;var d=100;var j=100;f+=NC.util.sprintf("left:%d::top:%d::width:%d::height:%d::red:%d::green:%d::blue:%d-",b+0,h+0,a+0,k+0,c+0,d+0,j+0)
}this.saveCurrentRecords();this.set("changed",false);NC.ajax.transferData("sendmasks="+f,NC.ajax.sendMaskHandler,true)
},popupColorMenu:function(){var a=SC.page.get("colorMenu");a.popup(SC.page.get("privacyMaskColorButton"))
},setColor:function(c){var b=c.get("title");this.set("changed",b!=this.get("currentColor"));
this.setIfChanged("currentColor",b);var a=this.get("mask");a.setIfChanged("color",b);
document.body.style.overflow=""},maskChanged:function(){var a=this.get("mask");if(a!=null){this.set("currentColor",a.get("color"))
}}.property("mask"),});NC.motionController=NC.maskController.create({maxMaskCountBinding:SC.Binding.oneWay().from("NC.dataSrcController.video_motion_max"),createRecords:function(a){return NC.mainController.get("store").createRecords(NC.MotionMask,a)
},createRecord:function(a){return NC.MotionMask.create({left:a==null?0:a.left,top:a==null?0:a.top,height:a==null?0:a.height,width:a==null?0:a.width})
},doLayout:function(c,a){var f=NC.MSK_IMG_TOP;var b=f+40;var g=10;NC.getPath("maskPage.motionView.imageView").set("layout",{centerX:0,top:b,width:c+g*2,height:a+g*2});
NC.getPath("maskPage.motionView.imageView.imageView").set("layout",{top:g,left:g,width:c,height:a});
var e=NC.BUTTON_WIDTH;NC.getPath("maskPage.motionView.removeButton").set("layout",{top:b+a+g*2,centerX:(c-e)/2,width:e,height:NC.BUTTON_HEIGHT});
var d=NC.SLIDER_VIEW_WIDTH;NC.getPath("maskPage.motionView.sensitivityView").set("layout",{top:f,centerX:(c-d)/2,width:d,height:NC.SLIDER_VIEW_HEIGHT});
NC.getPath("maskPage.motionView.displayBox").set("layout",{top:f+10,centerX:(d-c)/2,width:d,height:NC.CHECKBOX_HEIGHT})
},getImageLayerPath:function(){return"maskPage.motionView.imageView.imageView"},getLayerPath:function(){return"maskPage.motionView.imageView"
},getRecordType:function(){return NC.MotionMask},getRecordTypeString:function(){return"NC.MotionMask"
},save:function(){if(!this.started||!this.get("changed")){return}var e=this.getRecordTypeString();
var b=this.getRecords();var h="";for(var c=0;c<b.length;c++){var g=b[c].get("left");
var f=b[c].get("top");var d=b[c].get("width");var a=b[c].get("height");h+=NC.util.sprintf("left:%d::top:%d::width:%d::height:%d-",g+0,f+0,d+0,a+0)
}this.saveCurrentRecords();this.set("changed",false);NC.ajax.transferData("sendmmasks="+h,NC.ajax.sendMotionHandler,true)
}});NC.mjpgController=SC.Object.extend({terminate:false,started:false,interval:null,doStartHandler:function(){console.log("NC.mjpgController.doStartHandler...");
if(!NC.mainController.get("running")){console.log("NC.mjpgController.doStartHandler...break");
window.clearInterval(this.mjpgController.interval);this.mjpgController.interval=null
}else{if(this.mjpgController.isValid()){console.log("NC.mjpgController.doStartHandler...start");
window.clearInterval(this.mjpgController.interval);this.mjpgController.interval=null;
this.mjpgController.doStart()}}},start:function(a){console.log("NC.mjpgController.start started=%s layerPath=%s my_layerPath=%s, interval=%s",this.get("started"),a,this.get("layerpath"),this.interval);
if(this.get("started")){if(a===this.get("layerpath")){console.log("NC.mjpgController.start: no change needed");
return}this.stop()}this.set("layerpath",a);this.set("terminate",false);if(this.interval===null){console.log("NC.mjpgController.start: start it");
window.mjpgController=this;this.interval=window.setInterval(this.doStartHandler,100)
}},doStart:function(){if(!this.get("terminate")){this.set("started",true)}},stop:function(){console.log("NC.mjpgController.stop");
this.set("terminate",true);this.set("started",false)},getImageLayer:function(){return NC.getPath(this.get("layerpath")).layer()
},isValid:function(){console.log("isValid");var a=this.getImageLayer();return typeof a!=="undefined"&&a!==null
},update:function(){var b=NC.mainController.get("selection");if(b==="_Liveview".loc()){this.start("liveViewPage.liveView.imageView")
}else{if(b==="_Setup".loc()){var a=NC.setupMenuController.get("currentItem").get("view");
if(a==="maskPage.privacyView"){this.start(NC.privacyMaskController.getImageLayerPath())
}else{if(a==="maskPage.motionView"){this.start(NC.motionController.getImageLayerPath())
}else{this.stop()}}}else{this.stop()}}}});NC.mjpgPollController=NC.mjpgController.create({image_loaded:false,images:new Array(),tstmp:0,framerate:5,doStart:function(){arguments.callee.base.apply(this,arguments);
if(this.get("terminate")){return}if(!this.isMainTimerValid()){this.initMainTimer()
}this.loadNextImage();this.pauseMainTimer(false)},initMainTimer:function(){var a=SC.Timer.schedule({target:NC.mjpgPollController,action:"updateImage",interval:1000/this.get("framerate"),repeats:YES});
this.set("mainTimer",a);this.pauseMainTimer(true)},isMainTimerValid:function(){var a=this.get("mainTimer");
return typeof a!=="undefined"&&a!==null},pauseMainTimer:function(a){console.log("pauseMainTimer pause="+a);
this.get("mainTimer").set("isPaused",a)},stopMainTimer:function(){this.get("mainTimer").invalidate()
},loadNextImage:function(){var b=this.get("tstmp");var a=new Image();a.style.position="absolute";
a.style.zIndex=-1;if(NC.ajax.navigator()==="Explorer"){a.src="http://"+location.hostname+"/jpeg?mode=picture&tstmp="+b
}else{a.src=NC.mainController.getHttpAddress()+"/jpeg?mode=picture&tstmp="+b}a.onload=NC.mjpgPollController.imageOnload;
var c=this.getImageLayer();c.insertBefore(a,c.firstChild)},imageOnload:function(){var c=NC.mjpgPollController.get("tstmp")+1;
NC.mjpgPollController.set("tstmp",c);this.style.zIndex=1;var a=NC.mjpgPollController.get("images");
while(a.length>0){var b=a.shift();b.parentNode.removeChild(b)}a.push(this);NC.mjpgPollController.set("image_loaded",true)
},updateImage:function(){var d=this.get("terminate");var c=this.get("image_loaded");
if(d){var a=NC.mjpgPollController.get("images");while(a.length>0){var b=a.shift();
b.parentNode.removeChild(b)}this.pauseMainTimer(true)}else{if(c){this.loadNextImage();
this.set("image_loaded",false)}}}});NC.mjpgPushController=NC.mjpgController.create({image:new Image(),doStart:function(){if(this.get("terminate")){return
}console.log("NC.mjpgPushController doStart started=%s",this.get("started"));if(!this.get("started")){var b=this.get("image");
b.style.position="absolute";b.style.zIndex=1;b.src=NC.mainController.getHttpAddress()+"/jpeg?mode=stream";
var a=this.getImageLayer();a.insertBefore(b,a.firstChild);this.set("started",true)
}},stop:function(){console.log("NC.mjpgPushController.stop started=%s",this.get("started"));
if(this.get("started")){var a=this.get("image");a.src=NC.mainController.getHttpAddress()+"/jpeg?mode=picture";
a.parentNode.removeChild(a)}arguments.callee.base.apply(this,arguments)}});NC.uploadSucceededPaneController=SC.Object.create({alertPaneDidDismiss:function(b,a){switch(a){case SC.BUTTON1_STATUS:NC.ajax.transferData("reboot",NC.ajax.emptyHandler,true);
NC.mainController.doLogout();break;case SC.BUTTON2_STATUS:NC.mainController.showProgressDialog("_CancelUploadProgress".loc());
NC.ajax.transferData("cancelupload",NC.ajax.emptyProgressHandler,true);break;case SC.BUTTON3_STATUS:break
}}});NC.uploadFailedPaneController=SC.Object.create({alertPaneDidDismiss:function(b,a){switch(a){case SC.BUTTON1_STATUS:break;
case SC.BUTTON2_STATUS:break;case SC.BUTTON3_STATUS:break}}});NC.progressController=SC.Object.create({cancelEnabled:true,value:0,pane:null,description:"",openPane:function(b,a){if(this.get("pane")==null){console.log("open progress pane");
this.set("pane",NC.ProgressPane.open(b,this))}var c=this.get("pane");c.contentView.childViews[3].set("isVisible",a);
this.set("value",0);this.set("description",b);if(!c.get("isPaneAttached")){c.append()
}},closePane:function(){var a=this.get("pane");if(a!=null&&a.get("isPaneAttached")){console.log("progressController: remove pane");
a.remove()}},cancel:function(){console.log("cancel");NC.mainController.cancelProgress();
var a=NC.progressController.get("cancelAction");var b=NC.progressController.get("cancelActionTarget");
console.log("call cancel action action=%s target=%s",typeof a,typeof b);a.call(b)
}});NC.RECORDER_PROPS=["options_mode","options_stream","alarm_event_motion","alarm_event_input","store_type","alarm_preduration_value","alarm_postduration_value"];
NC.RECORDER_CONSTANTS=["alarm_preduration_min","alarm_preduration_max","alarm_preduration_step","alarm_postduration_min","alarm_postduration_max","alarm_postduration_step"];
NC.recorder=SC.Object.extend({properties:[],getConstantProperties:function(){return NC.RECORDER_CONSTANTS
},getVariableProperties:function(){return NC.RECORDER_PROPS},getAbsoluteProperties:function(){return[]
},init:function(){arguments.callee.base.apply(this,arguments);var e=[];var a=this.get("propHeader");
var b=this.getVariableProperties();for(var d=0;d<b.length;d++){var f=a+"_"+b[d];NC.dataController.set(f,null);
this.bind(b[d],NC.dataController,f);e.push(f)}e=e.concat(this.getAbsoluteProperties());
this.set("properties",e);var c=this.getConstantProperties();for(var d=0;d<c.length;
d++){var f=a+"_"+c[d];this.bind(c[d],NC.dataSrcController,f).oneWay()}},recordingEnabled:function(){return this.get("options_mode")!=="off"
}.property("options_mode").cacheable(),alarmEnabled:function(){return this.get("options_mode")==="alarm"
}.property("options_mode").cacheable(),sambaEnabled:function(){return this.get("store_type")==="samba"
}.property("store_type").cacheable(),ftpEnabled:function(){return this.get("store_type")==="ftp"
}.property("store_type").cacheable(),nvrEnabled:function(){return this.get("store_type")==="nvr"
}.property("store_type").cacheable(),prealarmEnabled:function(){return this.get("alarmEnabled")
}.property("alarmEnabled").cacheable(),});sc_require("controllers/recording/recorder");
NC.IMAGE_RECORDER_PROPS=["options_interval","store_ftp_server","store_ftp_user","store_ftp_password","store_ftp_path","store_ftp_size","store_nvr_server","store_nvr_port"];
NC.IMAGE_RECORDER_ABSOLUTE_PROPS=["video_mjpg_quality_value","video_mjpg1_quality_value","video_mjpg3_quality_value"];
NC.IMAGE_RECORDER_STREAM_ITEMS=[{title:"_JPEGStream1Title".loc(),value:"jpeg-1",enabled:YES},{title:"_JPEGStream2Title".loc(),value:"jpeg-2",enabled:YES},{title:"_JPEGStream3Title".loc(),value:"jpeg-3",enabled:YES}];
NC.imageRecorder=NC.recorder.create({propHeader:"recording_image",streamItems:NC.IMAGE_RECORDER_STREAM_ITEMS,intervalArray:[500,1000,2000,3000,5000,10000,20000,30000,45000,60000,120000,180000,300000,600000,1200000,1800000,2700000,3600000],displayInterval:function(){var a=this.get("options_interval");
if(SC.none(a)){return"undefined"}return a<60000?a/1000:a/60000}.property("options_interval").cacheable(),displayIntervalName:function(){var a=this.get("options_interval");
var b="_SendInterval".loc("_sec".loc());if(SC.none(a)){return b}return a<60000?b:"_SendInterval".loc("_min".loc())
}.property("options_interval").cacheable(),jpegStream1Selected:function(){var a=this.get("options_stream");
return a==="jpeg-1"}.property("options_stream").cacheable(),jpegStream2Selected:function(){var a=this.get("options_stream");
return a==="jpeg-2"}.property("options_stream").cacheable(),jpegStream3Selected:function(){var a=this.get("options_stream");
return a==="jpeg-3"}.property("options_stream").cacheable(),getVariableProperties:function(){array=arguments.callee.base.apply(this,arguments);
return array.concat(NC.IMAGE_RECORDER_PROPS)},getAbsoluteProperties:function(){array=arguments.callee.base.apply(this,arguments);
return array.concat(NC.IMAGE_RECORDER_ABSOLUTE_PROPS)},prealarmEnabled:function(){return NO
}.property("alarmEnabled").cacheable(),});sc_require("controllers/recording/recorder");
NC.VIDEO_RECORDER_CONSTANTS=["options_duration_min","options_duration_max","options_duration_step"];
NC.VIDEO_RECORDER_PROPS=["options_autodelete","options_container","options_duration_value","store_samba_share","store_samba_user","store_samba_password","store_samba_path","store_samba_size"];
NC.VIDEO_RECORDER_STREAM_ITEMS=[{title:"_MPEG4Stream1Title".loc(),value:"mpeg4-1",enabled:YES},{title:"_MPEG4Stream2Title".loc(),value:"mpeg4-2",enabled:YES}];
NC.videoRecorder=NC.recorder.create({propHeader:"recording_video",streamItems:NC.VIDEO_RECORDER_STREAM_ITEMS,getConstantProperties:function(){array=arguments.callee.base.apply(this,arguments);
return array.concat(NC.VIDEO_RECORDER_CONSTANTS)},getVariableProperties:function(){array=arguments.callee.base.apply(this,arguments);
return array.concat(NC.VIDEO_RECORDER_PROPS)}});NC.recordsController=SC.TreeController.create({recordSelected:NO,recordsPropMap:[],records:[],sortProp:"name",sortUp:true,allowsMultipleSelection:YES,sortAction:[],storeSize:0,storeFree:0,initialize:function(){this.clearRecords();
this.selectObject(null);NC.videoController.set("content",null)},sortPropChanged:function(){if(this.get("sortAction").length!==2){return
}this.set("sortProp",this.get("sortAction")[0]);this.set("sortUp",this.get("sortAction")[1]);
var d=this.get("selection").toArray();var a=this.get("records");a.sort(this.recordSort);
var c=[];for(var b=0;b<a.length;b++){c.push(a[b])}this.set("records",c);this.selectObjects(d)
}.observes("sortAction"),recordSort:function(e,b){var f=NC.recordsController.get("sortProp");
var d=NC.recordsController.get("sortUp");var c=e.get(f);var a=b.get(f);if(c<a){return d?-1:1
}else{if(c>a){return d?1:-1}else{return 0}}},getRecords:function(){return this.get("records")
}.property("records").cacheable(),clearRecords:function(){var a=this.getRecords();
for(var b=0;b<a.length;b++){a[b].destroy()}this.set("records",[])},loadRecords:function(){NC.mainController.showProgressDialog("_LoadRecords".loc());
NC.ajax.loadData("recfiles",NC.ajax.loadRecordFilesHandler)},recordsLoaded:function(jsonRecords){console.log("NC.recordsController::recordsLoaded jsonRecords="+jsonRecords);
console.log("recordsLoaded: evalHash...");var recordsHash=eval("("+jsonRecords+")");
console.log("recordsLoaded: clearRecords...");this.clearRecords();console.log("recordsLoaded: createRecords...");
var records=NC.mainController.get("store").createRecords(NC.RecordFile,recordsHash);
console.log("recordsLoaded: createRecords done");records.sort(this.recordSort);this.set("records",records);
if(records.length>0){this.selectObject(records[0])}else{this.selectObject(null)}NC.mainController.hideProgressDialog()
},repairEnabled:function(){if(!NC.mainController.get("maintenanceEnabled")){return false
}if(this.get("selection").toArray().length!=1){return false}return this.get("selection").firstObject().get("incomplete")
}.property("selection"),selectionChanged:function(){var b=this.get("records");if(this.get("selection").toArray().length==0){if(b.length>0){this.selectObject(b[0])
}this.set("recordSelected",NO);NC.videoController.set("content",null)}else{var a=this.get("selection").firstObject();
NC.videoController.set("content",a);this.set("recordSelected",YES)}}.observes("selection"),exportRecords:function(){var a="/card/"+NC.videoController.get("name");
console.log("exportRecords path=%s",a);SC.download(a)},deleteRecords:function(){console.log("deleteRecords");
this.showDeleteWarnDialog()},doDeleteRecords:function(){console.log("doDeleteRecords");
var c="";var a=this.get("selection").toArray();for(var b=0;b<a.length;b++){c+=b==0?"":NC.DATA_DELIMITER;
c+=a[b].get("path")}console.log("doDeleteRecords=%s",c);NC.mainController.showProgressDialog("_DeleteRecords".loc());
NC.ajax.transferData("delrecords="+c,NC.ajax.removeRecordFilesHandler,true)},refreshRecords:function(){this.loadRecords()
},repairRecord:function(){console.log("repairRecord");var a=this.get("selection").firstObject().get("path");
NC.mainController.showProgressDialog("_RepairRecordProgress".loc(),NC.recordsController.repairRecordDone,this,NC.recordsController.cancelRepair,this);
NC.ajax.transferData("reprecord="+a,NC.ajax.emptyHandler,true)},cancelRepair:function(){console.log("cancelRepair");
NC.mainController.showProgressDialog("_CancelRepairProgress".loc());NC.ajax.transferData("cancelrepair",NC.ajax.emptyProgressHandler,true)
},repairRecordDone:function(f){console.log("repairRecordDone...sel");var c=this.get("selection");
var b=null;if(typeof c==="object"&&c.kindOf(SC.SelectionSet)){b=this.get("selection").firstObject()
}var e="";if(typeof b!=="undefined"&&b!=null){e=b.get("name")}var a="_RepairingSucceeded".loc().replace(/%1/g,e);
var d="_RepairingFailed".loc().replace(/%1/g,e);SC.AlertPane.info(f?a:d);if(f){this.loadRecords()
}console.log("repairRecordDone...done")},alertPaneDidDismiss:function(b,a){switch(a){case SC.BUTTON1_STATUS:this.doDeleteRecords();
break;case SC.BUTTON2_STATUS:break;case SC.BUTTON3_STATUS:break}},showDeleteWarnDialog:function(){SC.AlertPane.warn("_DeleteVideoTitle".loc(),"_DeleteVideoText".loc(),"","_Delete".loc(),"_Cancel".loc(),this)
},displaySpace:function(){var c=(this.get("storeSize")/1024/1024).toFixed(2);var b=(this.get("storeFree")/1024/1024).toFixed(2);
var d="_Size".loc()+": "+c+" "+"_MB".loc();var a="_Free".loc()+": "+b+" "+"_MB".loc();
return c>0?d+" | "+a:"_NoCard".loc()}.property("storeSize","storeFree").cacheable()});
NC.TableController=SC.ArrayController.extend({sortProperty:null,sortColumn:null,handleColumnSort:function(c,d,a){var e=this.get("content").sortProperty(c);
var b=d.get("sortState");if(!b){return}console.log("SORT STATE FOR  property="+c+"  with sort="+b);
if(b===SC.SORT_DESCENDING){this.set("content",e.reverse())}else{this.set("content",e)
}a.set("content",e);a.displayDidChange();a.awake();this.sortProperty=c;this.sortColumn=d
},updateContent:function(c,a){var b=this.get("selectedObject");this.set("content",c);
if(this.sortProperty!=null&&this.sortColumn!=null){this.handleColumnSort(this.sortProperty,this.sortColumn,a)
}else{a.set("content",c);a.displayDidChange();a.awake()}if(c.get("length")==0){this.selectObject(null)
}else{if(b&&(b.status()&SC.Record.READY)){this.selectObject(b)}else{this.set("selection",[])
}}},selectedObject:function(){var a=this.get("content");if(!a||this.get("content").get("length")==0){return null
}var b=this.get("selection");return b.length()>0?b.firstObject():null}.property("content","selection").cacheable()});
require("controllers/table");NC.recordsNewController=NC.TableController.create({allowsMultipleSelection:NO,initialize:function(){var a=NC.getPath("recordPage.recordView.tableView");
this.tableView=a;this.update()},addColumnObserver:function(c,a,d){var b=d;if(SC.none(b)){b=c.key
}c.addObserver("sortState",function(){NC.recordsNewController.handleColumnSort(b,c,a)
})},update:function(){console.log("update");var a=NC.recordsController.get("records");
this.updateContent(a,this.tableView);if(a.length()==0){this.selectObject(null)}},findRequestsByUser:function(b,a){if(SC.none(a)){return null
}var c=SC.Query.local(NC.Request,{conditions:"user = {user}",parameters:{user:a}});
return b.find(c).toArray()},findRequestsByCamera:function(a,b){if(SC.none(b)){return null
}var c=SC.Query.local(NC.Request,{conditions:"camera = {camera}",parameters:{camera:b}});
return a.find(c).toArray()},downloadRequest:function(){var c=this.get("selectedObject");
if(SC.none(c)||c.get("state")!=NC.REQ_STATE_DONE){return}var b=c.get("camera");if(SC.none(b)){return
}var a=b.get("serial");var d="/videos/"+a+"/"+c.get("guid")+"/"+c.get("filename");
console.log("downloadRequest path=%s",d);SC.download(d)},deleteRequest:function(){console.log("deleteRequest");
var a=this.get("selectedObject");if(SC.none(a)){return}a.destroy();NC.mainController.save()
},downloadEnabled:function(){var a=this.get("selectedObject");if(SC.none(a)){return NO
}return a.get("state")==NC.REQ_STATE_DONE}.property("selectedObject")});NC.setupMenuController=SC.TreeController.create({allowsEmptySelection:false,allowsMultipleSelection:false,content:null,currentItem:null,treeItemIsGrouped:YES,treeItemChildrenKey:"setupGroups",currentView:function(){var a=this.get("currentItem");
return a===null?null:a.getView()}.property("currentItem").cacheable(),initSelection:function(){console.log("initSelection currentItem=%s",this.get("currentItem"));
var a=NC.mainController.get("store").find(NC.SetupMenuItem,1);console.log("initSelection select:"+a);
this.selectObject(a);console.log("initSelection: setSetupView");this.setSetupView(a);
console.log("initSelection: reset");NC.dataController.reset();console.log("initSelection: reset done")
},resetSelection:function(){this.selectObject(this.get("currentItem"))},setSetupView:function(a){NC.timeController.pauseTimer(a.get("view")!=="timePage.timeView");
NC.privacyMaskController.stop();NC.motionController.stop();if(a.get("view")==="userPage.userView"){NC.usersController.loadUser()
}if(a.get("view")==="maskPage.privacyView"){NC.privacyMaskController.start()}if(a.get("view")==="maskPage.motionView"){NC.motionController.start()
}this.set("currentItem",a);var b=NC.getPath("setupPage.setupView.dataView");b.set("nowShowing",this.get("currentView"));
NC.mainController.getMjpgController().update()},updateSetupView:function(){console.log("updateSetupView...");
var a=this.get("selection").firstObject();this.setSetupView(a)},action:function(a){console.log("action item=%s selection=%s",this.get("selection").firstObject(),a.get("selection").firstObject());
var c=this.get("currentItem");var b=a.get("selection").firstObject();if(b===c){return
}NC.dataController.removePropObserver(c);if(NC.dataController.get("saveEnabled")){console.log("showDialog");
NC.dataController.showSaveDialog("setupMenuChanged")}else{this.setSetupView(b);NC.dataController.reset()
}},});NC.Stream=SC.Object.extend({sliderDivider:1,framerate:0,frameInterval:0,bitrate:0,timescale:30,framerateDividerObserver:function(){var a=this.get("framerateDivider");
this.set("sliderDivider",a.length>0?a[0]:1);this.updateFramerate()}.observes("framerateDivider"),updateFramerate:function(){var c=this.get("divider");
var b=NC.streamController.get("sensorFrameInterval");var a=this.get("timescale");
if(SC.none(a)||SC.none(c)||SC.none(b)){return}this.beginPropertyChanges();this.set("framerate",this.calculateFramerate(b,c,a));
this.set("frameInterval",b*c*1000/a);this.endPropertyChanges()},timescaleObserver:function(){if(SC.none(this.get("timescale"))){return
}this.updateFramerate()}.observes("timescale"),dividerObserver:function(){var a=this.get("divider");
if(SC.none(a)){return}this.setIfChanged("sliderDivider",a);this.updateFramerate()
}.observes("divider"),sliderDividerObserver:function(){var a=this.get("sliderDivider");
if(SC.none(a)){return}this.setIfChanged("divider",a);this.updateFramerate()}.observes("sliderDivider"),framerateDisplay:function(){var a=this.get("framerate");
if(SC.none(a)){return"undefined"}return this.displayFramerate(a)}.property("framerate").cacheable(),frameIntervalDisplay:function(){var a=this.get("frameInterval");
if(SC.none(a)){return 0}a=Math.round(a);return a>=1000?a/1000:a}.property("frameInterval").cacheable(),frameIntervalName:function(){var b=this.get("frameInterval");
var a=SC.none(b)||b>=1000?"_s".loc():"_ms".loc();return"_FrameInterval".loc()+" ("+a+")"
}.property("frameInterval").cacheable(),bitrateDisplay:function(){var b=this.get("bitrate");
var c=this.get("framerate");var a=this.get("timescale");if(SC.none(b)||SC.none(c)||SC.none(a)){return 0
}return this.displayBitrate(b,c,a)}.property("bitrate","framerate","timescale").cacheable(),calculateFramerate:function(b,c,a){if(SC.none(b)||SC.none(c)||SC.none(a)){return 0
}return a/(c*b)},displayBitrate:function(b,c,a){bitrate_c=b*c/a;if(bitrate_c>=100){bitrate_c=Math.round(bitrate_c)
}else{bitrate_c=Math.round(bitrate_c*10)/10}return bitrate_c},displayFramerate:function(a){return Math.round(100*a)/100
}});require("models/stream.js");NC.streamController=SC.Object.create({sensorFrameIntervals:[1,2,3,6,10,15],frameIntervals:[1,2,3,6,10,15,30,60,150,300,900,1800],stream1:NC.Stream.create({dividerBinding:SC.Binding.from("NC.dataController.video_mpeg4high_framerate_divider"),bitrateBinding:SC.Binding.from("NC.dataController.video_mpeg4high_bitrate_value").oneWay(),timescaleBinding:SC.Binding.from("NC.dataController.video_sensor_timescale").oneWay()}),stream2:NC.Stream.create({dividerBinding:SC.Binding.from("NC.dataController.video_mjpg_framerate_divider"),timescaleBinding:SC.Binding.from("NC.dataController.video_sensor_timescale").oneWay()}),timescaleBinding:SC.Binding.from("NC.dataController.video_sensor_timescale").oneWay(),sensorFrameIntervalObserver:function(){NC.dataController.updateSensorFrameInterval(this.get("sensorFrameInterval"))
}.observes("sensorFrameInterval"),updateDivider:function(){var k=this.get("stream1");
var j=this.get("stream2");var d=this.frameIntervals;var h=this.get("sensorFrameInterval");
var m=[];var l=[];var g=null;var f=null;for(var e=0;e<d.length;e++){var a=d[e];if(h<=a){var c=Math.round(a/h);
if(g<c){m.push(c);g=c}var b=c+c%2;if(f<b){l.push(b);f=b}}}k.set("framerateDivider",m);
j.set("framerateDivider",l)},sensorFrameIntervalLabel:function(){var b=this.get("sensorFrameInterval");
var a=this.get("timescale");if(SC.none(b)||SC.none(a)){return"undefined"}return Math.round(b*1000/a).toString()
}.property("sensorFrameInterval","timescale").cacheable(),sensorMaximumFramerateLabel:function(){var b=this.get("sensorFrameInterval");
var a=this.get("timescale");if(SC.none(b)||SC.none(a)){return"undefined"}return(Math.round(a*100/b)/100).toString()
}.property("sensorFrameInterval","timescale").cacheable(),updateSensorFrameInterval:function(a){if(typeof a==="undefined"){return
}this.removeObserver("sensorFrameInterval",this,this.sensorFrameIntervalObserver);
this.setIfChanged("sensorFrameInterval",a);this.updateDivider();this.addObserver("sensorFrameInterval",this,this.sensorFrameIntervalObserver)
},reset:function(){var a=NC.dataSrcController.get("video_sensor_frameinterval");var c=NC.dataSrcController.get("video_mpeg4high_framerate_divider");
var b=NC.dataSrcController.get("video_mjpg_framerate_divider");this.setIfChanged("sensorFrameInterval",a);
this.get("stream1").set("divider",c);this.get("stream2").set("divider",b)}});NC.timeController=SC.Object.create({timezones:null,manualTime:"",manualDate:"",initTimer:function(){var a=SC.Timer.schedule({target:NC.timeController,action:"updateClientTime",interval:1000,repeats:YES});
this.set("clientTimer",a);this.pauseTimer(true);this.updateClientTime()},stopTimer:function(){this.get("clientTimer").invalidate()
},updateClientTime:function(){var d=new Date();var c=(d.getTimezoneOffset()/60)*(-1);
var e=Math.floor(Math.abs(c));var a=(Math.abs(c)-e)*60;var f=NC.util.sprintf("GMT%s%02d:%02d",c>=0?"+":"-",e,a);
var b=NC.util.sprintf("%04d-%02d-%02d %02d:%02d:%02d %s",d.getFullYear(),d.getMonth()+1,d.getDate(),d.getHours(),d.getMinutes(),d.getSeconds(),f);
this.set("localTime",b)},pauseTimer:function(a){this.get("clientTimer").set("isPaused",a)
},synchWithClientTime:function(){this.sendServerTime(new Date())},synchWithManualTime:function(){var b=this.get("manualTime");
var a=this.get("manualDate");this.sendServerTime("%@_%@".fmt(a,b))},synchWithNtpTime:function(){var a="settime=ntp";
NC.mainController.showProgressDialog("_SyncNTPTimeProgress".loc());NC.ajax.transferData(a,NC.ajax.setNtpTimeHandler,true)
},sendServerTime:function(a){var b="settime=";if(typeof a==="string"){b+=a}else{b+=a.getTime()
}NC.mainController.showProgressDialog("_SetTimeProgress".loc());NC.ajax.transferData(b,NC.ajax.sendTimeHandler,true)
},createTimezone:function(a){return NC.Timezone.create({path:a.path,display:a.display})
},loadTimezones:function(recordHash){var recordArray=eval("("+recordHash+")");var timezones=[];
for(var i=0;i<recordArray.length;i++){timezones.push(this.createTimezone(recordArray[i]))
}this.set("timezones",timezones)},isManualButtonEnabled:function(){var d=this.get("manualTime");
var c=this.get("manualDate");var b=/^\d\d:\d\d:\d\d$/.test(d);var a=/^\d\d\d\d-\d\d-\d\d$/.test(c);
return b&&a}.property("manualTime","manualDate").cacheable()});NC.umtsController=SC.Object.create({upstreamRate:1500,downstreamRate:3000,connection:"UMTS",signalStrength:-200,upstreamRateDisplay:function(){return""+this.get("upstreamRate")+" "+"_Kbit".loc()
}.property("upstreamRate").cacheable(),downstreamRateDisplay:function(){return""+this.get("downstreamRate")+" "+"_Kbit".loc()
}.property("downstreamRate").cacheable(),signalDisplay:function(){var a=this.get("signalStrength");
return"("+a+" "+"_DBM".loc()+")"}.property("signalStrength").cacheable(),signalImage:function(){var a=this.get("signalStrength");
var b="nc-icon-umts-signal-0";if(a>-76){b="nc-icon-umts-signal-5"}else{if(a>-87){b="nc-icon-umts-signal-4"
}else{if(a>-98){b="nc-icon-umts-signal-3"}else{if(a>-107){b="nc-icon-umts-signal-2"
}else{b="nc-icon-umts-signal-1"}}}}return b}.property("signalStrength").cacheable()});
NC.userController=SC.ObjectController.create({passwordValid:function(){var b=this.get("password");
var a=this.get("confirm");return b.length>4&&b===a}.property("password","confirm").cacheable(),nameValid:function(){return this.get("name").length>2
}.property("name").cacheable(),addEnabled:function(){var b=this.get("passwordValid");
var c=this.get("nameValid");if(!b||!c){return false}var a=this.get("name");return !NC.usersController.userNameExist(a)
}.property("name","passwordValid").cacheable(),editEnabled:function(){var b=this.get("passwordValid");
var c=this.get("nameValid");if(!b||!c){return false}if(NC.usersController.onlySelectionIsAdmin()){return this.get("group")==1
}var a=this.get("name");return !NC.usersController.userNameExist(a)||NC.usersController.isUserSelected(a)
}.property("name","group","passwordValid").cacheable(),});NC.usersController=SC.TreeController.create({users:[],sortProp:"name",sortUp:true,sortAction:[],allowsMultipleSelection:NO,userSelected:NO,changed:false,initialize:function(){this.clearUsers();
this.selectObject(null);NC.userController.set("content",this.createDummyUser("",1,"",""))
},createDummyUser:function(b,d,c,a){return SC.Object.create({name:b,group:d,password:c,confirm:a})
},sortPropChanged:function(){if(this.get("sortAction").length!==2){return}this.set("sortProp",this.get("sortAction")[0]);
this.set("sortUp",this.get("sortAction")[1]);var c=this.get("selection").toArray();
var d=this.get("users");d.sort(this.userSort);var a=[];for(var b=0;b<d.length;b++){a.push(d[b])
}this.set("users",a);this.selectObjects(c)}.observes("sortAction"),userSort:function(f,d){console.log("userSort user1=%s user2=%s",f,d);
var e=NC.usersController.get("sortProp");var c=NC.usersController.get("sortUp");var b=f.get(e);
var a=d.get(e);console.log("userSort prop=%s sortUp=%s value1=%s value2=%s",e,c,b,a);
if(b<a){return c?-1:1}else{if(b>a){return c?1:-1}else{return 0}}},getUsers:function(){return this.get("users")
}.property("users").cacheable(),clearUsers:function(){var b=this.getUsers();for(var a=0;
a<b.length;a++){b[a].destroy()}this.set("users",[])},loadUser:function(){NC.ajax.loadData("users",NC.ajax.userHandler)
},usersLoaded:function(jsonRecords){console.log("NC.usersController::usersLoaded jsonRecords="+jsonRecords);
console.log("usersLoaded: evalHash...");var usersHash=eval("("+jsonRecords+")");console.log("usersLoaded: clearUsers...");
this.clearUsers();console.log("usersLoaded: createRecords...");var users=NC.mainController.get("store").createRecords(NC.User,usersHash);
console.log("usersLoaded: createRecords done users=%s",users);users.sort(this.userSort);
console.log("sorted users=%s",users);this.set("users",users);if(users.length>0){this.selectObject(users[0])
}else{this.selectObject(null)}},selectionChanged:function(){var b=this.get("users");
if(this.get("selection").toArray().length==0){if(b.length>0){this.selectObject(b[0])
}this.set("userSelected",NO);NC.userController.set("content",this.createDummyUser("",1,"",""))
}else{var a=this.get("selection").firstObject();NC.userController.set("content",this.createDummyUser(a.get("name"),a.get("group"),"",""));
this.set("userSelected",YES)}}.observes("selection"),adminCount:function(){var b=0;
var c=this.get("users");for(var a=0;a<c.length;a++){if(c[a].get("group")==1){b++}}return b
},onlySelectionIsAdmin:function(){if(this.adminCount()!=1){return false}var a=this.get("selection");
if(a.toArray().length==0){return false}return a.firstObject().get("group")==1}.property("selection"),userNameExist:function(a){var c=this.get("users");
for(var b=0;b<c.length;b++){if(c[b].get("name")===a){return true}}return false},isUserSelected:function(a){var b=this.get("selection");
return b.firstObject().get("name")===a},removeEnabled:function(){var a=this.get("selection");
if(a.toArray().length==0){return false}return !this.get("onlySelectionIsAdmin")}.property("selection"),addUser:function(){this.set("changed",true);
var a=NC.userController.get("name");var c=NC.userController.get("group");var b=NC.userController.get("password");
var d=a+NC.DATA_DELIMITER+c+NC.DATA_DELIMITER+b;NC.ajax.transferData("adduser="+d,NC.ajax.removeUserHandler,true)
},editUser:function(){this.set("changed",true);var a=this.get("selection").firstObject();
var b=a.get("name");NC.ajax.transferData("deluser="+b,NC.ajax.emptyHandler,true);
this.addUser()},removeUser:function(){this.set("changed",true);var a=this.get("selection").firstObject();
var b=a.get("name");NC.ajax.transferData("deluser="+b,NC.ajax.removeUserHandler,true)
},doRemoveUser:function(){this.loadUser()},reset:function(){if(this.get("changed")){NC.ajax.transferData("resetusers",NC.ajax.userHandler,true);
this.set("changed",false)}},save:function(){if(this.get("changed")){NC.ajax.transferData("saveusers",NC.ajax.emptyHandler,true);
this.set("changed",false)}},changedObserver:function(){NC.dataController.data_changed()
}.observes("changed")});NC.videoController=SC.ObjectController.create({});NC.BUTTON_WIDTH=110;
NC.BUTTON_HEIGHT=25;NC.TITLE_HEIGHT=20;NC.TITLE_TOP=20;NC.TITLEVIEW_HEIGHT=3*NC.TITLE_HEIGHT+10;
NC.DATA_LEFT=30;NC.LABEL_HEIGHT=18;NC.TEXT_FIELD_HEIGHT=18;NC.CHECKBOX_HEIGHT=18;
NC.LABELED_TEXT_FIELD_HEIGHT=30;NC.SLIDER_HEIGHT=18;NC.SLIDER_VAL_LEFT=210;NC.SELECT_FIELD_HEIGHT=20;
NC.TEXTFIELD_WIDTH=150;NC.TEXT_ROW_HEIGHT=30;NC.SEPARATOR_HEIGHT=30;NC.SETUP_MENU_WIDTH=208;
NC.SETUP_ACTION_HEIGHT=53;NC.SLIDER_VIEW_HEIGHT=40;NC.SLIDER_VIEW_WIDTH=250;NC.REC_ROW2_LEFT=350;
NC.MAIN_PANE_WIDTH=950;NC.MAIN_PANE_HEIGHT=900;NC.MAIN_PANE_TITLE_TOP=11;NC.MAIN_PANE_TITLE_HEIGHT=146;
NC.MAIN_PANE_MENU_TOP=169;NC.MAIN_PANE_MENU_HEIGHT=39;NC.MAIN_PANE_MAIN_TOP=213;NC.MAIN_PANE_MAIN_HEIGHT=644;
NC.TITLE_VIEW_BUTTON_TOP=8;NC.TITLE_VIEW_LOGOUT_BUTTON_RIGHT=10;NC.TITLE_VIEW_LOGOUT_BUTTON_WIDTH=80;
NC.TITLE_VIEW_SEG_VIEW_LEFT=10;NC.TITLE_VIEW_SEG_VIEW_WIDTH=200;NC.mainPage=SC.Page.design({mainPane:SC.MainPane.design({layout:{centerX:0,width:NC.MAIN_PANE_WIDTH,height:NC.MAIN_PANE_HEIGHT},classNames:"main_pane",childViews:"titleView menuView mainView".w(),titleView:SC.View.design({layout:{top:NC.MAIN_PANE_TITLE_TOP,height:NC.MAIN_PANE_TITLE_HEIGHT},classNames:"sc-gray-border"}),menuView:SC.View.design({layout:{top:NC.MAIN_PANE_MENU_TOP,height:NC.MAIN_PANE_MENU_HEIGHT},classNames:"sc-gray-border",childViews:"logoutButton segView".w(),logoutButton:SC.ButtonView.design().layout({right:NC.TITLE_VIEW_LOGOUT_BUTTON_RIGHT,top:NC.TITLE_VIEW_BUTTON_TOP,width:NC.TITLE_VIEW_LOGOUT_BUTTON_WIDTH,height:NC.BUTTON_HEIGHT}).prop("title","_Logout".loc()).prop("action","logout").prop("target","NC.mainController").prop("isDefault",YES),segView:SC.SegmentedView.design({layout:{left:NC.TITLE_VIEW_SEG_VIEW_LEFT,top:NC.TITLE_VIEW_BUTTON_TOP,width:NC.TITLE_VIEW_SEG_VIEW_WIDTH,height:NC.BUTTON_HEIGHT},itemsBinding:"NC.mainController.menuItems",valueBinding:"NC.mainController.selection",isEnabledB:YES})}),mainView:SC.View.design({layout:{top:NC.MAIN_PANE_MAIN_TOP,height:NC.MAIN_PANE_MAIN_HEIGHT},classNames:"sc-gray-border",childViews:"containerView".w(),containerView:SC.ContainerView.design({})})}),testPane:SC.MainPane.design({childViews:"labelView".w(),labelView:SC.LabelView.design({layout:{centerX:0,centerY:0,width:100,height:18},tagName:"h1",value:"Hallo Du Nase"})}),testPane2:SC.MainPane.design({childViews:"containerView".w(),containerView:SC.ContainerView.design({layout:{centerX:0,centerY:0,width:500,height:500},})}),container3:SC.LabelView.design({value:"Container3",layout:{left:40,centerY:0,right:40,height:40},tagName:"h1"})});
NC.LabeledTextFieldView=SC.View.extend({childViews:"nameLabel valueField".w(),fieldLeft:100,fieldWidth:100,nameTransform:function(a){return a
},init:function(){arguments.callee.base.apply(this,arguments);var a=this.nameLabel.bind("value",this,"name");
a.transform(this.nameTransform);this.valueField.bind("validator",this,"validator");
this.valueField.bind("value",this,"value");this.valueField.bind("hint",this,"hint");
this.valueField.bind("isEnabled",this,"enabled").oneWay();this.nameLabel.bind("isEnabled",this,"enabled").oneWay();
this.doLayout()},doLayout:function(){this.valueField.set("layout",{left:this.get("fieldLeft"),width:this.get("fieldWidth"),centerY:0,height:NC.TEXT_FIELD_HEIGHT})
}.observes("fieldWidth","fieldLeft"),nameLabel:SC.LabelView.design({layout:{centerY:0,height:NC.LABEL_HEIGHT}}),valueField:SC.TextFieldView.design({isPassword:NO,}),});
NC.LabeledPasswordFieldView=NC.LabeledTextFieldView.extend({valueField:SC.TextFieldView.design({isPassword:YES,}),});
NC.ASCII8Validator=SC.Validator.extend({validateKeyDown:function(b,c,a){return a.charCodeAt(0)>=32&&a.charCodeAt(0)<=127
}});sc_require("views/labeled_text_field");sc_require("validator/ascii8");NC.REC_FTP_DATA_LEFT=NC.DATA_LEFT;
NC.REC_FTP_SERVER_TOP=0;NC.REC_FTP_USER_TOP=NC.REC_FTP_SERVER_TOP+NC.LABELED_TEXT_FIELD_HEIGHT;
NC.REC_FTP_SIZE_TOP=NC.REC_FTP_USER_TOP+NC.LABELED_TEXT_FIELD_HEIGHT;NC.REC_FTP_PATH_LEFT=NC.REC_ROW2_LEFT+8;
NC.REC_FTP_FIELD_LEFT=100;NC.REC_FTP_FIELD2_LEFT=70;NC.REC_FTP_SERVER_WIDTH=190;NC.REC_FTP_PATH_WIDTH=190;
NC.REC_FTP_USER_WIDTH=NC.REC_FTP_SERVER_WIDTH;NC.REC_FTP_PASSWORD_WIDTH=NC.REC_FTP_PATH_WIDTH;
NC.REC_FTP_SIZE_WIDTH=190;NC.RecordingFtpView=SC.View.extend({init:function(){arguments.callee.base.apply(this,arguments);
this.serverView.bind("value",this,"recorder.store_ftp_server");this.pathView.bind("value",this,"recorder.store_ftp_path");
this.userView.bind("value",this,"recorder.store_ftp_user");this.passwordView.bind("value",this,"recorder.store_ftp_password");
this.sizeView.bind("value",this,"recorder.store_ftp_size");this.serverView.bind("isEnabled",this,"recorder.ftpEnabled").oneWay();
this.pathView.bind("isEnabled",this,"recorder.ftpEnabled").oneWay();this.userView.bind("isEnabled",this,"recorder.ftpEnabled").oneWay();
this.passwordView.bind("isEnabled",this,"recorder.ftpEnabled").oneWay();this.sizeView.bind("isEnabled",this,"recorder.ftpEnabled").oneWay()
},childViews:"serverView pathView userView passwordView sizeView".w(),serverView:NC.LabeledTextFieldView.design({hint:"_ServerAddress".loc(),name:"_ServerAddress".loc(),validator:NC.ASCII8Validator,fieldLeft:NC.REC_FTP_FIELD_LEFT,fieldWidth:NC.REC_FTP_SERVER_WIDTH,layout:{left:NC.REC_FTP_DATA_LEFT,top:NC.REC_FTP_SERVER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),pathView:NC.LabeledTextFieldView.design({hint:"_Path".loc(),name:"_Path".loc(),validator:NC.ASCII8Validator,fieldLeft:NC.REC_FTP_FIELD2_LEFT,fieldWidth:NC.REC_FTP_PATH_WIDTH,layout:{left:NC.REC_FTP_PATH_LEFT,top:NC.REC_FTP_SERVER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),userView:NC.LabeledTextFieldView.design({hint:"_User".loc(),name:"_User".loc(),validator:NC.ASCII8Validator,fieldLeft:NC.REC_FTP_FIELD_LEFT,fieldWidth:NC.REC_FTP_USER_WIDTH,layout:{left:NC.REC_FTP_DATA_LEFT,top:NC.REC_FTP_USER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),passwordView:NC.LabeledPasswordFieldView.design({hint:"_Password".loc(),name:"_Password".loc(),validator:NC.ASCII8Validator,fieldLeft:NC.REC_FTP_FIELD2_LEFT,fieldWidth:NC.REC_FTP_PASSWORD_WIDTH,layout:{left:NC.REC_FTP_PATH_LEFT,top:NC.REC_FTP_USER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),sizeView:NC.LabeledTextFieldView.design({hint:"_SizeInMB".loc(),name:"_Size".loc()+" ("+"_MB".loc()+")",validator:SC.Validator.PositiveInteger,isVisible:NO,fieldLeft:NC.REC_FTP_FIELD_LEFT,fieldWidth:NC.REC_FTP_SIZE_WIDTH,layout:{left:NC.REC_FTP_DATA_LEFT,top:NC.REC_FTP_SIZE_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}})});
NC.InfoBoxEntryView=SC.View.extend({childViews:"nameLabel valueLabel".w(),valueLeft:100,colonEnabled:true,nameTransform:function(a){return a+":"
},init:function(){arguments.callee.base.apply(this,arguments);var a=this.nameLabel.bind("value",this,"name").oneWay();
if(this.get("colonEnabled")){a.transform(this.nameTransform)}this.valueLabel.bind("value",this,"value").oneWay();
this.doLayout()},doLayout:function(){this.valueLabel.set("layout",{left:this.get("valueLeft")})
}.observes("valueLeft"),nameLabel:SC.LabelView.design({}),valueLabel:SC.LabelView.design({}),});
NC.ArraySliderView=SC.SliderView.extend({values:[],step:1,minimum:0,maximum:1,init:function(){arguments.callee.base.apply(this,arguments)
},valueObjectObserver:function(){var c=this.get("valueObject");if(SC.none(c)){return
}var b=this.get("values");if(b.length==0){this.set("valueObject",null);return}var a=this.get("value");
if(b[a]!==c){for(var d=0;d<b.length;d++){if(b[d]===c){this.set("value",d);return}}this.set("valueObject",b[a])
}}.observes("valueObject"),valuesObserver:function(){var a=this.get("values");this.set("maximum",Math.max(1,a.length-1))
}.observes("values"),valueObserver:function(){var b=this.get("values");var a=this.get("value");
var c=a<b.length?b[a]:null;this.setIfChanged("valueObject",c)}.observes("value")});
sc_require("views/info_box_entry");sc_require("views/array_slider");NC.REC_IMGOPT_SENDINTERVAL_TOP=NC.TITLE_HEIGHT+20;
NC.REC_IMGOPT_QUALITY_TOP=NC.REC_IMGOPT_SENDINTERVAL_TOP+NC.TEXT_ROW_HEIGHT;NC.REC_IMGOPT_INFO_ENTRY_WIDTH=145;
NC.REC_IMGOPT_INFO_ENTRY_VALUE_LEFT=125;NC.REC_IMGOPT_SLIDER_LEFT=NC.REC_IMGOPT_INFO_ENTRY_WIDTH+10;
NC.REC_IMGOPT_SLIDER_WIDTH=150;NC.RecordingImageOptionsView=SC.View.extend({init:function(){arguments.callee.base.apply(this,arguments);
this.sendIntervalView.infoboxView.bind("value",this,"recorder.displayInterval").oneWay();
this.sendIntervalView.infoboxView.bind("name",this,"recorder.displayIntervalName").oneWay();
this.sendIntervalView.sliderView.bind("values",this,"recorder.intervalArray").oneWay();
this.sendIntervalView.sliderView.bind("valueObject",this,"recorder.options_interval");
this.qualityView1.bind("isVisible",this,"recorder.jpegStream1Selected").oneWay();
this.qualityView2.bind("isVisible",this,"recorder.jpegStream2Selected").oneWay();
this.qualityView3.bind("isVisible",this,"recorder.jpegStream3Selected").oneWay()},childViews:"titleView sendIntervalView  qualityView1 qualityView2 qualityView3 separator".w(),titleView:SC.LabelView.design({classNames:"text_title",value:"_Options".loc(),layout:{height:NC.TITLE_HEIGHT},}),sendIntervalView:SC.View.design({layout:{top:NC.REC_IMGOPT_SENDINTERVAL_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"infoboxView sliderView".w(),infoboxView:NC.InfoBoxEntryView.design({layout:{width:NC.REC_IMGOPT_INFO_ENTRY_WIDTH},valueLeft:NC.REC_IMGOPT_INFO_ENTRY_VALUE_LEFT}),sliderView:NC.ArraySliderView.design({layout:{left:NC.REC_IMGOPT_SLIDER_LEFT,top:2,width:NC.REC_IMGOPT_SLIDER_WIDTH}})}),qualityView1:SC.View.design({layout:{top:NC.REC_IMGOPT_QUALITY_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"infoboxView sliderView".w(),infoboxView:NC.InfoBoxEntryView.design({layout:{width:NC.REC_IMGOPT_INFO_ENTRY_WIDTH},name:"_Quality".loc(),valueBinding:SC.Binding.from("NC.dataController.video_mjpg1_quality_value").oneWay(),valueLeft:NC.REC_IMGOPT_INFO_ENTRY_VALUE_LEFT}),sliderView:SC.SliderView.design({layout:{left:NC.REC_IMGOPT_SLIDER_LEFT,top:2,width:NC.REC_IMGOPT_SLIDER_WIDTH},minimumBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_min").oneWay(),maximumBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_max").oneWay(),stepBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_step").oneWay(),valueBinding:"NC.dataController.video_mjpg1_quality_value"})}),qualityView2:SC.View.design({layout:{top:NC.REC_IMGOPT_QUALITY_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"infoboxView sliderView".w(),infoboxView:NC.InfoBoxEntryView.design({layout:{width:NC.REC_IMGOPT_INFO_ENTRY_WIDTH},name:"_Quality".loc(),valueBinding:SC.Binding.from("NC.dataController.video_mjpg_quality_value").oneWay(),valueLeft:NC.REC_IMGOPT_INFO_ENTRY_VALUE_LEFT}),sliderView:SC.SliderView.design({layout:{left:NC.REC_IMGOPT_SLIDER_LEFT,top:2,width:NC.REC_IMGOPT_SLIDER_WIDTH},minimumBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_min").oneWay(),maximumBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_max").oneWay(),stepBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_step").oneWay(),valueBinding:"NC.dataController.video_mjpg_quality_value"})}),qualityView3:SC.View.design({layout:{top:NC.REC_IMGOPT_QUALITY_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"infoboxView sliderView".w(),infoboxView:NC.InfoBoxEntryView.design({layout:{width:NC.REC_IMGOPT_INFO_ENTRY_WIDTH},name:"_Quality".loc(),valueBinding:SC.Binding.from("NC.dataController.video_mjpg3_quality_value").oneWay(),valueLeft:NC.REC_IMGOPT_INFO_ENTRY_VALUE_LEFT}),sliderView:SC.SliderView.design({layout:{left:NC.REC_IMGOPT_SLIDER_LEFT,top:2,width:NC.REC_IMGOPT_SLIDER_WIDTH},minimumBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_min").oneWay(),maximumBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_max").oneWay(),stepBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_step").oneWay(),valueBinding:"NC.dataController.video_mjpg3_quality_value"})}),separator:SC.SeparatorView.design({classNames:"nc-separator-view",layout:{bottom:0,height:NC.SEPARATOR_HEIGHT}})});
NC.SLIDER_LABEL_LEFT=8;NC.SliderView=SC.View.extend({valueLeft:100,label:" ",minimum:0,maximum:100,step:1,init:function(){arguments.callee.base.apply(this,arguments);
this.labelView.bind("isEnabled",this,"isEnabled").oneWay();this.valueView.bind("isEnabled",this,"isEnabled").oneWay();
this.sliderView.bind("isEnabled",this,"isEnabled").oneWay();this.labelView.bind("value",this,"label").oneWay();
this.sliderView.bind("minimum",this,"minimum").oneWay();this.sliderView.bind("maximum",this,"maximum").oneWay();
this.sliderView.bind("step",this,"step").oneWay();if(typeof this.get("valueLabelBinding")!=="undefined"){this.valueView.bind("value",this,"valueLabel").oneWay()
}else{this.valueView.bind("value",this,"value").oneWay()}this.sliderView.bind("value",this,"value");
this.valueView.set("layout",{right:8,width:50,height:NC.LABEL_HEIGHT})},childViews:"labelView valueView sliderView".w(),labelView:SC.LabelView.design({layout:{left:NC.SLIDER_LABEL_LEFT,height:NC.LABEL_HEIGHT}}),valueView:SC.LabelView.design({classNames:"nc-slider-value"}),sliderView:SC.SliderView.design({value:0,layout:{bottom:0,height:NC.SLIDER_HEIGHT}}),});
sc_require("views/slider");sc_require("views/labeled_text_field");NC.REC_MODE_EVENT_TOP=75;
NC.REC_MODE_EVENT_HEIGHT=NC.CHECKBOX_HEIGHT;NC.REC_MODE_DATA_LEFT=NC.DATA_LEFT;NC.REC_MODE_INPUT_LEFT=75;
NC.REC_MODE_INPUT_WIDTH=75;NC.REC_MODE_MOTION_LEFT=150;NC.REC_MODE_MOTION_WIDTH=200;
NC.REC_MODE_PRE_TOP=NC.REC_MODE_EVENT_TOP+NC.REC_MODE_EVENT_HEIGHT+10;NC.REC_MODE_POST_TOP=NC.REC_MODE_PRE_TOP;
NC.REC_MODE_POST_LEFT=NC.REC_ROW2_LEFT;NC.REC_MODE_PRE_SLVAL_LEFT=210;NC.REC_MODE_POST_SLVAL_LEFT=210;
NC.REC_MODE_STREAM_LEFT=NC.REC_ROW2_LEFT;NC.REC_MODE_STREAM_RADIO_LEFT=60;NC.RecordingModeView=SC.View.extend({init:function(){arguments.callee.base.apply(this,arguments);
this.radioView.bind("value",this,"recorder.options_mode");this.streamView.radioView.bind("value",this,"recorder.options_stream");
this.eventView.inputBox.bind("value",this,"recorder.alarm_event_input");this.eventView.motionBox.bind("value",this,"recorder.alarm_event_motion");
this.preView.bind("value",this,"recorder.alarm_preduration_value");this.postView.bind("value",this,"recorder.alarm_postduration_value");
this.eventView.labelView.bind("isEnabled",this,"recorder.alarmEnabled").oneWay();
this.eventView.inputBox.bind("isEnabled",this,"recorder.alarmEnabled").oneWay();this.eventView.motionBox.bind("isEnabled",this,"recorder.alarmEnabled").oneWay();
this.preView.bind("isEnabled",this,"recorder.prealarmEnabled").oneWay();this.postView.bind("isEnabled",this,"recorder.alarmEnabled").oneWay();
this.preView.bind("minimum",this,"recorder.alarm_preduration_min").oneWay();this.preView.bind("maximum",this,"recorder.alarm_preduration_max").oneWay();
this.preView.bind("step",this,"recorder.alarm_preduration_step").oneWay();this.postView.bind("minimum",this,"recorder.alarm_postduration_min").oneWay();
this.postView.bind("maximum",this,"recorder.alarm_postduration_max").oneWay();this.postView.bind("step",this,"recorder.alarm_postduration_step").oneWay();
this.streamView.radioView.bind("items",this,"recorder.streamItems")},childViews:"radioView streamView eventView preView postView separator".w(),radioView:SC.RadioView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",items:[{title:"_Off".loc(),value:"off",enabled:YES},{title:"_LongTime".loc(),value:"longtime",enabled:YES},{title:"_Alarm".loc(),value:"alarm",enabled:YES}],layoutDirection:SC.LAYOUT_VERTICAL}),streamView:SC.View.design({childViews:"labelView radioView".w(),labelView:SC.LabelView.design({value:"_Stream".loc()+":",layout:{height:NC.LABEL_HEIGHT},}),radioView:SC.RadioView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",layoutDirection:SC.LAYOUT_VERTICAL,layout:{left:NC.REC_MODE_STREAM_RADIO_LEFT}}),layout:{left:NC.REC_MODE_STREAM_LEFT}}),eventView:SC.View.design({childViews:"labelView motionBox inputBox".w(),labelView:SC.LabelView.design({value:"_Event".loc()+":",layout:{height:NC.LABEL_HEIGHT},}),inputBox:SC.CheckboxView.design({title:"_Input".loc(),layout:{left:NC.REC_MODE_INPUT_LEFT,width:NC.REC_MODE_INPUT_WIDTH,height:NC.CHECKBOX_HEIGHT}}),motionBox:SC.CheckboxView.design({title:"_MotionDetection".loc(),layout:{left:NC.REC_MODE_MOTION_LEFT,width:NC.REC_MODE_MOTION_WIDTH,height:NC.CHECKBOX_HEIGHT}}),layout:{left:NC.REC_MODE_DATA_LEFT,top:NC.REC_MODE_EVENT_TOP,height:NC.REC_MODE_EVENT_HEIGHT}}),preView:NC.SliderView.design({label:"_PreDuration".loc()+" ("+"_sec".loc()+")",layout:{left:NC.REC_MODE_DATA_LEFT-8,top:NC.REC_MODE_PRE_TOP,height:NC.SLIDER_VIEW_HEIGHT,width:NC.SLIDER_VIEW_WIDTH},valueLeft:NC.REC_MODE_PRE_SLVAL_LEFT,}),postView:NC.SliderView.design({label:"_PostDuration".loc()+" ("+"_sec".loc()+")",layout:{left:NC.REC_MODE_POST_LEFT,top:NC.REC_MODE_POST_TOP,height:NC.SLIDER_VIEW_HEIGHT,width:NC.SLIDER_VIEW_WIDTH},valueLeft:NC.REC_MODE_POST_SLVAL_LEFT,}),separator:SC.SeparatorView.design({classNames:"nc-separator-view",layout:{bottom:0,height:NC.SEPARATOR_HEIGHT}})});
sc_require("views/labeled_text_field");sc_require("validator/ascii8");NC.REC_NVR_DATA_LEFT=NC.DATA_LEFT;
NC.REC_NVR_SERVER_TOP=0;NC.REC_NVR_PATH_LEFT=NC.REC_ROW2_LEFT+8;NC.REC_NVR_FIELD_LEFT=100;
NC.REC_NVR_FIELD2_LEFT=70;NC.REC_NVR_SERVER_WIDTH=190;NC.REC_NVR_PORT_WIDTH=190;NC.RecordingNvrView=SC.View.extend({init:function(){arguments.callee.base.apply(this,arguments);
this.serverView.bind("value",this,"recorder.store_nvr_server");this.portView.bind("value",this,"recorder.store_nvr_port");
this.serverView.bind("isEnabled",this,"recorder.nvrEnabled").oneWay();this.portView.bind("isEnabled",this,"recorder.nvrEnabled").oneWay()
},childViews:"serverView portView".w(),serverView:NC.LabeledTextFieldView.design({hint:"_ServerAddress".loc(),name:"_ServerAddress".loc(),validator:NC.ASCII8Validator,fieldLeft:NC.REC_NVR_FIELD_LEFT,fieldWidth:NC.REC_NVR_SERVER_WIDTH,layout:{left:NC.REC_NVR_DATA_LEFT,top:NC.REC_NVR_SERVER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),portView:NC.LabeledTextFieldView.design({hint:"_Port".loc(),name:"_Port".loc(),validator:SC.Validator.PositiveInteger,fieldLeft:NC.REC_NVR_FIELD2_LEFT,fieldWidth:NC.REC_NVR_PORT_WIDTH,layout:{left:NC.REC_NVR_PATH_LEFT,top:NC.REC_NVR_SERVER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}})});
sc_require("views/labeled_text_field");sc_require("validator/ascii8");NC.REC_SMB_DATA_LEFT=NC.DATA_LEFT;
NC.REC_SMB_SERVER_TOP=0;NC.REC_SMB_USER_TOP=NC.REC_SMB_SERVER_TOP+NC.LABELED_TEXT_FIELD_HEIGHT;
NC.REC_SMB_SIZE_TOP=NC.REC_SMB_USER_TOP+NC.LABELED_TEXT_FIELD_HEIGHT;NC.REC_SMB_PATH_LEFT=NC.REC_ROW2_LEFT+8;
NC.REC_SMB_FIELD_LEFT=100;NC.REC_SMB_FIELD2_LEFT=70;NC.REC_SMB_SERVER_WIDTH=190;NC.REC_SMB_PATH_WIDTH=190;
NC.REC_SMB_USER_WIDTH=NC.REC_SMB_SERVER_WIDTH;NC.REC_SMB_PASSWORD_WIDTH=NC.REC_SMB_PATH_WIDTH;
NC.REC_SMB_SIZE_WIDTH=190;NC.RecordingSambaView=SC.View.extend({init:function(){arguments.callee.base.apply(this,arguments);
this.shareView.bind("value",this,"recorder.store_samba_share");this.pathView.bind("value",this,"recorder.store_samba_path");
this.userView.bind("value",this,"recorder.store_samba_user");this.passwordView.bind("value",this,"recorder.store_samba_password");
this.sizeView.bind("value",this,"recorder.store_samba_size");this.shareView.bind("isEnabled",this,"recorder.sambaEnabled").oneWay();
this.pathView.bind("isEnabled",this,"recorder.sambaEnabled").oneWay();this.userView.bind("isEnabled",this,"recorder.sambaEnabled").oneWay();
this.passwordView.bind("isEnabled",this,"recorder.sambaEnabled").oneWay();this.sizeView.bind("isEnabled",this,"recorder.sambaEnabled").oneWay()
},childViews:"shareView pathView userView passwordView sizeView".w(),shareView:NC.LabeledTextFieldView.design({hint:"_SambaShare".loc(),name:"_SambaShare".loc(),validator:NC.ASCII8Validator,fieldLeft:NC.REC_SMB_FIELD_LEFT,fieldWidth:NC.REC_SMB_SERVER_WIDTH,layout:{left:NC.REC_SMB_DATA_LEFT,top:NC.REC_SMB_SERVER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),pathView:NC.LabeledTextFieldView.design({hint:"_Path".loc(),name:"_Path".loc(),validator:NC.ASCII8Validator,fieldLeft:NC.REC_SMB_FIELD2_LEFT,fieldWidth:NC.REC_SMB_PATH_WIDTH,layout:{left:NC.REC_SMB_PATH_LEFT,top:NC.REC_SMB_SERVER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),userView:NC.LabeledTextFieldView.design({hint:"_User".loc(),name:"_User".loc(),validator:NC.ASCII8Validator,fieldLeft:NC.REC_SMB_FIELD_LEFT,fieldWidth:NC.REC_SMB_USER_WIDTH,layout:{left:NC.REC_SMB_DATA_LEFT,top:NC.REC_SMB_USER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),passwordView:NC.LabeledPasswordFieldView.design({hint:"_Password".loc(),name:"_Password".loc(),validator:NC.ASCII8Validator,fieldLeft:NC.REC_SMB_FIELD2_LEFT,fieldWidth:NC.REC_SMB_PASSWORD_WIDTH,layout:{left:NC.REC_SMB_PATH_LEFT,top:NC.REC_SMB_USER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),sizeView:NC.LabeledTextFieldView.design({hint:"_SizeInMB".loc(),name:"_Size".loc()+" ("+"_MB".loc()+")",validator:SC.Validator.PositiveInteger,fieldLeft:NC.REC_SMB_FIELD_LEFT,fieldWidth:NC.REC_SMB_SIZE_WIDTH,layout:{left:NC.REC_SMB_DATA_LEFT,top:NC.REC_SMB_SIZE_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}})});
NC.REC_VIDOPT_AUTODEL_TOP=NC.TITLE_HEIGHT+20;NC.REC_VIDOPT_AUTODEL_HEIGHT=NC.CHECKBOX_HEIGHT;
NC.REC_VIDOPT_AUTODEL_WIDTH=100;NC.REC_VIDOPT_DURATION_TOP=NC.TITLE_HEIGHT+10;NC.REC_VIDOPT_DURATION_LEFT=NC.REC_ROW2_LEFT;
NC.REC_VIDOPT_DURATION_SLVAL_LEFT=NC.SLIDER_VAL_LEFT;NC.RecordingVideoOptionsView=SC.View.extend({init:function(){arguments.callee.base.apply(this,arguments);
this.autoDeleteBox.bind("value",this,"recorder.options_autodelete");this.durationView.bind("value",this,"recorder.options_duration_value");
this.durationView.bind("minimum",this,"recorder.options_duration_min").oneWay();this.durationView.bind("maximum",this,"recorder.options_duration_max").oneWay();
this.durationView.bind("step",this,"recorder.options_duration_step").oneWay()},childViews:"titleView autoDeleteBox durationView separator".w(),titleView:SC.LabelView.design({classNames:"text_title",value:"_Options".loc(),layout:{height:NC.TITLE_HEIGHT},}),autoDeleteBox:SC.CheckboxView.design({title:"_AutoDelete".loc(),layout:{top:NC.REC_VIDOPT_AUTODEL_TOP,width:NC.REC_VIDOPT_AUTODEL_WIDTH,height:NC.REC_VIDOPT_AUTODEL_HEIGHT}}),durationView:NC.SliderView.design({label:"_MaxDuration".loc()+" ("+"_min".loc()+")",layout:{left:NC.REC_VIDOPT_DURATION_LEFT,top:NC.REC_VIDOPT_DURATION_TOP,height:NC.SLIDER_VIEW_HEIGHT,width:NC.SLIDER_VIEW_WIDTH},valueLeft:NC.REC_VIDOPT_DURATION_SLVAL_LEFT,}),separator:SC.SeparatorView.design({classNames:"nc-separator-view",layout:{bottom:0,height:NC.SEPARATOR_HEIGHT}})});
NC.Data=SC.Record.extend({});NC.Mask=SC.Object.extend({properties:["left","top","height","width"],includes:function(b,f){var e=this.get("left");
var d=this.get("top");var c=this.get("width");var a=this.get("height");return b>=e&&b<=e+c&&f>=d&&f<=d+a
},move:function(i,g,f,e){var b=this.get("width");var j=this.get("height");var d=this.get("left")+i;
var h=this.get("top")+g;var c=0;var a=0;d=d<c?c:d;d=d+b>f-1?f-b-1:d;h=h<a?a:h;h=h+j>e-1?e-j-1:h;
this.set("left",d);this.set("top",h)},updateElement:function(){},});NC.MotionMask=NC.Mask.extend({});
NC.PrivacyMask=NC.Mask.extend({properties:["red","green","blue","color"],color:"Black",});
NC.RecordFile=SC.Record.extend({resolution:function(){return""+this.get("video_image_width")+"x"+this.get("video_image_height")+"@"+this.get("video_image_depth")
}.property("video_image_width","video_image_height","video_image_depth").cacheable(),frameRate:function(){var a=0;
var b=this.get("video_frame_duration");if(b>0){a=this.get("video_time_scale")/b}return""+(Math.round(a*1000)/1000)+" "+"_FPS".loc()
}.property("video_time_scale","video_frame_duration").cacheable(),videoBitrate:function(){var a=(this.get("video_bitrate")/1024).toFixed(0);
return""+a+" "+"_Kbit".loc()}.property("video_bitrate").cacheable(),sizeMB:function(){var a=this.get("size")/1024/1024;
return Math.round(a*100)/100}.property("size").cacheable(),displaySize:function(){return this.get("sizeMB")+" "+"_MB".loc()
}.property("sizeMB").cacheable(),displayTableStartTime:function(){var b=this.get("incomplete");
var c=this.get("startTime");var a=c.match(/^(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d).*/);
if(a!=null){c=a[1]}return b?"_Incomplete".loc():c}.property("startTime","incomplete").cacheable(),displayStartTime:function(){var a=this.get("incomplete");
return a?"_Incomplete".loc():this.get("startTime")}.property("startTime","incomplete").cacheable(),durationStr:function(){var d=this.get("video_duration");
var c=this.get("video_time_scale");var e=0;var b=0;if(c>0){e=d/c;b=Math.floor(e/60);
e-=b*60}var a=NC.util.sprintf("%d:%02d",b,e);return a}.property("video_duration","video_time_scale").cacheable(),audioDurationStr:function(){var d=this.get("audio_duration");
var c=this.get("video_time_scale");var e=0;var b=0;if(c>0){e=d/c;b=Math.floor(e/60);
e-=b*60}var a=NC.util.sprintf("%d:%02d",b,e);return a}.property("audio_duration","video_time_scale").cacheable(),displayDuration:function(){return this.get("durationStr")+" "+"_min".loc()
}.property("durationStr").cacheable(),displayAudioSamplerate:function(){return this.get("audio_samplerate")+" "+"_HZ".loc()
}.property("audio_samplerate").cacheable(),displayAudioBitrate:"128 "+"_Kbit".loc(),displayAudioDuration:function(){return this.get("audioDurationStr")+" "+"_min".loc()
}.property("audioDurationStr").cacheable(),incomplete:function(){return this.get("video_frame_count")==0
}.property("video_frame_count").cacheable()});NC.SetupGroup=SC.Record.extend(SC.TreeItemContent,{count:function(){return this.getPath("items.length")
}.property("*items.length").cacheable(),items:SC.Record.toMany("NC.SetupMenuItem"),treeItemCollapse:function(){},treeItemChildren:function(){return this.get("items")
}.property("items").cacheable(),treeItemBranchIndexes:function(){return SC.IndexSet.EMPTY
},name:SC.Record.attr(String)});NC.SetupMenuItem=SC.Record.extend(SC.TreeItemContent,{count:0,treeItemChildren:[],treeItemIsExpanded:NO,group:SC.Record.toOne("NC.SetupGroup"),name:SC.Record.attr(String),icon:SC.Record.attr(String),view:SC.Record.attr(String),getView:function(){return NC.getPath(this.get("view"))
}.property("view").cacheable()});NC.Timezone=SC.Record.extend({});NC.USER_GROUPS=["_Admin".loc(),"_User".loc(),"_Guest".loc()];
NC.User=SC.Record.extend({groupName:function(){return NC.USER_GROUPS[this.get("group")-1]
}.property("group").cacheable()});NC.UserGroup=SC.Record.extend(SC.TreeItemContent,{count:function(){return this.getPath("items.length")
}.property("*items.length").cacheable(),users:SC.Record.toMany("NC.User"),treeItemCollapse:function(){},treeItemChildren:function(){return this.get("users")
}.property("users").cacheable(),treeItemBranchIndexes:function(){return SC.IndexSet.EMPTY
},name:SC.Record.attr(String)});require("core");NC.util=SC.Object.create({sprintf:function(){if(typeof arguments=="undefined"){return null
}if(arguments.length<1){return null}if(typeof arguments[0]!="string"){return null
}if(typeof RegExp=="undefined"){return null}var j=arguments[0];var c=new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g);
var g=new Array();var l=new Array();var a=0;var h=0;var m=0;var d=0;var k="";var f=null;
while(f=c.exec(j)){if(f[9]){a+=1}h=d;m=c.lastIndex-f[0].length;l[l.length]=j.substring(h,m);
d=c.lastIndex;g[g.length]={match:f[0],left:f[3]?true:false,sign:f[4]||"",pad:f[5]||" ",min:f[6]||0,precision:f[8],code:f[9]||"%",negative:parseInt(arguments[a])<0?true:false,argument:String(arguments[a])}
}l[l.length]=j.substring(d);if(g.length==0){return j}if((arguments.length-1)<a){return null
}var b=null;var f=null;var e=null;for(e=0;e<g.length;e++){if(g[e].code=="%"){substitution="%"
}else{if(g[e].code=="b"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(2));
substitution=this.convert(g[e],true)}else{if(g[e].code=="c"){g[e].argument=String(String.fromCharCode(parseInt(Math.abs(parseInt(g[e].argument)))));
substitution=this.convert(g[e],true)}else{if(g[e].code=="d"){g[e].argument=String(Math.abs(parseInt(g[e].argument)));
substitution=this.convert(g[e])}else{if(g[e].code=="f"){g[e].argument=String(Math.abs(parseFloat(g[e].argument)).toFixed(g[e].precision?g[e].precision:6));
substitution=this.convert(g[e])}else{if(g[e].code=="o"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(8));
substitution=this.convert(g[e])}else{if(g[e].code=="s"){g[e].argument=g[e].argument.substring(0,g[e].precision?g[e].precision:g[e].argument.length);
substitution=this.convert(g[e],true)}else{if(g[e].code=="x"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(16));
substitution=this.convert(g[e])}else{if(g[e].code=="X"){g[e].argument=String(Math.abs(parseInt(g[e].argument)).toString(16));
substitution=this.convert(g[e]).toUpperCase()}else{substitution=g[e].match}}}}}}}}}k+=l[e];
k+=substitution}k+=l[e];return k},convert:function(b,d){if(d){b.sign=""}else{b.sign=b.negative?"-":b.sign
}var a=b.min-b.argument.length+1-b.sign.length;var c=new Array(a<0?0:a).join(b.pad);
if(!b.left){if(b.pad=="0"||d){return b.sign+c+b.argument}else{return c+b.sign+b.argument
}}else{if(b.pad=="0"||d){return b.sign+b.argument+c.replace(/0/g," ")}else{return b.sign+b.argument+c
}}},arrayFindProperty:function(d,c,b){for(var a=0;a<d.length;a++){if(d[a].get(c)===b){return d[a]
}}return null},arrayIncludeElem:function(c,b){for(var a=0;a<c.length;a++){if(c[a]===b){return YES
}}return NO},profile_start:function(){this.pfstart=new Date()},profile_trace:function(a){if(SC.none(this.pfstart)){this.profile_start()
}else{console.log("%s time=%s",a,(new Date()-this.pfstart)/1000)}},});NC.AlphaNumValidator=SC.Validator.extend({validateKeyDown:function(b,c,a){var d=c.$input().val();
if(!d){d=""}d+=a;return/^[\w]+$/.test(d)}});NC.DateValidator=SC.Validator.extend({validateKeyDown:function(b,c,a){var d=c.$input().val();
if(!d){d=""}d+=a;return/^[\d-]+$/.test(d)}});NC.IPValidator=SC.Validator.extend({validateKeyDown:function(b,c,a){var d=c.$input().val();
if(!d){d=""}d+=a;return/^[\d.]+$/.test(d)}});NC.TimeValidator=SC.Validator.extend({validateKeyDown:function(b,c,a){var d=c.$input().val();
if(!d){d=""}d+=a;return/^[\d:]+$/.test(d)}});NC.InfoBoxView=SC.View.extend({entryHeight:40,init:function(){arguments.callee.base.apply(this,arguments);
console.log("init title=%s",this.get("title"));var a=this.titleLabel.create();a.bind("value",this,"title");
this.appendChild(a);this.initEntries()},initEntries:function(){if(!(this.entries instanceof Array)){return
}for(var c=0;c<this.entries.length;c++){var e=this.entries[c];if(e instanceof Array&&e.length>=3){var g=e[2];
var b=e[0];var f=e[1];var h=null;if(e.length>=6){var d=e[3];var a=e[4];h=NC.InfoBoxStreamEntryView.create({name:b,linkLeft:a,blankTarget:e[5],layout:{left:0,top:this.entryHeight*(c+1),height:NC.LABEL_HEIGHT},});
h.bind("link",d).oneWay()}else{h=NC.InfoBoxEntryView.create({name:b,layout:{left:0,top:this.entryHeight*(c+1),height:NC.LABEL_HEIGHT},})
}if(g){h.bind("value",f).oneWay()}else{h.set("value",f)}h.bind("valueLeft",this,"valueLeft").oneWay();
this.appendChild(h)}}},titleLabel:SC.LabelView.design({layout:{height:NC.LABEL_HEIGHT},classNames:"text_title"}),});
NC.InfoBoxStreamEntryView=SC.View.extend({childViews:"nameLabel valueLabel linkView".w(),valueLeft:100,linkLeft:150,blankTarget:false,nameTransform:function(a){return a+":"
},init:function(){arguments.callee.base.apply(this,arguments);var a=this.nameLabel.bind("value",this,"name").oneWay();
a.transform(this.nameTransform);this.valueLabel.bind("value",this,"value").oneWay();
this.linkView.bind("link",this,"link").oneWay();this.linkView.bind("blankTarget",this,"blankTarget").oneWay();
this.doLayout()},doLayout:function(){this.linkView.set("layout",{left:this.get("linkLeft")});
this.valueLabel.set("layout",{left:this.get("valueLeft")})}.observes("valueLeft","linkLeft"),nameLabel:SC.LabelView.design({}),valueLabel:SC.LabelView.design({}),linkView:SC.View.design({displayProperties:"link",render:function(b,e){var a=this.get("link");
console.log("linkView rtsp=%s",a);var d=this.get("blankTarget")?'target="_blank"':"";
var c='<a href="'+a+'"'+d+">"+a+"</a>";console.log("rtsp=%s link=%s",a,c);b.push(c)
}}),});NC.ProgressPane=SC.AlertPane.extend({contentView:SC.View.extend({useStaticLayout:YES,layout:{left:0,right:0,top:0,height:180},childViews:[SC.View.extend(SC.StaticLayout,{classNames:["info"],displayProperties:"description".w(),descriptionBinding:SC.Binding.oneWay().from("NC.progressController.description"),render:function(a,d){var c=this.get("pane");
var b=SC.BLANK_IMAGE_URL;if(c.get("icon")=="blank"){a.addClass("plain")}a.push('<img src="%@" class="icon %@" />'.fmt(b,c.get("icon")));
a.begin("h1").text(c.get("message")||"").end();a.push(this.get("description")||"");
a.push(c.get("displayCaption")||"");a.push('<div class="separator"></div>')}}),SC.View.extend({layout:{bottom:13,height:24,right:18,width:466},childViews:["cancelButton","okButton"],classNames:["text-align-right"],cancelButton:SC.ButtonView.extend({useStaticLayout:YES,actionKey:SC.BUTTON2_STATUS,localize:YES,titleMinWidth:64,layout:{right:5,height:"auto",width:"auto",bottom:0},theme:"capsule",title:"Cancel",action:"dismiss",isVisible:NO}),okButton:SC.ButtonView.extend({useStaticLayout:YES,localize:YES,titleMinWidth:64,layout:{left:0,height:"auto",width:"auto",bottom:0},theme:"capsule",title:"OK",isDefault:YES,actionBinding:"NC.progressController.cancel",isEnabledBinding:SC.Binding.oneWay().from("NC.progressController.cancelEnabled")}),}),SC.View.extend({layout:{bottom:13,height:24,left:18,width:150},isVisible:NO,childViews:[SC.ButtonView.extend({useStaticLayout:YES,actionKey:SC.BUTTON3_STATUS,localize:YES,titleMinWidth:64,layout:{left:0,height:"auto",width:"auto",bottom:0},theme:"capsule",title:"Extra",action:"dismiss",isVisible:NO})]}),SC.ProgressView.extend(SC.StaticLayout,{useStaticLayout:YES,layout:{centerX:0,bottom:30,height:20,width:420},valueBinding:SC.Binding.oneWay().from("NC.progressController.value"),minimum:0,maximum:100,isEnabled:YES})]}),});
NC.ProgressPane.open=function(c,b){var a=this.info("_PleaseWait".loc(),c,"","_Cancel".loc(),b);
return a};NC.ScrollView=SC.ScrollView.extend({mouseWheelTickY:1,mouseWheelTickX:1,mouseWheel:function(a){this._scroll_wheelDeltaX+=a.wheelDeltaX*this.mouseWheelTickX;
this._scroll_wheelDeltaY+=a.wheelDeltaY*this.mouseWheelTickY;this.invokeLater(this._scroll_mouseWheel,10);
return YES},});NC.STREAM_VIEW_TITLE_TOP=NC.TITLE_TOP;NC.STREAM_VIEW_TITLE_HEIGHT=NC.TITLE_HEIGHT+10;
NC.STREAM_VIEW_RES_TOP=NC.STREAM_VIEW_TITLE_TOP+NC.STREAM_VIEW_TITLE_HEIGHT;NC.STREAM_VIEW_RES_HEIGHT=5;
NC.STREAM_VIEW_FRAME_TOP=NC.STREAM_VIEW_RES_TOP+NC.STREAM_VIEW_RES_HEIGHT;NC.STREAM_VIEW_FRAME_HEIGHT=100;
NC.STREAM_VIEW_SLIDER1_TOP=NC.STREAM_VIEW_RES_TOP;NC.STREAM_VIEW_SLIDER2_TOP=NC.STREAM_VIEW_FRAME_TOP;
NC.STREAM_VIEW_SLIDER_LEFT=300;NC.StreamView=SC.View.extend({init:function(){arguments.callee.base.apply(this,arguments);
console.log("StreamView init");this.titleView.bind("value",this,"title").oneWay();
this.initFramerateView();this.sliderView1.bind("value",this,"slider1Value");this.sliderView1.bind("label",this,"slider1Title").oneWay();
this.sliderView1.bind("minimum",this,"slider1Min").oneWay();this.sliderView1.bind("maximum",this,"slider1Max").oneWay();
this.sliderView1.bind("step",this,"slider1Step").oneWay()},initResolutionView:function(){this.resolutionView.labelView.bind("value",this,"resTitle").oneWay();
this.resolutionView.checkView1.bind("title",this,"resLabel1").oneWay();this.resolutionView.checkView1.bind("value",this,"resolution");
this.resolutionView.checkView1.bind("value",this.resolutionView.checkView2,"value").transform(function(a,b){return !a
}).oneWay();this.resolutionView.checkView2.bind("title",this,"resLabel2").oneWay();
this.resolutionView.checkView2.bind("value",this.resolutionView.checkView1,"value").transform(function(a,b){return !a
}).oneWay()},initFramerateView:function(){this.framerateView.labelView.bind("value",this,"framerateTitle").oneWay();
if(SC.typeOf(this.framerateLabels)!==SC.T_ARRAY||SC.typeOf(this.framerateValues)!==SC.T_ARRAY){return
}var a=this.framerateLabels.length;a=a<this.framerateValues.length?a:this.framerateValues.length;
console.log("initFramerateView len = %s",a);var b=[];for(var c=0;c<a;c++){var e=this.framerateLabels[c];
var d=this.framerateValues[c];b=b.concat([{title:e,value:d,enabled:YES}])}this.framerateView.radioView.set("items",b);
this.framerateView.radioView.bind("value",this,"framerate")},childViews:"titleView framerateView sliderView1".w(),titleView:SC.LabelView.design({classNames:"text_title",layout:{top:NC.STREAM_VIEW_TITLE_TOP,height:NC.STREAM_VIEW_TITLE_HEIGHT}}),resolutionView:SC.View.design({layout:{top:NC.STREAM_VIEW_RES_TOP,height:NC.STREAM_VIEW_RES_HEIGHT},childViews:"labelView checkView1 checkView2".w(),labelView:SC.LabelView.design({layout:{height:NC.LABEL_HEIGHT}}),checkView1:SC.CheckboxView.design({isEnabled:false,layout:{left:100,height:NC.CHECKBOX_HEIGHT}}),checkView2:SC.CheckboxView.design({isEnabled:false,layout:{top:20,left:100,height:NC.CHECKBOX_HEIGHT}}),}),framerateView:SC.View.design({layout:{top:NC.STREAM_VIEW_FRAME_TOP,height:NC.STREAM_VIEW_FRAME_HEIGHT},childViews:"labelView radioView".w(),labelView:SC.LabelView.design({layout:{height:NC.LABEL_HEIGHT}}),radioView:SC.RadioView.design({layout:{left:100},itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",isEnabled:YES,layoutDirection:SC.LAYOUT_VERTICAL}),}),sliderView1:NC.SliderView.design({layout:{left:NC.STREAM_VIEW_SLIDER_LEFT,top:NC.STREAM_VIEW_SLIDER1_TOP,height:NC.SLIDER_VIEW_HEIGHT,width:NC.SLIDER_VIEW_WIDTH},valueLeft:NC.SLIDER_VAL_LEFT}),});
NC.TableView=SC.View.extend({childViews:"scrollView titleView".w(),contentProp:"",selectionProp:"",content:[],width:[],title:[],sortAction:[],scrollView:NC.ScrollView.design({mouseWheelTickY:9,hasHorizontalScroller:NO,layout:{top:NC.LABEL_HEIGHT},contentView:SC.View.design({})}),titleView:SC.View.design({classNames:"sc-gray-border",layout:{height:NC.LABEL_HEIGHT},}),init:function(){console.log("NC.Table: init");
arguments.callee.base.apply(this,arguments);console.log("NC.Table: init2");var d=this.get("content");
var c=this.get("width");var f=this.get("title");var e=0;for(var b=0;b<d.length;b++){console.log("add row=%s left=%s",b,e);
var a=this.addRow(d[b],e,c[b]);var g=this.addLabel(f[b],e,c[b]);if(b==0){a.addObserver("frame",a,this.listFrameChanged);
g.set("isActive",true)}else{g.set("isActive",false)}g.set("actionTarget",this);g.set("actionProp","sortAction");
g.set("actionValue",b);e+=c[b]}},addLabel:function(b,c,a){var d=NC.TableLabelView.create({classNames:"sc-gray-border",value:b,layout:{left:c,width:a},textAlign:SC.ALIGN_CENTER});
console.log("addLabel: %s labelView=%s",this.get("titleView"),d);this.get("titleView").appendChild(d);
return d},addRow:function(d,c,b){var a=SC.ListView.create({classNames:"sc-gray-border",layout:{left:c,width:b},contentBinding:this.get("contentProp"),selectionBinding:this.get("selectionProp"),contentValueKey:d,hasContentIcon:false,});
this.get("scrollView").get("contentView").appendChild(a);return a},sortActionChanged:function(){var a=this.get("sortAction");
if(a.length!=2){return}var e=a[0];var b=a[1];if(this.get("content").length-1>=e){this.set("sort",[this.get("content")[e],b])
}console.log("sort row=%s up=%s",e,b);var d=this.get("titleView").childViews;for(var c=0;
c<d.length;c++){d[c].set("isActive",c==e)}}.observes("sortAction"),listFrameChanged:function(){console.log("listFrameChanged: this=%s",this);
var a=this.frame().height;var b=this.parentView;if(b.get("layout").height!==a){b.set("layout",{height:a})
}}});NC.TableLabelView=SC.LabelView.extend({isMouseDown:NO,isSortUp:YES,isActive:NO,actionTarget:null,actionProp:"",actionValue:null,classNames:"nc-table-label-view",init:function(){arguments.callee.base.apply(this,arguments)
},mouseDown:function(a){console.log("mouseDown isActive=%s isSortUp=%s",this.get("isActive"),this.get("isSortUp"));
this.set("isMouseDown",true);if(this.get("isActive")){console.log("switch sort up:%s",this.get("isSortUp"));
this.set("isSortUp",!this.get("isSortUp"))}return YES},mouseUp:function(a){console.log("mouseUp");
if(this.get("isMouseDown")){if(this.get("actionTarget")!==null){this.get("actionTarget").set(this.get("actionProp"),[this.get("actionValue"),this.get("isSortUp")])
}this.set("isMouseDown",false)}return YES},updateBackground:function(){var d=this.get("isActive");
var b=this.get("isMouseDown");var e=this.get("isSortUp");console.log("updateBackground isActive=%s isMouseDown=%s row=%s",d,b,this.get("actionValue"));
var a="#aaa";var c="nc-table-label-view";if(d){c+=e?"-active-sortdown":"-active-sortup"
}if(b){c+="-down"}console.log("color=%s style=%s",a,c);this.set("classNames",["sc-view","sc-label-view",c,"sc-gray-border"]);
this.set("layerNeedsUpdate",YES);this.updateLayerIfNeeded()}.observes("isActive","isMouseDown"),});
NC.TitleView=SC.View.extend({childViews:"titleLabel descriptionLabel".w(),init:function(){arguments.callee.base.apply(this,arguments);
console.log(this.titleLabel);this.titleLabel.bind("value",this,"title");this.descriptionLabel.bind("value",this,"description")
},titleLabel:SC.LabelView.design({classNames:"text_title",layout:{height:NC.TITLE_HEIGHT}}),descriptionLabel:SC.LabelView.design({layout:{top:NC.TITLE_HEIGHT}}),});
NC.dialogPage=SC.Page.design({progressPane:SC.PanelPane.create({layout:{width:400,height:200,centerX:0,centerY:0},classNames:"progressPane",contentView:SC.View.extend({childViews:"msgView".w(),msgView:SC.LabelView.design({layout:{centerX:0,centerY:0,width:400,height:NC.LABEL_HEIGHT},valueBinding:"NC.mainController.progressDlgMsg"})})})});
NC.LOGIN_PANE_WIDTH=750;NC.LOGIN_PANE_HEIGHT=415;NC.LOGIN_PANE_MSG_LEFT=75;NC.LOGIN_PANE_USER_LEFT=295;
NC.LOGIN_PANE_PW_LEFT=NC.LOGIN_PANE_USER_LEFT+160;NC.LOGIN_PANE_BUTTON_LEFT=NC.LOGIN_PANE_PW_LEFT+155;
NC.LOGIN_PANE_LABEL_WIDTH=160;NC.LOGIN_PANE_FIELD_WIDTH=125;NC.LOGIN_PANE_MSG_BOTTOM=22;
NC.LOGIN_PANE_FIELD_BOTTOM=23;NC.LOGIN_PANE_LABEL_BOTTOM=NC.LOGIN_PANE_FIELD_BOTTOM+22;
NC.LOGIN_PANE_BUTTON_BOTTOM=19;NC.loginPage=SC.Page.design({loginPane:SC.PanelPane.create({layout:{width:NC.LOGIN_PANE_WIDTH,height:NC.LOGIN_PANE_HEIGHT,centerX:0,centerY:0},classNames:"login_pane",contentView:SC.View.extend({childViews:"image userLabel userTextField pwLabel pwTextField loginButton".w(),image:SC.ImageView.design({value:"http://"+location.hostname+"/login.png",layout:{width:750,height:415}}),userLabel:SC.LabelView.design({layout:{left:NC.LOGIN_PANE_USER_LEFT,bottom:NC.LOGIN_PANE_LABEL_BOTTOM,width:NC.LOGIN_PANE_LABEL_WIDTH,height:NC.LABEL_HEIGHT},value:"_User".loc()}),userTextField:SC.TextFieldView.design().layout({left:NC.LOGIN_PANE_USER_LEFT,bottom:NC.LOGIN_PANE_FIELD_BOTTOM,width:NC.LOGIN_PANE_FIELD_WIDTH,height:NC.TEXT_FIELD_HEIGHT}).bind("value","NC.mainController.user").prop("hint","_User".loc()),pwLabel:SC.LabelView.design().layout({left:NC.LOGIN_PANE_PW_LEFT,bottom:NC.LOGIN_PANE_LABEL_BOTTOM,width:NC.LOGIN_PANE_LABEL_WIDTH,height:NC.LABEL_HEIGHT}).prop("value","_Password".loc()),pwTextField:SC.TextFieldView.design().layout({left:NC.LOGIN_PANE_PW_LEFT,bottom:NC.LOGIN_PANE_FIELD_BOTTOM,width:NC.LOGIN_PANE_FIELD_WIDTH,height:NC.TEXT_FIELD_HEIGHT}).bind("value","NC.mainController.password").prop("hint","_Password".loc()).prop("isPassword",YES),loginButton:SC.ButtonView.design().layout({left:NC.LOGIN_PANE_BUTTON_LEFT,bottom:NC.LOGIN_PANE_BUTTON_BOTTOM,width:NC.BUTTON_WIDTH,height:NC.BUTTON_HEIGHT}).prop("title","_Login".loc()).prop("action","login").prop("target","NC.mainController").prop("isDefault",YES)})})});
NC.USRD_PANE_WIDTH=400;NC.USRD_PANE_HEIGHT=350;NC.USRD_FIELD_LEFT=100;NC.USRD_FIELD_WIDTH=200;
NC.USRD_FIELD_HEIGHT=NC.LABELED_TEXT_FIELD_HEIGHT+20;NC.USRD_MSG_TOP=NC.TITLEVIEW_HEIGHT;
NC.USRD_GROUP_TOP=NC.USRD_MSG_TOP+NC.USRD_FIELD_HEIGHT;NC.USRD_USER_TOP=NC.USRD_GROUP_TOP+NC.USRD_FIELD_HEIGHT;
NC.USRD_PW_TOP=NC.USRD_USER_TOP+NC.USRD_FIELD_HEIGHT;NC.USRD_CONFIRM_TOP=NC.USRD_PW_TOP+NC.USRD_FIELD_HEIGHT;
NC.USRD_BUTTONS_BOTTOM=10;NC.USRD_BUTTONS_RIGHT=0;NC.USRD_BUTTON_HEIGHT=NC.BUTTON_HEIGHT;
NC.USRD_ACCEPT_RIGHT=0;NC.USRD_CANCEL_RIGHT=NC.USRD_CANCEL_RIGHT+NC.BUTTON_WIDTH+10;
NC.USRD_MSG_LEFT=50;NC.USRD_GROUP_HEIGHT=NC.USRD_FIELD_HEIGHT;NC.USRD_GROUP_LBL_WIDTH=100;
NC.userDlgPage=SC.Page.design({userDlgPane:SC.PanelPane.create({layout:{width:NC.USRD_PANE_WIDTH,height:NC.USRD_PANE_HEIGHT,centerX:0,centerY:0},contentView:SC.View.extend({childViews:"userDlgView".w(),userDlgView:SC.View.design({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},childViews:"titleView groupView userView pwView pwConfirmView buttonView msgView".w(),titleView:NC.TitleView.design({title:"_User_Dialog_Title".loc(),description:"_User_Dialog_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.TITLEVIEW_HEIGHT}}),groupView:SC.View.design({childViews:"labelView radioView".w(),layout:{top:NC.USRD_GROUP_TOP,height:NC.USRD_GROUP_HEIGHT},labelView:SC.LabelView.design({layout:{width:NC.USRD_GROUP_LBL_WIDTH,centerY:0,height:NC.LABEL_HEIGHT},value:"_Group".loc()+":"}),radioView:SC.RadioView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",items:[{title:"_Admin".loc(),value:1,enabled:YES},{title:"_User".loc(),value:2,enabled:YES},{title:"_Guest".loc(),value:3,enabled:YES}],valueBinding:"NC.userController.dlgGroup",isEnabled:YES,layoutDirection:SC.LAYOUT_HORIZONTAL,layout:{left:NC.USRD_GROUP_LBL_WIDTH,centerY:0,height:NC.LABEL_HEIGHT}})}),userView:NC.LabeledTextFieldView.design({hint:"_User".loc(),name:"_User".loc(),enabled:YES,valueBinding:"NC.userController.dlgUser",fieldLeft:NC.USRD_FIELD_LEFT,fieldWidth:NC.USRD_FIELD_WIDTH,layout:{top:NC.USRD_USER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),pwView:NC.LabeledTextFieldView.design({hint:"_Password".loc(),name:"_Password".loc(),enabled:YES,valueBinding:"NC.userController.dlgPassword",fieldLeft:NC.USRD_FIELD_LEFT,fieldWidth:NC.USRD_FIELD_WIDTH,layout:{top:NC.USRD_PW_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),pwConfirmView:NC.LabeledTextFieldView.design({hint:"_Password".loc(),name:"_Confirm".loc(),enabled:YES,valueBinding:"NC.userController.dlgConfirm",fieldLeft:NC.USRD_FIELD_LEFT,fieldWidth:NC.USRD_FIELD_WIDTH,layout:{top:NC.USRD_CONFIRM_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),buttonView:SC.View.design({childViews:"cancelButton acceptButton".w(),layout:{bottom:NC.USRD_BUTTONS_BOTTOM,right:NC.USRD_BUTTONS_RIGHT,height:NC.USRD_BUTTON_HEIGHT},cancelButton:SC.ButtonView.design({isDefault:NO,target:"NC.userController",action:"cancelUser",title:"_Cancel".loc(),layout:{bottom:0,right:NC.USRD_CANCEL_RIGHT,height:NC.BUTTON_HEIGHT,width:NC.BUTTON_WIDTH}}),acceptButton:SC.ButtonView.design({isDefault:YES,target:"NC.userController",action:"acceptUser",title:"_Accept".loc(),layout:{bottom:0,right:NC.USRD_ACCEPT_RIGHT,height:NC.BUTTON_HEIGHT,width:NC.BUTTON_WIDTH}}),}),msgView:SC.LabelView.design({layout:{left:NC.USRD_MSG_LEFT,top:NC.USRD_MSG_TOP,height:NC.LABEL_HEIGHT},classNames:"msg_label",valueBinding:"NC.userController.message"})})})})});
NC.INFO_LEFT=30;NC.INFO_TOP=20;NC.INFO_BOX_ENTRY_HEIGHT=30;NC.INFO_BOX_VALUE_LEFT=100;
NC.INFO_CAMERA_TOP=NC.INFO_TOP;NC.INFO_CAMERA_HEIGHT=160;NC.INFO_NETWORK_LEFT=450;
NC.INFO_NETWORK_HEIGHT=NC.INFO_CAMERA_HEIGHT;NC.INFO_VIDEO_TOP=2*NC.INFO_TOP+NC.INFO_NETWORK_HEIGHT+NC.SEPARATOR_HEIGHT;
NC.INFO_VIDEO_HEIGHT=140;NC.INFO_UMTS_TOP=NC.INFO_TOP+NC.INFO_VIDEO_TOP+NC.INFO_VIDEO_HEIGHT+NC.SEPARATOR_HEIGHT;
NC.INFO_UMTS_BOX_HEIGHT=115;NC.INFO_UMTS_SIG_TOP=NC.INFO_UMTS_BOX_HEIGHT;NC.INFO_UMTS_SIG_HEIGHT=50;
NC.INFO_UMTS_HEIGHT=NC.INFO_UMTS_BOX_HEIGHT+NC.INFO_UMTS_SIG_HEIGHT;NC.INFO_UMTS_SIG_LBL_TOP=5;
NC.INFO_UMTS_SIG_LBL_WIDTH=100;NC.INFO_UMTS_SIG_PIC_LEFT=NC.INFO_BOX_VALUE_LEFT+2;
NC.INFO_UMTS_SIG_PIC_TOP=0;NC.INFO_UMTS_SIG_PIC_WIDTH=38;NC.INFO_UMTS_SIG_PIC_HEIGHT=20;
NC.INFO_UMTS_SIG_VAL_LEFT=NC.INFO_UMTS_SIG_PIC_LEFT+NC.INFO_UMTS_SIG_PIC_WIDTH+10;
NC.INFO_VSEP_LEFT=NC.INFO_NETWORK_LEFT-50;NC.infoPage=SC.Page.design({infoView:SC.View.extend({childViews:"cameraBox vseparator1 networkBox separator1 videoBox separator2 umtsView".w(),classNames:"infoview",cameraBox:NC.InfoBoxView.design({title:"_Camera".loc(),entryHeight:NC.INFO_BOX_ENTRY_HEIGHT,valueLeft:NC.INFO_BOX_VALUE_LEFT,entries:[["_Version".loc(),"NC.dataSrcController.camera_version",true],["_SerialNumber".loc(),"NC.dataSrcController.info_serial_number",true],["_Uptime".loc(),"NC.dataSrcController.info_uptime",true],],layout:{left:NC.INFO_LEFT,top:NC.INFO_CAMERA_TOP,height:NC.INFO_CAMERA_HEIGHT},}),vseparator1:SC.SeparatorView.design({layout:{left:NC.INFO_VSEP_LEFT,top:NC.INFO_TOP,height:NC.INFO_NETWORK_HEIGHT,width:NC.SEPARATOR_HEIGHT},layoutDirection:SC.LAYOUT_VERTICAL}),networkBox:NC.InfoBoxView.design({title:"_Network".loc(),entryHeight:NC.INFO_BOX_ENTRY_HEIGHT,valueLeft:NC.INFO_BOX_VALUE_LEFT,entries:[["_Ipv4Address".loc(),"NC.dataSrcController.info_network_ipv4",true],["_SubnetMask".loc(),"NC.dataSrcController.info_network_subnetmask",true],["_DNSServer".loc(),"NC.dataSrcController.displayDnsServer",true],["_PPPIP".loc(),"NC.umtsController.pppIp",true]],layout:{left:NC.INFO_NETWORK_LEFT,top:NC.INFO_TOP,height:NC.INFO_NETWORK_HEIGHT},}),separator1:SC.SeparatorView.design({layout:{left:NC.INFO_LEFT,right:NC.INFO_LEFT,top:NC.INFO_TOP+NC.INFO_NETWORK_HEIGHT,height:NC.SEPARATOR_HEIGHT}}),videoBox:NC.InfoBoxView.design({title:"_Video".loc(),entryHeight:NC.INFO_BOX_ENTRY_HEIGHT,valueLeft:NC.INFO_BOX_VALUE_LEFT,entries:[["_Stream".loc()+" 1","NC.dataSrcController.mpeg4highInfo",true,"NC.dataSrcController.mpeg4highRtspLink",360,false],["_Stream".loc()+" 2","NC.dataSrcController.mjpgInfo",true,"NC.dataSrcController.mjpgLink",360,true],["_Stream".loc()+" 3","NC.dataSrcController.mpeg4lowInfo",true,"NC.dataSrcController.mpeg4lowRtspLink",360,false]],layout:{left:NC.INFO_LEFT,top:NC.INFO_VIDEO_TOP,height:NC.INFO_VIDEO_HEIGHT},}),separator2:SC.SeparatorView.design({layout:{left:NC.INFO_LEFT,right:NC.INFO_LEFT,top:NC.INFO_VIDEO_TOP+NC.INFO_VIDEO_HEIGHT,height:NC.SEPARATOR_HEIGHT}}),umtsView:SC.View.design({layout:{left:NC.INFO_LEFT,top:NC.INFO_UMTS_TOP,height:NC.INFO_UMTS_HEIGHT},isVisibleBinding:SC.Binding.oneWay().from("NC.dataSrcController.umts_enabled"),childViews:"umtsBox signalView".w(),umtsBox:NC.InfoBoxView.design({title:"_WirelessConnection".loc(),entryHeight:NC.INFO_BOX_ENTRY_HEIGHT,valueLeft:NC.INFO_BOX_VALUE_LEFT,entries:[["_Connection".loc(),"NC.umtsController.connection",true],["_Upstreamrate".loc(),"NC.umtsController.upstreamRateDisplay",true],["_Downstreamrate".loc(),"NC.umtsController.downstreamRateDisplay",true]],layout:{height:NC.INFO_UMTS_BOX_HEIGHT}}),signalView:SC.View.design({childViews:"labelView imageView valueView".w(),layout:{top:NC.INFO_UMTS_SIG_TOP,height:NC.INFO_UMTS_SIG_HEIGHT},labelView:SC.LabelView.design({layout:{top:NC.INFO_UMTS_SIG_LBL_TOP,width:NC.INFO_UMTS_SIG_LBL_WIDTH,height:NC.LABEL_HEIGHT},value:"_SignalStrength".loc()+":"}),imageView:SC.ImageView.design({layout:{left:NC.INFO_UMTS_SIG_PIC_LEFT,top:NC.INFO_UMTS_SIG_PIC_TOP,width:NC.INFO_UMTS_SIG_PIC_WIDTH,height:NC.INFO_UMTS_SIG_PIC_HEIGHT},valueBinding:SC.Binding.oneWay().from("NC.umtsController.signalImage")}),valueView:SC.LabelView.design({layout:{left:NC.INFO_UMTS_SIG_VAL_LEFT,top:NC.INFO_UMTS_SIG_LBL_TOP,width:NC.INFO_UMTS_SIG_LBL_WIDTH,height:NC.LABEL_HEIGHT},valueBinding:SC.Binding.oneWay().from("NC.umtsController.signalDisplay")})})}),separator3:SC.SeparatorView.design({layout:{left:NC.INFO_LEFT,right:NC.INFO_LEFT,top:NC.INFO_UMTS_TOP+NC.INFO_UMTS_HEIGHT,height:NC.SEPARATOR_HEIGHT}})})});
NC.LV_IMG_TOP=50;NC.LV_LINK_HIGH_WIDTH=180;NC.LV_LINK_LOW_WIDTH=170;NC.liveViewPage=SC.Page.design({liveView:SC.View.extend({childViews:"imageView infoLabel rtspHighLink rtspLowLink".w(),classNames:"liveview",imageView:SC.View.design({classNames:"imgborder"}),infoLabel:SC.LabelView.design({valueBinding:"NC.dataSrcController.liveViewLabel"}),rtspHighLink:SC.View.design({render:function(d,f){var c=NC.dataSrcController.get("mpeg4highResolution");
var b=NC.dataSrcController.get("mpeg4highRtspLink");var a="_MPEG4Stream".loc()+" ("+c+")";
var e='<a href="'+b+'">'+a+"</a>";console.log("res=%s label=%s link=%s",c,a,e);d.push(e)
}}),rtspLowLink:SC.View.design({render:function(d,f){var c=NC.dataSrcController.get("mpeg4lowResolution");
var b=NC.dataSrcController.get("mpeg4lowRtspLink");var a="_MPEG4Stream".loc()+" ("+c+")";
var e='<a href="'+b+'">'+a+"</a>";console.log("res=%s label=%s link=%s",c,a,e);d.push(e)
}})})});NC.MAIN_PANE_WIDTH=950;NC.MAIN_PANE_HEIGHT=900;NC.MAIN_PANE_TITLE_TOP=11;
NC.MAIN_PANE_TITLE_HEIGHT=146;NC.MAIN_PANE_MENU_TOP=167;NC.MAIN_PANE_MENU_HEIGHT=39;
NC.MAIN_PANE_MAIN_TOP=216;NC.MAIN_PANE_MAIN_HEIGHT=644;NC.TITLE_VIEW_BUTTON_TOP=8;
NC.TITLE_VIEW_RECORD_DISPLAY_TOP=5;NC.TITLE_VIEW_RECORD_DISPLAY_RIGHT=10;NC.TITLE_VIEW_RECORD_DISPLAY_WIDTH=32;
NC.TITLE_VIEW_RECORD_DISPLAY_HEIGHT=32;NC.TITLE_VIEW_LOGOUT_BUTTON_RIGHT=NC.TITLE_VIEW_RECORD_DISPLAY_RIGHT+NC.TITLE_VIEW_RECORD_DISPLAY_WIDTH+10;
NC.TITLE_VIEW_LOGOUT_BUTTON_WIDTH=80;NC.TITLE_VIEW_RECORD_BUTTON_RIGHT=NC.TITLE_VIEW_LOGOUT_BUTTON_RIGHT+NC.TITLE_VIEW_LOGOUT_BUTTON_WIDTH+10;
NC.TITLE_VIEW_RECORD_BUTTON_WIDTH=120;NC.TITLE_VIEW_LENS_VIEW_RIGHT=NC.TITLE_VIEW_RECORD_BUTTON_RIGHT+NC.TITLE_VIEW_RECORD_BUTTON_WIDTH+10;
NC.TITLE_VIEW_LENS_VIEW_WIDTH=113;NC.TITLE_VIEW_SEG_VIEW_LEFT=20;NC.TITLE_VIEW_SEG_VIEW_RIGHT=NC.TITLE_VIEW_LENS_VIEW_RIGHT+NC.TITLE_VIEW_LENS_VIEW_WIDTH+10;
NC.mainPage=SC.Page.design({emptyMainPane:SC.MainPane.design({}),mainPane:SC.MainPane.design({childViews:"scrollView".w(),scrollView:NC.ScrollView.design({layout:{left:0,right:0,bottom:0,top:0},hasVerticalScroller:YES,isVerticalScrollerVisible:YES,autohidesVerticalScroller:NO,mouseWheelTickY:50,contentView:SC.View.design({layout:{left:20,width:NC.MAIN_PANE_WIDTH,height:NC.MAIN_PANE_HEIGHT},classNames:"main_pane",childViews:"titleView menuView mainView".w(),titleView:SC.ImageView.design({value:"http://"+location.hostname+"/header.png",layout:{top:NC.MAIN_PANE_TITLE_TOP,height:NC.MAIN_PANE_TITLE_HEIGHT},classNames:"sc-gray-border"}),menuView:SC.View.design({layout:{top:NC.MAIN_PANE_MENU_TOP,height:NC.MAIN_PANE_MENU_HEIGHT},classNames:"sc-gray-border",childViews:"lensView logoutButton recordDisplay recordOffDisplay recordButton segView".w(),lensView:SC.View.design({layout:{width:NC.TITLE_VIEW_LENS_VIEW_WIDTH,top:NC.TITLE_VIEW_BUTTON_TOP,right:NC.TITLE_VIEW_LENS_VIEW_RIGHT,height:NC.BUTTON_HEIGHT},childViews:"segView".w(),segView:SC.SegmentedView.design({allowsMultipleSelection:NO,allowsEmptySelection:NO,items:[{title:"_Lens1".loc(),value:0},{title:"_Lens2".loc(),value:1}],itemTitleKey:"title",itemValueKey:"value",valueBinding:"NC.mainController.lens",isVisibleBinding:SC.Binding.oneWay().from("NC.mainController.lensEnabled"),})}),recordDisplay:SC.View.design({layout:{right:NC.TITLE_VIEW_RECORD_DISPLAY_RIGHT,top:NC.TITLE_VIEW_RECORD_DISPLAY_TOP,width:NC.TITLE_VIEW_RECORD_DISPLAY_WIDTH,height:NC.TITLE_VIEW_RECORD_DISPLAY_HEIGHT},isVisibleBinding:SC.Binding.oneWay().from("NC.mainController.recording"),classNames:"sc-icon-record"}),recordOffDisplay:SC.View.design({layout:{right:NC.TITLE_VIEW_RECORD_DISPLAY_RIGHT,top:NC.TITLE_VIEW_RECORD_DISPLAY_TOP,width:NC.TITLE_VIEW_RECORD_DISPLAY_WIDTH,height:NC.TITLE_VIEW_RECORD_DISPLAY_HEIGHT},isVisibleBinding:SC.Binding.oneWay().from("NC.mainController.recordingOff"),classNames:"sc-icon-record-idle"}),recordButton:SC.ButtonView.design({layout:{right:NC.TITLE_VIEW_RECORD_BUTTON_RIGHT,top:NC.TITLE_VIEW_BUTTON_TOP,width:NC.TITLE_VIEW_RECORD_BUTTON_WIDTH,height:NC.BUTTON_HEIGHT},titleBinding:SC.Binding.oneWay().from("NC.mainController.recordButtonTitle"),isVisibleBinding:SC.Binding.oneWay().from("NC.mainController.recordButtonEnabled"),actionBinding:SC.Binding.oneWay().from("NC.mainController.recordButtonAction"),target:"NC.mainController",isDefault:NO}),logoutButton:SC.ButtonView.design().layout({right:NC.TITLE_VIEW_LOGOUT_BUTTON_RIGHT,top:NC.TITLE_VIEW_BUTTON_TOP,width:NC.TITLE_VIEW_LOGOUT_BUTTON_WIDTH,height:NC.BUTTON_HEIGHT}).prop("title","_Logout".loc()).prop("action","logout").prop("target","NC.mainController").prop("isDefault",NO),segView:SC.View.design({childViews:"segView".w(),layout:{left:NC.TITLE_VIEW_SEG_VIEW_LEFT,top:NC.TITLE_VIEW_BUTTON_TOP,right:NC.TITLE_VIEW_SEG_VIEW_RIGHT,height:NC.BUTTON_HEIGHT},segView:SC.SegmentedView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",itemsBinding:"NC.mainController.menuItems",valueBinding:"NC.mainController.selection",isEnabled:YES})}),segViewOLD:SC.SegmentedView.design({layout:{left:NC.TITLE_VIEW_SEG_VIEW_LEFT,top:NC.TITLE_VIEW_BUTTON_TOP,right:NC.TITLE_VIEW_SEG_VIEW_RIGHT,height:NC.BUTTON_HEIGHT},itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",itemsBinding:"NC.mainController.menuItems",valueBinding:"NC.mainController.selection",isEnabled:YES})}),mainView:SC.View.design({layout:{top:NC.MAIN_PANE_MAIN_TOP,height:NC.MAIN_PANE_MAIN_HEIGHT},classNames:"sc-gray-border",childViews:"containerView".w(),containerView:SC.ContainerView.design({})})})})})});
NC.mainTestPage=SC.Page.design({mainPane:SC.MainPane.design({childViews:"labelView".w(),labelView:SC.LabelView.design({layout:{centerX:0,centerY:0,width:200,height:18},textAlign:SC.ALIGN_CENTER,tagName:"h1",value:"Welcome to SproutCore!"})})});
NC.MTN_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.MTN_LEFT=50;NC.MTN_RIGHT=50;NC.MTN_BTN_WIDTH=200;
NC.MTN_START_TOP=20;NC.MTN_START_HEIGHT=140;NC.MTN_START_BTN_TOP=NC.MTN_TITLE_HEIGHT;
NC.MTN_FORMAT_TOP=NC.MTN_START_TOP+NC.MTN_START_HEIGHT;NC.MTN_FORMAT_HEIGHT=120;NC.MTN_FORMAT_BTN_TOP=NC.MTN_TITLE_HEIGHT-20;
NC.MTN_RESET_TOP=NC.MTN_FORMAT_TOP+NC.MTN_FORMAT_HEIGHT;NC.MTN_RESET_HEIGHT=120;NC.MTN_RESET_BTN_TOP=NC.MTN_TITLE_HEIGHT-20;
NC.MTN_FIRMWARE_TOP=NC.MTN_RESET_TOP+NC.MTN_RESET_HEIGHT;NC.MTN_FIRMWARE_HEIGHT=150;
NC.MTN_FW_UPLOAD_TOP=NC.MTN_TITLE_HEIGHT;NC.MTN_SEP2_TOP=NC.MTN_FIRMWARE_TOP+NC.MTN_FIRMWARE_HEIGHT;
NC.MTN_START_BTN_WIDTH=NC.MTN_BTN_WIDTH;NC.MTN_FORNAT_BTN_WIDTH=NC.MTN_BTN_WIDTH;
NC.MTN_RESET_BTN_WIDTH=NC.MTN_BTN_WIDTH;NC.MTN_CHECK_BTN_WIDTH=NC.MTN_BTN_WIDTH;NC.MTN_SEPARATOR_HEIGHT=10;
NC.maintenancePage=SC.Page.design({mainView:SC.View.extend({childViews:"startView formatView resetView firmware".w(),classNames:"nc-maintenance-view",startView:SC.View.design({childViews:"title startButton separator".w(),layout:{left:NC.MTN_LEFT,top:NC.MTN_START_TOP,height:NC.MTN_START_HEIGHT,right:NC.MTN_RIGHT},title:NC.TitleView.design({titleBinding:SC.Binding.oneWay().from("NC.maintenanceController.startBtnTitle"),descriptionBinding:SC.Binding.oneWay().from("NC.maintenanceController.startMaintenanceText"),isEnabledBinding:SC.Binding.oneWay().from("NC.mainController.maintenanceEnabled"),layout:{height:NC.MTN_TITLE_HEIGHT}}),startButton:SC.ButtonView.design({isDefault:NO,target:"NC.maintenanceController",actionBinding:SC.Binding.oneWay().from("NC.maintenanceController.startBtnAction"),titleBinding:SC.Binding.oneWay().from("NC.maintenanceController.startBtnTitle"),isEnabled:YES,layout:{top:NC.MTN_START_BTN_TOP,width:NC.MTN_START_BTN_WIDTH,centerX:0,height:NC.BUTTON_HEIGHT}}),separator:SC.SeparatorView.design({layout:{bottom:NC.MTN_SEPARATOR_HEIGHT,height:NC.MTN_SEPARATOR_HEIGHT}})}),formatView:SC.View.design({childViews:"title formatButton separator".w(),layout:{left:NC.MTN_LEFT,top:NC.MTN_FORMAT_TOP,height:NC.MTN_FORMAT_HEIGHT,right:NC.MTN_RIGHT},title:NC.TitleView.design({title:"_FormatMMCTitle".loc(),description:"_FormatMMCText".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.mainController.maintenanceEnabled"),layout:{height:NC.MTN_TITLE_HEIGHT}}),formatButton:SC.ButtonView.design({isDefault:NO,target:"NC.maintenanceController",action:"showFormatDialog",title:"_FormatMMC".loc()+"...",isEnabledBinding:SC.Binding.oneWay().from("NC.mainController.maintenanceEnabled"),layout:{top:NC.MTN_FORMAT_BTN_TOP,width:NC.MTN_FORNAT_BTN_WIDTH,centerX:0,height:NC.BUTTON_HEIGHT}}),separator:SC.SeparatorView.design({layout:{bottom:NC.MTN_SEPARATOR_HEIGHT,height:NC.MTN_SEPARATOR_HEIGHT}})}),resetView:SC.View.design({childViews:"title resetButton separator".w(),layout:{left:NC.MTN_LEFT,top:NC.MTN_RESET_TOP,height:NC.MTN_RESET_HEIGHT,right:NC.MTN_RIGHT},title:NC.TitleView.design({title:"_ResetDefaultsTitle".loc(),description:"_ResetDefaultsText".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.mainController.maintenanceEnabled"),layout:{height:NC.MTN_TITLE_HEIGHT}}),resetButton:SC.ButtonView.design({isDefault:NO,target:"NC.maintenanceController",action:"showResetDialog",title:"_ResetDefaults".loc()+"...",isEnabledBinding:SC.Binding.oneWay().from("NC.mainController.maintenanceEnabled"),layout:{top:NC.MTN_RESET_BTN_TOP,width:NC.MTN_RESET_BTN_WIDTH,centerX:0,height:NC.BUTTON_HEIGHT}}),separator:SC.SeparatorView.design({layout:{bottom:NC.MTN_SEPARATOR_HEIGHT,height:NC.MTN_SEPARATOR_HEIGHT}})}),firmware:SC.View.design({childViews:"title upload iframe".w(),layout:{left:NC.MTN_LEFT,top:NC.MTN_FIRMWARE_TOP,height:NC.MTN_FIRMWARE_HEIGHT,right:NC.MTN_RIGHT},title:NC.TitleView.design({title:"_FirmwareUploadTitle".loc(),description:"_FirmwareUploadText".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.maintenanceController.enabled"),layout:{height:NC.MTN_TITLE_HEIGHT}}),upload:SC.View.design({layout:{top:NC.MTN_FW_UPLOAD_TOP},isEnabledBinding:SC.Binding.oneWay().from("NC.maintenanceController.enabled"),displayProperties:"isEnabled".w(),render:function(a,g){var e=location.hostname;
var b=this.get("isEnabled")?"":"disabled readonly";var f="disabled";var d=this.get("value");
var c='<form name="firmware" action="http://'+e+'/upload?upload" method="post" onsubmit="return NC.mainController.startUpload();" target="test_frame" enctype="multipart/form-data">';
a.push(c);a.push('<p><input name="Upload_File" type="file" size="50" maxlength="100000" onchange="NC.maintenanceController.uploadFileChanged(this.value);" accept="text/*" "'+b+'"><br><br>');
a.push('<input name="Upload_Send_Button" type="submit" value="'+"_Upload".loc()+'" '+f+"></p>");
a.push("</form>")}}),iframe:SC.View.design({layout:{top:0,left:0,height:0,width:0},render:function(a,c){console.log("render iframe");
var b='<IFRAME src="empty.txt" height="0" width="0" frameborder="0" name="test_frame" TITLE="News"/>';
a.push(b)}})})})});NC.RCD_SPACE_TOP=NC.TITLE_TOP;NC.RCD_SPACE_LEFT=50;NC.RCD_TABLE_LEFT=NC.RCD_SPACE_LEFT;
NC.RCD_TABLE_TOP=NC.TITLE_TOP+NC.TITLE_HEIGHT+40;NC.RCD_TABLE_WIDTH=500;NC.RCD_TABLE_HEIGHT=450;
NC.RCD_BTNV_TOP=NC.RCD_TABLE_TOP+NC.RCD_TABLE_HEIGHT;NC.RCD_BTNV_LEFT=NC.RCD_TABLE_LEFT;
NC.RCD_BTNV_WIDTH=NC.RCD_TABLE_WIDTH;NC.RCD_BTNV_HEIGHT=NC.BUTTON_HEIGHT+20;NC.RCD_BTN_WIDTH=100;
NC.RCD_BTN_EXPORT_RIGHT=0;NC.RCD_BTN_REMOVE_RIGHT=NC.RCD_BTN_EXPORT_RIGHT+NC.RCD_BTN_WIDTH+10;
NC.RCD_BTN_REPAIR_RIGHT=NC.RCD_BTN_REMOVE_RIGHT+NC.RCD_BTN_WIDTH+10;NC.RCD_INFO_LEFT=NC.RCD_TABLE_LEFT+NC.RCD_TABLE_WIDTH+50;
NC.RCD_INFO_TOP=NC.RCD_TABLE_TOP;NC.RCD_INFO_HEIGHT=310;NC.RCD_AUDIO_TOP=NC.RCD_TABLE_TOP+NC.RCD_INFO_HEIGHT;
NC.RCD_AUDIO_HEIGHT=150;NC.RCD_TBL_NAME_LEFT=0;NC.RCD_TBL_NAME_WIDTH=155;NC.RCD_TBL_SIZE_LEFT=NC.RCD_TBL_NAME_LEFT+NC.RCD_TBL_NAME_WIDTH;
NC.RCD_TBL_SIZE_WIDTH=90;NC.RCD_TBL_DUR_LEFT=NC.RCD_TBL_SIZE_LEFT+NC.RCD_TBL_SIZE_WIDTH;
NC.RCD_TBL_DUR_WIDTH=110;NC.RCD_TBL_MDF_LEFT=NC.RCD_TBL_DUR_LEFT+NC.RCD_TBL_DUR_WIDTH;
NC.RCD_TBL_MDF_WIDTH=NC.RCD_TABLE_WIDTH-NC.RCD_TBL_MDF_LEFT-4;NC.recordPage=SC.Page.design({recordView:SC.View.extend({classNames:"nc-record-view",childViews:"titleView tableView videoBox audioBox buttonView".w(),titleView:NC.TitleView.design({title:"_InternalFlashMemory".loc(),descriptionBinding:"NC.recordsController.displaySpace",layout:{top:NC.RCD_SPACE_TOP,left:NC.RCD_SPACE_LEFT,height:NC.USR_TITLE_HEIGHT}}),spaceView:SC.LabelView.design({layout:{top:NC.RCD_SPACE_TOP,left:NC.RCD_SPACE_LEFT,height:NC.LABEL_HEIGHT},valueBinding:"NC.recordsController.displaySpace"}),tableView:NC.TableView.design({content:"name sizeMB durationStr displayTableStartTime".w(),width:[NC.RCD_TBL_NAME_WIDTH,NC.RCD_TBL_SIZE_WIDTH,NC.RCD_TBL_DUR_WIDTH,NC.RCD_TBL_MDF_WIDTH],title:["_Name".loc(),"_Size".loc()+" ("+"_MB".loc()+")","_Length".loc()+" ("+"_min".loc()+")","_StartTime".loc()],layout:{top:NC.RCD_TABLE_TOP,left:NC.RCD_TABLE_LEFT,width:NC.RCD_TABLE_WIDTH,height:NC.RCD_TABLE_HEIGHT},contentProp:"NC.recordsController.records",selectionProp:"NC.recordsController.selection",sortBinding:"NC.recordsController.sortAction"}),videoBox:NC.InfoBoxView.design({title:"_Video".loc(),entryHeight:25,valueLeft:100,entries:[["_Name".loc(),"NC.videoController.name",true],["_Size".loc(),"NC.videoController.displaySize",true],["_Length".loc(),"NC.videoController.displayDuration",true],["_StartTime".loc(),"NC.videoController.displayStartTime",true],["_Modified".loc(),"NC.videoController.modified",true],["_FrameCount".loc(),"NC.videoController.video_frame_count",true],["_Framerate".loc(),"NC.videoController.frameRate",true],["_Bitrate".loc(),"NC.videoController.videoBitrate",true],["_Pcount".loc(),"NC.videoController.video_pcount",true],["_FrameDrops".loc(),"NC.videoController.video_frame_drops",true],["_Resolution".loc(),"NC.videoController.resolution",true]],layout:{left:NC.RCD_INFO_LEFT,top:NC.RCD_INFO_TOP,height:NC.RCD_INFO_HEIGHT},}),audioBox:NC.InfoBoxView.design({title:"_Audio".loc(),entryHeight:25,valueLeft:100,entries:[["_Length".loc(),"NC.videoController.displayAudioDuration",true],["_SampleCount".loc(),"NC.videoController.audio_sample_count",true],["_Samplerate".loc(),"NC.videoController.displayAudioSamplerate",true],["_Bitrate".loc(),"NC.videoController.displayAudioBitrate",true],["_Channels".loc(),"NC.videoController.audio_channels",true]],layout:{left:NC.RCD_INFO_LEFT,top:NC.RCD_AUDIO_TOP,height:NC.RCD_AUDIO_HEIGHT},}),buttonView:SC.View.design({childViews:"exportButton removeButton refreshButton repairButton".w(),layout:{top:NC.RCD_BTNV_TOP,left:NC.RCD_BTNV_LEFT,width:NC.RCD_BTNV_WIDTH,height:NC.RCD_BTNV_HEIGHT},exportButton:SC.ButtonView.design({isDefault:NO,target:"NC.recordsController",action:"exportRecords",title:"_Export".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.mainController.downloadButtonEnabled"),layout:{right:NC.RCD_BTN_EXPORT_RIGHT,width:NC.RCD_BTN_WIDTH,centerY:0,height:NC.BUTTON_HEIGHT}}),removeButton:SC.ButtonView.design({isDefault:NO,target:"NC.recordsController",action:"deleteRecords",title:"_Delete".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.recordsController.recordSelected"),layout:{right:NC.RCD_BTN_REMOVE_RIGHT,width:NC.RCD_BTN_WIDTH,centerY:0,height:NC.BUTTON_HEIGHT}}),repairButton:SC.ButtonView.design({isDefault:NO,target:"NC.recordsController",action:"repairRecord",title:"_Repair".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.recordsController.repairEnabled"),layout:{right:NC.RCD_BTN_REPAIR_RIGHT,width:NC.RCD_BTN_WIDTH,centerY:0,height:NC.BUTTON_HEIGHT}}),refreshButton:SC.ButtonView.design({isDefault:NO,target:"NC.recordsController",action:"refreshRecords",title:"_Refresh".loc(),isEnabled:YES,layout:{width:NC.RCD_BTN_WIDTH,centerY:0,height:NC.BUTTON_HEIGHT}})})})});
NC.SVC_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.SVC_LEFT=50;NC.SVC_RIGHT=50;NC.SVC_FIELD_LEFT=100;
NC.SVC_FIELD_WIDTH=100;NC.SVC_SERIAL_TOP=20;NC.SVC_SERIAL_TEXT_TOP=NC.SVC_TITLE_HEIGHT;
NC.SVC_SERIAL_BTN_TOP=NC.SVC_SERIAL_TEXT_TOP+2;NC.SVC_SERIAL_HEIGHT=140;NC.SVC_SERIAL_TEXT_WIDTH=200;
NC.SVC_SERIAL_BTN_WIDTH=200;NC.SVC_SERIAL_BTN_LEFT=NC.SVC_SERIAL_TEXT_WIDTH+20;NC.SVC_SEPARATOR_HEIGHT=10;
NC.servicePage=SC.Page.design({mainView:SC.View.extend({childViews:"serialView".w(),classNames:"nc-service-view",serialView:SC.View.design({childViews:"title serialText serialButton separator".w(),layout:{left:NC.SVC_LEFT,top:NC.SVC_SERIAL_TOP,height:NC.SVC_SERIAL_HEIGHT,right:NC.SVC_RIGHT},title:NC.TitleView.design({title:"_EnterSerialTitle".loc(),description:"_EnterSerialText".loc(),layout:{height:NC.SVC_TITLE_HEIGHT}}),serialText:NC.LabeledTextFieldView.design({hint:"_SerialNumber".loc(),name:"_SerialNumber".loc(),valueBinding:"NC.dataSrcController.info_serial_number",fieldLeft:NC.SVC_FIELD_LEFT,fieldWidth:NC.SVC_FIELD_WIDTH,layout:{top:NC.SVC_SERIAL_TEXT_TOP,width:NC.SVC_SERIAL_TEXT_WIDTH,height:NC.BUTTON_HEIGHT}}),serialButton:SC.ButtonView.design({isDefault:NO,target:"NC.maintenanceController",action:"transferSerialNumber",title:"_SaveSerialNumber".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.dataSrcController.serialValid"),layout:{top:NC.SVC_SERIAL_BTN_TOP,width:NC.SVC_SERIAL_BTN_WIDTH,left:NC.SVC_SERIAL_BTN_LEFT,height:NC.BUTTON_HEIGHT}}),separator:SC.SeparatorView.design({layout:{bottom:NC.SVC_SEPARATOR_HEIGHT,height:NC.SVC_SEPARATOR_HEIGHT}})})})});
NC.SETUP_BUTTON_TOP=14;NC.SETUP_SAVE_RIGHT=30;NC.SETUP_RESET_RIGHT=170;NC.setupPage=SC.Page.design({setupView:SC.View.design({classNames:"setupview",childViews:"menuView dataView actionView".w(),menuView:SC.SourceListView.design({contentBinding:"NC.setupMenuController.arrangedObjects",selectionBinding:"NC.setupMenuController.selection",contentValueKey:"name",contentIconKey:"icon",hasContentIcon:true,action:"action",target:"NC.setupMenuController",actOnSelect:true,layout:{width:NC.SETUP_MENU_WIDTH-1}}),dataView:SC.ContainerView.design({layout:{left:NC.SETUP_MENU_WIDTH,bottom:NC.SETUP_ACTION_HEIGHT}}),actionView:SC.View.design({classNames:"actionview",childViews:"resetButton saveButton".w(),layout:{left:NC.SETUP_MENU_WIDTH,bottom:0,height:NC.SETUP_ACTION_HEIGHT},resetButton:SC.ButtonView.design({isDefault:NO,target:"NC.dataController",action:"reset",title:"_Reset".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.dataController.saveEnabled"),layout:{top:NC.SETUP_BUTTON_TOP,right:NC.SETUP_RESET_RIGHT,height:NC.BUTTON_HEIGHT,width:NC.BUTTON_WIDTH}}),saveButton:SC.ButtonView.design({isDefault:YES,target:"NC.dataController",action:"save",title:"_Save".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.dataController.saveEnabled"),layout:{top:NC.SETUP_BUTTON_TOP,right:NC.SETUP_SAVE_RIGHT,height:NC.BUTTON_HEIGHT,width:NC.BUTTON_WIDTH}})}),}),});
NC.testPage=SC.Page.design({testView:SC.View.extend({childViews:"imageView".w(),imageView:SC.View.design({layout:{left:0,top:0,width:640,height:352},classNames:"imgborder",render:function(c,d){var b=NC.mainController.getHttpAddress()+"/jpeg?mode=stream";
var a='<p><img src="'+b+'" width="640" height="352" alt="image"></p>';c.push(a)}})})});
NC.AUDIO_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.AUDIO_ENABLED_TOP=NC.AUDIO_TITLE_HEIGHT+10;
NC.AUDIO_CHECK_BOX_HEIGHT=50;NC.AUDIO_SAMPLERATE_TOP=NC.AUDIO_ENABLED_TOP+NC.AUDIO_CHECK_BOX_HEIGHT;
NC.AUDIO_SAMPLERATE_HEIGHT=100;NC.AUDIO_BITRATE_TOP=NC.AUDIO_SAMPLERATE_TOP+NC.AUDIO_SAMPLERATE_HEIGHT;
NC.AUDIO_BITRATE_HEIGHT=100;NC.AUDIO_VOLUME_TOP=NC.AUDIO_ENABLED_TOP+NC.AUDIO_CHECK_BOX_HEIGHT;
NC.AUDIO_RADIO_LEFT=125;NC.AUDIO_SLIDER_VAL_LEFT=NC.SLIDER_VAL_LEFT;NC.audioPage=SC.Page.design({audioView:SC.View.extend({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},classNames:"nc-audio-view",properties:["audio_main_mode","audio_main_volume_value"],childViews:"titleView enabledView volumeView".w(),titleView:NC.TitleView.design({title:"_Audio_Title".loc(),description:"_Audio_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.AUDIO_TITLE_HEIGHT}}),enabledView:SC.CheckboxView.design({title:"_Audio/MP3".loc(),valueBinding:"NC.dataController.audioEnabled",layout:{top:NC.AUDIO_ENABLED_TOP,height:NC.CHECKBOX_HEIGHT}}),volumeView:NC.SliderView.design({layout:{top:NC.AUDIO_VOLUME_TOP,height:NC.SLIDER_VIEW_HEIGHT,width:NC.SLIDER_VIEW_WIDTH},valueBinding:"NC.dataController.audio_main_volume_value",minimumBinding:SC.Binding.oneWay().from("NC.dataSrcController.audio_main_volume_min"),maximumBinding:SC.Binding.oneWay().from("NC.dataSrcController.audio_main_volume_max"),stepBinding:SC.Binding.oneWay().from("NC.dataSrcController.audio_main_volume_step"),isEnabledBinding:SC.Binding.oneWay().from("NC.dataController.audioEnabled"),label:"_Volume".loc(),valueLeft:NC.AUDIO_SLIDER_VAL_LEFT,}),}),});
NC.MSK_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.MSK_IMG_TOP=NC.MSK_TITLE_HEIGHT+20;NC.maskPage=SC.Page.design({privacyView:SC.View.extend({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},classNames:"nc-privacy-view",properties:[],childViews:"titleView imageView removeButton".w(),titleView:NC.TitleView.design({title:"_Privacy_Mask_Title".loc(),description:"_Privacy_Mask_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.MSK_TITLE_HEIGHT}}),imageView:SC.View.design({childViews:"imageView".w(),imageView:SC.View.design({classNames:"imgborder",})}),removeButton:SC.ButtonView.design({isDefault:NO,target:"NC.privacyMaskController",action:"removeCurrentMask",title:"_Remove_Mask".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.privacyMaskController.removeButtonEnabled")})}),motionView:SC.View.extend({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},classNames:"nc-motion-view",properties:["video_motion_sensitivity_value","video_motion_display_enabled"],childViews:"titleView imageView removeButton sensitivityView displayBox".w(),titleView:NC.TitleView.design({title:"_Motion_Detection_Title".loc(),description:"_Motion_Detection_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.MSK_TITLE_HEIGHT}}),imageView:SC.View.design({childViews:"imageView".w(),imageView:SC.View.design({classNames:"imgborder",})}),removeButton:SC.ButtonView.design({isDefault:NO,target:"NC.motionController",action:"removeCurrentMask",title:"_Remove_Motion".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.motionController.removeButtonEnabled")}),sensitivityView:NC.SliderView.design({label:"_Sensitivity".loc(),minimumBinding:NC.StrToIntBinding.beget("NC.dataSrcController.video_motion_sensitivity_min"),maximumBinding:NC.StrToIntBinding.beget("NC.dataSrcController.video_motion_sensitivity_max"),stepBinding:NC.StrToIntBinding.beget("NC.dataSrcController.video_motion_sensitivity_step"),valueBinding:"NC.dataController.video_motion_sensitivity_value",valueLeft:NC.SLIDER_VAL_LEFT}),displayBox:SC.CheckboxView.design({title:"_EnableMotionDisplay".loc(),valueBinding:"NC.dataController.video_motion_display_enabled",layout:{top:NC.OVL_TEXT_BOX_TOP,height:NC.CHECKBOX_HEIGHT}})})});
sc_require("validator/ascii8");sc_require("validator/ip");NC.NET_DATA_LEFT=30;NC.NET_FIELD_LEFT=110;
NC.NET_FIELD_WIDTH=180;NC.NET_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.NET_BONJOUR_TOP=NC.NET_TITLE_HEIGHT;
NC.NET_BONJOUR_HEIGHT=NC.CHECKBOX_HEIGHT+NC.LABELED_TEXT_FIELD_HEIGHT+NC.SEPARATOR_HEIGHT+10;
NC.NET_IPV4_TOP=NC.NET_BONJOUR_TOP+NC.NET_BONJOUR_HEIGHT;NC.NET_IPV4_RADIO_HEIGHT=50;
NC.NET_IP4V_ADDRESS_TOP=NC.NET_IPV4_RADIO_HEIGHT;NC.NET_IP4V_SUBNET_TOP=NC.NET_IP4V_ADDRESS_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;
NC.NET_IP4V_GATEWAY_TOP=NC.NET_IP4V_SUBNET_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;NC.NET_IPV4_HEIGHT=NC.NET_IP4V_GATEWAY_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+NC.SEPARATOR_HEIGHT;
NC.NET_DNS_TOP=NC.NET_IPV4_TOP+NC.NET_IPV4_HEIGHT;NC.NET_DNS1_TOP=NC.LABELED_TEXT_FIELD_HEIGHT;
NC.NET_DNS2_TOP=NC.NET_DNS1_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;NC.NET_DNS_HEIGHT=NC.NET_DNS2_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+NC.SEPARATOR_HEIGHT;
NC.NET_DYNDNS_TOP=NC.NET_DNS_TOP+NC.NET_DNS_HEIGHT;NC.NET_DYNDNS_NAME_TOP=NC.CHECKBOX_HEIGHT+10;
NC.NET_DYNDNS_NAME_WIDTH=NC.NET_FIELD_WIDTH;NC.NET_DYNDNS_USER_TOP=NC.NET_DYNDNS_NAME_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;
NC.NET_DYNDNS_USER_WIDTH=180;NC.NET_DYNDNS_USR_FIELD_LEFT=110;NC.NET_DYNDNS_PW_LEFT=NC.NET_DATA_LEFT+NC.NET_DYNDNS_USR_FIELD_LEFT+NC.NET_DYNDNS_USER_WIDTH+30;
NC.NET_DYNDNS_PW_FIELD_LEFT=70;NC.NET_DYNDNS_HEIGHT=NC.NET_DYNDNS_USER_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;
NC.NET_NTP_TOP=NC.NET_DNS_TOP+NC.NET_DNS_HEIGHT;NC.NET_NTP_HEIGHT=NC.CHECKBOX_HEIGHT+NC.LABELED_TEXT_FIELD_HEIGHT+10;
NC.NetManualEnabledBinding=SC.Binding.oneWay().transform(function(a,b){return(a==="ipv4"?true:false)
});NC.networkPage=SC.Page.design({networkView:SC.View.extend({childViews:"titleView bonjourView ipv4View dnsView dyndnsView".w(),classNames:"nc-network-view",properties:["network_bonjour_enabled","network_bonjour_name","network_eth0_mode","network_eth0_ipv4_address","network_eth0_ipv4_subnetmask","network_eth0_ipv4_defaultgw","network_dns0_ip","network_dns1_ip","network_ntp_enabled","network_ntp_server","network_dyndns_enabled","network_dyndns_name","network_dyndns_user","network_dyndns_password"],layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},titleView:NC.TitleView.design({title:"_Network_Title".loc(),description:"_Network_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.NET_TITLE_HEIGHT}}),bonjourView:SC.View.design({childViews:"enabledView valueView separator".w(),layout:{top:NC.NET_BONJOUR_TOP,height:NC.NET_BONJOUR_HEIGHT},enabledView:SC.CheckboxView.design({title:"_Bonjour".loc(),valueBinding:"NC.dataController.network_bonjour_enabled",layout:{height:NC.CHECKBOX_HEIGHT}}),valueView:NC.LabeledTextFieldView.design({hint:"_Name".loc(),name:"_Name".loc(),enabledBinding:SC.Binding.oneWay().from("NC.dataController.network_bonjour_enabled"),valueBinding:"NC.dataController.network_bonjour_name",fieldLeft:NC.NET_FIELD_LEFT,fieldWidth:NC.NET_FIELD_WIDTH,layout:{left:NC.NET_DATA_LEFT,bottom:NC.SEPARATOR_HEIGHT,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),separator:SC.SeparatorView.design({layout:{bottom:0,height:NC.SEPARATOR_HEIGHT}}),}),ipv4View:SC.View.design({childViews:"radioView addressView subnetView gatewayView separator".w(),layout:{top:NC.NET_IPV4_TOP,height:NC.NET_IPV4_HEIGHT},radioView:SC.RadioView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",items:[{title:"_DHCP".loc(),value:"dhcp",enabled:YES},{title:"_Manual".loc(),value:"ipv4",enabled:YES}],valueBinding:"NC.dataController.network_eth0_mode",isEnabled:YES,layoutDirection:SC.LAYOUT_VERTICAL}),addressView:NC.LabeledTextFieldView.design({hint:"_Ipv4Address".loc(),name:"_Ipv4Address".loc(),enabledBinding:NC.NetManualEnabledBinding.beget("NC.dataController.network_eth0_mode"),validator:NC.IPValidator,valueBinding:"NC.dataController.network_eth0_ipv4_address",fieldLeft:NC.NET_FIELD_LEFT,fieldWidth:NC.NET_FIELD_WIDTH,layout:{left:NC.NET_DATA_LEFT,top:NC.NET_IP4V_ADDRESS_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),subnetView:NC.LabeledTextFieldView.design({hint:"_SubnetMask".loc(),name:"_SubnetMask".loc(),enabledBinding:NC.NetManualEnabledBinding.beget("NC.dataController.network_eth0_mode"),validator:NC.IPValidator,valueBinding:"NC.dataController.network_eth0_ipv4_subnetmask",fieldLeft:NC.NET_FIELD_LEFT,fieldWidth:NC.NET_FIELD_WIDTH,layout:{left:NC.NET_DATA_LEFT,top:NC.NET_IP4V_SUBNET_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),gatewayView:NC.LabeledTextFieldView.design({hint:"_Gateway".loc(),name:"_Gateway".loc(),enabledBinding:NC.NetManualEnabledBinding.beget("NC.dataController.network_eth0_mode"),validator:NC.IPValidator,valueBinding:"NC.dataController.network_eth0_ipv4_defaultgw",fieldLeft:NC.NET_FIELD_LEFT,fieldWidth:NC.NET_FIELD_WIDTH,layout:{left:NC.NET_DATA_LEFT,top:NC.NET_IP4V_GATEWAY_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),separator:SC.SeparatorView.design({layout:{bottom:0,height:NC.SEPARATOR_HEIGHT}})}),dnsView:SC.View.design({childViews:"labelView dns1View dns2View separator".w(),layout:{top:NC.NET_DNS_TOP,height:NC.NET_DNS_HEIGHT},labelView:SC.LabelView.design({layout:{height:NC.LABEL_HEIGHT},value:"_DNS".loc()}),dns1View:NC.LabeledTextFieldView.design({hint:"_DNSServer1".loc(),name:"_DNSServer1".loc(),enabled:YES,validator:NC.IPValidator,valueBinding:"NC.dataController.network_dns0_ip",fieldLeft:NC.NET_FIELD_LEFT,fieldWidth:NC.NET_FIELD_WIDTH,layout:{left:NC.NET_DATA_LEFT,top:NC.NET_DNS1_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),dns2View:NC.LabeledTextFieldView.design({hint:"_DNSServer2".loc(),name:"_DNSServer2".loc(),enabled:YES,validator:NC.IPValidator,valueBinding:"NC.dataController.network_dns1_ip",fieldLeft:NC.NET_FIELD_LEFT,fieldWidth:NC.NET_FIELD_WIDTH,layout:{left:NC.NET_DATA_LEFT,top:NC.NET_DNS2_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),separator:SC.SeparatorView.design({layout:{bottom:0,height:NC.SEPARATOR_HEIGHT}})}),dyndnsView:SC.View.design({childViews:"enabledView nameView userView passwordView".w(),layout:{top:NC.NET_DYNDNS_TOP,height:NC.NET_DYNDNS_HEIGHT},enabledView:SC.CheckboxView.design({title:"_Dyndns".loc(),valueBinding:"NC.dataController.network_dyndns_enabled",layout:{height:NC.CHECKBOX_HEIGHT}}),nameView:NC.LabeledTextFieldView.design({hint:"_Name".loc(),name:"_Name".loc(),validator:NC.ASCII8Validator,enabledBinding:SC.Binding.oneWay().from("NC.dataController.network_dyndns_enabled"),valueBinding:"NC.dataController.network_dyndns_name",fieldLeft:NC.NET_FIELD_LEFT,fieldWidth:NC.NET_DYNDNS_NAME_WIDTH,layout:{left:NC.NET_DATA_LEFT,top:NC.NET_DYNDNS_NAME_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),userView:NC.LabeledTextFieldView.design({hint:"_User".loc(),name:"_User".loc(),validator:NC.ASCII8Validator,enabledBinding:SC.Binding.oneWay().from("NC.dataController.network_dyndns_enabled"),valueBinding:"NC.dataController.network_dyndns_user",fieldLeft:NC.NET_DYNDNS_USR_FIELD_LEFT,fieldWidth:NC.NET_DYNDNS_USER_WIDTH,layout:{left:NC.NET_DATA_LEFT,top:NC.NET_DYNDNS_USER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),validator:NC.ASCII8Validator,passwordView:NC.LabeledPasswordFieldView.design({hint:"_Password".loc(),name:"_Password".loc(),validator:NC.ASCII8Validator,enabledBinding:SC.Binding.oneWay().from("NC.dataController.network_dyndns_enabled"),valueBinding:"NC.dataController.network_dyndns_password",fieldLeft:NC.NET_DYNDNS_PW_FIELD_LEFT,fieldWidth:NC.NET_DYNDNS_USER_WIDTH,layout:{left:NC.NET_DYNDNS_PW_LEFT,top:NC.NET_DYNDNS_USER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}})}),ntpView:SC.View.design({childViews:"enabledView valueView".w(),layout:{top:NC.NET_NTP_TOP,height:NC.NET_NTP_HEIGHT},enabledView:SC.CheckboxView.design({title:"_NTPServerATU".loc(),valueBinding:"NC.dataController.network_ntp_enabled",layout:{height:NC.CHECKBOX_HEIGHT}}),valueView:NC.LabeledTextFieldView.design({hint:"_NTPServer".loc(),name:"_Name".loc(),enabledBinding:SC.Binding.oneWay().from("NC.dataController.network_ntp_enabled"),valueBinding:"NC.dataController.network_ntp_server",fieldLeft:NC.NET_FIELD_LEFT,fieldWidth:NC.NET_FIELD_WIDTH,layout:{left:NC.NET_DATA_LEFT,bottom:0,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),}),})});
NC.NVR_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.NVR_DATA_LEFT=30;NC.nvrPage=SC.Page.design({nvrView:SC.View.extend({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},classNames:"nc-nvr-view",properties:["nvr_server_ip"],childViews:"titleView serverView".w(),titleView:NC.TitleView.design({title:"_NVR_Title".loc(),description:"_NVR_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.NVR_TITLE_HEIGHT}}),serverView:NC.LabeledTextFieldView.design({hint:"_NVRServerAddress".loc(),name:"_NVRServerAddress".loc(),enabled:YES,valueBinding:"NC.dataController.nvr_server_ip",fieldLeft:100,fieldWidth:200,layout:{left:NC.NVR_DATA_LEFT,top:100,height:NC.LABELED_TEXT_FIELD_HEIGHT}})})});
NC.OVL_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.OVL_CHECK_BOX_HEIGHT=30;NC.OVL_TYPE_LABEL_TOP=NC.OVL_TITLE_HEIGHT;
NC.OVL_DATE_BOX_TOP=NC.OVL_TYPE_LABEL_TOP+NC.OVL_CHECK_BOX_HEIGHT;NC.OVL_TIME_BOX_TOP=NC.OVL_DATE_BOX_TOP+NC.OVL_CHECK_BOX_HEIGHT;
NC.OVL_TEXT_BOX_TOP=NC.OVL_TIME_BOX_TOP+NC.OVL_CHECK_BOX_HEIGHT;NC.OVL_POS_LABEL_TOP=NC.OVL_TIME_BOX_TOP+NC.OVL_CHECK_BOX_HEIGHT;
NC.OVL_POS_RADIO_TOP=NC.OVL_POS_LABEL_TOP+NC.OVL_CHECK_BOX_HEIGHT;NC.OVL_TEXT_FIELD_LEFT=80;
NC.OVL_TEXT_FIELD_WIDTH=NC.TEXTFIELD_WIDTH;NC.overlayPage=SC.Page.design({overlayView:SC.View.extend({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},classNames:"nc-overlay-view",properties:["video_overlay_date_enabled","video_overlay_time_enabled","video_overlay_text_enabled","video_overlay_text_value","video_overlay_position"],childViews:["titleView","typeLabel","dateBox","timeBox","posLabel","posRadio"],titleView:NC.TitleView.design({title:"_Overlay_Title".loc(),description:"_Overlay_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.OVL_TITLE_HEIGHT}}),typeLabel:SC.LabelView.design({layout:{top:NC.OVL_TYPE_LABEL_TOP,height:NC.LABEL_HEIGHT},value:"_Overlay_Type".loc()}),dateBox:SC.CheckboxView.design({title:"_Date".loc(),valueBinding:"NC.dataController.video_overlay_date_enabled",layout:{top:NC.OVL_DATE_BOX_TOP,height:NC.CHECKBOX_HEIGHT}}),timeBox:SC.CheckboxView.design({title:"_Time".loc(),valueBinding:"NC.dataController.video_overlay_time_enabled",layout:{top:NC.OVL_TIME_BOX_TOP,height:NC.CHECKBOX_HEIGHT}}),textBox:SC.CheckboxView.design({title:"_Text".loc(),valueBinding:"NC.dataController.video_overlay_text_enabled",layout:{top:NC.OVL_TEXT_BOX_TOP,height:NC.CHECKBOX_HEIGHT}}),textField:SC.TextFieldView.design({isEnabledBinding:"NC.dataController.video_overlay_text_enabled",valueBinding:"NC.dataController.video_overlay_text_value",layout:{top:NC.OVL_TEXT_BOX_TOP,left:NC.OVL_TEXT_FIELD_LEFT,height:NC.TEXT_FIELD_HEIGHT,width:NC.OVL_TEXT_FIELD_WIDTH}}),posLabel:SC.LabelView.design({layout:{top:NC.OVL_POS_LABEL_TOP,height:NC.LABEL_HEIGHT},value:"_Position".loc()}),posRadio:SC.RadioView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",items:[{title:"_Top".loc(),value:"top",enabled:YES},{title:"_Bottom".loc(),value:"bottom",enabled:YES}],valueBinding:"NC.dataController.video_overlay_position",isEnabled:YES,layoutDirection:SC.LAYOUT_VERTICAL,layout:{top:NC.OVL_POS_RADIO_TOP}}),}),});
NC.RECIMG_MODE_HEIGHT=180;NC.RECIMG_STORE_HEIGHT=235;NC.RECIMG_OPT_HEIGHT=130;NC.RECIMG_MODE_TOP=NC.TITLEVIEW_HEIGHT-10;
NC.RECIMG_OPT_TOP=NC.RECIMG_MODE_TOP+NC.RECIMG_MODE_HEIGHT;NC.RECIMG_STORE_TOP=NC.RECIMG_OPT_TOP+NC.RECIMG_OPT_HEIGHT;
NC.RECIMG_STORE_RADIO_TOP=NC.TITLE_HEIGHT+10;NC.RECIMG_STORE_FTP_TOP=NC.RECIMG_STORE_RADIO_TOP+65;
NC.RECIMG_STORE_ITEMS=[{title:"_Nvr".loc(),value:"nvr",enabled:YES},{title:"_Ftp".loc(),value:"ftp",enabled:YES}];
NC.recordingImagePage=SC.Page.design({recordingView:SC.View.extend({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},classNames:"nc-recording-view",init:function(){arguments.callee.base.apply(this,arguments);
this.set("properties",NC.imageRecorder.get("properties"))},childViews:"titleView modeView optionsView storeView".w(),titleView:SC.LabelView.design({classNames:"text_title",value:"_ImageRecMode".loc(),layout:{top:NC.TITLE_TOP,height:NC.TITLE_HEIGHT}}),modeView:NC.RecordingModeView.design({layout:{top:NC.RECIMG_MODE_TOP,height:NC.RECIMG_MODE_HEIGHT},recorder:NC.imageRecorder}),storeView:SC.View.design({layout:{top:NC.RECIMG_STORE_TOP,height:NC.RECIMG_STORE_HEIGHT},childViews:"titleView radioView ftpView nvrView".w(),titleView:SC.LabelView.design({classNames:"text_title",value:"_Store".loc(),layout:{height:NC.TITLE_HEIGHT},}),radioView:SC.RadioView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",items:NC.RECIMG_STORE_ITEMS,valueBinding:"NC.imageRecorder.store_type",layoutDirection:SC.LAYOUT_VERTICAL,layout:{top:NC.RECIMG_STORE_RADIO_TOP},}),ftpView:NC.RecordingFtpView.design({recorder:NC.imageRecorder,isVisibleBinding:SC.Binding.from("NC.imageRecorder.ftpEnabled").oneWay(),layout:{top:NC.RECIMG_STORE_FTP_TOP}}),nvrView:NC.RecordingNvrView.design({recorder:NC.imageRecorder,isVisibleBinding:SC.Binding.from("NC.imageRecorder.nvrEnabled").oneWay(),layout:{top:NC.RECIMG_STORE_FTP_TOP}})}),optionsView:NC.RecordingImageOptionsView.design({recorder:NC.imageRecorder,layout:{top:NC.RECIMG_OPT_TOP,height:NC.RECIMG_OPT_HEIGHT}})})});
NC.RECVID_MODE_HEIGHT=180;NC.RECVID_STORE_HEIGHT=235;NC.RECVID_OPT_HEIGHT=130;NC.RECVID_MODE_TOP=NC.TITLEVIEW_HEIGHT-10;
NC.RECVID_OPT_TOP=NC.RECVID_MODE_TOP+NC.RECVID_MODE_HEIGHT;NC.RECVID_STORE_TOP=NC.RECVID_OPT_TOP+NC.RECVID_OPT_HEIGHT;
NC.RECVID_STORE_RADIO_TOP=NC.TITLE_HEIGHT+10;NC.RECVID_STORE_SMB_TOP=NC.RECVID_STORE_RADIO_TOP+65;
NC.RECVID_STORE_ITEMS=[{title:"_Internal".loc(),value:"internal",enabled:YES},{title:"_Samba".loc(),value:"samba",enabled:YES}];
NC.recordingVideoPage=SC.Page.design({recordingView:SC.View.extend({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},classNames:"nc-recording-view",init:function(){arguments.callee.base.apply(this,arguments);
this.set("properties",NC.videoRecorder.get("properties"))},childViews:"titleView modeView storeView optionsView".w(),titleView:SC.LabelView.design({classNames:"text_title",value:"_VideoRecMode".loc(),layout:{top:NC.TITLE_TOP,height:NC.TITLE_HEIGHT}}),modeView:NC.RecordingModeView.design({layout:{top:NC.RECVID_MODE_TOP,height:NC.RECVID_MODE_HEIGHT},recorder:NC.videoRecorder}),storeView:SC.View.design({layout:{top:NC.RECVID_STORE_TOP,height:NC.RECVID_STORE_HEIGHT},childViews:"titleView radioView sambaView".w(),titleView:SC.LabelView.design({classNames:"text_title",value:"_Store".loc(),layout:{height:NC.TITLE_HEIGHT},}),radioView:SC.RadioView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",items:NC.RECVID_STORE_ITEMS,valueBinding:"NC.videoRecorder.store_type",layoutDirection:SC.LAYOUT_VERTICAL,layout:{top:NC.RECVID_STORE_RADIO_TOP},}),sambaView:NC.RecordingSambaView.design({recorder:NC.videoRecorder,isVisibleBinding:SC.Binding.from("NC.videoRecorder.sambaEnabled").oneWay(),layout:{top:NC.RECVID_STORE_SMB_TOP}})}),optionsView:NC.RecordingVideoOptionsView.design({recorder:NC.videoRecorder,layout:{top:NC.RECVID_OPT_TOP,height:NC.RECVID_OPT_HEIGHT}})})});
NC.SENSOR_MODE_TOP=20;NC.SENSOR_HBLANK_TOP=NC.SENSOR_MODE_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+20;
NC.SENSOR_VBLANK_TOP=NC.SENSOR_HBLANK_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+20;NC.SENSOR_EXPOSURE_TOP=NC.SENSOR_VBLANK_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+20;
NC.SENSOR_DELAY_TOP=NC.SENSOR_EXPOSURE_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+20;NC.SENSOR_FIELD_LEFT=100;
NC.SENSOR_FIELD_WIDTH=100;NC.SENSOR_TEXT_WIDTH=300;NC.sensorPage=SC.Page.design({sensorView:SC.View.extend({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},classNames:"nc-options-view",properties:["video_sensor_maxexposure","video_sensor_hblank","video_sensor_vblank","video_sensor_frameratemode","video_sensor_aewdelay"],childViews:"modeView hblankView vblankView exposureView delayView".w(),modeView:NC.LabeledTextFieldView.design({name:"_FramerateMode".loc(),valueBinding:"NC.dataController.video_sensor_frameratemode",fieldLeft:NC.SENSOR_FIELD_LEFT,fieldWidth:NC.SENSOR_FIELD_WIDTH,layout:{top:NC.SENSOR_MODE_TOP,width:NC.SENSOR_TEXT_WIDTH,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),hblankView:NC.LabeledTextFieldView.design({name:"_HorizontalBlank".loc(),valueBinding:"NC.dataController.video_sensor_hblank",fieldLeft:NC.SENSOR_FIELD_LEFT,fieldWidth:NC.SENSOR_FIELD_WIDTH,layout:{top:NC.SENSOR_HBLANK_TOP,width:NC.SENSOR_TEXT_WIDTH,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),vblankView:NC.LabeledTextFieldView.design({name:"_VertictalBlank".loc(),valueBinding:"NC.dataController.video_sensor_vblank",fieldLeft:NC.SENSOR_FIELD_LEFT,fieldWidth:NC.SENSOR_FIELD_WIDTH,layout:{top:NC.SENSOR_VBLANK_TOP,width:NC.SENSOR_TEXT_WIDTH,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),exposureView:NC.LabeledTextFieldView.design({name:"_MaxExposure".loc(),valueBinding:"NC.dataController.video_sensor_maxexposure",fieldLeft:NC.SENSOR_FIELD_LEFT,fieldWidth:NC.SENSOR_FIELD_WIDTH,layout:{top:NC.SENSOR_EXPOSURE_TOP,width:NC.SENSOR_TEXT_WIDTH,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),delayView:NC.LabeledTextFieldView.design({name:"_AewDelay".loc(),valueBinding:"NC.dataController.video_sensor_aewdelay",fieldLeft:NC.SENSOR_FIELD_LEFT,fieldWidth:NC.SENSOR_FIELD_WIDTH,layout:{top:NC.SENSOR_DELAY_TOP,width:NC.SENSOR_TEXT_WIDTH,height:NC.LABELED_TEXT_FIELD_HEIGHT}})})});
NC.STREAM_SENSOR_TOP=NC.TITLE_TOP;NC.STREAM_SENSOR_TIMESCALE_TOP=NC.TITLE_HEIGHT+10;
NC.STREAM_SENSOR_FRAME_INTERVAL_TOP=NC.STREAM_SENSOR_TIMESCALE_TOP+NC.TEXT_ROW_HEIGHT+5;
NC.STREAM_SENSOR_FRAMERATE_TOP=NC.STREAM_SENSOR_FRAME_INTERVAL_TOP+NC.TEXT_ROW_HEIGHT;
NC.STREAM_SENSOR_HEIGHT=NC.STREAM_SENSOR_FRAMERATE_TOP+NC.TEXT_ROW_HEIGHT+NC.SEPARATOR_HEIGHT;
NC.STREAM1_TOP=NC.STREAM_SENSOR_TOP+NC.STREAM_SENSOR_HEIGHT+10;NC.STREAM_FRAMERATE_TOP=NC.TITLE_HEIGHT+10;
NC.STREAM_FRAMEINTERVAL_TOP=NC.STREAM_FRAMERATE_TOP+NC.TEXT_ROW_HEIGHT;NC.STREAM_BITRATE_TOP=NC.STREAM_FRAMEINTERVAL_TOP+NC.TEXT_ROW_HEIGHT;
NC.STREAM1_HEIGHT=NC.STREAM_BITRATE_TOP+NC.TEXT_ROW_HEIGHT+NC.SEPARATOR_HEIGHT;NC.STREAM2_TOP=NC.STREAM1_TOP+NC.STREAM1_HEIGHT+10;
NC.STREAM2_HEIGHT=NC.STREAM1_HEIGHT;NC.STREAM_INFO_ENTRY_VALUE_LEFT=190;NC.STREAM_INFO_ENTRY_WIDTH=230;
NC.STREAM_SLIDER_LEFT=NC.STREAM_INFO_ENTRY_WIDTH+10;NC.STREAM_SLIDER_WIDTH=150;NC.STREAM_COMMENT_LEFT=NC.STREAM_SLIDER_LEFT+NC.STREAM_SLIDER_WIDTH+20;
NC.streamsPage=SC.Page.design({streamsView:SC.View.extend({layout:{right:NC.DATA_LEFT},classNames:"nc-options-view",properties:["video_mpeg4high_framerate_divider","video_mpeg4high_bitrate_value","video_mjpg_framerate_divider","video_mjpg_quality_value","video_sensor_frameinterval","video_sensor_timescale"],childViews:"sensorView stream1View stream2View".w(),sensorView:SC.View.design({layout:{top:NC.STREAM_SENSOR_TOP,height:NC.STREAM_SENSOR_HEIGHT},childViews:"titleView timeScaleView exposureView framerateView separator".w(),titleView:SC.LabelView.design({classNames:"text_title",value:"_CommonOptions".loc(),layout:{left:NC.DATA_LEFT,height:NC.TITLE_HEIGHT},}),timeScaleView:SC.View.design({layout:{left:NC.DATA_LEFT,top:NC.STREAM_SENSOR_TIMESCALE_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"labelView radioView".w(),labelView:SC.LabelView.design({layout:{height:NC.LABEL_HEIGHT},value:"_TimeScale".loc()+" ("+"_FPS".loc()+")"}),radioView:SC.RadioView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",items:[{title:"25",value:25,enabled:YES},{title:"30",value:30,enabled:YES}],valueBinding:"NC.dataController.video_sensor_timescale",isEnabled:YES,layoutDirection:SC.LAYOUT_HORIZONTAL,layout:{left:NC.STREAM_INFO_ENTRY_VALUE_LEFT-17}})}),exposureView:SC.View.design({layout:{left:NC.DATA_LEFT,top:NC.STREAM_SENSOR_FRAME_INTERVAL_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"infoboxView sliderView".w(),infoboxView:NC.InfoBoxEntryView.design({layout:{width:NC.STREAM_INFO_ENTRY_WIDTH},name:"_MaximalExposureTime".loc()+" ("+"_ms".loc()+")",valueBinding:SC.Binding.from("NC.streamController.sensorFrameIntervalLabel").oneWay(),valueLeft:NC.STREAM_INFO_ENTRY_VALUE_LEFT}),sliderView:NC.ArraySliderView.design({layout:{left:NC.STREAM_SLIDER_LEFT,top:2,width:NC.STREAM_SLIDER_WIDTH},valuesBinding:SC.Binding.from("NC.streamController.sensorFrameIntervals").oneWay(),valueObjectBinding:"NC.streamController.sensorFrameInterval"})}),framerateView:NC.InfoBoxEntryView.design({name:"_MaximumFramerate".loc()+" ("+"_FPS".loc()+")",valueBinding:SC.Binding.from("NC.streamController.sensorMaximumFramerateLabel").oneWay(),valueLeft:NC.STREAM_INFO_ENTRY_VALUE_LEFT,layout:{left:NC.DATA_LEFT,top:NC.STREAM_SENSOR_FRAMERATE_TOP,height:NC.SLIDER_VIEW_HEIGHT,width:NC.STREAM_INFO_ENTRY_WIDTH}}),separator:SC.SeparatorView.design({classNames:"nc-separator-view",layout:{left:NC.DATA_LEFT,bottom:0,height:NC.SEPARATOR_HEIGHT}})}),stream1View:SC.View.design({layout:{top:NC.STREAM1_TOP,height:NC.STREAM1_HEIGHT},childViews:"titleView framerateView frameintervalView bitrateView separator".w(),titleView:SC.LabelView.design({classNames:"text_title",value:"_MPEG4Stream1Title".loc(),layout:{left:NC.DATA_LEFT,height:NC.TITLE_HEIGHT},}),framerateView:SC.View.design({layout:{left:NC.DATA_LEFT,top:NC.STREAM_FRAMERATE_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"infoboxView sliderView commentView".w(),infoboxView:NC.InfoBoxEntryView.design({layout:{width:NC.STREAM_INFO_ENTRY_WIDTH},name:"_Framerate".loc()+" ("+"_FPS".loc()+")",valueBinding:SC.Binding.from("NC.streamController.stream1.framerateDisplay").oneWay(),valueLeft:NC.STREAM_INFO_ENTRY_VALUE_LEFT}),sliderView:NC.ArraySliderView.design({layout:{left:NC.STREAM_SLIDER_LEFT,top:2,width:NC.STREAM_SLIDER_WIDTH},valuesBinding:SC.Binding.from("NC.streamController.stream1.framerateDivider").oneWay(),valueObjectBinding:"NC.streamController.stream1.sliderDivider"}),commentView:SC.LabelView.design({layout:{left:NC.STREAM_COMMENT_LEFT},value:"_FramerateComment".loc()})}),frameintervalView:NC.InfoBoxEntryView.design({nameBinding:SC.Binding.from("NC.streamController.stream1.frameIntervalName").oneWay(),valueBinding:SC.Binding.from("NC.streamController.stream1.frameIntervalDisplay").oneWay(),valueLeft:NC.STREAM_INFO_ENTRY_VALUE_LEFT,layout:{left:NC.DATA_LEFT,top:NC.STREAM_FRAMEINTERVAL_TOP,height:NC.SLIDER_VIEW_HEIGHT,width:NC.STREAM_INFO_ENTRY_WIDTH}}),bitrateView:SC.View.design({layout:{left:NC.DATA_LEFT,top:NC.STREAM_BITRATE_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"infoboxView sliderView".w(),infoboxView:NC.InfoBoxEntryView.design({layout:{width:NC.STREAM_INFO_ENTRY_WIDTH},name:"_Bitrate".loc()+" ("+"_Kbit".loc()+")",valueBinding:SC.Binding.from("NC.streamController.stream1.bitrateDisplay").oneWay(),valueLeft:NC.STREAM_INFO_ENTRY_VALUE_LEFT}),sliderView:SC.SliderView.design({layout:{left:NC.STREAM_SLIDER_LEFT,top:2,width:NC.STREAM_SLIDER_WIDTH},minimumBinding:SC.Binding.from("NC.dataSrcController.video_mpeg4high_bitrate_min").oneWay(),maximumBinding:SC.Binding.from("NC.dataSrcController.video_mpeg4high_bitrate_max").oneWay(),stepBinding:SC.Binding.from("NC.dataSrcController.video_mpeg4high_bitrate_step").oneWay(),valueBinding:"NC.dataController.video_mpeg4high_bitrate_value"})}),separator:SC.SeparatorView.design({classNames:"nc-separator-view",layout:{left:NC.DATA_LEFT,bottom:0,height:NC.SEPARATOR_HEIGHT}})}),stream2View:SC.View.design({layout:{top:NC.STREAM2_TOP,height:NC.STREAM2_HEIGHT},childViews:"titleView framerateView frameintervalView qualityView".w(),titleView:SC.LabelView.design({classNames:"text_title",value:"_JPEGStream2Title".loc(),layout:{left:NC.DATA_LEFT,height:NC.TITLE_HEIGHT},}),framerateView:SC.View.design({layout:{left:NC.DATA_LEFT,top:NC.STREAM_FRAMERATE_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"infoboxView sliderView commentView".w(),infoboxView:NC.InfoBoxEntryView.design({layout:{width:NC.STREAM_INFO_ENTRY_WIDTH},name:"_Framerate".loc()+" ("+"_FPS".loc()+")",valueBinding:SC.Binding.from("NC.streamController.stream2.framerateDisplay").oneWay(),valueLeft:NC.STREAM_INFO_ENTRY_VALUE_LEFT}),sliderView:NC.ArraySliderView.design({layout:{left:NC.STREAM_SLIDER_LEFT,top:2,width:NC.STREAM_SLIDER_WIDTH},valuesBinding:SC.Binding.from("NC.streamController.stream2.framerateDivider").oneWay(),valueObjectBinding:"NC.streamController.stream2.sliderDivider"}),commentView:SC.LabelView.design({layout:{left:NC.STREAM_COMMENT_LEFT},value:"_FramerateComment".loc()})}),frameintervalView:NC.InfoBoxEntryView.design({nameBinding:SC.Binding.from("NC.streamController.stream2.frameIntervalName").oneWay(),valueBinding:SC.Binding.from("NC.streamController.stream2.frameIntervalDisplay").oneWay(),valueLeft:NC.STREAM_INFO_ENTRY_VALUE_LEFT,layout:{left:NC.DATA_LEFT,top:NC.STREAM_FRAMEINTERVAL_TOP,height:NC.SLIDER_VIEW_HEIGHT,width:NC.STREAM_INFO_ENTRY_WIDTH}}),qualityView:SC.View.design({layout:{left:NC.DATA_LEFT,top:NC.STREAM_BITRATE_TOP,height:NC.SLIDER_VIEW_HEIGHT},childViews:"infoboxView sliderView".w(),infoboxView:NC.InfoBoxEntryView.design({layout:{width:NC.STREAM_INFO_ENTRY_WIDTH},name:"_Quality".loc(),valueBinding:SC.Binding.from("NC.dataController.video_mjpg_quality_value").oneWay(),valueLeft:NC.STREAM_INFO_ENTRY_VALUE_LEFT}),sliderView:SC.SliderView.design({layout:{left:NC.STREAM_SLIDER_LEFT,top:2,width:NC.STREAM_SLIDER_WIDTH},minimumBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_min").oneWay(),maximumBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_max").oneWay(),stepBinding:SC.Binding.from("NC.dataSrcController.video_mjpg_quality_step").oneWay(),valueBinding:"NC.dataController.video_mjpg_quality_value"})})})})});
sc_require("validator/ascii8");sc_require("validator/time");sc_require("validator/date");
NC.TIME_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.TIME_CAMERA_TOP=NC.TIME_TITLE_HEIGHT;
NC.TIME_TIMEZONE_TOP=NC.TIME_CAMERA_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;NC.TIME_TIMEZONE_HEIGHT=NC.SELECT_FIELD_HEIGHT;
NC.TIME_SEPARATOR1_TOP=NC.TIME_TIMEZONE_TOP+NC.TIME_TIMEZONE_HEIGHT+10;NC.TIME_LOCAL_TOP=NC.TIME_SEPARATOR1_TOP+NC.SEPARATOR_HEIGHT+10;
NC.TIME_LOCAL_TIME_TOP=NC.LABELED_TEXT_FIELD_HEIGHT+10;NC.TIME_LOCAL_HEIGHT=NC.TIME_LOCAL_TIME_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;
NC.TIME_SEPARATOR2_TOP=NC.TIME_LOCAL_TOP+NC.TIME_LOCAL_HEIGHT;NC.TIME_MANUAL_TOP=NC.TIME_SEPARATOR2_TOP+NC.SEPARATOR_HEIGHT+10;
NC.TIME_MANUAL_DATE_TOP=NC.LABELED_TEXT_FIELD_HEIGHT+5;NC.TIME_MANUAL_TIME_TOP=NC.TIME_MANUAL_DATE_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;
NC.TIME_MANUAL_HEIGHT=NC.TIME_MANUAL_TIME_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;NC.TIME_SEPARATOR3_TOP=NC.TIME_MANUAL_TOP+NC.TIME_MANUAL_HEIGHT;
NC.TIME_NTP_TOP=NC.TIME_SEPARATOR3_TOP+NC.SEPARATOR_HEIGHT+10;NC.TIME_NTP_ENABLED_TOP=NC.LABELED_TEXT_FIELD_HEIGHT+10;
NC.TIME_NTP_SERVER_TOP=NC.TIME_NTP_ENABLED_TOP+NC.CHECKBOX_HEIGHT+10;NC.TIME_NTP_HEIGHT=NC.TIME_NTP_SERVER_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;
NC.TIME_FIELD_LEFT=100;NC.TIME_FIELD_WIDTH=90;NC.TIME_MANUAL_LABEL_LEFT=NC.TIME_FIELD_LEFT+NC.TIME_FIELD_WIDTH+20;
NC.TIME_NTP_FIELD_LEFT=NC.TIME_FIELD_LEFT;NC.TIME_NTP_FIELD_WIDTH=240;NC.TIME_BUTTON_LEFT=400;
NC.TIME_BUTTON_WIDTH=200;NC.TIME_BUTTON_Y=3;NC.TIME_LABEL_Y=6;NC.timePage=SC.Page.design({timeView:SC.View.extend({layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},classNames:"nc-time-view",properties:["network_ntp_enabled","network_ntp_server","system_localization_timezone"],childViews:["titleView","cameraTimeView","timezoneView","localSetupView","manualSetupView","ntpView","separator1","separator2","separator3"],titleView:NC.TitleView.design({title:"_Time_Title".loc(),description:"_Time_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.TIME_TITLE_HEIGHT}}),cameraTimeView:NC.InfoBoxEntryView.design({name:"_CameraTime".loc(),colonEnabled:false,valueBinding:"NC.timeController.serverTime",valueLeft:NC.TIME_FIELD_LEFT,layout:{top:NC.TIME_CAMERA_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),timezoneView:SC.View.design({childViews:"timezoneLabel timezoneField".w(),timezoneLabel:SC.LabelView.design({value:"_Timezone".loc(),layout:{right:NC.TIME_FIELD_LEFT}}),timezoneField:SC.SelectFieldView.design({objectsBinding:"NC.timeController.timezones",nameKey:"display",valueKey:"path",isEnabled:YES,disableSort:true,valueBinding:"NC.dataController.system_localization_timezone",layout:{left:NC.TIME_FIELD_LEFT}}),layout:{top:NC.TIME_TIMEZONE_TOP,height:NC.SELECT_FIELD_HEIGHT}}),localSetupView:SC.View.design({childViews:"titleView timeView buttonView".w(),layout:{top:NC.TIME_LOCAL_TOP,height:NC.TIME_LOCAL_HEIGHT},titleView:SC.LabelView.design({classNames:"text_sub_title",layout:{height:NC.LABEL_HEIGHT},value:"_LocalTimeSetupTitle".loc()}),timeView:NC.InfoBoxEntryView.design({name:"_LocalTime".loc(),colonEnabled:false,valueBinding:"NC.timeController.localTime",valueLeft:NC.TIME_FIELD_LEFT,layout:{top:NC.TIME_LOCAL_TIME_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),buttonView:SC.ButtonView.design({isDefault:NO,target:"NC.timeController",action:"synchWithClientTime",title:"_SynchCameraTime".loc(),isEnabled:YES,layout:{top:NC.TIME_LOCAL_TIME_TOP,left:NC.TIME_BUTTON_LEFT,height:NC.BUTTON_HEIGHT,width:NC.TIME_BUTTON_WIDTH}})}),manualSetupView:SC.View.design({childViews:"titleView dateView dateLabel timeView timeLabel buttonView".w(),layout:{top:NC.TIME_MANUAL_TOP,height:NC.TIME_MANUAL_HEIGHT},titleView:SC.LabelView.design({classNames:"text_sub_title",layout:{height:NC.LABEL_HEIGHT},value:"_ManualTimeSetupTitle".loc()}),dateView:NC.LabeledTextFieldView.design({hint:"_Date".loc(),name:"_Date".loc(),validator:NC.DateValidator,valueBinding:"NC.timeController.manualDate",fieldLeft:NC.TIME_FIELD_LEFT,fieldWidth:NC.TIME_FIELD_WIDTH,layout:{top:NC.TIME_MANUAL_DATE_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),dateLabel:SC.LabelView.design({layout:{top:NC.TIME_MANUAL_DATE_TOP+NC.TIME_LABEL_Y,left:NC.TIME_MANUAL_LABEL_LEFT,height:NC.LABEL_HEIGHT},value:"_ManualDateSetupFormat".loc()}),timeView:NC.LabeledTextFieldView.design({hint:"_Time".loc(),name:"_Time".loc(),validator:NC.TimeValidator,valueBinding:"NC.timeController.manualTime",fieldLeft:NC.TIME_FIELD_LEFT,fieldWidth:NC.TIME_FIELD_WIDTH,layout:{top:NC.TIME_MANUAL_TIME_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),timeLabel:SC.LabelView.design({layout:{top:NC.TIME_MANUAL_TIME_TOP+NC.TIME_LABEL_Y,left:NC.TIME_MANUAL_LABEL_LEFT,height:NC.LABEL_HEIGHT},value:"_ManualTimeSetupFormat".loc()}),buttonView:SC.ButtonView.design({isDefault:NO,target:"NC.timeController",action:"synchWithManualTime",title:"_SetCameraTime".loc(),isEnabledBinding:SC.Binding.oneWay().from("NC.timeController.isManualButtonEnabled"),layout:{top:NC.TIME_MANUAL_TIME_TOP+NC.TIME_BUTTON_Y,left:NC.TIME_BUTTON_LEFT,height:NC.BUTTON_HEIGHT,width:NC.TIME_BUTTON_WIDTH}})}),ntpView:SC.View.design({childViews:"titleView enabledView valueView ntpButton".w(),titleView:SC.LabelView.design({classNames:"text_sub_title",layout:{height:NC.LABEL_HEIGHT},value:"_NtpTimeSetupTitle".loc()}),layout:{top:NC.TIME_NTP_TOP,height:NC.TIME_NTP_HEIGHT},enabledView:SC.CheckboxView.design({title:"_NTPServerATU".loc(),valueBinding:"NC.dataController.network_ntp_enabled",layout:{top:NC.TIME_NTP_ENABLED_TOP,height:NC.CHECKBOX_HEIGHT}}),valueView:NC.LabeledTextFieldView.design({hint:"_NTPServer".loc(),name:"_NTPServer".loc(),validator:NC.ASCII8Validator,valueBinding:"NC.dataController.network_ntp_server",fieldLeft:NC.TIME_NTP_FIELD_LEFT,fieldWidth:NC.TIME_NTP_FIELD_WIDTH,layout:{top:NC.TIME_NTP_SERVER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),ntpButton:SC.ButtonView.design({isDefault:NO,target:"NC.timeController",action:"synchWithNtpTime",title:"_SynchCameraTime".loc(),layout:{top:NC.TIME_NTP_SERVER_TOP+NC.TIME_BUTTON_Y,left:NC.TIME_BUTTON_LEFT,height:NC.BUTTON_HEIGHT,width:NC.TIME_BUTTON_WIDTH}}),}),separator1:SC.SeparatorView.design({layout:{top:NC.TIME_SEPARATOR1_TOP,height:NC.SEPARATOR_HEIGHT}}),separator2:SC.SeparatorView.design({layout:{top:NC.TIME_SEPARATOR2_TOP,height:NC.SEPARATOR_HEIGHT}}),separator3:SC.SeparatorView.design({layout:{top:NC.TIME_SEPARATOR3_TOP,height:NC.SEPARATOR_HEIGHT}})}),});
sc_require("validator/ascii8");NC.UMTS_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.UMTS_ENABLED_TOP=NC.UMTS_TITLE_HEIGHT;
NC.UMTS_ENABLED_HEIGHT=NC.CHECKBOX_HEIGHT+10;NC.UMTS_CARD_TOP=NC.UMTS_ENABLED_TOP+NC.UMTS_ENABLED_HEIGHT;
NC.UMTS_SIMCARD_TOP=NC.SEPARATOR_HEIGHT;NC.UMTS_PIN_TOP=NC.UMTS_SIMCARD_TOP+NC.LABEL_HEIGHT+10;
NC.UMTS_CARD_HEIGHT=NC.UMTS_PIN_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+NC.SEPARATOR_HEIGHT;
NC.UMTS_AP_TOP=NC.UMTS_CARD_TOP+NC.UMTS_CARD_HEIGHT;NC.UMTS_AP_ADDRESS_TOP=NC.LABEL_HEIGHT+10;
NC.UMTS_AP_USER_TOP=NC.UMTS_AP_ADDRESS_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;NC.UMTS_AP_PW_TOP=NC.UMTS_AP_USER_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;
NC.UMTS_AP_HEIGHT=NC.UMTS_AP_PW_TOP+NC.LABELED_TEXT_FIELD_HEIGHT+10;NC.UMTS_DATA_LEFT=30;
NC.UMTS_FIELD_LEFT=150;NC.UMTS_FIELD_WIDTH=150;NC.umtsPage=SC.Page.design({umtsView:SC.View.extend({childViews:"titleView enabledView cardView accessView".w(),classNames:"nc-umts-view",properties:["network_umts_enabled","network_umts_pin","network_umts_accesspoint_address","network_umts_accesspoint_user","network_umts_accesspoint_password"],layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},titleView:NC.TitleView.design({title:"_UMTS_Title".loc(),description:"_UMTS_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.UMTS_TITLE_HEIGHT}}),enabledView:SC.CheckboxView.design({title:"_UMTS_Enabled".loc(),valueBinding:"NC.dataController.network_umts_enabled",layout:{top:NC.UMTS_ENABLED_TOP,height:NC.CHECKBOX_HEIGHT}}),cardView:SC.View.design({childViews:"separator1 labelView pinView separator2".w(),layout:{top:NC.UMTS_CARD_TOP,height:NC.UMTS_CARD_HEIGHT},separator1:SC.SeparatorView.design({layout:{top:0,height:NC.SEPARATOR_HEIGHT}}),labelView:SC.LabelView.design({layout:{top:NC.UMTS_SIMCARD_TOP,height:NC.LABEL_HEIGHT},value:"_SimCard".loc()}),pinView:NC.LabeledPasswordFieldView.design({hint:"_Pin".loc(),name:"_Pin".loc(),enabled:YES,validator:NC.ASCII8Validator,valueBinding:"NC.dataController.network_umts_pin",fieldLeft:NC.UMTS_FIELD_LEFT,fieldWidth:NC.UMTS_FIELD_WIDTH,layout:{left:NC.UMTS_DATA_LEFT,top:NC.UMTS_PIN_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),separator2:SC.SeparatorView.design({layout:{bottom:0,height:NC.SEPARATOR_HEIGHT}})}),accessView:SC.View.design({childViews:"labelView apnView userView pwView".w(),layout:{top:NC.UMTS_AP_TOP,height:NC.UMTS_AP_HEIGHT},labelView:SC.LabelView.design({layout:{height:NC.LABEL_HEIGHT},value:"_Access_Point".loc()}),apnView:NC.LabeledTextFieldView.design({hint:"_APN".loc(),name:"_APN".loc(),enabled:YES,validator:NC.ASCII8Validator,valueBinding:"NC.dataController.network_umts_accesspoint_address",fieldLeft:NC.UMTS_FIELD_LEFT,fieldWidth:NC.UMTS_FIELD_WIDTH,layout:{left:NC.UMTS_DATA_LEFT,top:NC.UMTS_AP_ADDRESS_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),userView:NC.LabeledTextFieldView.design({hint:"_User".loc(),name:"_User".loc(),enabled:YES,validator:NC.ASCII8Validator,valueBinding:"NC.dataController.network_umts_accesspoint_user",fieldLeft:NC.UMTS_FIELD_LEFT,fieldWidth:NC.UMTS_FIELD_WIDTH,layout:{left:NC.UMTS_DATA_LEFT,top:NC.UMTS_AP_USER_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),pwView:NC.LabeledPasswordFieldView.design({hint:"_Password".loc(),name:"_Password".loc(),enabled:YES,validator:NC.ASCII8Validator,valueBinding:"NC.dataController.network_umts_accesspoint_password",fieldLeft:NC.UMTS_FIELD_LEFT,fieldWidth:NC.UMTS_FIELD_WIDTH,layout:{left:NC.UMTS_DATA_LEFT,top:NC.UMTS_AP_PW_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}})}),})});
sc_require("validator/alpha_num");NC.USR_TITLE_HEIGHT=NC.TITLEVIEW_HEIGHT;NC.USR_ANON_TOP=NC.USR_TITLE_HEIGHT+25;
NC.USR_TABLE_TOP=NC.USR_TITLE_HEIGHT+70;NC.USR_TABLE_LEFT=30;NC.USR_TABLE_WIDTH=300;
NC.USR_TABLE_HEIGHT=350;NC.USR_TBL_NAME_WIDTH=150;NC.USR_TBL_GROUP_WIDTH=150;NC.USR_USER_TOP=NC.USR_TABLE_TOP+30;
NC.USR_USER_LEFT=NC.USR_TABLE_LEFT+NC.USR_TABLE_WIDTH+30;NC.USR_USER_WIDTH=295;NC.USR_USER_HEIGHT=NC.USR_TABLE_HEIGHT;
NC.USR_USER_FIELD_HEIGHT=50;NC.USR_USER_FIELD_LEFT=70;NC.USER_USER_FIELD_WIDTH=225;
NC.USR_USER_TITLE_TOP=0;NC.USR_USER_GROUP_TOP=NC.USR_USER_TITLE_TOP+40;NC.USR_USER_NAME_TOP=NC.USR_USER_GROUP_TOP+NC.USR_USER_FIELD_HEIGHT;
NC.USR_USER_PW_TOP=NC.USR_USER_NAME_TOP+NC.USR_USER_FIELD_HEIGHT;NC.USR_USER_CONFIRM_TOP=NC.USR_USER_PW_TOP+NC.USR_USER_FIELD_HEIGHT;
NC.USR_USER_BUTTON_TOP=NC.USR_USER_CONFIRM_TOP+NC.USR_USER_FIELD_HEIGHT+10;NC.USR_USER_GROUP_HEIGHT=NC.BUTTON_HEIGHT;
NC.USR_USER_GRP_LBL_WIDTH=NC.USR_USER_FIELD_LEFT-18;NC.USR_USER_GRP_RAD_WIDTH=NC.USER_USER_FIELD_WIDTH;
NC.USR_BUTTON_WIDTH=80;NC.userPage=SC.Page.design({userView:SC.View.extend({childViews:"titleView anonymousBox tableView userView".w(),classNames:"nc-user-view",properties:["users_anonymous_enabled"],layout:{left:NC.DATA_LEFT,right:NC.DATA_LEFT},titleView:NC.TitleView.design({title:"_User_Title".loc(),description:"_User_Text".loc(),layout:{top:NC.TITLE_TOP,height:NC.USR_TITLE_HEIGHT}}),anonymousBox:SC.CheckboxView.design({title:"_AnonymousUser".loc(),valueBinding:"NC.dataController.users_anonymous_enabled",layout:{top:NC.USR_ANON_TOP,left:NC.USR_TABLE_LEFT,height:NC.CHECKBOX_HEIGHT}}),tableView:NC.TableView.design({content:"name groupName".w(),width:[NC.USR_TBL_NAME_WIDTH,NC.USR_TBL_GROUP_WIDTH],title:["_Name".loc(),"_Group".loc()],layout:{top:NC.USR_TABLE_TOP,left:NC.USR_TABLE_LEFT,width:NC.USR_TABLE_WIDTH,height:NC.USR_TABLE_HEIGHT},contentProp:"NC.usersController.users",selectionProp:"NC.usersController.selection",sortBinding:"NC.usersController.sortAction"}),userView:SC.View.design({layout:{top:NC.USR_USER_TOP,left:NC.USR_USER_LEFT,width:NC.USR_USER_WIDTH,height:NC.USR_USER_HEIGHT},childViews:"titleView groupView nameView pwView pwConfirmView buttonView".w(),titleView:SC.LabelView.design({classNames:"text_title",layout:{top:NC.USR_USER_TITLE_TOP,height:NC.LABEL_HEIGHT},value:"_User".loc()}),groupView:SC.View.design({childViews:"labelView radioView".w(),layout:{top:NC.USR_USER_GROUP_TOP,height:NC.USR_USER_GROUP_HEIGHT},labelView:SC.LabelView.design({layout:{width:NC.USR_USER_GRP_LBL_WIDTH,centerY:0,height:NC.LABEL_HEIGHT},value:"_Group".loc()+":"}),radioView:SC.RadioView.design({itemTitleKey:"title",itemValueKey:"value",itemIsEnabledKey:"enabled",items:[{title:"_Admin".loc(),value:1,enabled:YES},{title:"_Guest".loc(),value:3,enabled:YES}],valueBinding:"NC.userController.group",isEnabled:YES,layoutDirection:SC.LAYOUT_HORIZONTAL,layout:{left:NC.USR_USER_GRP_LBL_WIDTH,centerY:0,height:NC.USR_USER_GROUP_HEIGHT}})}),nameView:NC.LabeledTextFieldView.design({hint:"_User".loc(),name:"_User".loc(),enabled:YES,validator:NC.AlphaNumValidator,valueBinding:"NC.userController.name",fieldLeft:NC.USR_USER_FIELD_LEFT,fieldWidth:NC.USER_USER_FIELD_WIDTH,layout:{top:NC.USR_USER_NAME_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),pwView:NC.LabeledPasswordFieldView.design({hint:"_Password".loc(),name:"_Password".loc(),validator:NC.AlphaNumValidator,enabled:YES,valueBinding:"NC.userController.password",fieldLeft:NC.USR_USER_FIELD_LEFT,fieldWidth:NC.USER_USER_FIELD_WIDTH,layout:{top:NC.USR_USER_PW_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),pwConfirmView:NC.LabeledPasswordFieldView.design({hint:"_Password".loc(),name:"_Confirm".loc(),validator:NC.AlphaNumValidator,enabled:YES,valueBinding:"NC.userController.confirm",fieldLeft:NC.USR_USER_FIELD_LEFT,fieldWidth:NC.USER_USER_FIELD_WIDTH,layout:{top:NC.USR_USER_CONFIRM_TOP,height:NC.LABELED_TEXT_FIELD_HEIGHT}}),buttonView:SC.View.design({childViews:"addButton editButton removeButton".w(),layout:{top:NC.USR_USER_BUTTON_TOP,height:NC.BUTTON_HEIGHT},addButton:SC.ButtonView.design({isDefault:NO,target:"NC.usersController",action:"addUser",title:"_Add".loc(),isEnabledBinding:"NC.userController.addEnabled",layout:{left:0,width:NC.USR_BUTTON_WIDTH}}),editButton:SC.ButtonView.design({isDefault:NO,target:"NC.usersController",action:"editUser",title:"_Edit".loc(),isEnabledBinding:"NC.userController.editEnabled",layout:{centerX:0,width:NC.USR_BUTTON_WIDTH}}),removeButton:SC.ButtonView.design({isDefault:NO,target:"NC.usersController",action:"removeUser",title:"_Delete".loc(),isEnabledBinding:"NC.usersController.removeEnabled",layout:{right:0,width:NC.USR_BUTTON_WIDTH}})})})})});
NC.UPLOAD_NO_ERR=0;NC.UPLOAD_ERR_START=1;NC.UPLOAD_ERR_CRC=2;NC.UPLOAD_ERR_MAGIC=3;
NC.KEEP_ALIVE_ID_REC="rec";NC.KEEP_ALIVE_ID_UMTS_UP="umtsup";NC.KEEP_ALIVE_ID_UMTS_DOWN="umtsdown";
NC.KEEP_ALIVE_ID_UMTS_CONN="umtsconn";NC.KEEP_ALIVE_ID_UMTS_SIG="umtssignal";NC.KEEP_ALIVE_PPP_IP="pppip";
NC.KEEP_ALIVE_TIME="time";NC.KEEP_ALIVE_UPTIME="uptime";NC.KEEP_ALIVE_SENSOR="sensor";
NC.MAIN_BOOL_PROPS=["network_bonjour_enabled","network_ntp_enabled","video_overlay_date_enabled","video_overlay_time_enabled","video_overlay_text_enabled","recording_video_alarm_event_motion","recording_video_alarm_event_input","recording_video_options_autodelete","recording_image_alarm_event_motion","recording_image_alarm_event_input","video_motion_display_enabled","video_sensor_flip","umts_enabled","network_dyndns_enabled","users_anonymous_enabled","network_umts_enabled"];
NC.MAIN_INT_PROPS=["video_mpeg4high_resolution_width","video_mpeg4high_resolution_height","video_mpeg4low_resolution_width","video_mpeg4low_resolution_height","video_mjpg_resolution_width","video_mjpg_resolution_height","audio_main_volume_value","audio_main_volume_min","audio_main_volume_max","audio_main_volume_step","video_motion_max","video_masks_max","video_mpeg4high_bitrate_min","video_mpeg4high_bitrate_max","video_mpeg4high_bitrate_step","video_mpeg4high_bitrate_value","video_sensor_exposure_min","video_sensor_exposure_max","video_sensor_exposure_step","video_sensor_exposure_value","video_sensor_maxexposure","video_sensor_hblank","video_sensor_vblank","video_sensor_frameratemode","video_sensor_aewdelay","video_sensor_frameinterval","video_mjpg_quality_value","video_mjpg1_quality_value","video_mjpg3_quality_value","video_mpeg4high_framerate_divider","video_mjpg_framerate_divider","video_mjpg_quality_min","video_mjpg_quality_max","video_mjpg_quality_step","video_sensor_timescale","recording_video_alarm_preduration_min","recording_video_alarm_preduration_max","recording_video_alarm_preduration_step","recording_video_alarm_preduration_value","recording_video_alarm_postduration_min","recording_video_alarm_postduration_max","recording_video_alarm_postduration_step","recording_video_alarm_postduration_value","recording_video_options_duration_min","recording_video_options_duration_max","recording_video_options_duration_step","recording_video_options_duration_value","recording_image_alarm_preduration_value","recording_image_alarm_postduration_value","recording_image_alarm_preduration_min","recording_image_alarm_preduration_max","recording_image_alarm_preduration_step","recording_image_alarm_postduration_min","recording_image_alarm_postduration_max","recording_image_alarm_postduration_step","recording_image_options_interval"];
NC.mainController=SC.Object.create({errorDialogClosed:true,progressDlgMsg:"",initialDataLoading:true,running:false,recording:false,progressCanceled:false,sidBinding:SC.Binding.oneWay().from("NC.ajax.sid"),recordModeBinding:SC.Binding.oneWay().from("NC.dataSrcController.recording_video_options_mode"),recordSelectedBinding:SC.Binding.oneWay().from("NC.recordsController.recordSelected"),scrollOffsetYBinding:SC.Binding.oneWay().from("NC.mainPage.mainPane.scrollView.verticalScrollOffset"),scrollOffsetXBinding:SC.Binding.oneWay().from("NC.mainPage.mainPane.scrollView.horizontalScrollOffset"),showLoginDialog:function(){this.set("password","");
this.set("user","");this.set("loginMessage","");NC.getPath("loginPage.loginPane").append()
},hideLoginDialog:function(){NC.getPath("loginPage.loginPane").remove()},login:function(){console.log("login");
var a="login="+this.get("user")+"&pw="+this.get("password");NC.ajax.transferData(a,NC.ajax.loginHandler,false)
},isGuest:function(a){return a.length!=5||a.charAt(0)=="3"},deleteRecords:function(){var a=NC.dataController.get("content");
NC.dataController.set("content",null);if(typeof a==="object"){console.log("delete dataController content");
delete a}a=NC.dataSrcController.get("content");NC.dataSrcController.set("content",null);
if(typeof a==="object"){console.log("delete dataSrcController content");delete a}},doLogin:function(a){console.log("navigator: appName=%s appCodeName=%s appVersion=%s",navigator.appName,navigator.appCodeName,navigator.appVersion);
console.log("doLogin sid=%s",a);if(a=="failed"){console.log("authenication failed");
this.set("loginMessage","authentication failed!");return}this.set("initialDataLoading",true);
NC.ajax.set("sid",a);console.log("doLogin sid=%s - initTimer",a);NC.timeController.initTimer();
NC.recordsController.initialize();NC.usersController.initialize();console.log("doLogin sid=%s - hideLoginDialog",a);
this.hideLoginDialog();this.deleteRecords();console.log("doLogin sid=%s - createRecord",a);
console.log("doLogin sid=%s - set content",a);NC.dataController.set("content",new Object());
console.log("doLogin sid=%s - start keepAliveTimer",a);this.startTimer("keepAliveTimer","sendKeepAlive",YES,NO,1000);
this.startTimer("progressTimer","sendProgress",YES,YES,1000);console.log("doLogin sid=%s - loadData",a);
this.loadData()},dataLoaded:function(a){console.log("data loaded...");NC.dataSrcController.set("content",a);
var e=NC.MAIN_BOOL_PROPS;NC.dataSrcController.beginPropertyChanges();for(var c=0;
c<e.length;c++){var d=NC.dataSrcController.get(e[c]);NC.dataSrcController.set(e[c],d==="true"?true:false)
}var b=NC.MAIN_INT_PROPS;for(c=0;c<b.length;c++){d=NC.dataSrcController.get(b[c]);
NC.dataSrcController.set(b[c],parseInt(d))}NC.dataSrcController.endPropertyChanges();
if(this.get("initialDataLoading")){NC.ajax.loadData("state",NC.ajax.stateHandler);
this.set("initialDataLoading",false)}console.log("data loaded...done")},stateLoaded:function(b){console.log("stateLoaded: state=%s",b);
var a=false;if(b=="maintenance"){a=true}else{if(b=="repairing"){a=true;this.showProgressDialog("_RepairRecordProgress".loc(),NC.recordsController.repairRecordDone,this,NC.recordsController.cancelRepair,this)
}else{if(b=="uploading"){a=true;this.showProgressDialog("_UploadingFirmwareProgress".loc(),this.uploadDone,this);
this.startTimer("uploadTimer","checkUpload",YES,NO,1000)}}}console.log("stateLoaded1");
this.set("maintenanceEnabled",a);this.updateMenuItems(a,b==="service");console.log("stateLoaded2");
this.set("selection",a?"_Info".loc():"_Liveview".loc());console.log("stateLoaded3");
NC.ajax.loadData("sourceList",NC.ajax.menuHandler)},menuLoaded:function(){console.log("menu loaded");
var b=this.get("store").recordsFor(NC.SetupGroup);var a=SC.Object.create(SC.TreeItemContent,{treeItemIsGrouped:YES,treeItemChildren:b,count:b.get("length")});
console.log("menu loaded1");NC.setupMenuController.set("content",a);console.log("menu loaded2");
NC.setupMenuController.initSelection();console.log("menu loaded3");if(!this.isGuest(NC.ajax.get("sid"))){NC.ajax.loadData("masks",NC.ajax.maskHandler);
NC.ajax.loadData("mmasks",NC.ajax.motionHandler);NC.ajax.loadData("timezones",NC.ajax.timezoneHandler)
}console.log("menu loaded4");NC.getPath("mainPage.emptyMainPane").remove();console.log("menu loaded5");
NC.getPath("mainPage.mainPane").append();console.log("menu loaded6");this.set("running",true)
},loadData:function(){NC.ajax.loadData("config",NC.ajax.dataHandler)},reloadData:function(){if(!this.isGuest(NC.ajax.get("sid"))){NC.ajax.loadData("masks",NC.ajax.maskHandler);
NC.ajax.loadData("mmasks",NC.ajax.motionHandler);NC.usersController.reset();this.loadData()
}},logout:function(){if(NC.dataController.get("saveEnabled")){NC.dataController.showSaveDialog("logout")
}else{var a="logout";NC.ajax.transferData(a,NC.ajax.logoutHandler,true)}},doLogout:function(){var a=this.get("maintenanceEnabled");
this.set("selection",a?"_Info".loc():"_Liveview".loc());console.log("doLogout");this.set("running",false);
this.stopTimer("keepAliveTimer");this.stopTimer("progressTimer");console.log("doLogout - stopTimer");
NC.timeController.stopTimer();console.log("doLogout - NC.privacyMaskController.clear()");
NC.privacyMaskController.clear();console.log("doLogout - NC.motionController.clear()");
NC.motionController.clear();console.log("doLogout - this.getMjpgController().stop()");
this.getMjpgController().stop();console.log("doLogout - remove data");this.deleteRecords();
NC.getPath("mainPage.mainPane").remove();NC.getPath("mainPage.emptyMainPane").append();
NC.ajax.set("sid",null);this.hideProgressDialog();this.showLoginDialog();console.log("doLogout finished")
},selectionChanged:function(){console.log("selection=%s",this.get("selection"));var b=NC.getPath("mainPage.mainPane.scrollView.contentView.mainView.containerView");
NC.timeController.pauseTimer(true);console.log("selectionChanged: stop mjpg controller");
if(this.get("selection")==="_Info".loc()){b.set("nowShowing","NC.infoPage.infoView")
}else{if(this.get("selection")==="_Setup".loc()){var a=NC.setupMenuController.get("currentItem").get("view");
NC.timeController.pauseTimer(a!=="timePage.timeView");b.set("nowShowing","NC.setupPage.setupView")
}else{if(this.get("selection")==="_Records".loc()){b.set("nowShowing","NC.recordPage.recordView");
NC.recordsController.loadRecords()}else{if(this.get("selection")==="_Maintenance".loc()){b.set("nowShowing","NC.maintenancePage.mainView")
}else{if(this.get("selection")==="_Service".loc()){b.set("nowShowing","NC.servicePage.mainView")
}else{if(this.get("selection")==="Test".loc()){b.set("nowShowing","NC.testPage.testView")
}else{b.set("nowShowing","NC.liveViewPage.liveView")}}}}}}this.getMjpgController().update()
}.observes("selection"),alertPaneDidDismiss:function(b,a){console.log("alertPaneDidDismiss pane=%s status=%s",b,a);
if(NC.ajax.get("sid")!==null){this.doLogout()}this.set("errorDialogClosed",true)},showErrorDialog:function(a,b){if(!this.get("running")){return
}if(this.get("errorDialogClosed")){this.set("errorDialogClosed",false);SC.AlertPane.error(a,b,"",this)
}},showLoginErrorDialog:function(a,b){if(this.get("errorDialogClosed")){this.set("errorDialogClosed",false);
SC.AlertPane.error(a,b,"",this)}},getMjpgController:function(){return NC.ajax.navigator()==="Explorer"?NC.mjpgPollController:NC.mjpgPushController
},getHttpAddress:function(){var c=location.hostname;var b=NC.mainController.get("user");
var a=NC.mainController.get("password");if(b===""&&a===""){b="admin";a="admin"}return"http://"+b+":"+a+"@"+c
},maintenanceModeChanged:function(){var a=this.get("maintenanceEnabled");if(typeof a==="undefined"){return
}this.updateMenuItems(a,false)}.observes("maintenanceEnabled"),generateMenuItem:function(b,a){return SC.Object.create({title:b,value:b,enabled:a})
},updateMenuItems:function(b,d){var a=NC.ajax.get("sid");var c=[];if(this.isGuest(a)){c=[this.generateMenuItem("_Liveview".loc(),true),this.generateMenuItem("_Info".loc(),true)]
}else{c=[this.generateMenuItem("_Liveview".loc(),!b),this.generateMenuItem("_Setup".loc(),!b),this.generateMenuItem("_Records".loc(),true),this.generateMenuItem("_Maintenance".loc(),true),this.generateMenuItem("_Info".loc(),true)];
if(d){c.push(this.generateMenuItem("_Service".loc(),true))}}this.set("menuItems",c)
},streamingStarted:function(){console.log("streamingStarted");this.set("maintenanceEnabled",false)
},streamingStopped:function(){console.log("streamingStopped");this.set("maintenanceEnabled",true)
},pauseTimer:function(b,a){this.get(b).set("isPaused",a)},stopTimer:function(a){this.get(a).invalidate()
},startTimer:function(f,d,a,c,b){console.log("startTimer: prop=%s action=%s repeats=%s paused=%s msInterval=%s",f,d,a,c,b);
var e=SC.Timer.schedule({target:this,action:d,interval:b,repeats:a,isPaused:c});this.set(f,e)
},sendProgress:function(){console.log("sendProgress...");this.pauseTimer("progressTimer",true);
NC.ajax.transferData("getprogress",NC.ajax.getProgressHandler,true);console.log("sendProgress...done")
},cancelProgress:function(){console.log("cancelProgress...");this.set("progressCanceled",true);
this.pauseTimer("keepAliveTimer",false);this.pauseTimer("progressTimer",true)},stopProgress:function(c){console.log("stopProgress...");
this.pauseTimer("keepAliveTimer",false);var a=this.get("progressStopAction");var b=this.get("stopActionTarget");
this.hideProgressDialog();console.log("call action=%s target=%s succeeded=%s",a,b,c);
a.call(b,c);console.log("stopProgress...done")},continueProgress:function(b,a){console.log("continueProgress progressValue=%d progressMax=%d",b,a);
NC.progressController.set("value",b*100/a);if(this.get("progressCanceled")){this.set("progressCanceled",false)
}else{this.pauseTimer("progressTimer",false)}},showProgressDialog:function(f,e,d,a,b){console.log("showProgressDialog...msg=%s stopAction=%s stopActionTarget=%s",f,typeof e,typeof d);
NC.progressController.openPane(f,typeof e==="function");console.log("showProgressDialog...appended");
var c=false;if(typeof e==="function"){console.log("showProgressDialog...pause keepAliveTimer...");
this.pauseTimer("keepAliveTimer",true);console.log("showProgressDialog...start progressTimer...");
this.set("progressCanceled",false);this.pauseTimer("progressTimer",false);console.log("showProgressDialog...start progressTimer...done");
this.set("progressStopAction",e);this.set("stopActionTarget",d)}if(typeof a==="function"){NC.progressController.set("cancelAction",a);
NC.progressController.set("cancelActionTarget",b);NC.progressController.set("cancelEnabled",true)
}else{NC.progressController.set("cancelEnabled",false)}console.log("showProgressDialog...done")
},hideProgressDialog:function(){NC.progressController.closePane()},keepAliveDone:function(b){var a=b.split(":::");
for(var d=0;d<a.length;d++){var g=a[d].match(/(.+)=(.*)/);if(g!==null){var h=g[1];
var f=g[2];switch(h){case NC.KEEP_ALIVE_ID_REC:this.setIfChanged("recording",f==="true");
break;case NC.KEEP_ALIVE_ID_UMTS_UP:NC.umtsController.set("upstreamRate",parseInt(f));
break;case NC.KEEP_ALIVE_ID_UMTS_DOWN:NC.umtsController.set("downstreamRate",parseInt(f));
break;case NC.KEEP_ALIVE_ID_UMTS_CONN:NC.umtsController.set("connection",f);break;
case NC.KEEP_ALIVE_ID_UMTS_SIG:NC.umtsController.set("signalStrength",parseInt(f));
break;case NC.KEEP_ALIVE_PPP_IP:NC.umtsController.set("pppIp",f);break;case NC.KEEP_ALIVE_TIME:NC.timeController.set("serverTime",f);
break;case NC.KEEP_ALIVE_UPTIME:NC.dataSrcController.set("info_uptime",f);break;case NC.KEEP_ALIVE_SENSOR:var c=this.get("lens");
var e=parseInt(f);if(e!==c){this.removeObserver("lens",this,this.lensObserver);this.set("lens",e);
this.addObserver("lens",this,this.lensObserver)}break}}}this.pauseTimer("keepAliveTimer",false)
},sendKeepAlive:function(){if(this.get("running")===true){this.pauseTimer("keepAliveTimer",true);
NC.ajax.transferData("keepalive",NC.ajax.keepAliveHandler,true)}},checkUpload:function(){this.pauseTimer("uploadTimer",true);
NC.ajax.transferData("checkupload",NC.ajax.checkUploadHandler,true);console.log("checkUpload")
},startUpload:function(){console.log("startUpload...");this.showProgressDialog("_UploadingFirmwareProgress".loc(),NC.mainController.uploadDone,this);
NC.ajax.transferData("startupload",NC.ajax.emptyHandler,true);this.startTimer("uploadTimer","checkUpload",YES,NO,1000);
return true},uploadDone:function(a){console.log("uploadDone")},continueUpload:function(){this.pauseTimer("uploadTimer",false)
},stopUpload:function(a){console.log("stopUpload: error=%d",a);NC.UPLOAD_NO_ERR=0;
NC.UPLOAD_ERR_START=1;NC.UPLOAD_ERR_CRC=2;NC.UPLOAD_ERR_MAGIC=3;this.stopTimer("uploadTimer");
this.cancelProgress();this.hideProgressDialog("upload...");if(a==NC.UPLOAD_NO_ERR){SC.AlertPane.info("_UploadSucceededTitle".loc(),"_UploadSucceededText".loc(),"","_RestartSystem".loc(),"_Cancel".loc(),NC.uploadSucceededPaneController)
}else{var b="_UploadFailedUnexpectedError".loc();if(a==NC.UPLOAD_ERR_CRC){b="_UploadFailedCRCFailed".loc()
}else{if(a==NC.UPLOAD_ERR_MAGIC){b="_UploadFailedWrongFormat".loc()}}SC.AlertPane.error("_UploadFailedTitle".loc(),b,"",NC.uploadFailedPaneController)
}},triggerEvent:function(){console.log("triggerEvent");NC.mainController.showProgressDialog("_TriggerEventProgress".loc());
NC.ajax.transferData("triggerevent",NC.ajax.emptyProgressHandler,true)},startRecord:function(){console.log("startRecord");
NC.mainController.showProgressDialog("_StartRecordProgress".loc());NC.ajax.transferData("startrecord",NC.ajax.emptyProgressHandler,true)
},stopRecord:function(){console.log("stopRecord");NC.mainController.showProgressDialog("_StopRecordProgress".loc());
NC.ajax.transferData("stoprecord",NC.ajax.emptyProgressHandler,true)},recordButtonEnabled:function(){var d=this.get("recordMode");
var c=this.get("sid");var b=this.get("maintenanceEnabled");if(typeof d==="undefined"||d===null||typeof c==="undefined"||c===null||typeof b==="undefined"||b===null){return false
}var a=this.isGuest(c);return !b&&!a&&(d!=="longtime")}.property("recordMode","maintenanceEnabled","sid").cacheable(),recordButtonTitle:function(){var b=this.get("recordMode");
if(b=="alarm"){return"_TriggerEvent".loc()}else{var a=this.get("recording");return a?"_StopRecord".loc():"_StartRecord".loc()
}}.property("recordMode","recording").cacheable(),recordButtonAction:function(){var b=this.get("recordMode");
if(b=="alarm"){return"triggerEvent"}else{var a=this.get("recording");return a?"stopRecord":"startRecord"
}}.property("recordMode","recording").cacheable(),recordIcon:function(){var a=this.get("recording");
return a?"sc-icon-record":"sc-icon-record-idle"}.property("recording").cacheable(),downloadButtonEnabled:function(){var a=this.get("recording");
var b=this.get("recordSelected");return b&&!a}.property("recordSelected","recording"),recordingOff:function(){return this.get("recording")!==true
}.property("recording").cacheable(),lensEnabled:function(){var d=this.get("lens");
var c=this.get("sid");var b=this.get("maintenanceEnabled");if(SC.none(d)||SC.none(c)||SC.none(b)){return false
}var a=this.isGuest(c);return !b&&!a}.property("lens","maintenanceEnabled","sid").cacheable(),lensObserver:function(){var a=this.get("lens");
NC.ajax.transferData("setsensor="+a,NC.ajax.emptyHandler,true)}});NC.main=function main(){console.log("start");
NC.mainController.set("store",SC.Store.create());NC.getPath("mainPage.emptyMainPane").append();
NC.mainController.showLoginDialog()};function main(){NC.main()};
