"use strict";var NIS=_.isUndefined(NIS)?{}:NIS;NIS.Settings={images:{DIR:"https://cts.nikonimagespace.com/gst/res/asset/images/",download:{DOWNLOAD:"bt_download.png?rel=1716948886135",OK:"bt_download_ok.png?rel=1716948886135",CANCEL:"bt_da_cancel.png?rel=1716948886135",LOADING:"download_loading_white.gif?rel=1716948886135",OK_OFF:"bt_download_off.png?rel=1716948886135",DOWNLOAD_SEP:"da_download_sep.png?rel=1716948886135",LOADED:"download_load.gif?rel=1716948886135",DOWNLOAD_ICON:"bt_mk_download.png?rel=1716948886135"},copy:{LOADING:"download_loading_white.gif?rel=1716948886135"},detail:{FULLSCREEN:"bt_fullscreen.png?rel=1716948886135",VOICE_MEMO:"bt_voice.png?rel=1716948886135",VOICE_STOP:"bt_stop.png?rel=1716948886135"},fileType:{GRID_RAW:"gd_icon_raw.png?rel=1716948886135",GRID_NMS:"gd_icon_nms.png?rel=1716948886135",GRID_MOV:"gd_icon_mov.png?rel=1716948886135",GRID_MPO:"gd_icon_mpo.png?rel=1716948886135",GRID_AVI:"gd_icon_avi.png?rel=1716948886135",GRID_TIFF:"gd_icon_tiff.png?rel=1716948886135",GRID_MP4:"gd_icon_mp4.png?rel=1716948886135",TIMELINE_RAW:"time_icon_raw.png?rel=1716948886135",TIMELINE_NMS:"time_icon_nms.png?rel=1716948886135",TIMELINE_MOV:"time_icon_mov.png?rel=1716948886135",TIMELINE_MPO:"time_icon_mpo.png?rel=1716948886135",TIMELINE_AVI:"time_icon_avi.png?rel=1716948886135",TIMELINE_TIFF:"time_icon_tiff.png?rel=1716948886135",TIMELINE_MP4:"time_icon_mp4.png?rel=1716948886135"},slideshow:{PLAY_BUTTON:"slc_play.png?rel=1716948886135",PAUSE_BUTTON:"slc_stop.png?rel=1716948886135"}},url:{GUEST_AUTH:"auth.html",GUEST_INDEX:"index.html",GUEST_DETAIL:"detail.html",GUEST_DOWNLOAD:"download.html",NIS_AUTH:"https://nis.nikonimagespace.com/myphoto/nis-auth",NIS_API:"https://nis.nikonimagespace.com/myphoto/nis-common",GA_REMOTE_AUTH:"https://www.nikonimagespace.com/conf/login/RemoteLogin.do",GA_TOP:"https://www.nikonimagespace.com/",GA_LOGOUT:"https://www.nikonimagespace.com/conf/Logout.do",MYP_TOP:"https://nis.nikonimagespace.com/html/myphoto/",MNT_API:"http://mnt.nikonimagespace.com/mntsv/mainte_inquire/mainte_get_all?",NIKONID_LOGIN:"https://www.nikonimagespace.com/conf/redirect/Login.do?okurl=",REGISTER:"https://www.nikonimagespace.com/conf/redirect/Register.do",HELP_SESSION:"https://info.nikonimagespace.com/help/50099",VIDEO_API:"https://mov.nikonimagespace.com/v/geturl",BGM:"https://cts.nikonimagespace.com/myp/slideshowbgm/music/",APP_URL_FOR_IPHONE:"com.nikonimagespace://",APP_STORE_URL_FOR_IPHONE:"itms-apps://itunes.apple.com/app/nikon-image-space/id468284680?mt=8",APP_URL_FOR_ANDROID:"intent://nikonimagespace.com/#Intent;scheme=nis;package=com.mypicturetown.gadget.mypt;launchFlags=0x14000000;end",SPHERE_IMG_URL:"https://smv.nikonimagespace.com/sphere/sphereImageViewer.html",SPHERE_MP4_URL:"https://smv.nikonimagespace.com/sphere/sphereVideoPlayer.html",GA_ORIGIN:"https://www.nikonimagespace.com"},TOUCH_SCREEN_BREAKPOINT:800,SHOW_THUMBS_PER_LOAD:102,FADE_ANIMATION_DURATION:300,GET_IMAGES_PER_LOAD:2,GET_ITEMS_PER_FETCH:102,KEEP_ALIVE_INTERVAL:18e4,RENEW_SHARE_TOKEN_INTERVAL:3e6,TIME_TO_DISCONNECT:18e5,DETAIL_THUMBS_PER_LOAD:6,TIMELINE_THUMBS_PER_LOAD:3,DOWNLOAD_THUMBS_PER_LOAD:24,SLIDE_SHOW_PER_LOAD:2,DOWNLOAD_SELECT_PATH:"download.html",SKIN_COLOR:{300:"black100",301:"black70",302:"black30",303:"black0"},LAYOUT:{square:"0",rectangle:"1"},REFERRERS:{facebook:{domain:"www.facebook.com",value:"1"},google:{domain:"plus.google.com",value:"3"}},COOKIE_KEY:{mdata:"ga.mdata"},URL_PARAMS_KEY:{gdata:"g",r:"r",auth:"a",page:"p"},AUTH_INITIATOR:{index:"GUEST_INDEX",detail:"GUEST_DETAIL",download:"GUEST_DOWNLOAD"},STORAGE_KEY:{token:"token",share:"share",albumId:"albumId",itemId:"itemId",gdata:"gdata",info:"info",items:"items",page:"page",hash:"hash"},SHOW_PAGERS_PER_PAGE:5,uaParams:{guest_header_1:{category:"guest",action:"header",label:"nislogo"},guest_header_2:{category:"guest",action:"header",label:"first"},guest_header_3:{category:"guest",action:"header",label:"plan"},guest_header_4:{category:"guest",action:"header",label:"help_button"},guest_footer_appli:{category:"guest",action:"footer",label:"appli"},guest_footer_1:{category:"guest",action:"footer",label:"nislogo"},guest_footer_2:{category:"guest",action:"footer",label:"home"},guest_footer_3:{category:"guest",action:"footer",label:"privacy"},guest_footer_4:{category:"guest",action:"footer",label:"terms"},guest_footer_5:{category:"guest",action:"footer",label:"cookie"},guest_password_1:{category:"guest",action:"password",label:"ok"},guest_password_2:{category:"guest",action:"password",label:"cancel"},guest_view_1:{category:"guest",action:"view",label:"download"},guest_view_2:{category:"guest",action:"view",label:"copy"},guest_view_3:{category:"guest",action:"view",label:"slideshow"},guest_view_4:{category:"guest",action:"view",label:"prev"},guest_view_5:{category:"guest",action:"view",label:"next"},guest_view_6:{category:"guest",action:"view",label:"pagebutton"},guest_view_7:{category:"guest",action:"view",label:"thumbnail"},guest_download_all_1:{category:"guest",action:"download_all",label:"ok"},guest_download_all_2:{category:"guest",action:"download_all",label:"preview"},guest_download_all_3:{category:"guest",action:"download_all",label:"cancel"},guest_download_choose_1:{category:"guest",action:"download_choose",label:"download_button"},guest_download_choose_5:{category:"guest",action:"download_choose",label:"breadcrumb"},guest_download_pagemovement_1:{category:"guest",action:"download_pagemovement",label:"cancel"},guest_download_pagemovement_2:{category:"guest",action:"download_pagemovement",label:"yes"},guest_download_check_1:{category:"guest",action:"download_check",label:"cancel"},guest_download_check_2:{category:"guest",action:"download_check",label:"ok"},guest_download_standby_1:{category:"guest",action:"download_standby",label:"cancel"},guest_download_ok_1:{category:"guest",action:"download_ok",label:"cancel"},guest_download_ok_2:{category:"guest",action:"download_ok",label:"download_button"},guest_copy_myaccount_login_1:{category:"guest",action:"copy_myaccount_login",label:"cancel"},guest_copy_myaccount_login_2:{category:"guest",action:"copy_myaccount_login",label:"login"},guest_copy_myaccount_login_5:{category:"guest",action:"copy_myaccount_login",label:"newaccount"},guest_copy_myaccount_1:{category:"guest",action:"copy_myaccount",label:"cancel"},guest_copy_myaccount_2:{category:"guest",action:"copy_myaccount",label:"ok"},guest_copy_myaccount_complete_1:{category:"guest",action:"copy_myaccount_complete",label:"cancel"},guest_copy_myaccount_complete_2:{category:"guest",action:"copy_myaccount_complete",label:"ok"},guest_photo_detail_1:{category:"guest",action:"photo_detail",label:"breadcrumb"},guest_photo_detail_2:{category:"guest",action:"photo_detail",label:"prev"},guest_photo_detail_3:{category:"guest",action:"photo_detail",label:"next"},guest_photo_detail_4:{category:"guest",action:"photo_detail",label:"download_button"},guest_photo_detail_5:{category:"guest",action:"photo_detail",label:"slideshow"},guest_photo_detail_6:{category:"guest",action:"photo_detail",label:"wow"},guest_photo_detail_7:{category:"guest",action:"photo_detail",label:"report"},guest_photo_detail_8:{category:"guest",action:"photo_detail",label:"zoom"},guest_photo_detail_9:{category:"guest",action:"photo_detail",label:"voice"},guest_photo_detail_10:{category:"guest",action:"photo_detail",label:"play"},guest_report_1:{category:"guest",action:"report",label:"cancel"},guest_report_2:{category:"guest",action:"report",label:"ok"},guest_zoom_1:{category:"guest",action:"zoom",label:"close_x"},guest_zoom_2:{category:"guest",action:"zoom",label:"prev"},guest_zoom_3:{category:"guest",action:"zoom",label:"next"},guest_zoom_4:{category:"guest",action:"zoom",label:"voice"},guest_zoom_5:{category:"guest",action:"zoom",label:"wow"},guest_slideshow_1:{category:"guest",action:"slideshow",label:"close_x"},guest_slideshow_2:{category:"guest",action:"slideshow",label:"prev"},guest_slideshow_3:{category:"guest",action:"slideshow",label:"next"},guest_slideshow_4:{category:"guest",action:"slideshow",label:"setting"},guest_slideshow_5:{category:"guest",action:"slideshow",label:"play"},guest_slideshow_setting_1:{category:"guest",action:"slideshow_setting",label:"cancel"},guest_slideshow_setting_2:{category:"guest",action:"slideshow_setting",label:"play"},guest_error_1:{category:"guest",action:"error",label:"ok"}}},NIS.APIReturnCode={SUCCESS:"NSSCS00001",common:{TOKEN_INVALID:"NSSYS00101",SESSION_EXPIRED:"NSSYS00201",ALBUM_ID_SHARE_EXPIRED:"NSERO01304",SHARE_ALBUM_NOT_EXIST:"NSERO03708",UNREGISTERED_APIKEY:"NSSYS00401"},auth:{ALBUM_ID_SHARE_PASSWORD_INVALID:"NSERO01305",NIS_MDATA_INVALID:"NSSYS00701",NIS_MDATA_EXPIRE:"NSSYS00702",NIS_LOGIN_SUSPENDED:"NSSYS00801",NIS_LOGIN_ERROR:"NSSYS01101"},download:{ITEM_ID_NOT_EXIST:"NSERO01203",DOWNLOAD_ITEM_EMPTY:"NSERO03701"},copy:{STORAGE_QUOTA_EXCEEDED:"NSERO02201",ALBUM_MAX_OVER:"NSERO01101",ALBUM_ITEM_MAX_OVER:"NSERO01306"}},NIS.Analytics=function(){var a=this,b=$.platform.is("pc")?"mouseup":"touchend",c="ga.uadata=",d=document.cookie+";";d.indexOf(c);window.addEventListener(b,_.throttle(function(a){},a.THROTTLING_DURATION),!0)},NIS.Analytics.prototype={INIT_RETRY_INTERVAL:100,MAX_RETRY_COUNT:10,THROTTLING_DURATION:200,getUAID:function(a){var b=$(a),c=b.data("ua");return null!=c?c:b.is("html")?null:this.getUAID(b.parent())}},NIS.setSkinColor=function(a){var b=NIS.Settings.SKIN_COLOR[a];_.isUndefined(b)||$("body").addClass(b)};var LoadQueueManager=function(a){var b=new createjs.LoadQueue(!1);b.setUseXHR(!1);var c=function(){};_.isFunction(a.fileload)||(a.fileload=c),_.isFunction(a.complete)||(a.complete=c),_.isFunction(a.error)||(a.error=c),b.setMaxConnections(a.maxConnection),b.on("fileload",a.fileload),b.on("complete",a.complete),b.on("error",a.error),this.queue=b};LoadQueueManager.prototype={getQueue:function(){return this.queue},addLoadQueue:function(a){this.queue.loadFile({id:a.id,src:a.src,type:a.type,method:"GET"})},addManifest:function(a){this.queue.loadManifest(a)},removeFromQueue:function(a){this.queue.remove(a)}};var NIS=_.isUndefined(NIS)?{}:NIS;NIS.ParameterManager=function(a,b){this.onSessionStorageError=a,this.onError=b,this.urlParams=this.getUrlParams(),this.sessionParams=this.getSessionStorageParams();try{sessionStorage.setItem("test","test"),sessionStorage.removeItem("test")}catch(a){this.onSessionStorageError()}},NIS.ParameterManager.prototype={splitKeyValue:function(a,b,c){var d={},e=_.compact(a.split(b));return _.each(e,function(a){var b=a.split(c);d[b[0]]=b[1]}),d},splitURI:function(a){var b=/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,c=a.match(b);return c?{scheme:c[1],authority:c[2],path:c[3],query:c[4],fragment:c[5]}:null},getCookieParams:function(){var a=NIS.Settings.COOKIE_KEY,b={};try{_.forOwn(a,function(a){b[a]=Cookies.get(a)})}catch(a){this.onError()}return b},getUrlParams:function(){return this.splitKeyValue(location.search.substring(1),"&","=")},getReferrer:function(){var a="0",b=this.splitURI(document.referrer),c=_.isObject(b)&&_.isString(b.authority)?b.authority:"";return _.isString(this.urlParams.r)&&(a=this.urlParams.r),_.forOwn(NIS.Settings.REFERRERS,function(b){c===b.domain&&(a=b.value)}),a},getSessionStorageParams:function(){var a=NIS.Settings.STORAGE_KEY,b={};try{_.forOwn(a,function(a){b[a]=sessionStorage.getItem(a)})}catch(a){this.onSessionStorageError()}return b},clearSession:function(){var a=NIS.Settings.STORAGE_KEY;try{_.each(a,function(a){sessionStorage.removeItem(a)})}catch(a){this.onSessionStorageError()}}},NIS.KeepAlive=function(a){this.interval=a.interval,this.success=a.success,this.fail=a.fail,this.timer=null},NIS.KeepAlive.prototype={start:function(){var a=this;a.timer||(a.timer=setInterval(function(){NIS.api.keepAlive().then(a.success,a.fail)},a.interval))},stop:function(){this.timer&&(clearInterval(this.timer),this.timer=null)}},NIS.OperationWatcher=function(){this.onTimeout=null,this.timerId=null,this.keyDownEvName="keydown.watcher",this.mouseMoveEvName="mousemove.watcher"},NIS.OperationWatcher.prototype={check:function(){var a=this;a.timerId&&clearTimeout(a.timerId),a.timerId=setTimeout(function(){a.stop(),a.onTimeout()},NIS.Settings.TIME_TO_DISCONNECT)},start:function(a){if(void 0!==a){this.onTimeout=a;var b=_.bind(this.check,this);$(window).on(this.keyDownEvName,b).on(this.mouseMoveEvName,b)}this.check()},stop:function(){this.timerId&&clearTimeout(this.timerId),$(window).off(this.keyDownEvName).off(this.mouseMoveEvName)}},NIS.API=function(a,b){var c=this;c.token=a,c.info=null==b?void 0:b,c.url=NIS.Settings.url.NIS_API,c.paramType="json",c.API_KEY="8f9d10b8184ba4e326361a46de44501e",Backbone._sync||(Backbone._sync=Backbone.sync,Backbone.sync=_.bind(c.sync,c)),_.bindAll(c,"download","shareCopy")},NIS.API.prototype={setToken:function(a){this.token=a},setInfo:function(a){this.info=a},sync:function(a,b,c){return Backbone._sync(a,b,this.getAjaxArgs(c))},executeAPI:function(a){var b={extra:{postData:a.postData,requestData:a.requestData}};return null!=a.url&&(b.url=a.url),null!=a.extra&&(a.extra=_.extend(b.extra,a.extra)),$.ajax(this.getAjaxArgs(b)).then(this.onAjaxSuccess,this.onFail)},getAjaxArgs:function(a){var b={url:this.url,type:"post",data:{},dataType:"json",async:!0,cache:!1,timeout:null,extra:{requestData:{},async:!1,asyncres:!1}};a.extra=_.extend(b.extra,a.extra);var c=_.extend(b,a),d={apiKey:this.API_KEY,async:c.extra.asyncres.toString(),asyncres:c.extra.asyncres.toString(),guest:"true"};return null!=this.token&&(d.tokenId=this.token),c.url+="?"+$.param(d),null!=c.extra.requestData&&(c.data={jsondata:JSON.stringify(c.extra.requestData)}),null!=c.extra.postData&&(c.data=_.extend(c.data,c.extra.postData)),c},executeAsyncWatch:function(a){var b=this,c=$.Deferred(),d=function(){b.getAsyncResponse(a.ticketId).then(f,g)},e=null,f=function(a){if(a.code===NIS.APIReturnCode.SUCCESS){var b=a.asyncRespose;"success"===b.status?c.resolve(b[b.methodName]):"error"===b.status?c.reject():e=setTimeout(d,2e3)}else c.reject(a.code)},g=function(){clearTimeout(e),c.reject()};return d(),c.promise()},onAjaxSuccess:function(a,b){var c=$.Deferred();if("success"===b){var d=_.find(a,function(a){return null!=a.code}),e=function(a){return _.isString(a)?NIS.StringTools.unescapeHTML(a):_.isObject(a)||_.isArray(a)?f(a):a},f=function(a){return _.isArray(a)?a.map(e):_.isObject(a)?_.mapValues(a,e):a},g=f(d);"success"===a.status&&g&&g.code===NIS.APIReturnCode.SUCCESS?c.resolve(g):c.reject(g)}else c.reject();return c.promise()},onFail:function(){NIS.parameterManager.clearSession(),NIS.alertView.render(NIS.Messages.error.title,NIS.Messages.error.CONNECTION_ERROR,location.href)},login:function(a,b,c){return this.executeAPI({url:NIS.Settings.url.NIS_AUTH,postData:{mdata:a,gdata:b,apiKey:this.apiKey,referer:c}})},logout:function(){return this.executeAPI({requestData:{Logout:{}}})},getShareInfo:function(a){return this.executeAPI({requestData:{GetShareInfo:{albumId:a}}})},keepAlive:function(){return this.executeAPI({requestData:{KeepAlive:{}}})},getAsyncResponse:function(a){return this.executeAPI({requestData:{GetAsyncResponse:{ticketId:a}}})},download:function(a,b,c,d){return this.executeAPI({extra:{async:d,asyncres:d},requestData:{Download:{libraryIdList:a,itemIdList:b,imageSize:NIS.guestPage.imageSize,info:this.info,sendMail:"false",secureDownloadFlg:c.toString()}}})},getSecureDownloadUrl:function(a,b){return this.executeAPI({requestData:{GetSecureDownloadUrl:{downloadId:a,downloadNumber:b}}})},getAlbumItems:function(a,b,c,d,e,f){return this.executeAPI({requestData:{GetAlbumItems:{albumId:a,sortBy:b,sortOrder:c,limit:d.toString(),offset:e.toString(),thumbSizeList:"300_300,320_240,1024_768,1600_1200,1920_1080",info:this.info,thumbCount:"0",allIdFlg:(!!f).toString()}}})},getTracks:function(a){return this.executeAPI({requestData:{GetTracks:{albumId:a,info:this.info}}})},getItemsInfo:function(a,b){return this.executeAPI({requestData:{GetItemsInfo:{itemIdList:a,info:this.info,shareAlbumId:b}}})},updateItemLikeCount:function(a,b,c){return this.executeAPI({requestData:{UpdateItemLikeCount:{itemId:a,referer:b,shareAlbumId:c}}})},updateItemViewCount:function(a,b,c){return this.executeAPI({requestData:{UpdateItemViewCount:{itemId:a,referer:b,shareAlbumId:c}}})},shareCopy:function(a,b){return this.executeAPI({extra:{async:!0,asyncres:!0},requestData:{ShareCopy:{albumId:a,itemIdList:void 0,trackFlg:"true",addAlbumId:void 0,albumName:b,info:this.info}}})},reportInappropriateItems:function(a,b,c){return this.executeAPI({requestData:{ReportInappropriateItems:{itemIdList:b,albumId:a,reportType:c}}})}},NIS.Auth=function(){_.bindAll(this)},NIS.Auth.prototype={loginGA:function(a){return this.remoteGaLogin(a.email,a.pass)},logoutGA:function(){return $.ajax({url:NIS.Settings.url.GA_LOGOUT,type:"GET",xhrFields:{withCredentials:!0}})},loginMyphoto:function(){return NIS.api.login(NIS.cookieParams[NIS.Settings.COOKIE_KEY.mdata],NIS.urlParams.g,NIS.parameterManager.getReferrer())},loginFacebook:function(){return this.oauth(NIS.Settings.url.GA_FACEBOOK_AUTH)},loginGoogle:function(){return this.oauth(NIS.Settings.url.GA_GOOGLE_AUTH)},oauth:function(a){function b(a){if(a.origin===NIS.Settings.url.GA_ORIGIN){NIS.cookieParams=NIS.parameterManager.getCookieParams();NIS.cookieParams[NIS.Settings.COOKIE_KEY.mdata]||(window.location.href=a.data)}}var c=$.Deferred();if(window.addEventListener("message",b,!1),$.browser.is("msie")){window.open("/html/guest/"+NIS.Country.browserLanguage()+"/proxy.html","ConnectWithOAuth","location=0,status=0,width=800,height=400")}return $.oauthpopup({path:a,callback:function(){NIS.cookieParams=NIS.parameterManager.getCookieParams();var a=NIS.cookieParams[NIS.Settings.COOKIE_KEY.mdata];_.isString(a)&&!_.isEmpty(a)?c.resolve():c.reject(),setTimeout(function(){window.removeEventListener("message",b,!1)},200)}}),c.promise()},remoteGaLogin:function(a,b){var c=new Blowfish("IZRJQwi4vN5QfBx"),d=c.encrypt64(a+" "+b+" 0");d=d.split("+").join("-"),d=d.split("/").join("_");var e=NIS.Settings.url.GA_REMOTE_AUTH+"?a="+d;return $.ajax({url:e,dataType:"jsonp",data:{q:e}}).then(this.onGALoginSuccess.bind(this),this.onGALoginError.bind(this))},onGALoginSuccess:function(a){return"0"!==a.status||"000"!==a.code?$.Deferred().reject(a.code):(NIS.cookieParams=NIS.parameterManager.getCookieParams(),this.loginMyphoto())},onGALoginError:function(){NIS.alertView.render(NIS.Messages.error.title,NIS.Messages.error.CONNECTION_ERROR)}},NIS.auth=new NIS.Auth,NIS.StringTools={DEFAULT_SHORTEN_STR_COUNT:10,ESCAPE_CHARS:[{escaped:"<",unescaped:"<"},{escaped:">",unescaped:">"},{escaped:""",unescaped:'"'},{escaped:""",unescaped:'"'},{escaped:"'",unescaped:"'"},{escaped:"'",unescaped:"'"},{escaped:"&",unescaped:"&"}],getComma:function(a){return a.length>0?a+", ":a},getShortFileName:function(a,b){_.isNumber(b)&&!_.isNaN(b)||(b=NIS.StringTools.DEFAULT_SHORTEN_STR_COUNT);var c=NIS.StringTools.unescapeHTML(a),d=c.split("."),e=d.pop(),f=d.join(".");return f.length>b?(f=f.slice(0,b),e="…"+e):e="."+e,f+e},getShortString:function(a,b){return _.isNumber(b)&&!_.isNaN(b)||(b=NIS.StringTools.DEFAULT_SHORTEN_STR_COUNT),a=NIS.StringTools.unescapeHTML(a),a.length>b&&(a=a.slice(0,b)+"…"),a},isStringAndNotEmpty:function(a){return _.isString(a)&&!_.isEmpty(a)},isNotFalsyAndNotEmpty:function(a){return null!=a&&!_.isEmpty(a)},unescapeHTML:function(a){var b=a;return NIS.StringTools.ESCAPE_CHARS.forEach(function(a){var c=new RegExp(a.escaped,"g");b=b.replace(c,a.unescaped)}),b},escapeHTML:function(a){var b=a;return NIS.StringTools.ESCAPE_CHARS.forEach(function(a){var c=new RegExp(a.unescaped,"g");b=b.replace(c,a.escaped)}),b}},function(a){a.fn.bottom=function(b){var c={fromBottom:0},d=a.extend(c,b);return this.each(function(){var b=this,c=a(b);return c.on("scroll",function(){var e=null;(e=b===window?a(document).height():c[0].scrollHeight)-c.scrollTop()-c.height()<=+d.fromBottom&&a(b).trigger("bottom")}),!1})}}(jQuery),NIS.initialize=function(a){var b=$.Deferred();$(document).on("contextmenu",function(){return!1}).on("keydown",function(a){if(93===a.keyCode)return!1});var c=function(){NIS.alertView.render(NIS.Messages.error.title,NIS.Messages.error.SESSION_STORAGE_ERROR,NIS.Settings.url.HELP_SESSION,!0)},d=function(){NIS.alertView.render(NIS.Messages.error.title,NIS.Messages.error.CONNECTION_ERROR,NIS.Settings.url.GA_TOP)},e=new NIS.ParameterManager(c,d);NIS.parameterManager=e,NIS.urlParams=e.getUrlParams(),NIS.sessionParams=e.getSessionStorageParams(),NIS.cookieParams=e.getCookieParams(),NIS.analytics=new NIS.Analytics;var f=function(a){NIS.guestPage=new NIS.GuestPageModel(a),NIS.keepAlive=new NIS.KeepAlive({interval:NIS.Settings.KEEP_ALIVE_INTERVAL,success:function(){},fail:function(){NIS.parameterManager.clearSession(),NIS.alertView.render(NIS.Messages.error.title,NIS.Messages.error.DATA_READ_FAILED_RELOAD,location.href)}}),NIS.keepAlive.start(),NIS.watcher=new NIS.OperationWatcher,NIS.watcher.start(function(){NIS.api.logout().always(function(){NIS.parameterManager.clearSession(),NIS.alertView.render(NIS.Messages.error.title,NIS.Messages.error.TIMEOUT,NIS.Settings.url.GA_TOP)})}),NIS.guestLogin.isGuestLogin()&&NIS.watcher.stop(),b.resolve()},g=function(a){e.clearSession();var c=null;a&&(c=a.code);var d=null,f="",g=NIS.Messages.error,h=_.extend(NIS.APIReturnCode.auth,NIS.APIReturnCode.common);switch(c){case h.NIS_MDATA_INVALID:case h.NIS_MDATA_EXPIRE:case h.NIS_LOGIN_SUSPENDED:case h.NIS_LOGIN_ERROR:NIS.auth.logoutGA(),f=g.DATA_READ_FAILED_RELOAD,d=location.href;break;case h.ALBUM_ID_SHARE_EXPIRED:case h.SHARE_ALBUM_NOT_EXIST:f=g.REMOVED,d=NIS.Settings.url.GA_TOP;break;case h.TOKEN_INVALID:case h.SESSION_EXPIRED:f=g.DATA_READ_FAILED_RELOAD,d=location.href;break;default:f=NIS.Messages.error.CONNECTION_ERROR,d=NIS.Settings.url.GA_TOP}NIS.alertView.render(NIS.Messages.error.title,f,d),b.reject()};NIS.api=new NIS.API(NIS.sessionParams[NIS.Settings.STORAGE_KEY.token],NIS.sessionParams[NIS.Settings.STORAGE_KEY.info]);var h=function(c){if(NIS.guestLogin=new NIS.GuestLoginModel(c),NIS.guestLogin.hasErrorStatus())return c.code=NIS.APIReturnCode.common.ALBUM_ID_SHARE_EXPIRED,b.reject(c);NIS.api.setToken(NIS.guestLogin.tokenId),sessionStorage.setItem(NIS.Settings.STORAGE_KEY.token,NIS.guestLogin.tokenId);var d=NIS.api.info,f="?"+$.param(NIS.urlParams)+location.hash;return NIS.guestLogin.needsPassword()&&!NIS.StringTools.isStringAndNotEmpty(d)&&NIS.StringTools.isStringAndNotEmpty(a)&&(e.clearSession(),NIS.urlParams[NIS.Settings.URL_PARAMS_KEY.auth]=a,location.href=NIS.Settings.url.GUEST_AUTH+f),NIS.guestLogin.needsPassword()||NIS.StringTools.isStringAndNotEmpty(a)||(location.href=NIS.Settings.url.GUEST_INDEX+f),NIS.api.getShareInfo(NIS.guestLogin.albumId)};return _.isString(NIS.sessionParams.token)&&(NIS.sessionParams.gdata===NIS.urlParams.g?NIS.api.setToken(NIS.sessionParams.token):sessionStorage.setItem(NIS.Settings.STORAGE_KEY.gdata,NIS.urlParams.g)),NIS.api.login(NIS.cookieParams[NIS.Settings.COOKIE_KEY.mdata],NIS.urlParams.g,NIS.parameterManager.getReferrer()).then(h).then(f).fail(g),b.promise()},NIS.ItemModel=Backbone.Model.extend({NO_THUMB_W:180,NO_THUMB_H:135,STANDARD_HEIGHT:100,WIDTH_TRIMMING:3,HEIGHT_TRIMMING:9/16,hasItemInfo:!1,initialize:function(){_.bindAll(this)},showsCaption:function(){return"1"===this.get("item").captionFlg},hasDirection:function(){var a=this.get("item");return!_.isUndefined(a.direction)},isJPEG:function(){return"0"===this.get("item").itemType},isMPO:function(){return"6"===this.get("item").itemType},isTIFF:function(){var a=this.get("item");return"1"===a.itemType||"9"===a.itemType},isMOV:function(){return"5"===this.get("item").itemType},isAVI:function(){return"4"===this.get("item").itemType},isRAW:function(){switch(this.get("item").itemType){case"2":case"3":case"10":case"11":return!0;default:return!1}},isMP4:function(){var a=this.get("item");return"14"===a.itemType||"16"===a.itemType},hasVoiceMemo:function(){return"8"===this.get("item").itemType},isVideo:function(){switch(this.get("item").itemType){case"4":case"5":case"7":case"14":case"16":return!0;default:return!1}},isNMS:function(){return"7"===this.get("item").itemType},isNoThumb:function(){switch(this.get("item").itemType){case"9":case"10":case"11":return!0;default:return!1}},isSphere:function(){switch(this.get("item").itemType){case"15":case"16":case"17":case"18":return!0;default:return!1}},isSmallerThan:function(a,b){var c=this.get("item");return null==b&&(b=a),+c.res_w<=a&&+c.res_h<=b},isShotDate:function(){return"1"===this.get("item").shotDateFlg},isShotTime:function(){return"1"===this.get("item").shotDateChangeFlg},getImgSizeAspect:function(a){var b=this.get("item"),c=null,d=null;this.isNoThumb()?(c=this.NO_THUMB_H,d=this.NO_THUMB_W):"5"===b.orient||"6"===b.orient||"7"===b.orient||"8"===b.orient?(c=+b.res_w,d=+b.res_h):(c=+b.res_h,d=+b.res_w);var e={width:d,height:c};if(a.rectangleFlg){if(d/c>this.WIDTH_TRIMMING&&a.length>1)e.width=this.STANDARD_HEIGHT*this.WIDTH_TRIMMING;else if(d/c<%= select %>
<%= fileList %>
<%= label %>
',button:'<%- label %><%- suffix %><%- label_small %>
',strong:'<%= label %>',dlIcon:'<%= pref %>
<%- label %>
',prof:'',pref:'