Sie sind auf Seite 1von 43

choose-button")),ke("#flash-upload-container > .moxie-shim")[0].style.

top="0px",
ke("#flash-upload-container > .moxie-shim")[0].style.left="0px",ke("#flash-uploa
d-container > .moxie-shim")[0].style.width="100%",ke("#flash-upload-container >
.moxie-shim")[0].style.height="100%"):(ke("#choose-button").click(function(e){re
turn function(){return ke("#"+e.PLU.id+"_html5").click()}}(this)),ke("#add-butto
n").click(function(){return function(){return ke("#choose-button").click()}}(thi
s)))}},ni=ut.FileQueue={init:function(){return ni._listen()},_listen:function(){
return document.observe(oi.QUEUE_EVT,ni._file_queued.bind(this)),document.observ
e(oi.QUEUE_ERROR_EVT,ni._file_queue_errored.bind(this)),document.observe(oi.UPDA
TE_EVT,ni._file_updated.bind(this)),document.observe(oi.COMPLETE_EVT,ni._file_co
mpleted.bind(this)),document.observe(oi.ERROR_EVT,ni._file_errored.bind(this)),d
ocument.observe(oi.CANCEL_EVT,ni._file_cancelled.bind(this))},_file_queued:funct
ion(e){var t,n,i,r,o;for(r=e.memo.files,o=[],n=0,i=r.length;i>n;n++)t=r[n],this.
files[t.id]=t,ni.uploading||this._start_uploading(),this.current_file=t,o.push(V
t("File queued:",t.name));return o},_file_queue_errored:function(e){return this.
_file_queued(e),setTimeout(function(t){return function(){return t._file_errored(
e)}}(this),250)},_file_updated:function(e){var t,n,i,r,o,s,a,_,l;return r=e.memo
.file,s=e.memo.percent_complete,o=s*r.size,l=o+this.completed_size(),i=(new Date
).getTime(),this.last_update_time&&(a=(i-this.last_update_time)/1e3,oi.PLU.total
.bytesPerSec?this.average_bps=oi.PLU.total.bytesPerSec:(n=o-this.last_update_siz
e,t=n/a,this.average_bps=((l-n)*this.average_bps+n*t)/l),_=(this.queue_size()-l)
/this.average_bps,this.formatted_time=re.format_time(_+this.num_left())),this.cu
rrent_file=r,this.last_update_time=(new Date).getTime(),this.last_update_size=o}
,_file_completed:function(e){var t;return t=e.memo.file,this.completed_files[t.i
d]=!0,Vt("File completed:",t.name),this._check_if_finished(t)},_file_errored:fun
ction(e){var t;return t=e.memo.file,this.errored_files[t.id]=!0,ti.update_errors
(),ii.update_errors(),Vt("File errored:",t.name),this._check_if_finished(t)},_fi
le_cancelled:function(e){var t;return t=e.memo.file,this.cancelled_files[t.id]=!
0,t.status===H.UPLOADING?(oi.PLU.stop(),oi.PLU.removeFile(t),oi.PLU.start()):oi.
PLU.removeFile(t),Vt("File cancelled:",t.name),this._check_if_finished(t)},_star
t_uploading:function(){var e;return this.uploading=oi.uploadNext(),this.uploadin
g?(this.all_cancelled=!1,window.onbeforeunload=e=function(){return function(){re
turn Pt("Leaving this page will cancel your uploads.")}}(this)):void 0},finished
:function(){return this._finished_uploading()},_check_if_finished:function(){ret
urn this.empty()?this.uploading?this._finished_uploading():void 0:oi.uploadNext(
)},_finished_uploading:function(){var e,t,n,i;if(this.uploading=!1,this.num_file
s()?this.errors()?(ti.errored(),ii.errored()):(ti.completed(),ii.completed()):ti
.cancelled(),i=$("inline-upload-status").visible(),Nr.select_fq_paths=[],Nr.insi
de_dir){for(n in this.completed_files)t=this.files[n],e=rt.normalize(t.dest),Nr.
select_fq_paths.push(e+"/"+t.name);Nr.force_reload()}else Nr.in_search_mode()&&c
r.force_reload();return i&&ii.show(),pi.onHide=null,window.onbeforeunload=null},
empty:function(){return!this.num_left()},num_files:function(){return this.file_i
ds().length},num_non_cancelled_files:function(){return this.file_ids().length-th
is.cancels()},next:function(){return v(this.files).filter(function(e){return fun
ction(t){return!(e.cancelled_files[t.id]||e.errored_files[t.id]||e.completed_fil
es[t.id])}}(this))[0]},cancels:function(){return v(this.cancelled_files).keys().
length},errors:function(){return v(this.errored_files).keys().length},queue_size
:function(){var e,t,n,i,r,o;for(o=0,r=this.file_ids(),n=0,i=r.length;i>n;n++)t=r
[n],e=this.files[t],this.errored_files[t]||this.cancelled_files[t]||"undefined"=
=typeof e.size||(o+=e.size);return o},completed_size:function(){var e,t,n,i,r;fo
r(r=0,i=v(this.completed_files).keys(),t=0,n=i.length;n>t;t++)e=i[t],"undefined"
!=typeof this.files[e].size&&(r+=this.files[e].size);return r},file_ids:function
(){return v(this.files).map(function(){return function(e,t){return t}}(this))},t
otalPercentage:function(){return this.completed_size()/this.queue_size()},num_le
ft:function(){return v(this.file_ids()).filter(function(e){return function(t){re
turn!(e.cancelled_files[t]||e.errored_files[t]||e.completed_files[t])}}(this)).l
ength},clear:function(){return this.files={},this.cancelled_files={},this.all_ca
ncelled=!1,this.errored_files={},this.completed_files={},this.last_update_time=0
,this.last_update_size=0,this.average_bps=0,this.formatted_time="",this.uploadin
g=!1,window.onbeforeunload=null,"undefined"!=typeof pi&&null!==pi?pi.onHide=null

:void 0}},ni.clear(),si=ut.UploadFile={FILENAME_SNIPPET_LENGTH:15,DEST_SNIPPET_L
ENGTH:13,_tmpl:null,init:function(){return si._tmpl=ot.tmpl("upload_list_item_tm
pl"),si._listen()},_listen:function(){return document.observe(oi.QUEUE_EVT,si._f
ile_queued),document.observe(oi.QUEUE_ERROR_EVT,si._file_queue_errored),document
.observe(oi.UPDATE_EVT,si._file_updated),document.observe(oi.COMPLETE_EVT,si._fi
le_completed),document.observe(oi.ERROR_EVT,si._file_errored),document.observe(o
i.CANCEL_EVT,si._file_cancelled)},_file_queued:function(e){var t,n,i,r,o;for(r=e
.memo.files,o=[],n=0,i=r.length;i>n;n++)t=r[n],o.push(function(e){var t,n,i,r,o,
s,a,l;return t=e.dest,Jn.is_quicksend_dest(t)?void Jn.add_external_file(e):(s=q.
format_bytes(e.size||0),n=si._tmpl({file:e,icon:rt.file_icon(e.name),filename_sn
ippet:_.em_snippet(e.name,si.FILENAME_SNIPPET_LENGTH),size:s,dest:t,dest_snippet
:_.em_snippet(Pt("Dropbox")+t,si.DEST_SNIPPET_LENGTH,0),Sprite:Q}),$("upload-fil
es-list").__sert(n),r=$(e.id),o=ni.num_files(),qn.show_share_button_in_file_uplo
ader&&(i=ke("#"+e.id),i.find(".dest-col").hide()),a=$("upload-files-list"),6>=o?
a.removeClassName("scroll"):a.addClassName("scroll"),a.scrollTop=a.scrollHeight,
r.down(".dest").observe("click",function(){return Nr.reload_fqpath(r.readAttribu
te("data-dest"),!0),pi.hide()}),l=r.down(".status-col").down("a.small-x-button")
,l.stopObserving("click"),l.observe("click",function(){return document.fire(oi.C
ANCEL_EVT,{file:e}),ke(document).trigger(oi.CANCEL_EVT,{file:e})}),r.down(".uplo
ad-progress-bar").setStyle({width:"0"}))}(t));return o},_file_queue_errored:func
tion(e){return si._file_queued(e),si._file_errored(e)},_file_updated:function(e)
{var t,n,i,r;return t=e.memo.file,n=$(t.id),1===ni.num_files()&&(r=Pt("%(time_le
ft)s left").format({time_left:ni.formatted_time}),n.down(".time-col").__date(r))
,i=parseInt(t.percent,10)+"%","100%"===i&&(n.down(".time-col").__date(),n.down("
.status-col").__date(new Element("img",{src:"/static/images/icons/ajax-loading-s
mall-vfl3Wt7C_.gif"}))),n.down(".upload-progress-bar").setStyle({width:i})},_fil
e_completed:function(e){var t,n,i;return t=e.memo.file,t.completed=!0,i=$(t.id),
i.addClassName("complete"),qn.show_share_button_in_file_uploader&&!Jn.is_quickse
nd_dest(t.dest)&&(n=ke("#"+t.id),n.find(".share-link").show(),et.SharedFolderAct
ivityLogger.log("web","share_button_in_uploader_impression",Nr.active_user,{}),n
.on("click",function(){var e,n;return pi.hide(),et.SharedFolderActivityLogger.lo
g("web","share_button_in_uploader_click",Nr.active_user,{}),e=t.dest+"/"+t.name,
n="file_uploader",qn.shmodel(e,n)})),setTimeout(function(){return i.down(".statu
s-col").__date(Q.make("web","s_check"))},0),i.down(".upload-progress-bar").setSt
yle({width:"100%"})},_file_errored:function(e){var t,n;return t=e.memo.file,n=$(
t.id),n?si._actual_file_errored(e):setTimeout(function(){return function(){retur
n si._actual_file_errored(e)}}(this),0)},_actual_file_errored:function(e){var t,
n,i,r,o;return i=e.memo.file,r=$(i.id),r.addClassName("error"),r.down(".dest-col
").hide(),r.down(".time-col").__date(),r.down(".status-col").__date(Element("img
",{src:"/static/images/nosync-vfl18cuTS.png",srcset:"/static/images/nosync@2x.pn
g 2x"})),r.down(".upload-progress-bar").setStyle({width:"100%"}),Jn.is_quicksend
_dest(i.dest)?void 0:(n=e.memo.message||Pt("Upload Error"),t=void 0,e.memo.toolt
ip_text?t=e.memo.tooltip_text:(t=Pt('Something went wrong with the advanced uplo
ader. If the problem persists, please use the <a id="basic_link">basic uploader<
/a> to upload via the website.'),ke(document).on("click","a#basic_link",function
(){return _i.show_basic_upload(),!1})),r.down(".error-msg").__date(n),o=r.down("
.error-details"),o.observe("mouseover",function(){return wi.show(o,t)}),r.down("
.error-col").show())},_file_cancelled:function(e){var t,n;return t=e.memo.file,n
=$(t.id),n.addClassName("cancelled"),n.down(".dest-col").__date(Pt(e.memo.messag
e||"Canceled")),n.down(".time-col").__date(),n.down(".status-col").__date(Elemen
t("img",{src:"/static/images/cancelsync-vflGFIEUK.png",srcset:"/static/images/ca
ncelsync@2x.png 2x"})),n.down(".upload-progress-bar").setStyle({width:"100%"})}}
,ti=ut.BulkUpload={init:function(){return this.elem=$("bulk-upload-status"),ti._
listen()},_listen:function(){return document.observe(oi.QUEUE_EVT,ti._file_queue
d.bind(this)),document.observe(oi.UPDATE_EVT,ti._file_updated.bind(this))},_file
_queued:function(){var e;return e=new Element("a",{"class":"small-x-button"}),e.
observe("click",function(){var e,t,n,i,r;for(ni.all_cancelled=!0,e=ni.file_ids()
.slice(0),r=[],n=0,i=e.length;i>n;n++)t=e[n],ni.completed_files[t]||ni.errored_f
iles[t]?r.push(void 0):(document.fire(oi.CANCEL_EVT,{file:ni.files[t]}),r.push(k
e(document).trigger(oi.CANCEL_EVT,{file:ni.files[t]})));return r}),this.elem.dow

n(".status").__date(e)},_file_updated:function(){var e,t,n;return ni.num_files()


>1&&(this.elem.removeClassName("error"),this.elem.removeClassName("complete"),th
is.elem.removeClassName("cancelled"),e=Ft("%d file","%d files",ni.num_non_cancel
led_files()).format(ni.num_non_cancelled_files()),this.elem.down(".num-files")._
_date(e),t=Pt("- %(size)s").format({size:q.format_bytes(oi.PLU.total.size)}),thi
s.elem.down(".size").__date(t),ni.formatted_time&&(n=Pt("%(time_left)s left").fo
rmat({time_left:ni.formatted_time}),this.elem.down(".time-left").__date(n)),this
.elem.down(".upload-progress-bar").style.width=Math.min(100,(100*ni.totalPercent
age()||0).toFixed(2))+"%",this.elem.show(),"flash"===oi.PLU.runtime)?Fe.clone_po
sition(ke("#flash-upload-container"),ke("#add-button")):void 0},update_errors:fu
nction(){var e;return e=Ft("- %d error","- %d errors",ni.errors()).format(ni.err
ors()),$("bulk-upload-status").down(".num-errors").__date(e)},completed:function
(){var e,t;return $("hide-button").hide(),$("done-button").show(),ni.num_files()
>1?(this.elem.addClassName("complete"),e=Ft("Uploaded %d file","Uploaded %d file
s",ni.num_non_cancelled_files()).format(ni.num_non_cancelled_files()),this.elem.
down(".num-files").__date(e),t=Pt("- %(size)s").format({size:q.format_bytes(ni.c
ompleted_size())}),this.elem.down(".size").__date(t),this.elem.down(".num-errors
").__date(),this.elem.down(".time-left").__date(),this.elem.down(".status").__da
te(Q.make("web","s_check")),this.elem.down(".upload-progress-bar").style.width="
100%"):void 0},errored:function(){var e;return $("hide-button").hide(),$("done-b
utton").show(),this.completed(),e=Ft("- %d error","- %d errors",ni.errors()).for
mat(ni.errors()),this.elem.down(".num-errors").__date(e)},cancelled:function(){r
eturn $("hide-button").hide(),$("done-button").show(),ni.num_files()>1?(this.ele
m.addClassName("cancelled"),this.elem.down(".num-files").__date(Pt("All uploads
canceled")),this.elem.down(".size").__date(),this.elem.down(".num-errors").__dat
e(),this.elem.down(".time-left").__date(),this.elem.down(".status").__date(Eleme
nt("img",{src:"/static/images/cancelsync-vflGFIEUK.png",srcset:"/static/images/c
ancelsync@2x.png 2x"})),this.elem.down(".upload-progress-bar").style.width="100%
"):void 0}},ii=ut.InlineUploadStatus={FILENAME_SNIPPET_LENGTH:30,init:function()
{return this._listen()},_listen:function(){return document.observe(oi.QUEUE_EVT,
ii._file_queued.bind(this)),document.observe(oi.UPDATE_EVT,ii._file_updated.bind
(this))},_file_queued:function(){var e,t;return e=$("inline-upload-status"),e.re
moveClassName("error"),e.removeClassName("complete"),e.down(".icon").__date(Q.ma
ke("web","s_sync")),e.down(".file-desc").__date(Pt("Starting upload...")),e.down
(".num-errors").__date(),t=Ft("%d file","%d files",ni.num_left()).format(ni.num_
left()),e.down(".view-details").__date(t),e.down(".status").__date(),e.down(".in
line-upload-progress").style.width="0%"},_file_updated:function(e){var t,n,i,r,o
,s;return t=$("inline-upload-status"),n=e.memo.file,t.down(".icon").__date(Q.mak
e("web","s_sync")),i=Pt("Uploading %(filename)s").format({filename:_.em_snippet(
n.name,this.FILENAME_SNIPPET_LENGTH)}),t.down(".file-desc").__date(i),ni.num_lef
t()>1?(s=Ft("%d file left","%d files left",ni.num_left()-1).format(ni.num_left()
-1),t.down(".view-details").__date(s)):t.down(".view-details").__date(Pt("View d
etails")),ni.formatted_time&&(o=Pt("%(time_left)s left").format({time_left:ni.fo
rmatted_time}),t.down(".status").__date(o)),r=n.percent+"%",t.down(".inline-uplo
ad-progress").style.width=r},update_errors:function(){var e,t;return e=$("inline
-upload-status"),t=Ft("- %d error","- %d errors",ni.errors()).format(ni.errors()
),e.down(".num-errors").__date(t)},add_x_button:function(){var e,t;return t=new
Element("a",{"class":"small-x-button"}),t.observe("click",function(){return ii.h
ide(),oi.reset()}),e=$("inline-upload-status"),e.down(".status").__date(t)},comp
leted:function(){var e,t;return e=$("inline-upload-status"),e.addClassName("comp
lete"),e.removeClassName("error"),e.down(".icon").__date(Q.make("web","s_check")
),t=ni.num_files()>1?Pt("Uploaded %(num_files)d files").format({num_files:ni.num
_non_cancelled_files()}):Pt("Uploaded %(filename)s").format({filename:_.em_snipp
et(ni.current_file.name,this.FILENAME_SNIPPET_LENGTH)}),e.down(".file-desc").__d
ate(t),e.down(".num-errors").__date(),e.down(".view-details").__date(Pt("View de
tails")),this.add_x_button(),e.down(".inline-upload-progress").style.width="100%
"},errored:function(){var e,t,n,i;return e=$("inline-upload-status"),e.addClassN
ame("error"),e.removeClassName("complete"),e.down(".icon").__date(Element("img",
{src:"/static/images/nosync-vfl18cuTS.png",srcset:"/static/images/nosync@2x.png
2x"})),t=void 0,ni.num_files()>1?(t=Pt("Uploaded %(num_completed)d of %(num_file

s)d files").format({num_completed:ni.num_non_cancelled_files()-ni.errors(),num_f
iles:ni.num_non_cancelled_files()}),e.down(".file-desc").__date(t),i=Ft("- %d er
ror","- %d errors",ni.errors()).format(ni.errors()),e.down(".num-errors").__date
(i)):(null!=ni.current_file&&(n=_.em_snippet(ni.current_file.name,this.FILENAME_
SNIPPET_LENGTH)),t=n?Pt("Unable to upload %(filename)s").format({filename:n}):Pt
("Unable to upload file"),e.down(".file-desc").__date(t),e.down(".num-errors")._
_date()),e.down(".view-details").__date(Pt("View details")),this.add_x_button(),
e.down(".inline-upload-progress").style.width="100%"},show:function(){return $("
inline-upload-status").show()},hide:function(){return $("inline-upload-status").
hide()}},ai=ut.UploadPrep={_drop_indicators:!1,_drop_dest_folder:null,file_count
er:0,current_req:null,_notifications_cleared:!1,supported:function(){return Prot
otype.BrowserFeatures.DB_CORS},enabled:function(){return ai.supported()&&Nr.insi
de_dir&&!(Nr.in_search_mode()&&cr.fulltext_search_enabled)},browse_indicators_en
abled:function(){var e,t,n,i;if(!ai.enabled())return!1;for(i=["modal-overlay"],t
=0,n=i.length;n>t;t++)if(e=i[t],$(e).visible())return!1;return!0},modal_indicato
rs_enabled:function(){var e;return ai.enabled()&&ke("#modal #upload-modal-dropzo
ne").length&&ke("#modal").visible()&&(null!=(e=ke("#modal").offset())?e.left:voi
d 0)>0},_show_border_drop_indicators:function(){return $$(".external-drop-indica
tor").each(function(e){return ke(e).css("opacity",0).fadeTo(500,.6)})},_hide_bor
der_drop_indicators:function(){return $$(".external-drop-indicator").invoke("hid
e")},show_drop_indicators:function(e){var t;if(!ai._drop_indicators){if(ai.modal
_indicators_enabled())t=$("upload-modal-dropzone"),Fe.clone_position(ke(t),ke("#
modal"),{setLeft:!1,setTop:!1}),ke(t).fadeIn(500),ai._show_border_drop_indicator
s();else{if(!ai.browse_indicators_enabled())return;Tr._add_drop_indicators(e)}re
turn $("drag-status").removeClassName("active"),ai._drop_indicators=!0}},hide_dr
op_indicators:function(){return ai._drop_indicators&&(ai._hide_border_drop_indic
ators(),Tr._remove_drop_indicators(),ai._notifications_cleared||b.clear(),$("upl
oad-modal-dropzone").hide(),$("drag-status").addClassName("active"),setTimeout(f
unction(){return ai._drop_indicators=!1,ai._drop_dest_folder=null,ai._notificati
ons_cleared=!1},500)),ai._notifications_cleared=!0},folder_dragover:function(e){
var t;return ai.browse_indicators_enabled()&&ai._drop_indicators?(ri.disabled?nu
ll==ai._drop_dest_folder&&(t=Pt("You can't upload files because you're out of sp
ace."),b.error(t,60),ai._notifications_cleared=!1,ai._show_border_drop_indicator
s()):e!==ai._drop_dest_folder&&(e===Nr.containing_fq_path()?(Nr.inside_read_only
_shared_folder?(t=Pt("You don't have permission to add to this folder."),b.error
(t,60)):(t=Pt("Drop your file to %(upload_action)s",{comment:"upload_action is a
phrase like 'upload to folder 'XYZ'"}).format({upload_action:_i.upload_plain_sn
ippet()}),b.success(new ot(t),60),ai._show_border_drop_indicators()),ai._notific
ations_cleared=!1):(b.clear(),ai._hide_border_drop_indicators())),ai._drop_dest_
folder=e):void 0},supports_recursive_upload:function(e){var t;return window.File
&&window.FileReader&&window.FileList&&window.Blob&&(null!=e&&null!=(t=e[0])?t.we
bkitGetAsEntry:void 0)},upload:function(e,t,n){var i,r,o,s;if(null==n&&(n=null),
!Nr.inside_read_only_shared_folder){if(ri.disabled)return s=Pt("You can't upload
files because you're out of space."),b.error(s);if(ai.supports_recursive_upload
(n))return ai._recursive_upload(e,n);for(r=0,o=t.length;o>r;r++)i=t[r],i.dest=e;
return ai._upload(t,n)}},_recursive_upload:function(e,t){var n,i,r,o,s,a,_,l,u,d
,c,h,f;for(u=[],f=[],i=function(t,n){return t.dest=e+rt.parent_dir(n.fullPath),u
.push(t)},c=0,h=t.length;h>c;c++)d=t[c],a=d.webkitGetAsEntry(),null!==a&&(a.isDi
rectory?Jn.is_quicksend_dest(e)?b.error(Pt("Please select files instead of folde
rs.")):f.push(a):i(d.getAsFile(),a));return s=0,l=0,r=function(e,t){var n;return
n=Pt('The drag and drop uploader can\'t upload %(name)s because it contains Uni
code characters. Use the <a id="use-advanced-uploader"> advanced uploader</a> in
stead.').format({name:t.name}),b.error(new ot(n)),ke("#use-advanced-uploader").o
n("click",function(e){return e.preventDefault(),_i.show_upload()})},n=3e3,_=0,(o
=function(){for(var e;f.length;)a=f.pop(),null!==a&&(a.isDirectory?!function(e){
var t;return t=e.createReader(),s+=1,t.readEntries(function(e){var n,i,r;if(0!==
e.length){for(i=0,r=e.length;r>i;i++)n=e[i],f.push(n);return t.readEntries(argum
ents.callee)}return s-=1},function(t){return s-=1,r(t,e)})}(a):(l+=1,e=function(
e){return function(t){return i(t,e),l-=1}},a.file(e(a),function(e){return l-=1,r
(e,a)})));return u.length>n&&!_?(_=1,void b.error(Pt("The Dropbox website can't

upload more than %(max_files)s files.").format({max_files:n}))):s||l?o.defer():u


.length?ai._upload(u):void 0})()},_upload:function(e,t){var n,i;return null==t&&
(t=null),t&&(n=this._parse_upload_items(t)),i=function(){var t,i,r,o,s;for(s=[],
i=0,r=e.length;r>i;i++)t=e[i],navigator.userAgent.toLowerCase().indexOf("chrome"
)>-1&&(null!=n&&null!=(o=n[t.name])?o.isDirectory:void 0)&&(t.is_directory=!0),
t.id=H.guid(),s.push(oi.PLU.addFile(t));return s},$("modal").visible()?i():(_i.s
how_upload(i),pi.hide(null,!0))},_parse_upload_items:function(e){var t,n,i,r;for
(t={},i=0,r=e.length;r>i;i++)n=e[i],n.getAsEntry?n=n.getAsEntry():n.webkitGetAsE
ntry&&(n=n.webkitGetAsEntry()),t[n.name]=n;return t}},ri=ut.OverQuotaUploads={di
sabled:!1,init:function(e){return this.disabled=e,this.disabled?ke("body").addCl
ass("uploads-disabled"):void 0}};var _i;_i=INLINE_JS.FileOps=ut.FileOps={NOTIFIC
ATION_SNIPPET_LEN:40,_find_app_by_id:function(e){var t,n,i,r;for(r=pi.vars.apps,
n=0,i=r.length;i>n;n++)if(t=r[n],t.app_id===e)return t;return null},create_album
_from_folder:function(e,t){return g.WebProgressRequest({url:"/collection_from_fo
lder",data:{path:e,album_name:t},subject_user:K.get_viewer().photos_user,progres
s_text:Pt("Creating album..."),success:function(e){return e=JSON.parse(e),nt.red
irect(e.url)}})},dir_handler:function(e,t){var n,i;return"string"==typeof t&&(t=
$(t)),n=$$(".treeview .highlight")[0],n&&n.removeClassName("highlight"),i=t.up("
div"),i.addClassName("highlight"),pi.selected_div=i,pi.shown()&&t.blur(),documen
t.fire("db:dir_click",{path:e}),pi.vars.selected_path=e},show_folder_pick:functi
on(e,t,n,i,r){var o;return Gt.fillVal(rt.filename(t).escapeHTML(),"folder-pick-f
ile"),bi.move("copy-move-treeview","folder-pick-treeview",{user:Nr.active_user})
,o=Pt(r?"Move":"Copy"),Gt.fillVal(o,"folder-pick-action-text"),pi.show(e,$("fold
er-pick"),{fq_path:t,action:n,folder:i}),ke("#first-treeview-link").trigger("cli
ck")},show_bulk_folder_pick:function(e,t,n,i){var r,o,s;return s=lr.profile_file
s(n),o=lr.profile_summary(s),Gt.fillVal(o,"bulk-folder-pick-file"),bi.move("copy
-move-treeview","bulk-folder-pick-treeview",{user:Nr.active_user}),r=Pt("move"==
=t?"Move":"copy"===t?"Copy":"Restore"),Gt.fillVal(r,"bulk-folder-pick-action-tex
t"),pi.show(e,$("bulk-folder-pick"),{files:n,action:i}),ke("#first-treeview-link
").trigger("click")},show_copy:function(e,t){var n;return n=Pt(t?"Copy folder to
...":"Copy file to..."),bi.set_params({disable_read_only:!0}),_i.show_folder_pic
k(n,e,_i.do_copy,t,!1)},show_copy_bulk:function(e){var t;return t=Ft("Copy %(ite
m_count)s item to...","Copy %(item_count)s items to...",e.length).format({item_c
ount:e.length}),bi.set_params({disable_read_only:!0}),_i.show_bulk_folder_pick(t
,"copy",e,_i.do_bulk_copy)},show_compress_bulk:function(e,t){return bi.set_param
s({disable_read_only:!0}),Lt.show({title_text:Ft("Compress file?","Compress file
s?",t.length),body_html:Ft("Do you want to compress <strong>%(filename)s</strong
>?<br/>This might take a while.","Do you want to compress %(file_count)s files?<
br/>This might take a while.",t.length).format({file_count:t.length,filename:v.e
scape(t.first().filename)}),confirm_text:Pt("Compress"),cancel_text:Pt("Cancel")
,confirm_callback:function(){return _i.do_bulk_compress(e,t)}})},do_bulk_compres
s:function(e,t){var n;return b.clear(),n=t.pluck("fq_path"),g.WebProgressRequest
({url:"/cmd/compress",data:{files:n},subject_user:e,progress_text:Pt("Compressin
g..."),success:function(e){var n,i,r;return r=JSON.parse(e),n=r.compressed_files
,ft(n.length>0,"Must have at least 1 compressed file"),i=v.escape(rt.filename(n.
first().fq_path)),b.success(Ft("Compressed successfully to %(filename)s","Compre
ssed %(file_count)s files successfully.",n.length).format({file_count:n.length,f
ilename:i})),ke(document).trigger(s.COMPRESS,{original_files:t,compressed_files:
n})}})},show_move_bulk:function(e){var t;return t=Ft("Move %(item_count)s item t
o...","Move %(item_count)s items to...",e.length).format({item_count:e.length}),
bi.set_params({disable_read_only:!0}),_i.show_bulk_folder_pick(t,"move",e,_i.do_
bulk_move)},show_move:function(e,t){var n;return n=Pt(t?"Move folder to...":"Mov
e file to..."),bi.set_params({disable_read_only:!0}),_i.show_folder_pick(n,e,_i.
do_move,t,!0)},show_delete:function(e,t,n,i,r,o){var s,a;return null==r&&(r=null
),null==o&&(o=!1),o?r?(ft(e.is_team,"Found a nested shared folder not on a busin
ess account"),a=K.get_viewer().team_name,s=Pt("Are you sure you want to delete t
he shared folder <strong>%(items)s</strong>? People outside %(team_name)s youve sha
red this folder with will still have access unless you remove them from the <a h
ref= /work%(file_path)s?shareoptions=1&share_subfolder=0 >member list</a>.").for
mat({items:rt.filename(t).escapeHTML(),team_name:a.escapeHTML(),file_path:t.esca

peHTML()})):s=Pt("Are you sure you want to delete the shared folder <strong>%(ite
ms)s</strong>? This shared folder will stay shared with other members and you can
rejoin it later.").format({items:rt.filename(t).escapeHTML()}):s=r?Pt("Are you
sure you want to delete <strong>%(items)s</strong> from the shared folder %(sf_na
me)s?").format({items:rt.filename(t).escapeHTML(),sf_name:r.escapeHTML()}):Pt("Ar
e you sure you want to delete <strong>%(items)s</strong> from your Dropbox?").fo
rmat({items:rt.filename(t).escapeHTML()}),Lt.show({title_text:Pt(n?"Delete folde
r?":"Delete file?"),body_html: <div class="simple-modal-word-wrap-content"> +s+"
</div>",confirm_text:Pt("Delete"),cancel_text:Pt("Cancel"),confirm_callback:func
tion(){return i?_i.do_nonbrowse_delete(e,[t]):_i.do_delete(e,t)}})},show_bulk_de
lete:function(e,t,n){var i;return null==n&&(n=null),i=n?Ft("Are you sure you wan
t to delete %(item_count)s item from the shared folder %(sf_name)s?","Are you sure
you want to delete %(item_count)s items from the shared folder %(sf_name)s?",t.le
ngth).format({item_count:t.length,sf_name:n.escapeHTML()}):Ft("Are you sure you
want to delete %(item_count)s item from your Dropbox?","Are you sure you want to
delete %(item_count)s items from your Dropbox?",t.length).format({item_count:t.
length}),Lt.show({title_text:Ft("Delete %(item_count)s item?","Delete %(item_cou
nt)s items?",t.length).format({item_count:t.length}),body_html:i,confirm_text:Pt
("Delete"),cancel_text:Pt("Cancel"),confirm_callback:function(){return _i.do_bul
k_delete(e,t)}})},show_purge:function(e,t){return Lt.show({title_text:Pt(t?"Perm
anently delete folder?":"Permanently delete file?"),body_html:Pt("Are you sure y
ou want to permanently delete <strong>%(items)s</strong> from your Dropbox?").fo
rmat({items:rt.filename(e).escapeHTML()}),confirm_text:Pt("Permanently delete"),
cancel_text:Pt("Cancel"),confirm_callback:function(){return _i.do_purge(Nr.find_
file(e))}})},show_bulk_purge:function(e){return Lt.show({title_text:Ft("Permanen
tly delete %d item?","Permanently delete %d items?",e.length).format(e.length),b
ody_html:Ft("Are you sure you want to permanently delete %(item_count)s item fro
m your Dropbox?","Are you sure you want to permanently delete %(item_count)s ite
ms from your Dropbox?",e.length).format({item_count:e.length}),confirm_text:Pt("
Permanently delete"),cancel_text:Pt("Cancel"),confirm_callback:function(){return
_i.do_bulk_purge(e)}})},show_bulk_restore:function(e){return Lt.show({title_tex
t:Ft("Restore %d item...","Restore %d items...",e.length).format(e.length),body_
html:Ft("Are you sure you want to restore %(item_count)s item?","Are you sure yo
u want to restore %(item_count)s items?",e.length).format({item_count:e.length})
,confirm_text:Pt("Restore"),cancel_text:Pt("Cancel"),confirm_callback:function()
{return _i.do_bulk_restore(e)}})},wrap_strong:function(e){return""===Nr.containi
ng_fq_path()?e.escapeHTML():"<strong>"+e.escapeHTML()+"</strong>"},upload_snippe
t:function(e){var t,n;return null==e&&(e=1e3),K.get_viewer().is_paired&&Nr.activ
e_user.is_team&&(n=_.em_snippet(K.get_viewer().team_name,e).escapeHTML()),""===N
r.containing_fq_path()?K.get_viewer().is_paired?Nr.active_user.is_team?Pt(" uplo
ad to your %(team_name)s Dropbox",{comment:"Used after the string drop your fil
e to... or choose a file to... "}).format({team_name:n}):Pt(" upload to your p
ersonal Dropbox",{comment:"Used after the string drop your file to... or choo
se a file to... "}):Pt(" upload to your Dropbox"):(t=_.em_snippet(rt.filename(Nr
.containing_fq_path()),e).escapeHTML(),K.get_viewer().is_paired?Nr.active_user.i
s_team?Pt(" upload to the folder <strong>%(folder)s</strong> in your %(team_name
)s Dropbox",{comment:"Used after the string drop your file to... or choose a
file to... "}).format({folder:t,team_name:n}):Pt(" upload to the folder <strong>
%(folder)s</strong> in your personal Dropbox",{comment:"Used after the string d
rop your file to... or choose a file to... "}).format({folder:t}):Pt(" upload
to the folder <strong>%(folder)s</strong>",{comment:"Used after the string drop
your file to... or choose a file to... "}).format({folder:t}))},upload_short_
snippet:function(e){var t,n;return null==e&&(e=1e3),(n=Nr.containing_fq_path())?
(t=_.em_snippet(rt.filename(n),e),Pt("Upload to %(folder_name)s ",{comment:"Upl
oad a file to some folder on the website"}).format({folder_name:t})):Pt("Upload
to Dropbox",{comment:"Upload a file to the root Dropbox folder"})},upload_plain_
snippet:function(e){return null==e&&(e=1e3),this.upload_snippet(e).replace("<str
ong>"," ").replace("</strong>"," ")},show_upload:function(e,t,n){var i,r,o,s,a,_
;if(i=Nr.containing_fq_path(),ri.disabled)return Gt.fillVal(this.wrap_strong(rt.
filename(i)),"disabled-upload-foldername"),a=this.upload_short_snippet(20),void

pi.show(a,$("disabled-upload-modal"),{},!1);if(!FlashDetect.versionAtLeast(9)&&"
flash"===oi.runtimes)return _i.show_basic_upload(),void $("enhanced-upload-toggl
e").hide();for(Gt.fillVal(this.upload_snippet(20),"upload-foldername"),Gt.fillVa
l(this.upload_plain_snippet(10),"dnd-upload-foldername"),$("upload-desc").visibl
e()&&ai.supported()&&($("upload-desc").hide(),$("dnd-upload-desc").show()),a=thi
s.upload_short_snippet(20),pi.show(a,Gt.fromElm("advanced-upload-modal"),{wit_gr
oup:"advanced-uploader"},!1,!1,ni.num_files()),_=[$("modal").down(".basic-link-s
tart"),$("modal").down(".basic-link-running")],r=0,o=_.length;o>r;r++)s=_[r],nul
l!=s&&s.observe("click",function(){return _i.show_basic_upload(),!1});return ni.
num_files()?oi.set_dest(rt.normalize(i)):oi.init(rt.normalize(i),!0,e,n),ii.hide
()},show_basic_upload:function(){return Gt.fillVal(this.upload_snippet(20),"basi
c-upload-foldername"),pi.show(this.upload_short_snippet(20),$("basic-upload-moda
l"),{},!1),$("modal").down(".enhanced-link").observe("click",function(){return _
i.show_upload(),!1}),oi.set_dest(rt.normalize(Nr.containing_fq_path())),oi.init_
basic()},show_undelete:function(e){var t,n,i;return Gt.fillVal(e.filename.escape
HTML(),"undelete_filename"),t=Q.make("web",e.icon,{}),t.addClassName("link-img")
,t.style.backgroundColor="transparent",n=_i.build_revisions_uri(e.fq_path,Nr.act
ive_user,{undelete:1}),$$(".undelete-icon").invoke("update",t),$$(".undelete-oth
er-versions")[0].href=n,$$(".undelete-link")[0].href=n,i=Pt("Restore file?"),pi.
show(i,$("undelete-modal"),{file:e})},do_undelete:function(){var e,t;return e=pi
.vars.file,t=Pt("Restored %(file_name)s ").format({file_name:e.filename}),new A
jax.DBRequest("/cmd/restore",{parameters:{files:[e.fq_path]},subject_user:Nr.act
ive_user,job:!0,html_in_error_msg:!0,progress_text:Pt("Restoring..."),onSuccess:
function(){return pi.hide(),b.success(t),document.fire(s.RESTORE,{files:[e]})}})
,!1},do_copy:function(e,t){var n;return e=e||pi.vars.fq_path,t=t||pi.vars.select
ed_path,n=Nr.find_file(e),ft(n,"Trying to copy a file we couldn t find."),_i.do_
bulk_copy([n],t)},do_bulk_copy:function(e,t){var n,i,r,o,a;if(Nr.pre_action_sele
ction=xr.get_selected_fq_paths(),e=e||pi.vars.files,ft(e.length>0,"Tried to copy
0 files"),"undefined"==typeof t){if("undefined"==typeof pi.vars.selected_path)r
eturn void b.error(Pt("You need to select a destination for the file."));t=pi.va
rs.selected_path}for(t=rt.normalize(t),r=0,o=0,a=e.length;a>o;o++)if(n=e[o],n.di
r&&0===(t+"/").indexOf(n.fq_path+"/"))return void b.error(Pt("You cannot copy a
folder into itself."));return i=e.pluck("fq_path"),b.clear(),new Ajax.DBRequest(
"/cmd/copy",{parameters:{files:i,to_path:t},subject_user:Nr.active_user,job:!0,h
tml_in_error_msg:!0,progress_text:Pt("Copying..."),onSuccess:function(r){var o,a
,l,u,d,c,h,f;for(o=r.responseText.evalJSON().changesets,a=i.length,c=_.em_snippe
t(rt.filename(t),_i.NOTIFICATION_SNIPPET_LEN).escapeHTML(),h=Ft("Copied %(count)
d item to <a id=\"reload-link\">%(location)s</a> .","Copied %(count)d items to
<a id=\"reload-link\">%(location)s</a> .",a),h=h.format({count:a,location:c}),e
e.notifyWithUndo(new ot(h),o,_i.do_rollback),l=[],f=r.responseText.evalJSON().ne
w_browse_files,u=0,d=f.length;d>u;u++)n=f[u],l.push(n.fq_path);return Nr.select_
fq_paths=l,$("reload-link").observe("click",function(){return pr.set_path_url(nu
ll,t)}),bi.schedule_reset(),document.fire(s.COPY,{files:e,to_fq_path:t})}})},bul
k_move_error:function(e,t){var n,i,r,o,s,a,_,l,u;if(r=Nr.find_file(t),o=lr.profi
le_files(e),l=void 0,a=void 0,u=void 0,r?(a=r.dir,l=r.fq_path,u=r.target_ns||r.n
s_id):Nr.inside_dir&&Nr.can_get_details_from_fq_path(t)?(i=Nr.details_from_fq_pa
th(t),a=!0,l=i.fq_path,u=i.ns_id):(a=!0,l=t,u=void 0),s=e.pluck("fq_path").colle
ct(rt.normalize),-1!==s.indexOf(rt.normalize(l)))return Pt("You cannot copy a fo
lder into itself.");if(n=_=function(e){var t;return t=rt.parent_dir(e.fq_path),t
===(l||"/")},e.all(n))return Ft("That file already exists in that folder.","Thos
e files already exist in that folder.",e.length);if(!a)return Pt("You cannot put
files inside one another.");if(o.target_namespaces>0&&u&&u!==c.root_ns&&r){if(o
.sandboxes>0){if(r.is_sandbox())return Pt("You re not allowed to put an applicat
ion folder inside another application folder.");if(r.is_shared_folder())return P
t("You re not allowed to put an application folder inside a shared folder.")}els
e if(o.shared_folders>0){if(r.is_sandbox())return Pt("You re not allowed to put
a shared folder inside an application folder.");if(r.can_hold_shared_folders&&0=
==o.team_shared_folders)return;if(r.is_shared_folder())return Pt("You re not all
owed to put a shared folder inside another shared folder.")}return Pt("You re no
t allowed to nest special folders.")}return Nr.public_folder_enabled&&"/Public"=

==l&&o.target_namespaces>0?Pt("You re not allowed to move shared folders to your


Public folder."):o.public_folder>0?Pt("You re not allowed to move your Public f
older."):o.deleted>0?Pt("Moving deleted folders or files isnt allowed."):void 0},
do_move:function(e,t){var n;return e=e||pi.vars.fq_path,t=t||pi.vars.selected_pa
th,n=Nr.find_file(e),ft(n,"Trying to move a file we couldn t find."),_i.do_bulk_
move([n],t)},do_nonbrowse_move:function(e,t,n){var i,r;return i=ke.Deferred(),r=
"/cmd/move",new Ajax.DBRequest(r,{parameters:{files:t,to_path:n},subject_user:e,
job:!0,html_in_error_msg:!0,progress_text:Pt("Moving"),onSuccess:i.resolve,onFail
ure:i.reject}),i.promise()},do_bulk_move:function(e,t){var n,i,r,o;return Nr.pre
_action_selection=xr.get_selected_fq_paths(),(e=e||pi.vars.files)?(ft(e.length>0
,"Tried to move 0 files"),o=t||pi.vars.selected_path||"",o=rt.normalize(o),(n=_i
.bulk_move_error(e,o))?void b.error(n):(i=e.pluck("fq_path"),b.clear(),r=functio
n(t){var n,r,a,l;return n=t.responseText.evalJSON().changesets,r=i.length,a=_.em
_snippet(rt.filename(o),_i.NOTIFICATION_SNIPPET_LEN).escapeHTML(),l=Ft( Moved %(
count)d item to <a id="reload-link">%(location)s</a>. , Moved %(count)d items to <a
id="reload-link">%(location)s</a>. ,r),l=l.format({count:r,location:a}),ee.notif
yWithUndo(new ot(l),n,_i.do_rollback),$("reload-link").observe("click",function(
){return pr.set_path_url(null,o)}),bi.schedule_reset(),document.fire(s.MOVE,{fil
es:e,to_fq_path:o})},_i.do_nonbrowse_move(Nr.active_user.id,i,o).then(r))):void
0},do_rollback:function(e){return new Ajax.DBRequest("/cmd/rollback",{parameters
:{ns_to_cs:JSON.stringify(e)},subject_user:Nr.active_user,job:!0,html_in_error_m
sg:!0,progress_text:Pt("Undoing..."),onSuccess:function(){var e;return e=Pt("Und
o complete."),b.success(e),ft(Nr.pre_action_selection instanceof Array,"Expected
a selection from before the action to be undone"),Nr.in_search_mode()?(cr.selec
t_fq_paths=Nr.pre_action_selection,cr.force_reload()):(Nr.select_fq_paths=Nr.pre
_action_selection,Nr.force_reload()),Nr.pre_action_selection=!1}})},do_bulk_dele
te:function(e,t){var n,i;return Nr.pre_action_selection=xr.get_selected_fq_paths
(),t=t||pi.vars.files,ft(t.length>0,"Tried to delete 0 files"),i=function(){var
e,i,r;for(r=[],e=0,i=t.length;i>e;e++)n=t[e],r.push(n.fq_path);return r}(),b.cle
ar(),new Ajax.DBRequest("/cmd/delete",{parameters:{files:i},subject_user:e,job:!
0,html_in_error_msg:!0,progress_text:Pt("Deleting..."),onSuccess:function(e){var
n,r;return r=e.responseText.evalJSON(),n=Ft("Deleted %d item.","Deleted %d item
s.",i.length).format(i.length),ee.notifyWithUndo(n,r.changesets,_i.do_rollback),
bi.schedule_reset(),document.fire(s.DELETE,{files:t})}})},do_delete:function(e,t
){var n;return n=Nr.find_file(t||pi.vars.fq_path),ft(n,"Trying to delete a file
we couldn t find."),_i.do_bulk_delete(e,[n])},do_nonbrowse_delete:function(e,t){
var n,i;return n=ke.Deferred(),i=Ft("Deleted %(file_count)s item","Deleted %(fil
e_count)s items",t.length),i=i.format({file_count:t.length}),b.success(i),new Aj
ax.DBRequest("/cmd/delete",{parameters:{files:t},subject_user:e,html_in_error_ms
g:!0,onSuccess:function(e){return document.fire(s.DELETE,{fq_paths:t}),n.resolve
(e)},onFailure:function(e){return b.error(Pt("Failed to perform the delete. Plea
se try again later.")),n.reject(e)}}),n.promise()},do_nonbrowse_rename:function(
e,t,n){var i;return i=ke.Deferred(),new Ajax.DBRequest("/cmd/rename"+encodeURICo
mponent(t),{parameters:{to_path:n},subject_user:e,html_in_error_msg:!0,onSuccess
:function(e){return i.resolve(e)},onFailure:function(e){return i.reject(e)}}),i.
promise()},do_purge:function(e){return ft(e,"Trying to purge a file we couldn t
find."),_i.do_bulk_purge([e])},do_bulk_purge:function(e){var t,n;return ft(e.len
gth>0,"Tried to purge 0 files"),t=e.collect(function(e){return e.fq_path}),n=Ft(
"Permanently deleted %d item","Permanently deleted %d items",t.length).format(t.
length),new Ajax.DBRequest("/cmd/purge",{parameters:{files:t},subject_user:Nr.ac
tive_user,job:!0,html_in_error_msg:!0,progress_text:Pt("Deleting..."),onSuccess:
function(){return b.success(n),bi.schedule_reset(),document.fire(s.PURGE,{files:
e})}})},do_bulk_restore:function(e){var t,n,i;return e=e||pi.vars.files,i=pi.var
s.user,ft(e.length>0,"Tried to restore 0 files"),t=e.collect(function(e){return
e.fq_path}),n=Ft("Restored %d item","Restored %d items",t.length,{comment:"meani
ng, successfully restored x files and folders"}).format(t.length),new Ajax.DBReq
uest("/cmd/restore",{parameters:{files:t},subject_user:Nr.active_user,job:!0,htm
l_in_error_msg:!0,progress_text:Pt("Restoring..."),onSuccess:function(){return b
.success(n),bi.schedule_reset(),document.fire(s.RESTORE,{files:e})}})},do_folder
_restore:function(e,t){var n;return n=function(t){var n,i;return n=Pt("Restoring

%(folder_name)s ").format({folder_name:rt.filename(e)}),i=t.responseText,i.sta
rtsWith("err:")?(i=i.substring(4),ke("#async-result").html(i),b.error(new ot(i),
60)):(n=Pt("Restored %(folder_name)s ").format({folder_name:rt.filename(e)}),ke
("#status-of-files").text(Pt("Restored files")),b.success(n,60)),ke("#restore-do
ne-heading").text(n),ke(".pre-restore").hide(),ke(".post-restore").show()},new A
jax.DBRequest("/cmd/restore",{parameters:{files:[e]},job:!0,html_in_error_msg:!0
,progress_text:Pt("Restoring..."),onSuccess:n,onFailure:n,subject_user:t})},do_b
ulk_download:function(e){var t,n,i,r;for(t=new Element("form",{action:o({scheme:
"https",authority:be.BLOCK_CLUSTER,path:"/zip_batch"}).updateQuery(D.UID_PARAM_N
AME,Nr.active_user.id).toString(),method:"post"}),i=0,r=e.length;r>i;i++)n=e[i],
li.add_vars(t,{files:n.fq_path});return li.add_vars(t,{parent_path:Nr.block_hash
_param||"/",w:Nr.block_hash}),$(document.body).__sert(t),t.submit()},do_bulk_pho
to_view:function(e,t){var n,i,r,s;return s={},s[D.UID_PARAM_NAME]=e.id,n=String(
o({scheme:"https",authority:be.WEBSERVER,path:"/app/view_in_timeline",query:s}))
,i=new Element("form",{action:n,method:"post"}),li.add_vars(i,{t:Be.read(Re.JS_C
SRF_COOKIE),ns_ids:JSON.stringify(function(){var e,n,i;for(i=[],e=0,n=t.length;n
>e;e++)r=t[e],i.push(r.ns_id);return i}()),ns_paths:JSON.stringify(function(){va
r e,n,i;for(i=[],e=0,n=t.length;n>e;e++)r=t[e],i.push(r.ns_path);return i}())}),
$(document.body).__sert(i),i.submit()},build_revisions_uri:function(e,t,n){retur
n null==n&&(n={}),n[D.UID_PARAM_NAME]=String(t),ne.getGandalfRule("revision-hist
ory-web")?o({path:"/history"+e}).updateQuery(n):o({path:"/revisions"+e}).updateQ
uery(n)}};var li,yn={}.hasOwnProperty;li=__CONDITIONAL_JS__.Forms=INLINE_JS.Form
s=ut.Forms={submitOnlyOnce:function(){var e;return e=li.submitted!==!0,li.submit
ted=!0,e},disable:function(e){return e?setTimeout(function(){return e.disabled=!
0},0):void 0},enable:function(e){return e?setTimeout(function(){return e.disable
d=!1},0):void 0},_button_on_change:function(e,t,n,i){var r,o,s,a;return r=ke(e),
r[t](),null==i&&(i=r.closest("form")),o=i[0],null==this.next_id&&(this.next_id=0
),s=this.next_id++,null==this.initial_vars&&(this.initial_vars={}),this.initial_
vars[s]=this.collect_form_vars(o),r.attr("data-id",s),i.data("button-id",s),a=fu
nction(e){return function(){var i,a,_;r[t](),a=e.collect_form_vars(o),Object.key
s(a).length!==Object.keys(e.initial_vars[s]).length&&r[n](),_=[];for(i in a)_.pu
sh(a[i]!==e.initial_vars[s][i]?r[n]():void 0);return _}}(this),i.change(a),i.fin
d("input").filter(":text").on("input",a),i.find("textarea").on("input",a)},show_
button_on_change:function(e,t){return this._button_on_change(e,"hide","show",t)}
,hide_button_on_change:function(e,t){return this._button_on_change(e,"show","hid
e",t)},add_vars:function(e,t){var n,i,r;e=$(e),r=[];for(i in t)yn.call(t,i)&&(n=
new Element("input",{type:"hidden",name:i}),n.setValue(t[i]),r.push(e.__sert(n))
);return r},collect_form_vars:function(e,t){var n,i,r,o,s,a;for(null==t&&(t=!1),
e=e||$(document.body),i=e.select("input").concat(e.select("textarea")).concat(e.
select("select")),s={},r=0,o=i.length;o>r;r++)n=i[r],n.name&&"t"!==n.name&&!ke(n
).attr("data-ignore-var")&&(a=n.getValue(),(a||t)&&("string"!=typeof a&&(a=a.joi
n(",")),null!=s[n.name]?"string"==typeof s[n.name]?s[n.name]=[s[n.name],a]:s[n.n
ame].push(a):s[n.name]=a));return s},add_loading:function(e,t){var n;return e?(e
=$(e),n=new Element("img",{src:"/static/images/icons/ajax-loading-small-vfl3Wt7C
_.gif"}),n.addClassName("text-img ajax_submit_loading"),"after"===t?ke(e).after(
n):ke(e).before(n)):void 0},remove_loading:function(){return ke(".ajax_submit_lo
ading").remove()},ui_form_submit:function(e,t){return t=t||e.action,e.ajax_submi
tted?!1:(e.ajax_submitted=!0,new h(ke(e),t,{data:li.collect_form_vars(e),success
:function(t){return function(){var n,i;return i=ke(e).data("button-id"),null!=i?
(n=ke(e).find("*[type= submit ][data-id= "+i+" ]"),t.initial_vars[i]=t.collect_f
orm_vars(e),n.hide()):void 0}}(this),complete:function(){return function(){retur
n e.ajax_submitted=!1}}(this)}))},ajax_submit_obj:function(e){var t,n,i,r,o,s,a,
_,l,u,d;return r=e.form,d=e.url,u=e.success_callback,i=e.fail_callback,t=e.butto
n,a=e.more_vars,_=e.position,s=e.job,o=e.html_response,n=e.complete_callback,l=e
.progress_text,li.ajax_submit(r,d,u,i,t,a,_,s,o,n,l)},ajax_submit:function(e,t,n
,i,r,o,s,a,_,l,u){var d,c,h,f,p;if(null==_&&(_=!1),e.ajax_submitted)return!1;for
(e.ajax_submitted=!0,p=ke(e).find(".suggestion-input"),c=0,h=p.length;h>c;c++)d=
p[c],vi.blank(d.identify())();return r&&li.add_loading(r,s),f=li.collect_form_va
rs(e),o&&Object.extend(f,o),new Ajax.DBRequest(t||e.action,{noAutonotify:!0,para
meters:f,job:a,progress_text:u,evalJSON:!1,onSuccess:function(e){return li.remov

e_loading(),n&&"function"==typeof n?n(e):void 0},onFailure:function(t){var n,r;r


eturn t&&(0===t.responseText.indexOf("err:")?(n=t.responseText.substr(4),0===n.i
ndexOf("{")?(r=n.evalJSON(!0),li.fill_errors(e,r)):(_&&(n=new ot(n)),b.error(n))
):b.error(),li.remove_loading(),i&&"function"==typeof i)?i(t):void 0},onComplete
:function(t){var n,i,r;for(r=e.select(".suggestion-input"),n=0,i=r.length;i>n;n+
+)d=r[n],vi.blur_elm(d);return e.ajax_submitted=!1,l&&"function"==typeof l?l(t):
void 0}}),!1},clear_errors:function(e){return e=e||$(document.body),this.hide_er
rors(e),e.select(".error-removable").invoke("remove")},fill_errors:function(e,t)
{var n,i,r,o,s,a;t=t||{},e=e||$(document.body),li.clear_errors(e);for(s in t)yn.
call(t,s)&&(i=e.down("[data-error-field-name= "+s+" ]")||e.down("[name= "+s+" ]"
),i&&(n=new Element("br",{"class":"error-removable"}),r=new Element("span",{"cla
ss":"error-message error-removable"}),o=t[s],ft(o.message_html||o.message_text,"
Error message must have a message_html or message_text property"),o.message_html
?r.update(o.message_html):r.__date(o.message_text),ke(i).before(r),ke(i).before(
n),a=ke(e).find("input[name= "+s+" ], textarea[name= "+s+" ]"),a&&a.addClass("in
put-error")));return this.show_errors(e)},value:function(e){var t,n,i,r,o;for(i=
$$( input[name=" +e+ "] ),o=null,t=0,r=i.length;r>t;t++)n=i[t],o=$(n).getValue()
||o;return o},postRequest:function(e,t,n){var i;return null==t&&(t={}),null==n&&
(n={}),ft(null!=e,"postRequest missing action"),t.t=Be.read(Re.JS_CSRF_COOKIE),i
=new Element("form",{action:e,method:"POST"}),n.target&&(i.target=n.target),docu
ment.body.appendChild(i),li.add_vars(i,t),i.submit()},hide_errors:function(e){va
r t,n,i,r,o;for(t=this.get_errors(e),r=[],n=0,i=t.length;i>n;n++)o=t[n],r.push(o
.down("span.error-message")?o.hide():void 0);return r},show_errors:function(e){v
ar t,n,i,r;for(t=this.get_errors(e),n=0,i=t.length;i>n;n++)r=t[n],r.down("span.e
rror-message")&&r.show();return ke(".sick-input").find("label").css("top","")},g
et_errors:function(e){var t,n;return n=".error-bubble, .error-plain-text",t=e?e.
select(n):$$(n)}},ke(function(){return li.show_errors()});var ui;ui=ut.ActAsBloc
k={elm_list:["margin-left","margin-right","padding-left","padding-right","border
-left-width","border-right-width"],parent_list:["padding-left","padding-right","
border-left-width","border-right-width"],register:function(e,t){var n,i,r,o;for(
null==t&&(t=document.body),r=$(t).getElementsByClassName("act_as_block"),o=[],n=
0,i=r.length;i>n;n++)e=r[n],o.push(this.resize(e));return o},resize:function(e){
var t,n,i,r;return e=$(e),n=e.up(),t=Kt.sumStyles(e,this.elm_list),i=Kt.sumStyle
s(n,this.parent_list),e.style.width="1px",r=n.getWidth()-t-i,r>0?e.style.width=r
+"px":void 0}};var di;di=ut.BrowseStyleRows={register_all:function(){var e,t,n,i
;for(n=$$(".bs-row"),e=0,t=n.length;t>e;e++)i=n[e],this.register(i);return Event
.observe(document,"click",this.kill_current.bind(this)),ke(document).on("dropdow
n-opened",this.kill_current.bind(this))},register:function(e){var t;return e=$(e
),e.db_observe("mouseover",this.mouseover.bind(this)),e.db_observe("mouseout",th
is.mouseout.bind(this)),t=e.down(".action-button"),t?t.db_observe("click",this.c
lick.bind(this)):void 0},mouseover:function(e,t){return t.hasClassName("no-hover
")?void 0:t.addClassName("hover")},mouseout:function(e,t){return t.removeClassNa
me("hover")},click:function(e,t){var n,i,r;if("A"!==e.target.tagName)return i=t.
up(".bs-row"),Event.stop(e),i.hasClassName("selected")?void this.kill_current(!1
):(ke(document).trigger("dropdown-opened"),this.kill_current(!1),r=$(e.target),r
.match(".bs-actions-list *")||i.addClassName("selected"),n=r.hasClassName("bs-ro
w")?r:r.up(".bs-row"),n.style.zIndex=9)},kill_current:function(){var e,t,n,i,r;f
or(i=$$(".bs-row.selected"),r=[],t=0,n=i.length;n>t;t++)e=i[t],e.removeClassName
("selected"),r.push(e.style.zIndex="");return r}};var ci;ci=ut.Bubble={make:func
tion(e,t,n,i,r){var o,s,a,_,l,u,d,c,h,f,p,m,v,g,w,b,y,k,E,x;return null==t&&(t="
left"),r=null!=r?r:{},["left","right"].contains(t)?(n=n||"middle",ft(["top","mid
dle","bottom"].contains(n),"expected tail position [ top , middle , bottom ],
got "+n)):["bottom","top"].contains(t)?(n=n||"center",ft(["left","center","right
"].contains(n),"expected tail position [ left , center , right ], got "+n)):["
none"].contains(t)||ft(!1,"unexpected tail side, got "+t),m=new Element("table")
,"titled"===r.style?(m.addClassName("bluebubble"),v="bluebubble"):(m.addClassNam
e("bubble"),v="bubble"),i&&(m.style.width=i+"px"),w=new Element("tbody"),k=new E
lement("tr"),b=new Element("td"),b.addClassName("tl"),p=new Element("td"),p.addC
lassName("t"),"titled"===r.style&&i&&(p.style.width=i-42+"px"),y=new Element("td
"),y.addClassName("tr"),"top"===t&&(g=new Element("img",{src:"/static/images/"+v

+"_arrow_top.png"}),g.addClassName("tarrow"),"titled"===r.style?(g.addClassName(
"arrow-"+n),s=new Element("div"),s.addClassName("arrow-container"),i&&(s.style.w
idth=i-42+"px"),s.__sert(g),p.__sert(s)):(p.style.textAlign=n,p.__sert(g))),k.__
sert(b),k.__sert(p),k.__sert(y),w.__sert(k),E=new Element("tr"),c=new Element("t
d"),c.addClassName("l"),"left"===t&&(o="titled"===r.style?new Element("img",{src
:"/static/images/bluebubble_arrow_left-vfl8zzy_-.png"}):new Element("img",{src:"
/static/images/bubble_arrow-vfl8m7tk-.png"}),o.addClassName("arrow"),c.__sert(o)
,c.vAlign=n),d=new Element("td"),d.addClassName("c"),d.update(e),h=new Element("
td"),h.addClassName("r"),"right"===t&&(f=new Element("img",{src:"/static/images/
bubble_arrow_right-vflmW3_2s.png"}),f.addClassName("rarrow"),h.__sert(f),h.vAlig
n=n),E.__sert(c),E.__sert(d),E.__sert(h),w.__sert(E),x=new Element("tr"),l=new E
lement("td"),l.addClassName("bl"),a=new Element("td"),a.addClassName("b"),"botto
m"===t&&(_=new Element("img",{src:"/static/images/"+v+"_arrow_bottom.png"}),_.ad
dClassName("barrow"),"titled"===r.style?(_.addClassName("arrow-"+n),s=new Elemen
t("div"),s.addClassName("arrow-container"),i&&(s.style.width=i-42+"px"),s.__sert
(_),a.__sert(s)):(a.style.textAlign=n,a.__sert(_))),u=new Element("td"),u.addCla
ssName("br"),x.__sert(l),x.__sert(a),x.__sert(u),w.__sert(x),m.__sert(w),m}};var
hi;hi=INLINE_JS.FreshDropdown=ut.FreshDropdown={show:function(e,t,n,i){var r,o,
s,a;return null==i&&(i=!1),ke(document).trigger("dropdownOpened",[1]),r=ke(t),n|
|(n=r[0].offsetHeight+10),this.hide_all(),o=ke(e).show(),a=o[0].offsetWidth,s=r[
0].offsetWidth,Fe.clone_position(o,r,{setHeight:!1,setWidth:!1,offsetLeft:-1*(as)+22,offsetTop:n}),i&&o.width(a),r.addClass("pressed"),function(){return functi
on(){return document.observe("click",hi.hide_all)}}(this).defer()},hide_all:func
tion(){var e,t;return t=ke(".freshdropdown-menu"),e=0,t.each(function(){return k
e(this).is(":visible")?e+=1:void 0}),t.hide(),ke(document).trigger("dropdownClos
ed",[e]),$$(".freshdropdown-button").invoke("removeClassName","pressed"),documen
t.stopObserving("click",hi.hide_all)}};var fi;fi=ut.JumpWatcher={inverval:null,l
ast_hash:null,last_page_offset:0,check:function(){return window.location.href.en
dsWith("#")&&0===window.pageYOffset&&0!==fi.last_page_offset?this.report():(this
.last_page_offset=window.pageYOffset,this.last_hash=o.parse(window.location.href
).fragment)},report:function(){return clearInterval(fi.interval),pt("Hash jump d
etected, last hash = "+this.last_hash+". You may have an onclick handler that is
n t firing, or you are not preventing the default action (eg. by returning false
in your handler)")}};var pi;pi=__CONDITIONAL_JS__.Modal=INLINE_JS.Modal=ut.Moda
l={KEY_SCOPE:"modal",width:640,vertical_offset:90,show:function(e,t,n,i,r,o,s,a,
_){var l,u,d,c,h,f;return null==n&&(n=!1),null==i&&(i=!1),null==r&&(r=!1),null==
o&&(o=!1),null==s&&(s=""),null==a&&(a=!0),null==_&&(_=!1),pi.shown()&&pi._cleanu
p(),r=r||this.width,u="#modal-content .error-message, #modal-content .error-remo
vable, #modal-content .error-bubble",$$(u).invoke("hide"),ni.uploading&&!o?(ht(P
t("You can t do this while uploading.")),!1):(ft(t,"Missing modal content!"),h=t
his.vars._prev_scope,this.vars=n||{},this.vars._prev_scope=h,$("modal").setStyle
({width:r+"px",margin:"0 0 0 "+Math.floor(-r/2).toString()+"px"}),this.vars.extr
a_class="",s&&($("modal").addClassName(s),this.vars.extra_class=s),o||(ni.num_fi
les()&&(oi.reset(),ni.clear()),c=Kt.childElement($("modal-content"),0),c&&c!==t&
&$("grave-yard").__sert(c),l=new Element("div"),l.update(t),$("modal-content")._
_sert(l),
t.show&&t.show(),Element.show("modal")),ke("#modal-overlay").off("click"),a?ke("
#modal-overlay").on("click",function(e){return pi.hide(null,!1,!0),e.preventDefa
ult(),e.stopPropagation()}):ke("#modal-overlay").on("click",function(e){return e
.preventDefault(),e.stopPropagation()}),this.fix_position(),$("modal-overlay").s
how(),$("modal-behind").setStyle({width:r+20+"px",margin:"0 0 0 "+Math.floor(-r/
2-10).toString()+"px"}),ke("#modal-behind").css("opacity",.2),$("modal-behind").
show(),i?$("modal-content").select("#"+i.id).first().focus():Kt.ie||(d=$("modal"
).down("input[type=submit]")||$("modal").down("input[type=button]"),d&&d.focus()
),this.track_id||this.track_resizes(),e?(Kt.isElm(e)?ke("#modal-title").html(e):
ke("#modal-title").text(e),ke("#modal-title").show(),f=ke("#modal-title").text()
,Vt("Modal.show:",f)):(ke("#modal-title").hide(),Vt("Modal.show")),ui.register(!
1,"modal"),this.keydownHandler=this.keydown.bind(this),document.observe("keydown
",this.keydownHandler),$("modal-content").style.height="auto",key.getScope()!==t
his.KEY_SCOPE&&(this.vars._prev_scope=key.getScope()),key.setScope(this.KEY_SCOP

E),this.prevent_hide_if_loading=_,ke("#modal").find("input").filter(":visible:fi
rst").focus(),this.in_viewport()&&(this.scroll_locked=!0,Fe.scroll_lock_document
()),ke(document).trigger("modalOpened",[1]),!1)},in_viewport:function(){var e,t,
n,i,r;return e=ke("#modal"),t=e.height(),r=e.width(),n=Fe.viewport_dimensions(),
i=Fe.viewport_offset(e),i.left>0&&i.top>0&&i.left+r<n.width&&i.top+t<n.height},f
ix_position:function(){var e,t;return t=document.viewport.getScrollOffsets().top
+this.vertical_offset,e=parseInt($("modal").getStyle("height"),10),e+this.vertic
al_offset<document.viewport.getHeight()?($("modal").setStyle({position:"fixed",t
op:this.vertical_offset+"px"}),$("modal-behind").setStyle({position:"fixed",heig
ht:e+20+"px",top:this.vertical_offset-10+"px"})):($("modal").setStyle({position:
"absolute",top:t+"px"}),$("modal-behind").setStyle({position:"absolute",height:e
+20+"px",top:t-10+"px"}))},keydown:function(e){var t,n,i,r;if(i=e.keyCode||e.whi
ch||e.charCode,(27===i||8===i&&!Fe.focus_in_input())&&(e.preventDefault(),this.h
ide(null,!1,!0)),9===i&&!Fe.focus_in_input()){for(n=$("modal").down("input[type=
text], input[type=email]"),r=$("modal").down(".modal-tabs"),t=r;t&&t.next();)if(
t=t.next(),t.visible()){n=t.down("input[type=text], input[type=email]");break}if
(n)return e.preventDefault(),n.focus()}},shown:function(){return $("modal").visi
ble()},hide:function(e,t,n){return e&&Event.stop(e),this.should_prevent_hide()?!
1:(this.prevent_hide_if_loading=!1,this.onHide?void this.onHide(n):(this.onHide=
null,Element.hide("modal-behind"),Element.hide("modal-overlay"),$("modal").remov
eClassName(this.vars.extra_class),t||ni.num_files()?($("modal").style.marginLeft
="-10000000px",ni.uploading&&ii.show()):Element.hide("modal"),pi._cleanup(),this
.track_id&&(clearInterval(this.track_id),this.track_id=!1),document.stopObservin
g("keydown",this.keydownHandler),document.activeElement&&-1===[document,window,d
ocument.body].indexOf(document.activeElement)&&$(document.activeElement).blur(),
key.setScope(this.vars._prev_scope),Vt("Modal.hide")))},_cleanup:function(){retu
rn ke(document).trigger("modalClosed",[1]),this.scroll_locked?Fe.scroll_unlock_d
ocument():void 0},should_prevent_hide:function(){return this.prevent_hide_if_loa
ding&&v.some(ke("#modal form"),function(e){return e.ajax_submitted})},track_resi
zes:function(){return this.track_id=setInterval(this.on_resize.bind(this),150)},
on_resize:function(){var e;return e=$("modal").getHeight(),this.old_height!==e||
$("modal-behind").getHeight()<e?(this.old_height=e,this.fix_position()):void 0},
vars:{}};var mi;mi=ut.SickInput={init:function(){var e,t,n,i,r;for(i=$$(".sick-i
nput"),r=[],t=0,n=i.length;n>t;t++)e=i[t],e.hasClassName("sickified")||r.push(th
is._create(e));return r},_create:function(e){var t,n,i;if(null!=e)return n=e.ide
ntify(),i=e.down("input")||e.down("textarea")||e.down("select"),i.observe("focus
",function(){return e.addClassName("focused")}),i.observe("blur",function(){retu
rn e.removeClassName("focused")}),t=function(){return e.hasClassName("populated"
)&&""===i.getValue()?e.removeClassName("populated"):e.hasClassName("populated")|
|""===i.getValue()||e.addClassName("populated"),n in mi._handler_map?mi._handler
_map[n]():void 0},li.show_errors(),t(),setInterval(t,100)},_handler_map:{},add_i
nterval_handler:function(e,t){var n;return n=e.identify(),this._handler_map[n]=t
},remove_interval_handler:function(e,t){var n;return n=e.identify(),this._handle
r_map[n]===t?delete this._handler_map[n]:void 0}};var vi;vi=ut.SuggestionInput={
register:function(e){var t;return e=$(e),t=e.up("form"),vi.defaulted(e)||""===e.
getValue()?e.setValue(e.title):e.addClassName("suggestion-input-unfaded"),e.obse
rve("blur",this.blur.bind(this)),e.observe("focus",this.focus.bind(this)),e.obse
rve("db:value_change",this.focus.bind(this)),t?(e.id||(e.id="r_elm_id_"+Math.ran
dom().toString()),t.observe("submit",vi.blank(e.id).bind(this))):void 0},registe
r_all:function(){var e,t,n,i,r;for(i=$$(".suggestion-input"),r=[],e=0,n=i.length
;n>e;e++)t=i[e],r.push(this.register(t));return r},blank:function(e){return func
tion(t){return function(){var n;return(n=$(e))&&t.defaulted(n)?n.setValue(""):vo
id 0}}(this)},defaulted:function(e){return e=$(e),e.getValue()===e.title},do_bla
nk:function(e){return this.blank(e)()},clear:function(e){var t;return t={target:
e},this.focus(t)},focus:function(e){var t;return(t=$(e.target))&&this.defaulted(
t)?(t.addClassName("suggestion-input-unfaded"),t.setValue("")):void 0},blur_elm:
function(e){return""===e.getValue()&&(e.removeClassName("suggestion-input-unfade
d"),e.setValue(e.title)),e.blur()},blur:function(e){var t;return(t=$(e.target))?
this.blur_elm(t):void 0},reset:function(e){var t;return(t=$(e))?(t.removeClassNa
me("suggestion-input-unfaded"),t.setValue(t.title),t.defaulted=!0,t.blur()):void

0},setValue:function(e,t){var n;return(n=$(e))?(n.addClassName("suggestion-inpu
t-unfaded"),n.setValue(t),n.defaulted=!1):void 0}};var gi;gi=ut.TitleBubble=func
tion(){var e,t,n,i,r,o,s;return s=0,e=0,o=function(e){return s=e},r=function(i){
var r,o,a,_,l,u,d,c,h,f,p;return o=ke(i.currentTarget),p=o.attr("title"),(null!=
p?p.length:void 0)&&(o.attr("data-title",p),o.removeAttr("title")),l=parseInt(o.
data("title-delay")),_="title-bubble-"+e++,o.data("bubble-id",_),r=ke("<div/>",{
id:_,"class":"title_bubble_container"}),l||(r.css({opacity:0}),r.addClass("has-t
ransition")),o.hasClass("white")&&r.addClass("white"),o.hasClass("black")&&r.add
Class("black"),r.text(o.attr("data-title")),c=o.attr("data-title-html"),r.html(c
),f="yes"!==o.attr("data-title-hide-tail"),f&&(a=ke("<div/>",{"class":"tail"}),r
.append(a)),ke(document.body).append(r),d=n(o[0],r[0]),u=t(d,r[0],o[0]),Fe.clone
_position(r,o,{setWidth:!1,setHeight:!1,offsetTop:u.top-s,offsetLeft:u.left}),r.
addClass("position-"+d),f&&Fe.clone_position(a,o,{setWidth:!1,setHeight:!1,setTo
p:!1,offsetLeft:u.left+u.tail_offset_left+ke(r).outerWidth()/2}),h=function(){va
r e;if(r.data("pending-delay")&&o.data("bubble-id")===_)return e=parseInt(o.data
("title-fade-time"))||400,r.fadeIn(e)},l?(r.hide(),r.data("pending-delay",!0),se
tTimeout(h,l)):r.css({opacity:""})},n=function(e,t){var n,i,r;if(e=$(e),r=e.getA
ttribute("data-title-position"),n=document.viewport.getDimensions(),i=e.viewport
Offset(),"above"!==r&&"below"!==r&&"right"!==r&&"left"!==r&&(r="above"),"left"==
=r){if(i.left<t.width)return"right"}else if("right"===r){if(n.width-(i.left+e.ge
tWidth())<t.width)return"left"}else if("below"===r){if(n.height-(i.top+e.getHeig
ht())<t.height)return"above"}else if("above"===r&&i.top<t.height)return"below";r
eturn r},t=function(e,t,n){var i,r,o,s,a,_,l,u,d,c;return t=$(t),n=$(n),o=docume
nt.viewport.getDimensions(),i=t.getDimensions(),s=n.viewportOffset(),r=6,a=0,_=0
,d=0,c=0,("below"===e||"above"===e)&&(_="below"===e?n.getHeight()+r:-1*i.heightr,l=n.getWidth()/2-i.width/2,s.left+l+i.width>o.width?(a=o.width-s.left-i.width,
d=l-a-5):(a=l,d=-5)),("left"===e||"right"===e)&&(a="right"===e?n.getWidth()+r:-1
*i.width-r,u=n.getHeight()/2-i.height/2,s.top+u+i.height>o.height?(_=o.height-s.
top-i.height,c=u-_-5):(_=u,c=-5)),{left:a,top:_,tail_offset_left:d,tail_offset_t
op:c}},i=function(e){var t,n,i;return n=ke(null!=e?e.currentTarget:void 0),t=ke(
"#"+n.data("bubble-id")),t.data("pending-delay")?(t.removeData("pending-delay"),
i=parseInt(n.data("title-fade-time"))||400,t.fadeOut(i,function(){return t.remov
e()})):t.remove()},{init:function(){return ke(document).on("mouseenter",".title_
bubble",r),ke(document).on("mouseleave",".title_bubble",i).on("mouseup",".title_
bubble",i),ke(document).on("mouseenter",".title_bubble_sticky",r),ke(document).o
n("mouseleave",".title_bubble_sticky",i)},set_vertical_space:o,hide_all:function
(){return ke(".title_bubble_container").remove()}}}();var wi;wi=INLINE_JS.Toolti
p=ut.Tooltip={attach:function(e,t,n,i){var r,o;return null==i&&(i={}),e=$(e),n=n
?$(n):null,r=ci.make(t,e.tail_position,i.tail_position,i.width,i),r.setStyle({di
splay:"none",position:"absolute"}),$("floaters").__sert(r),r.style.zIndex=e.matc
h("#modal-content *")||e.match(".db-modal-content *")?"13001":"","right"===e.tai
l_position&&(o=Kt.ie?32:12,r.style.marginLeft=-(r.getWidth()+e.getWidth()+o)+"px
"),e.tooltip=r,e.out_target=n?!0:!1,e.observe("mouseout",this.mouseout("target",
e)),e.observe("mouseover",this.mouseover("target",e)),e.out_trigger=n?!1:!0,n&&(
n.observe("mouseout",this.mouseout("trigger",e)),n.observe("mouseover",this.mous
eover("trigger",e))),e.out_tooltip=!0,r.observe("mouseout",this.mouseout("toolti
p",e)),r.observe("mouseover",this.mouseover("tooltip",e))},update:function(e,t){
return e.tooltip?$(e.tooltip).update(t):void 0},mouseover:function(e,t){return f
unction(){return t["out_"+e]=!1}},mouseout:function(e,t){return function(){retur
n t["out_"+e]=!0,wi.hide_if_out.defer(t)}},show_by:function(e){var t,n;return t=
ke(e.tooltip),e=ke(e),t.show(),n=Math.floor(t[0].offsetHeight/2),Fe.clone_positi
on(t,e,{setWidth:!1,setHeight:!1,offsetTop:Math.floor(e[0].offsetHeight/2)-n,off
setLeft:e[0].offsetWidth+1})},hide_if_out:function(e){var t;if(e.out_target&&e.o
ut_trigger&&e.out_tooltip)return t=$(e.tooltip),t.hide()},show:function(e,t,n,i,
r){return null==i&&(i="left"),e=$(e),e.tail_position||(e.tail_position=i),n=n?$(
n):null,e.tooltip||this.attach(e,t,n,r),this.show_by(e)}};var bi;bi=INLINE_JS.Tr
eeView=ut.TreeView={tv:{},loaded:!1,user:null,role_icon:"",set_params:function(e
){return this.ajax_params=e},init:function(e,t,n){var i;return null==n&&(n="tree
view"),this.tv[n]={},i=this.tv[n],i.autohide=null===t?!0:t,i.handler=e,i.viewdiv
=$(n),i.hidefunc=this.hide.bindAsEventListener(this),this.ajax_params={},documen

t.observe(_r.ADD,function(e){return function(){return e.schedule_reset()}}(this)


),document.observe(_r.REMOVE,function(e){return function(){return e.schedule_res
et()}}(this)),document.observe(_r.MOVE,function(e){return function(){return e.sc
hedule_reset()}}(this))},schedule_reset:function(){return this.loaded=!1},reset:
function(e){var t,n,i,r,o,s,a;return t={url:"/ajax_subtreeview",type:"post",data
:ke.extend({},this.ajax_params),success:function(t){return function(n){var i,r;i
=[];for(r in t.tv)t.tv.hasOwnProperty(r)?(t.tv[r].viewdiv.down(".treeview-folder
s").update(n),i.push(e&&e.onSuccess?e.onSuccess(n):void 0)):i.push(void 0);retur
n i}}(this)},(null!=e?e.user:void 0)?(e.user.id!==(null!=(n=this.user)?n.id:void
0)&&(o=ke("<p />",{id:"treeview-loading"}),s=ke("<img />",{src:"/static/images/
icons/ajax-loading-small-vfl3Wt7C_.gif"}),o.append(s),a=" "+Pt("Loading your fol
ders"),o.append(a),ke("#dest-treeview .treeview-folders").html(o),this.user=e.us
er),t.subject_user=e.user,r=K.get_role_title(e.user),i=K.get_viewer().is_paired?
e.user.is_team?"s_briefcase":"s_house":"dropbox",r||(r=Pt("Dropbox")),ke("#first
-treeview-link span").text(r),Q.replace(ke("#root-img")[0],"web",this.role_icon,
i),this.role_icon=i):ke("#first-treeview-link span").text(Pt("Dropbox")),ke.ajax
(t)},toggle:function(e,t){var n;return Event.stop(e),n=this.tv[t||"treeview"],n.
shown?(n.shown=!1,this.hide(e,t)):(n.shown=!0,this.show(e.target,t)),!1},hide:fu
nction(e,t){var n;return n=this.tv[t||"treeview"],e&&$(e.target).descendantOf(n.
viewdiv)?void 0:(n.viewdiv.hide(),Event.stopObserving(window,"click",n.hidefunc)
,n.shown=!1)},show:function(e,t){var n,i;return i=this.tv[t||"treeview"],e=$(e),
e.blur(),n=e.cumulativeOffset(),i.viewdiv.setStyle({top:n.top+e.getHeight()+"px"
,left:n.left-4+"px"}),i.viewdiv.show(),Event.observe(window,"click",i.hidefunc)}
,toggleNode:function(e){var t;return e=$(e),t=e.down("img"),t.className.match("b
ullet_plus")?Q.replace(t,"web","bullet_plus","bullet_minus"):Q.replace(t,"web","
bullet_minus","bullet_plus"),e.up().next("div").toggle(),e.blur(),!1},toggleNode
Ajax:function(e,t,n){var i,r;return e.fetched_children?this.toggleNode(e):(e=$(e
),i=e.down("img"),r=Q._get(i),i.src="/static/images/icons/ajax-loading-small-vfl
3Wt7C_.gif",ke.ajax({url:"/ajax_subtreeview"+t,type:"post",data:ke.extend({},thi
s.ajax_params),subject_user:n,success:function(t){return function(n){var o;retur
n o=new Element("div",{style:"display: none;"}).update(n),e.up().__sert({after:o
}),e.fetched_children=!0,Q._set(i,r),t.toggleNode(e)}}(this),complete:function()
{return/loading/.match(i.src)?Q._set(i,r):void 0}}),!1)},handle:function(e,t){va
r n,i;return n=$H(this.tv).keys(),(i=$(t).ancestors().find(function(e){return n.
include(e.id)}))?(i=this.tv[i.id],ke(document).trigger("db:treeview_selected",[e
]),i.handler&&i.handler(e,t),i.autohide&&this.hide(i.id),!1):void 0},move:functi
on(e,t,n){var i;return i=$(e),this.loaded?n&&n.onSuccess&&n.onSuccess():this.res
et({onSuccess:function(i){return function(){return i.loaded=1,i.move(e,t,n)}}(th
is),user:null!=n?n.user:void 0}),ft(i,"Couldn t find tree_id"),ft($(t),"Couldn t
find location_id"),$(t).appendChild(i),i.show()}};var yi;yi=ut.ULSelectMenu=fun
ction(){var e,t,n,i,r,o,s,a,_,l,u;return e=function(e){return e.removeClassName(
"shown")},u=function(e){return e.toggleClassName("shown")},s=function(){return t
his.removeClassName("hover")},o=function(){return this.addClassName("hover")},a=
function(e,t){var n,i,r,o;for(r=[],n=0,i=t.length;i>n;n++)o=t[n],r.push(e.insert
(o));return r},i=function(e,t,n){return a(e,n),e.firstChild!==t?e.__sert({top:t}
):void 0},_=function(e,t){var n;return n="selected",ke(e).find("."+n).removeClas
s(n),ke(t).addClass(n)},l=function(e,t){var n,i,r,o,s;for(o=e.select("li"),s=[],
i=0,r=o.length;r>i;i++)n=o[i],s.push(n.getAttribute("data-value")===t?_(e,n):voi
d 0);return s},r=function(t,n,r){return function(){return t.hasClassName("select
ed")?(i(n,t,r),u(n)):(_(n,t),n.fire("db:change",t.getAttribute("data-value")),e(
n))}},t=function(t){var n,i,a,_,l,u,d,c;if(_=t.select("li"),ft(_.length,"Empty l
ist of options "+t.identify()),l=void 0,1===_.length)t.addClassName("one");else{
for(i=0,a=_.length;a>i;i++)n=_[i],d=n.getAttribute("data-value"),ft(d,n.identify
()+" missing data value"),n.observe("click",r(n,t,_)),n.observe("mouseenter",o),
n.observe("mouseleave",s),n.hasClassName("selected")&&(l=n);$(document.body).obs
erve("click",function(n){return $(n.target).up(".ul_select_menu")!==t?e(t):void
0})}return l||(l=_[0]),l.addClassName("selected"),c=new Element("span"),u=l.getD
imensions(),c.setStyle({width:u.width+"px",height:u.height+"px",position:"relati
ve",display:"inline-block"}),t.wrap(c)},n=function(){var e,n,i,r,o;for(r=$$(".ul
_select_menu"),o=[],n=0,i=r.length;i>n;n++)e=r[n],o.push(t(e));return o},ke(n),{

init:function(e){return t(e)},set_selected_by_value:l}}();var ki;ki=ut.DBCalenda


r=Class.create({initialize:function(e,t){return this.options=t||{},this.containe
r=$(e),ft(this.container,"Couldn t find the element"),this.today=new Date,this.o
ptions.disable_future&&(this.options.last_day=Kt.start_of_day(this.options.last_
day||this.today)),this.options.disable_past&&(this.options.first_day=Kt.start_of
_day(this.options.first_day||this.today)),this.view_date=Kt.start_of_day(this.op
tions.selected_date||this.today),this.selected_date=Kt.start_of_day(this.options
.selected_date||this.today),this.render()},_change_month:function(e,t){return Ev
ent.stop(e),this.view_date.setMonth(t),this.render()},is_valid_date:function(e,t
,n,i,r){var o;return e=parseInt(e,10),t=parseInt(t,10),n=parseInt(n,10),i=parseI
nt(i,10),r=parseInt(r,10),i=i||1970,r=r||(new Date).getFullYear()+1,t+=1,i>n?!1:
n>r?!1:1>t||t>12?!1:0>=e?!1:2===t?(o=n%4===0&&(n%100!==0||n%400===0),o?29>=e:28>
=e):4===t||6===t||9===t||11===t?30>=e:31>=e},change_date:function(e,t,n){var i;i
f(this.is_valid_date(e,t,n))return i=n!==this.view_date.getFullYear()||t!==this.
view_date.getMonth(),this.selected_date=new Date(n,t,e),i?(this.view_date.setMon
th(t),this.view_date.setFullYear(n),this.render()):(ke(this.container).find(".se
lected").removeClass("selected"),ke(this.container).find("a#day"+e+"-"+t).addCla
ss("selected")),this.options.onDateChange?this.options.onDateChange(this.selecte
d_date):void 0},render:function(){var e,t,n,i,r,o,s,a,_,l;return t=this.render_d
ays(),i=ke(".current-month",t),s=i.first().data("date"),o=i.last().data("date"),
l=s<=this.options.first_day,_=o>=this.options.last_day,e=new Element("div"),e.ad
dClassName("calendar clearfix"),_||(this._next_month=function(e){return this._ch
ange_month(e,this.view_date.getMonth()+1)}.bind(this),r=new Element("a"),r.addCl
assName("changemonth next"),r.update(Q.make("web","arrowright",{})),Event.observ
e(r,"click",this._next_month),e.__sert(r)),l||(this._prev_month=function(e){retu
rn this._change_month(e,this.view_date.getMonth()-1)}.bind(this),a=new Element("
a"),a.addClassName("changemonth prev"),a.update(Q.make("web","arrowleft",{})),Ev
ent.observe(a,"click",this._prev_month),e.__sert(a)),n=new Element("h5"),n.updat
e(Pt("%(month)s %(year)s",{comment:"For example January 2010 . This is used as
part of a calendar."}).format({month:re.month_name(this.view_date.getMonth()),ye
ar:this.view_date.getFullYear()})),e.__sert(n),e.__sert(t),this.container.__date
(e)},render_days:function(){var e,t,n,i,r,o,s,a,_;for(t=new Date(this.view_date.
getFullYear(),this.view_date.getMonth(),1),a=t.getDay(),e=new Element("div"),e.a
ddClassName("days"),n=r=_=a;0>=_?0>r:r>0;n=0>=_?++r:--r)s=new Date(t.getFullYear
(),t.getMonth(),t.getDate()),s.setDate(s.getDate()-n),e.__sert(this.render_day(s
,!0));for(i=new Date(this.view_date.getFullYear(),this.view_date.getMonth(),1);i
.getMonth()===this.view_date.getMonth();)e.__sert(this.render_day(i)),i=new Date
(this.view_date.getFullYear(),this.view_date.getMonth(),i.getDate()+1);for(o=new
Date(this.view_date.getFullYear(),this.view_date.getMonth()+1,0);6!==o.getDay()
;)o=new Date(o.getFullYear(),o.getMonth(),o.getDate()+1),e.__sert(this.render_da
y(o,!0));return e},render_day:function(e,t){var n,i;return i=!t,this.options.las
t_day&&(t=t||e>this.options.last_day),this.options.first_day&&(t=t||e<this.optio
ns.first_day),n=new Element(t?"span":"a"),ke(n).data("date",e),i&&n.addClassName
("current-month"),n.update(e.getDate()),n.addClassName("date"),n.writeAttribute(
"id","day"+e.getDate()+"-"+e.getMonth()),this.selected_date.getDate()===e.getDat
e()&&this.selected_date.getMonth()===e.getMonth()&&this.selected_date.getFullYea
r()===e.getFullYear()&&n.addClassName("selected"),t?n.addClassName("inactive"):(
this._handler=function(e){var t;return t=e.target.identify().substr(3).split("-"
),this.change_date(t[0],this.view_date.getMonth(),this.view_date.getFullYear())}
.bind(this),Event.observe(n,"click",this._handler)),n}});var Ei;Ei=ut.DatePicker
Input=Class.create({initialize:function(e,t){var n,i,r,o;return this.container=e
,this.options={},Object.extend(this.options,t||{}),this.input=this.container.dow
n(".input-date"),this.display=this.container.down(".visible-date"),o=this.input.
value?Kt.from_mysql_date(this.input.value):new Date,this.container.hasAttribute(
"data-first")&&(r=Kt.from_mysql_date(this.container.getAttribute("data-first")))
,n=null!=this.options.disable_future?this.options.disable_future:!0,i=null!=this
.options.disable_past?this.options.disable_past:!0,this.cal_container=this.conta
iner.down(".cal-container"),this.calendar=new ki(this.cal_container,{onDateChang
e:this.onDateChange.bind(this),first_day:r,disable_future:n,disable_past:i,selec
ted_date:o}),this.container.observe("click",this.show_cal.bindAsEventListener(th

is)),$(document.body).observe("click",this.hide_cal.bind(this)),this.onDateChang
e(o)},show_cal:function(e){var t;return e&&Event.stop(e),t=$(e.target),t.match("
.cal-container")||t.up(".cal-container")?void 0:(ke(".cal-container").hide(),thi
s.cal_container.show())},hide_cal:function(){return this.cal_container.hide()},o
nDateChange:function(e){return this.input.value=Kt.to_mysql_date(e,!1),this.disp
lay.update(jr.localize(e)),this.hide_cal()}});var xi;xi=ut.TextInputDatePicker=C
lass.create({initialize:function(e,t){var n,i,r,o;return this.options={include_s
econds:!0,include_microseconds:!0,choose_eod:!1},Object.extend(this.options,t||{
}),this.input=$(e),ft(this.input,"Couldn t find the element "+e.toString()),r=ne
w Date,o=this.input.value?Kt.from_mysql_date(this.input.value):!1,i=new Date(r.g
etUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),this.cal_icon=Q.make("web","cale
ndar_view_month",{align:"absmiddle"}),this.cal_container=new Element("div",{id:"
cal_container_"+e,style:"display: none; position: absolute; z-index: 1"}),this.c
alendar=new ki(this.cal_container,{onDateChange:this.onDateChange.bind(this),las
t_day:i,selected_date:o}),this.input.__sert({after:this.cal_icon}),this.cal_icon
.observe("click",this.toggle_cal.bindAsEventListener(this)),n=ke(this.input),Fe.
clone_position(ke(this.cal_container),n,{setWidth:!1,setHeight:!1,offsetTop:n[0]
.offsetHeight}),this.cal_icon.__sert({after:this.cal_container})},toggle_cal:fun
ction(e){return e&&Event.stop(e),this.cal_container.toggle()},hide_cal:function(
e){return e&&Event.stop(e),this.cal_container.hide()},onDateChange:function(e){r
eturn this.options.choose_eod&&e.setTime(Kt.start_of_day(e).getTime()+86399999),
this.input.value=Kt.to_mysql_date(e,this.options.include_seconds,this.options.in
clude_microseconds),this.hide_cal()}}),U.window_load(ui.register.bind(ui)),ke(mi
.init.bind(mi)),ke(vi.register_all.bind(vi)),Event.observe(window,"scroll",funct
ion(){return gi.hide_all()}),ke(function(){return fi.interval=setInterval(fi.che
ck.bind(fi),500),gi.init()});var Si,bn=function(e,t){function n(){this.construct
or=e}for(var i in t)yn.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.p
rototype=new n,e.__super__=t.prototype,e},yn={}.hasOwnProperty;Si=INLINE_JS.Chan
geNameModal=ut.ChangeNameModal=function(e){function t(){t.__super__.constructor.
call(this,{element_id:"change-name-modal"}),this.on_confirm_button_click=functio
n(e){return function(t){var n,i,r;return t.preventDefault(),n=ke(t.target),i=n.c
losest("form"),r=function(){return e.hide(),location.reload()},li.ajax_submit(i[
0],!1,r,null,n[0])}}(this)}return bn(t,e),t}(xt);var Ci,Ti,kn=function(e,t){retu
rn function(){return e.apply(t,arguments)}},bn=function(e,t){function n(){this.c
onstructor=e}for(var i in t)yn.call(t,i)&&(e[i]=t[i]);return n.prototype=t.proto
type,e.prototype=new n,e.__super__=t.prototype,e},yn={}.hasOwnProperty;Ti=ut.Man
ageAliasModal=function(e){function t(e){this.options=e,this._poll_until_verified
=kn(this._poll_until_verified,this),this._get_params_from_target=kn(this._get_pa
rams_from_target,this),this._on_load=kn(this._on_load,this),this._show_action_pa
nel=kn(this._show_action_panel,this),this._input_enter_handler=kn(this._input_en
ter_handler,this),this.resend_verify=kn(this.resend_verify,this),this.remove_ali
as=kn(this.remove_alias,this),this.add_alias=kn(this.add_alias,this),this.refres
h_alias=kn(this.refresh_alias,this),this.on_show=kn(this.on_show,this),t.__super
__.constructor.call(this,this.options)}return bn(t,e),t.prototype.before_show=fu
nction(e){return t.__super__.before_show.call(this,e),this.polling=0,e.find(".al
ias-action").on("click",this._show_action_panel),e.find(".alias-action-submit").
on("click",this.add_alias),e.find("form").submit(function(){return!1}),e.find(".
alias-action-inputs input").on("keyup",this._input_enter_handler)},t.prototype.o
n_show=function(){return this.refresh_alias(!0,this._poll_until_verified)},t.pro
totype.refresh_alias=function(e,t){return null==e&&(e=!0),e&&li.clear_errors(),n
ew Ajax.DBRequest("/account/alias/get",{subject_user:this.options.subject_user,o
nSuccess:function(e){return function(n){return e.$modal_window.find(".dynamic-co
ntent").html(n.responseText),e._on_load(n),"function"==typeof t?t():void 0}}(thi
s),onFailure:function(e){return function(){return e.hide()}}(this)})},t.prototyp
e.add_alias=function(e){var t,n,i,r;return e.preventDefault(),n=ke(e.currentTarg
et).closest("form"),t=n.find(".alias-action-submit"),r={},r[D.UID_PARAM_NAME]=th
is.options.subject_user.id,i=function(e){return function(){var t;return e.$modal
_window.find(".alias-action-inputs input").val(""),e.polling=0,t=e.polling?null:
e._poll_until_verified,e.refresh_alias(!0,t)}}(this),li.ajax_submit(n[0],!1,i,!1
,t[0],r,"before")},t.prototype.remove_alias=function(e){var t;return e.preventDe

fault(),t=this._get_params_from_target(e.currentTarget),new Ajax.DBRequest("/acc
ount/alias/remove",{subject_user:this.options.subject_user,parameters:t,onSucces
s:function(e){return function(){return e.refresh_alias()}}(this)})},t.prototype.
resend_verify=function(e){var t;return e.preventDefault(),t=this._get_params_fro
m_target(e.currentTarget),new Ajax.DBRequest("/account/alias/send_verify",{subje
ct_user:this.options.subject_user,parameters:t,onSuccess:function(e){return func
tion(){return e.refresh_alias()}}(this)})},t.prototype._input_enter_handler=func
tion(e){return e.preventDefault(),e.stopPropagation(),13===e.which?this.add_alia
s(e):void 0},t.prototype._show_action_panel=function(e){var t,n;return e.prevent
Default(),n=ke(e.currentTarget).data("target"),this.$modal_window.find(".alias-a
ction-panel").hide(),t=this.$modal_window.find("#"+n).show(),t.find("input:visib
le:enabled:first").focus()},t.prototype._on_load=function(){return di.register_a
ll(),this.$dynamic=this.$modal_window.find("#alias-list-container"),this.$dynami
c.on("click",".alias-remove",function(e){return function(t){return e.remove_alia
s(t)}}(this)),this.$dynamic.on("click",".alias-verify",function(e){return functi
on(t){return e.resend_verify(t)}}(this))},t.prototype._get_params_from_target=fu
nction(e){var t,n,i;return t=ke(e),i=t.data("alias-type"),n=t.closest(".alias-ro
w").find(".alias-text").text(),{alias:n,alias_type:i}},t.prototype._poll_until_v
erified=function(){var e,t,n,i;return t=5,e=60,n=function(e){return function(){r
eturn e.refresh_alias(!1,e._poll_until_verified)}}(this),i=this.$dynamic.find(".
alias-verify").length,i&&this.polling<e?(this.polling++,setTimeout(n,1e3*t)):thi
s.polling=0},t}(xt),Ci=INLINE_JS.AliasManager=ut.AliasManager={show:function(e){
var t,n,i,r;if(r=K.get_viewer().get_user_by_role(e),null!=r){if(!r.is_email_veri
fied)return void(e===D.ROLE_PERSONAL?personal_email_verification.verified_or_sho
w():work_email_verification.verified_or_show());i=K.get_viewer().is_paired?e:"",
n=Pt("Manage your %(role_show)s contact methods").format({role_show:i}),t=new Ti
({element_id:"manage-alias",title:n,subject_user:r,role:r.role}),t.show()}}};var
Ai;Ai=INLINE_JS.BonusTable=ut.BonusTable={_tmpl:null,_inited:null,_next_page:0,
_fetching_page:!1,init:function(e){return this.user_id=e,Ai._inited?void 0:(Ai._
inited=!0,$("bonus-loading").show(),Ai._tmpl=ot.tmpl("bonus_row_tmpl"),Ai.listen
(),Ai.get_next_page())},_render:function(e){var t,n,i,r;for(t=[],n=0,i=e.length;
i>n;n++)r=e[n],t.push(Ai._tmpl({row:r,Sprite:Q}));return $("bonus-table").__sert
(t)},get_next_page:function(){return Ai._fetching_page?void 0:(Ai._fetching_page
=!0,new Ajax.DBRequest("/account/bonus_page/"+Ai._next_page,{onSuccess:function(
e){var t,n,i;return t=e.responseText.evalJSON(),i=t.rows,n=t.has_more,Ai._render
(i),$("bonus-loading").hide(),n?(Ai._next_page+=1,$("load-more-bonus").show()):$
("load-more-bonus").hide(),Ai._fetching_page=!1},subject_user:this.user_id}))},_
max_referral_over:function(e){var t,n,i;return n=ke(e.currentTarget),i=Pt("You v
e earned the maximum amount of referral space. Thanks for inviting people to Dro
pbox!"),t=ke(ci.make(i,"right","middle")),Element.absolutize(t[0]),n.append(t),F
e.clone_position(t,n,{setWidth:!1,setHeight:!1}),t.css({width:"200px",left:parse
Int(t.css("left"),10)-210+"px",top:parseInt(t.css("top"),10)-55+"px"})},_max_ref
erral_out:function(){var e,t,n,i,r;for(i=ke(".reached-max-referral-bonus .bubble
"),r=[],t=0,n=i.length;n>t;t++)e=i[t],r.push(e.remove());return r},listen:functi
on(){return ke("#load-more-bonus").on("click",Ai.get_next_page.bind(Ai)),ke(docu
ment).on("mouseenter",".reached-max-referral-bonus",Ai._max_referral_over),ke(do
cument).on("mouseleave",".reached-max-referral-bonus",Ai._max_referral_out)},tog
gle:function(){return ke("#bonus-list").is(":visible")?(this.hide(),ke("#space-e
arned-link").text(Pt("View all space earned"))):(this.show(),ke("#space-earned-l
ink").text(Pt("Hide space earned")))},show:function(){return ke("#bonus-list").s
lideDown(150)},hide:function(){return ke("#bonus-list").slideUp(150)}};var Di,Oi
,Ni;Di=INLINE_JS.DowngradeReasons=ut.DowngradeReasons={reasons:{},addReason:func
tion(e){return this.reasons[e]=!0},addReasons:function(e){var t,n,i,r;for(r=[],t
=0,i=e.length;i>t;t++)n=e[t],r.push(this.addReason(n));return r},change:function
(e,t,n){var i,r,o,s,a,_;e=parseInt(e,10),r=$(t),ft(r,"Couldn t find container fo
r DowngradeReason"),i=!1,a=this.reasons;for(s in a)o=a[s],_=$(n+s),ft(_,"Couldn
t find container for ",n+s),o&&parseInt(s,10)===e?(_.show(),i=!0):_.hide();retur
n i?r.show():r.hide()}},Oi=ut.DowngradeReasons2={init:function(){var e,t,n,i;for
(i=["input[name=downgrade_reason_id]","input[name=other_reason_id]"],e=0,t=i.len
gth;t>e;e++)n=i[e],ke(n).change(function(e){var t;return t=e.target.id.indexOf("

other")>=0,Oi.change(t,e.target.getValue())});return ke(".shared-additional-info
").attr("name","shared_additional_info")},change:function(e,t){var n;return ke("
.downgrade-other-reason .error-message").hide(),e?void 0:(n="#downgrade-info-"+t
,ke(".downgrade-info").hide(),ke(n).show(),ke(".downgrade-info textarea").remove
Attr("name"),ke(n+" textarea").attr("name","additional_info"),ke("input[name=oth
er_reason_id]").removeAttr("checked"))}},Ni=ut.DowngradeSurvey={init:function(){
var e;return e="#downgrade-survey-form",ke(""+e).on("submit",function(){return f
unction(t){var n,i;return i=ke(e+" input[name=other_reason_id]:checked").length,
n=ke(e+" input[id=downgrade-radio-8]"),n.is(":checked")&&0===i?(ke(".downgrade-o
ther-reason .error-message").show(),t.preventDefault()):void 0}}(this))}};var $i
;$i=INLINE_JS.GetSpace=ut.GetSpace={_current_space:null,_why_msg:null,_twitter_u
rl:null,offer_highlight_color:"#ffa",init:function(e,t,n){var i;return $i._curre
nt_space=e,$i._why_msg=t,$i._twitter_url=n,$("space-actions").on("click",".space
-action",$i.perform_action),i=o.parse(window.location.href).fragment,i?$i.highli
ght_offer(i):void 0},highlight_offer:function(e){var t,n;return t=ke("#"+e),n=t.
css("background-color"),t.css("background-color",$i.offer_highlight_color).delay
(2e3).animate({"background-color":n}).queue(function(){return t.css("backgroundcolor","")})},perform_action:function(e){var t,n;return n={contact_sales:$i._con
tact_sales,contact_support:$i._contact_support,teams:$i._teams,upgrade:$i._upgra
de,plans:$i._plans,refer:$i._refer,get_started:$i._get_started,fb_link:$i._fb_li
nk,twitter_link:$i._twitter_link,twitter_follow:$i._twitter_follow,why_like:$i._
why_like,mailbox_link:$i._mailbox_link},t=$(e.target),t.hasClassName("space-acti
on")||(t=t.up(".space-action")),n[t.id]()},_teams:function(){return window.locat
ion.href="/business?tk=dropbox&ag=getspace&ad=v1"},_contact_sales:function(){ret
urn window.location.href="mailto:sales@dropbox.com"},_contact_support:function()
{return window.location.href="/support"},_plans:function(){return window.locatio
n.href="/plans"},_upgrade:function(){
return window.location.href="/upgrade"},_refer:function(){return window.location
.href="/referrals"},_get_started:function(){return window.location.href="/gs"},_
fb_link:function(){return B.do_auth(function(){return $i._refresh_link_bonuses()
,$i._completed($("fb_link"))},K.get_viewer().personal_user.id)},_twitter_link:fu
nction(){return Vr.do_auth(function(){return $i._refresh_link_bonuses(),Vr.set_i
s_authed(K.get_viewer().personal_user.id,!0),$i._completed($("twitter_link"))},K
.get_viewer().personal_user.id)},_twitter_follow:function(){return Vr.is_authed(
K.get_viewer().personal_user.id)?$i.follow_dropbox():Vr.do_auth($i.follow_dropbo
x,K.get_viewer().personal_user.id)},_why_like:function(){return pi.show(Pt("Tell
us why you love Dropbox"),$("why-i-like-modal")),$("why-i-like-input").focus(),
Kt._track_twitter_chars_left("why-i-like-input",90)},_mailbox_link:function(){re
turn window.location.href="http://www.mailboxapp.com/"},follow_dropbox:function(
){return Vr.is_authed(K.get_viewer().personal_user.id)||($i._refresh_link_bonuse
s(),Vr.set_is_authed(K.get_viewer().personal_user.id,!0)),Vr.follow_dropbox({sho
wWorking:function(){return $("twitter_follow").down(".title").__date(Pt("Followi
ng Dropbox on Twitter..."))},onFailure:function(){return $("twitter_follow").dow
n(".title").__date(Pt("Follow Dropbox on Twitter"))},onSuccess:function(){return
$("twitter_link")&&$("twitter_link").visible()&&$i._completed($("twitter_link")
),$i._completed($("twitter_follow"))}},K.get_viewer().personal_user.id)},submit_
why:function(){return $i._why_msg=$F("why-i-like-input"),li.ajax_submit($("why-i
-like-form"),!1,function(){return pi.hide(),$i._completed($("why_like"))},!1,$("
why-i-like-submit"))},_completed:function(e){var t;return e.addClassName("comple
ted"),e.down(".icon-col").__date(Element("img",{src:"/static/images/check_36-vfl
imxFPn.png"})),ke(e).css("opacity",.5).fadeTo(500,1),setTimeout(function(){retur
n ke(e).css("opacity",1).slideUp().animate({opacity:0},{queue:!1,duration:"norma
l"})},1500),t=parseInt(e.down(".space").readAttribute("data-space"),10),$i._curr
ent_space+=t,$("current-space").__date(q.format_bytes($i._current_space)),$("cur
rent-space").addClassName("updated"),setTimeout(function(){return $("current-spa
ce").removeClassName("updated")},5e3)},_refresh_link_bonuses:function(){return n
ew Ajax.DBRequest("/social_recheck")}};var Ii;Ii=ut.Help={toggle_more_help:!1,sh
ow_os:function(e,t,n){return t=$(t),$$(".os-filter").invoke("removeClassName","s
elected"),t.addClassName("selected"),$$(".help-os-section").invoke("hide"),$$(".
help-os-"+n).invoke("show"),Event.stop(e)},vote:function(e,t){return new Ajax.DB

Request("/help/"+e+"/vote/"+t),ke("#help-vote-cont").fadeOut(),b.success(Pt("Tha
nks for your feedback!"))}};var Li,Ri,Mi,Fi,kn=function(e,t){return function(){r
eturn e.apply(t,arguments)}},bn=function(e,t){function n(){this.constructor=e}fo
r(var i in t)yn.call(t,i)&&(e[i]=t[i]);return n.prototype=t.prototype,e.prototyp
e=new n,e.__super__=t.prototype,e},yn={}.hasOwnProperty;Ri=INLINE_JS.Hosts=ut.Ho
sts={attach_host_listener:function(e,t){var n,i,r,o;return n=ke("#"+e),r=n.data(
"host-ids"),i=n.data("display-name"),o=function(){return new Mi(r,i,t,null,null)
.show()},ke(".unlink-host-link",n).on("click",o),n.on("dblclick",function(){retu
rn Ri.edit(r,e)})},edit:function(e,t){var n,i,r,o,s,a;return r=ke("#"+t+" .hostitem .sprite-text"),"true"===r.data("editing")?!1:(r.data("editing","true"),i=r.
text(),r.data("previous",i),e=v.values(e),o=ke( <input type="text" class="name-i
nput skinny-input" size="20" maxlength="256" style="word-wrap: break-word;" /> )
.val(i),a=ke( <input type="button" class="button"> ).val(Pt("Save")),a.on("click
",function(){return Ri.doneEditing(e,t)}),n=ke( <input type="button" class="butt
on grayed"> ).val(Pt("Cancel")),n.on("click",function(){return Ri.cancelEditing(
t)}),r.empty(),r.append(o,"&nbsp;",a,"&nbsp;",n),s=ke("input",r),s.on("keydown",
function(){return Ri.checkKey(e,t)}),s.focus(),!1)},doneEditing:function(e,t){va
r n,i;return n=ke("#"+t+" .host-item .sprite-text"),i=ke("input",n).val(),ke.aja
x({url:"/account/change_host_name",data:{host_ids:JSON.stringify(e),name:i},type
:"POST"}).success(function(e){return Ri.unedit(n,JSON.parse(e).display_name)})},
cancelEditing:function(e){var t;return t=ke("#"+e+" .host-item .sprite-text"),Ri
.unedit(t,t.data("previous"))},unedit:function(e,t){return e.data("editing","fal
se"),e.text(t)},dismiss:function(e,t,n,i,r){return new ke.ajax("/account/dismiss
_unlink",{type:"POST",data:{host_id:e,user_id:t,team_id:n},subject_user:r,succes
s:function(){return i.remove()}}),!1},checkKey:function(e,t){return function(n){
return n=n||window.event,n.keyCode===Event.KEY_RETURN&&Ri.doneEditing(e,t),n.key
Code===Event.KEY_ESC?Ri.cancelEditing(t):void 0}},show_device_unlink_modal:funct
ion(e,t,n,i,r,o){var s,a;return s=ke("#unlink-device-modal-"+r),a={both:v.values
(i),personal:[i[D.ROLE_PERSONAL]],work:[i[D.ROLE_WORK]]},pi.show(n,s[0]),v.value
s(i).length>1&&s.addClass("show-selector"),ke("form input[type=submit]",s).on("c
lick",function(n){return n.preventDefault(),i=a[ke(".unlink-select select",s).va
l()],li.add_vars(ke("form",s)[0],{user_ids:JSON.stringify(i),app_id:t,device_id:
JSON.stringify(e),device_name:o}),ke("form",s).submit()})}},Li=ut.DeleteFailures
Modal=function(e){function t(){return this.on_show=kn(this.on_show,this),this.on
_confirm_button_click=kn(this.on_confirm_button_click,this),t.__super__.construc
tor.apply(this,arguments)}return bn(t,e),t.prototype.on_confirm_button_click=fun
ction(e){return e.preventDefault(),window.location.href="/delete_failures?host_i
d="+this.host_id,this.hide()},t.prototype.on_show=function(){var e;return e=Ft("
Dropbox couldn t delete %(num_failures)d file from the computer <strong>%(host_n
ame)s</strong>. You can download the name of this file and the reason why it cou
ldn t be deleted.","Dropbox couldn t delete %(num_failures)d files from the comp
uter <strong>%(host_name)s</strong>. You can download the names of these files a
nd the reasons why they couldn t be deleted.",this.num_failures).format({host_na
me:this.name.escapeHTML(),num_failures:this.num_failures}),this.$modal_window.fi
nd(".failures_message").html(e)},t}(xt),Fi=INLINE_JS.show_delete_failures_modal=
ut.show_delete_failures_modal=function(e,t,n){var i;return i=new Li({element_id:
"delete-failures-modal"}),i.host_id=e,i.name=t,i.num_failures=n,i.show(),!1},Mi=
INLINE_JS.UnlinkHostModal=ut.UnlinkHostModal=function(e){function t(e,n,i,r,o){t
his.host_ids=e,this.name=n,this.delete_support_type=i,this.owner_id=r,this.team_
id=o,this.on_show=kn(this.on_show,this),this._set_delete_text=kn(this._set_delet
e_text,this),this.fail_callback=kn(this.fail_callback,this),this.success_callbac
k=kn(this.success_callback,this),this.on_confirm_button_click=kn(this.on_confirm
_button_click,this),t.__super__.constructor.call(this,{element_id:"unlink-host-m
odal"}),this.show_host_selector=v(this.host_ids).values().length>1}return bn(t,e
),t.prototype.on_confirm_button_click=function(e){var t,n,i;return e.preventDefa
ult(),n=this.$modal_window.find(".unlink_host_form")[0],t=$(this.$modal_window.f
ind(".confirm-button")[0]),this.$modal_window.find("[type=button]").attr("disabl
ed",""),i={host_ids:JSON.stringify(this.get_selected_hosts())},li.ajax_submit(n,
!1,this.success_callback,this.fail_callback,t,i)},t.prototype.success_callback=f
unction(){return window.location.reload()},t.prototype.fail_callback=function(){

return this.$modal_window.find("[type=button]").removeAttr("disabled")},t.protot
ype._set_delete_text=function(e){return this.$modal_window.find(".delete_data_la
bel").text(e)},t.prototype._get_unlink_select=function(){return this.$modal_wind
ow.find(".unlink-select select").val()},t.prototype._clear_delete_checkbox=funct
ion(){return this.$modal_window.find(".delete_data").prop("checked",!1)},t.proto
type.on_show=function(){var e;return this._clear_delete_checkbox(),this.delete_s
upport_type===c.DELETE_ON_UNLINK_OLD_CLIENT?this.$modal_window.find(".unlink_hos
t_modal_content").addClass("show_old_client_modal"):this.delete_support_type===c
.DELETE_ON_UNLINK_UNSUPPORTED?this.$modal_window.find(".unlink_host_modal_conten
t .unlink_host_form").addClass("hidden"):this.delete_support_type===c.DELETE_ON_
UNLINK_SUPPORTED_TEAM_ONLY?(this.$modal_window.find(".unlink-choice").change(fun
ction(e){return function(){return e._get_unlink_select()===D.ROLE_PERSONAL?e.$mo
dal_window.find(".new_client").hide():e.$modal_window.find(".new_client").show()
}}(this)),this._set_delete_text(Pt("Delete files from %(team_name)s Dropbox the
next time this computer comes online.").format({team_name:K.get_viewer().team_na
me}))):this.delete_support_type===c.DELETE_ON_UNLINK_SUPPORTED_PERSONAL_ONLY?(th
is.$modal_window.find(".unlink-choice").change(function(e){return function(){ret
urn e._get_unlink_select()===D.ROLE_WORK?e.$modal_window.find(".new_client").hid
e():e.$modal_window.find(".new_client").show()}}(this)),this._set_delete_text(Pt
("Delete files from my personal Dropbox the next time this computer comes online
."))):this.delete_support_type===c.DELETE_ON_UNLINK_SUPPORTED&&(this._set_delete
_text(Pt("Delete files from these Dropboxes the next time this computer comes on
line.")),this.$modal_window.find(".unlink-choice").change(function(e){return fun
ction(){return e._set_delete_text(e._get_unlink_select()===D.ROLE_PERSONAL?Pt("D
elete files from my personal Dropbox the next time this computer comes online.")
:e._get_unlink_select()===D.ROLE_WORK?Pt("Delete files from %(team_name)s Dropbo
x the next time this computer comes online.").format({team_name:K.get_viewer().t
eam_name}):Pt("Delete files from these Dropboxes the next time this computer com
es online."))}}(this))),this.show_host_selector&&(e="<span class= host_name ></s
pan>",this.$modal_window.find(".unlink-select").removeClass("hidden"),this.$moda
l_window.find(".unlink-modal-text").html(Pt("Which Dropboxes do you want to unli
nk from %(host_name)s? Any Dropbox you unlink will immediately stop syncing.").f
ormat({host_name:e}))),this.$modal_window.find("[name=host_id]").attr("value",th
is.host_id),this.$modal_window.find("[name=team_id]").attr("value",this.team_id)
,this.$modal_window.find("[name=user_id]").attr("value",this.owner_id),this.$mod
al_window.find(".host_name").text(this.name)},t.prototype.get_selected_hosts=fun
ction(){var e;return 1===v.values(this.host_ids).length?v.values(this.host_ids):
(e=ke(".unlink-choice").val(),"both"===e?v.values(this.host_ids):[this.host_ids[
e]])},t}(xt);var Pi;Pi=ut.News={DEFAULT_TAB:"recent-news",init:function(){return
$("news-home").on("click","#nav a",function(e,t){var n;return t.hasAttribute("d
ata-div")?(e.preventDefault(),n=t.readAttribute("data-div"),p.push_state("/news/
"+n)):void 0}),p.add_callback("/news",Pi.history_change)},change_tab:function(e)
{var t;return t=$$("#nav a[data-div="+e+"]").first(),$(t)?($$(".section").invoke
("removeClassName","selected"),$$("#nav a").invoke("removeClassName","selected")
,$(t).addClassName("selected"),$(e).addClassName("selected")):void 0},history_ch
ange:function(e){return e=e||Pi.DEFAULT_TAB,Pi.change_tab(e)}};var qi;qi=ut.Reco
ver={init:function(){var e;return e=$("recover-form"),e.observe("submit",this.fo
rm_submit.bind(this))},form_submit:function(e){return this.clear_error(),e.preve
ntDefault(),li.ajax_submit($("recover-form"),null,this.submit_response.bind(this
))},submit_response:function(e){var t;return t=JSON.parse(e.responseText),"error
"===t.status&&this.show_error(t.msg),"ok"===t.status&&this.show_hosts(t),"redire
ct"===t.status?window.location.href=t.url:void 0},show_hosts:function(e){var t,n
,i,r,o,s,a;for(li.add_vars($("recover-form"),{check_file:"true"}),$("filename-to
-create").update(e.filename),n=$("trusted-hosts"),n.update(),a=e.hosts,i=0,o=a.l
ength;o>i;i++)t=a[i],s=new Element("li"),r="lnx","mac"===t.platform&&(r="osx"),"
win"===t.platform&&(r="win"),s.__sert(Q.make("web",r)),s.__sert(new ot(t.display
_name.escapeHTML())),n.appendChild(s);return $("login-step").hide(),$("hosts-ste
p").show()},show_error:function(e){return $("error-messages").update(e),$("error
-messages").show()},clear_error:function(){return $("error-messages").update()}}
;var Ui;Ui=ut.Restore={next:function(){var e,t;return t=ke("ul.selected"),e=t.ne

xt("ul"),e.addClass("selected"),t.removeClass("selected"),e.next("ul").length?ke
("#next-page").show():ke("#next-page").hide(),ke("#prev-page").show(),Ui.inc_pag
e(1)},prev:function(){var e,t;return t=ke("ul.selected"),e=t.prev("ul"),e.addCla
ss("selected"),t.removeClass("selected"),e.prev("ul").length?ke("#prev-page").sh
ow():ke("#prev-page").hide(),ke("#next-page").show(),Ui.inc_page(-1)},inc_page:f
unction(e){var t,n;return t=parseInt(ke("#page_num").text(),10),n=t+e,ke("#page_
num").text(n)},init:function(e,t,n){var i;return i=K.get_viewer().get_user_by_id
(n),ke("#next-page").on("click",function(e){return Ui.next(e),!1}),ke("#prev-pag
e").on("click",function(e){return Ui.prev(e),!1}),ke("#restore-submit-button").o
n("click",function(){return _i.do_folder_restore(e,i),!1}),ke("#restore-cancel-b
utton").on("click",function(){return nt.redirect(t)}),ke("#restore-back-button")
.on("click",function(){return nt.redirect(t)})}};var ji,Bi,zi,Hi,Vi,kn=function(
e,t){return function(){return e.apply(t,arguments)}},bn=function(e,t){function n
(){this.constructor=e}for(var i in t)yn.call(t,i)&&(e[i]=t[i]);return n.prototyp
e=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},yn={}.hasOwnProperty;
ji=ut.SelectRoleModal=function(e){function t(){return this.on_show=kn(this.on_sh
ow,this),t.__super__.constructor.apply(this,arguments)}return bn(t,e),t.prototyp
e.on_select_role=null,t.prototype.on_show=function(){return ke(".role-options li
").click(function(e){return function(t){var n,i;return n=ke(t.target).closest("l
i"),i=n.data("role"),ft(e.on_select_role,"missing on_select_role implementation"
),e.on_select_role(i),e.hide()}}(this))},t}(xt),zi=ut.SharedFolderSelectRoleModa
l=function(e){function t(){return t.__super__.constructor.apply(this,arguments)}
return bn(t,e),t.prototype.on_select_role=function(e){var t;return t=function(){
return Un.role_picker.ensure_role_is_visible(e),tn.start_wizard_for_user(K.get_v
iewer().get_user_by_role(e))},e===ie.logged_out_role?ie.show_modal({role:e,on_su
ccess:t}):t()},t}(ji),Hi=ut.ShmodelC2DSelectRoleModal=function(e){function t(){r
eturn t.__super__.constructor.apply(this,arguments)}return bn(t,e),t.prototype.o
n_select_role=function(e){var t;return t=function(){return Wn.show_c2d_modal(e)}
,K.get_viewer().is_role_signed_in(e)?t():ie.show_modal({role:e,on_success:t})},t
}(ji),Vi=ut.ShmodelSyncSelectRoleModal=function(e){function t(){return t.__super
__.constructor.apply(this,arguments)}return bn(t,e),t.prototype.on_select_role=f
unction(e){var t;return t=function(){return Wn.request_shared_folder_sync(e)},K.
get_viewer().is_role_signed_in(e)?t():ie.show_modal({role:e,on_success:t})},t}(j
i),Bi=ut.ShareShmodelSelectRoleModal=function(e){function t(){return this.on_sel
ect_role=kn(this.on_select_role,this),t.__super__.constructor.apply(this,argumen
ts)}return bn(t,e),t.prototype.on_select_role=function(e){return Wn.prompt_login
_then_share(this.options.link_url,this.options.short_url,this.options.tokenizer_
type,e)},t}(ji);var Yi;Yi=ut.TabController=Class.create({initialize:function(e,t
){var n;return n=$(e),ft(n,e+" is missing."),this.container=n,this.options={kill
Event:!0},Object.extend(this.options,t),this.listen()},listen:function(){var e,t
,n,i,r,o;for(o=this,i=this.container.select("a"),r=[],t=0,n=i.length;n>t;t++)e=i
[t],ft(e.id&&e.id.length>0,"Element is missing an id"),r.push(e.observe("click",
function(e){return this.click(e)}.bindAsEventListener(o)));return r},click:funct
ion(e){return this.options.killEvent&&Event.stop(e),this.toggle($(e.target))},to
ggle:function(e){var t,n,i,r,o;return o=this.container.down("a.selected"),o&&(r=
$(o.id+"-content"),r&&r.hide()),this.container.select(".selected").invoke("remov
eClassName","selected"),n=!1,e||(e=this.container.down("a"),n=!0),e.addClassName
("selected"),t=$(e.id+"-content"),t&&t.show(),this.options.onTabChange&&this.opt
ions.onTabChange(e,o),this.options.url_prefix?(i=this.options.url_prefix,n||(i+=
"/"+e.id),p.push_state(i)):void 0}});var Wi;Wi=ut.InviteForm={initialized:!1,ini
t:function(){return this.initialized?void 0:ke(function(e){return function(){ret
urn e.add_auto_completer=new Autocompleter.ContactsTokenizer(K.get_viewer().get_
user_by_role(D.ROLE_WORK),"team-invite-new-collab-input","team-invite-new-whobul
k","team-invite-hidden-input",{tokens:[",",";"],hide_import_contacts:!0,suggesti
ons_disabled:!0,contact_filter:function(e){return e.excludeTeamMembers().exclude
Facebook().excludeNewStyleGroups().excludeMe()}}),e.add_auto_completer.clearToke
ns(),e.tokenAdd=ke.proxy(e._tokenAdd,e),e.tokenRemove=ke.proxy(e._tokenRemove,e)
,ke("#team-invite-new-collab-input")[0].on("token:add",e.tokenAdd),ke("#team-inv
ite-new-collab-input")[0].on("token:remove",e.tokenRemove),e.reset_licenses(),e.
update_free_licenses_message(),e.initialized=!0,e.setup_tab_support(ke),mi.init(

)}}(this))},set_emails:function(e){return null!=e?ke(function(t){return function


(){var n,i,r,o,s;for(t.init(),s=[],r=0,o=e.length;o>r;r++)n=e[r],i=t.add_auto_co
mpleter.createTokenInfo(null,n,_e.EMAIL),s.push(t.add_auto_completer.addContact(
i));return s}}(this)):void 0},rebind_modal_submit_autocompleter:function(){var e
,t;return e=this.invite_modal.$modal_window,t=e.find(".tokenizer-submit-button")
,t.on("mousedown",function(e){return function(){return e.add_auto_completer.befo
reSubmit()}}(this)),this.setup_tab_support(e)},setup_tab_support:function(e){ret
urn e.find("#team-invite-new-collab-input").first().on("keyup change",function()
{var t;return t=e.find(".new-collab-input").first(),""!==t.val()?t.attr("tabinde
x",-1):t.removeAttr("tabindex")})},reset_modal_licenses:function(){var e,t,n;ret
urn n=null!=__CIRCULAR_DEPENDENCY__.Dashboard?__CIRCULAR_DEPENDENCY__.Dashboard.
get_licensed_members():null!=__CIRCULAR_DEPENDENCY__.MembersReact?__CIRCULAR_DEP
ENDENCY__.MembersReact.get_licensed_members():window.active_team_member_table.ge
t_licensed_members(),this.total_licenses=null!=(e=null!=(t=__CIRCULAR_DEPENDENCY
__.MembersReact)&&"function"==typeof t.get_total_licenses?t.get_total_licenses()
:void 0)?e:this.total_licenses,this.update_used_licenses(n),this.available_licen
ses=this.total_licenses-this.used_licenses,this.update_license_count(),this.new_
users=0},reset_licenses:function(){return this.available_licenses=this.total_lic
enses-this.used_licenses,this.update_license_count(),this.new_users=0},get_new_u
sers:function(){return this.new_users},_tokenAdd:function(){return this.availabl
e_licenses--,ke(window).trigger("token:changed",{remaining_licenses:this.availab
le_licenses}),this.new_users++},_tokenRemove:function(){return this.available_li
censes++,ke(window).trigger("token:changed",{remaining_licenses:this.available_l
icenses}),this.new_users--},already_invited_user:function(e){var t,n,i;if(window
.active_team_member_table){t=window.active_team_member_table.data.users;for(i in
t)if(n=t[i],n.email===e)return!0}},update_license_count:function(){var e,t;retu
rn e=ke("#license-count-message"),this.available_licenses<0?(t=Pt("You need more
licenses for this invitation."),e.addClass("over")):0===this.available_licenses
?(t=Pt("You have no remaining licenses."),e.removeClass("over")):this.available_
licenses>0?(t=Ft("You have %(invites)d remaining license.","You have %(invites)d
remaining licenses.",this.available_licenses).format({invites:this.available_li
censes}),e.removeClass("over")):t="You have remaining licenses.",e.text(t)},init
_modal_licenses:function(e,t,n,i){return this.total_licenses=e,this.is_trial=t,t
his.allow_trial_add_licenses=n,this.is_trial&&!this.allow_trial_add_licenses&&(i
=void 0),this.invite_modal||(this.invite_modal=new Ki(i,this.is_trial)),ke("body
").trigger("invite-modal-initialized")},update_used_licenses:function(e){return
this.used_licenses=e,this.reset_licenses()},init_form_licenses:function(e,t,n){r
eturn this.total_licenses=e,this.used_licenses=t,this.is_trial=n,Wi.reset_licens
es()},add_total_licenses:function(e){return e=e||0,e>0&&(this.total_licenses+=e,
this.available_licenses+=e,this.update_license_count(),null!=__CIRCULAR_DEPENDEN
CY__.Dashboard)?__CIRCULAR_DEPENDENCY__.Dashboard.add_licenses(e):void 0},on_add
_licenses_exit:function(e,t){var n;return(null!=(n=this.invite_modal)?n.$modal_w
indow:void 0)&&this.rebind_modal_submit_autocompleter(),this.add_total_licenses(
t)},reset_modal:function(){var e;return e=this.invite_modal.$modal_window,vi.res
et(e.find("#team-invite-message")[0]),this.add_auto_completer&&(this.add_auto_co
mpleter.clearTokens(),this.add_auto_completer.update.hide()),this.reset_modal_li
censes(),e.find(".new-collab-input").val("")},on_add_licenses_click:function(e){
var t;return e.preventDefault(),this.is_trial&&!this.allow_trial_add_licenses?(n
ull!=(t=this.invite_modal)&&t.hide(),__CIRCULAR_DEPENDENCY__.add_more_licenses_t
o_trial()):(null!=this.add_licenses_cb&&St.unregister(__CIRCULAR_DEPENDENCY__.Ad
dLicensesModal.LICENSES_ADDED,this.add_licenses_cb),this.add_licenses_cb=ke.prox
y(this.on_add_licenses_exit,this),St.register(__CIRCULAR_DEPENDENCY__.AddLicense
sModal.LICENSES_ADDED,this.add_licenses_cb),St.push(new __CIRCULAR_DEPENDENCY__.
AddLicensesModal))},update_free_licenses_message:function(){var e;return e=this.
invite_as_limited(),ke(".team-invite-add-licenses").toggle(!e),ke("#license-coun
t-message").toggle(!e),ke("#license-free-message").toggle(e)},invite_as_limited:
function(){var e;return e=ke( input[name="membership_type"] ),e&&e.is(":checked"
)}};var Ki,kn=function(e,t){return function(){return e.apply(t,arguments)}},bn=f
unction(e,t){function n(){this.constructor=e}for(var i in t)yn.call(t,i)&&(e[i]=
t[i]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e

},yn={}.hasOwnProperty;Ki=ut.InviteModal=function(e){function t(e,n){this.transi
tion_view_model=e,this.is_trial=n,this._reset=kn(this._reset,this),this._update_
form_pricing_information=kn(this._update_form_pricing_information,this),this._up
date_remaining_licenses_message=kn(this._update_remaining_licenses_message,this)
,this._make_transition_info_request=kn(this._make_transition_info_request,this),
this._handle_token_change=kn(this._handle_token_change,this),this._licenses_tota
l=kn(this._licenses_total,this),this.is_making_transition_info_request=kn(this.i
s_making_transition_info_request,this),this.on_hide=kn(this.on_hide,this),this.o
n_show=kn(this.on_show,this),t.__super__.constructor.call(this,{element_id:"team
-invite-wizard",focus:".new-collab-input",title:Pt("Invite team members")}),this
.inline_add_license=null!=this.transition_view_model,this.inline_add_license&&(t
his.transition_info_fetcher=new Bt([this.transition_view_model]),this.probabilit
y=Math.random()),this.skip_reset=!1,this.making_transition_info_request=!1,this.
transition_info_callback=null}return bn(t,e),t.prototype.on_confirm_button_click
=function(e){var t;return t=Wi.invite_as_limited()?0:this.add_qty,ir.add_users(e
,t)},t.prototype.on_show=function(){var e,t;return this._reset(),t=ke( input[nam
e="membership_type"] ),null!=t&&t.attr("checked",!1),null!=t&&t.click(function(e
){return function(){return Wi.update_free_licenses_message(),e._updated_charges_
messages(Wi.invite_as_limited())}}(this)),e=ke("#team-invite-wizard .team-invite
-add-licenses"),e.on("click",ke.proxy(Wi.on_add_licenses_click,Wi)),ke(window).o
n("token:changed",this._handle_token_change),Wi.initialized&&(li.clear_errors(),
Wi.update_license_count(),Wi.update_free_licenses_message()),St.register(St.CLEA
R,function(){return Wi.reset_modal()})},t.prototype.on_hide=function(){return ke
(window).off("token:changed",this._handle_token_change)},t.prototype.is_making_t
ransition_info_request=function(){return this.making_transition_info_request},t.
prototype._licenses_to_add=function(){return-1*Wi.available_licenses},t.prototyp
e._licenses_total=function(){return Wi.total_licenses+this._licenses_to_add()},t
.prototype._getInvitesCount=function(){return Wi.total_licenses-Wi.used_licenses
-Wi.available_licenses},t.prototype._handle_token_change=function(e,t){return th
is.remaining_licenses=t.remaining_licenses,this._updateConfirmButton(),this._upd
ate_remaining_licenses_message(),this.inline_add_license?(clearTimeout(this.fetc
h_transition_timeout_id),this.fetch_transition_timeout_id=setTimeout(function(e)
{return function(){return e._make_transition_info_request(),e.fetch_transition_t
imeout_id=null}}(this),100)):void 0},t.prototype._make_transition_info_request=f
unction(){var e,t,n,i;return this.making_transition_info_request=!0,t=Math.floor
(1e6*Math.random()),this.current_callback_token=t,e=this._licenses_to_add(),n=th
is._licenses_total(),i=function(i){return function(r){return i._update_form_pric
ing_information(t,e,n,null!=r?r[0]:void 0)}}(this),e>0?this.transition_info_fetc
her.get(i,{total_users:this._licenses_total()}):i(null)},t.prototype._update_rem
aining_licenses_message=function(){var e;return e=this._get_remaining_licenses_m
essage(this.remaining_licenses),this.$modal_window.find("#license-count-message"
).text(e)},t.prototype._get_remaining_licenses_message=function(e){var t;return
t=0>e?Pt("You need more licenses for this invitation."):0===e?Pt("After this inv
itation, you ll have no remaining licenses."):Ft("After this invitation, you ll
have %(count)d remaining license.","After this invitation, you ll have %(count)d
remaining licenses.",e).format({count:e})},t.prototype._update_form_pricing_inf
ormation=function(e,t,n,i){var r,o,s,a,_;if(e===this.current_callback_token)retu
rn i&&t>0?(this.add_qty=t,r=this.transition_view_model.state.currency,a=i.curren
t_total.amount,s=Ut.formatCurrency(a,r),_=Ut.formatCurrency(i.recurring_total.am
ount,r),o=this.is_trial?0:a,ke(".new-amount").text(s),ke(".add-qty").text(t),ke(
".recurring-amount").text(_),ke(".total-qty").text(n),ke("#expected_price").val(
o),this._updated_charges_messages(Wi.invite_as_limited())):this._reset(),this.ma
king_transition_info_request=!1},t.prototype._updateConfirmButton=function(e){va
r t,n;return null==e&&(e=!1),t=ke(".team-invite-buttons .confirm-button"),n=e?Pt
(this.is_trial?"Invite and add":"Invite and buy"):Ft("Send invite","Send invites
",this._getInvitesCount()),t.val(n)},t.prototype._reset=function(){return this.a
dd_qty=0,ke(".charges-section").hide(),ke("#expected_price").val(0),this._update
ConfirmButton()},t.prototype._updated_charges_messages=function(e){var t;return
t=this.inline_add_license&&this.add_qty>0&&!e,ke(".charges-section").toggle(t),t
his._updateConfirmButton(t)},t}(xt);var Ji,Gi,Qi,Xi,Zi,er,tr,nr,ir,rr,or,sr,ar,k

n=function(e,t){return function(){return e.apply(t,arguments)}},bn=function(e,t)


{function n(){this.constructor=e}for(var i in t)yn.call(t,i)&&(e[i]=t[i]);return
n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},yn={}.hasO
wnProperty;ir=INLINE_JS.Team=ut.Team={_use_async_reset:!1,team_id:K.get_viewer()
.team_id,set_team_id:function(e){this.team_id=e},setup_beta_modal_listeners:func
tion(){var e,t,n,i,r,o,s,a,_;for(t=ke(".feature-list .enroll-button"),i=ke(".fea
ture-list .feedback-button"),r=0,s=t.length;s>r;r++)e=t[r],n=ke(e).data("feature
"),ke(e).click(function(e){return function(){return new Gi(e).show()}}(n)),e.dis
abled=!1;for(_=[],o=0,a=i.length;a>o;o++)e=i[o],n=ke(e).data("feature"),_.push(k
e(e).click(function(e){return function(){return new Qi(e).show()}}(n)));return _
},invite_modal_show:function(e){return Wi.invite_modal?(this.invite_modal_alread
y_initialized?(Wi.invite_modal.show(),Wi.rebind_modal_submit_autocompleter()):(W
i.invite_modal.show(),Wi.init(),this.invite_modal_already_initialized=!0),null!=
window.active_team_member_table&&Wi.update_used_licenses(window.active_team_memb
er_table.get_licensed_members()),Wi.set_emails(e)):ke("body").one("invite-modalinitialized",function(t){return function(){return t.invite_modal_show(e)}}(this)
)},init_admin:function(){return gi.set_vertical_space(2),ke("form.activity-repor
t-generator").submit(this.submit_report_form.bind(this))},init_team_name_change_
notice:function(){return ke(".team_name_change_notice .hide_link").click(functio
n(e){return function(){return e.hide_team_name_change_banner()}}(this))},add_use
rs:function(e,t){var n,i,r;return Event.stop(e),i=$("team-invite-form"),ft(i,"Co
uldn t find the team invite form."),n=ke(i).find("input[name= emails ]"),0===n.l
ength?void b.error(Pt("You haven t included anyone to invite! Please invite at l
east one person.")):(r=function(r){return function(){var o;return o=li.collect_f
orm_vars(i),ke.extend(o,{team_id:r.team_id}),li.add_loading(e.target),new Ajax.D
BRequest("/account/team/add_users",{parameters:o,subject_user:K.get_viewer().wor
k_user,progress_text:Pt("Inviting members..."),noAutonotify:!0,onSuccess:functio
n(e){var i,r,o,s;return li.remove_loading(),Wi.reset_modal(),Wi.add_total_licens
es(t),Wi.invite_modal.hide(),o=JSON.parse(e.responseText),o?(null!=__CIRCULAR_DE
PENDENCY__.MembersReact?__CIRCULAR_DEPENDENCY__.MembersReact.refresh_member_stat
s():window.active_team_member_table?window.active_team_member_table.add_users(nu
ll!=o?o.users:void 0):null!=__CIRCULAR_DEPENDENCY__.Dashboard&&__CIRCULAR_DEPEND
ENCY__.Dashboard.set_num_invited(null!=o?o.num_invited:void 0),i=function(){var
e,t;e=null!=o?o.users:void 0,t=[];for(r in e)s=e[r],t.push(s);return t}(),1===i.
length?b.success(Pt("Invited %(user_email)s.").format({user_email:i[0].email})):
i.length>1?b.success(Pt("Invited %(user_count)d people.").format({user_count:i.l
ength})):b.error(Ft("Skipped %(num_skipped)d person who is already a member of t
he team.","Skipped %(num_skipped)d people who are already members of the team.",
n.length).format({num_skipped:n.length}))):b.error()},onFailure:function(e){var
t,n;return e&&(0===e.responseText.indexOf("err:")?(t=e.responseText.substr(4),0=
==t.indexOf("{")?(n=t.evalJSON(!0),li.fill_errors(i,n)):(t=new ot(t),b.error(t))
):b.error()),li.remove_loading(),ke("input[type= submit ]").prop("disabled",!1)}
})}}(this),setTimeout(function(){return Wi.invite_modal.is_making_transition_inf
o_request()?void 0:r()},100))},show_demo_signup_modal:function(e,t,n,i,r){var o,
s,a,_;return this.webinar_key=e,this.webinar_iso_datetime=t,this.webinar_date=n,
this.webinar_title=i,this.tab_url=r,_=Pt("Register for a webinar on %(start_time
)s").format({start_time:this.webinar_date}),s=new Xi({element_id:"demo-signup-mo
dal",title:_}),s.show(),s.$modal_window.find("input[name=webinar_key]").attr("va
lue",this.webinar_key),s.$modal_window.find("input[name=webinar_title]").attr("v
alue",this.webinar_title),s.$modal_window.find("input[name=Sales_Webinar_Topic__
c]").attr("value",this.webinar_title),s.$modal_window.find("input[name=Sales_web
inar_date__c]").attr("value",this.webinar_iso_datetime),a=s.$modal_window.find("
input[name=retURL]"),a.attr("value",a.val()+"#"+this.tab_url),o=s.$modal_window.
find("#demo-signup-form")[0],o.on("submit",s.on_confirm_button_click)},show_unsu
spend_modal:function(e,t,n,i){var r;return r=new tr({element_id:"dfe-unsuspend-m
odal",focus:"confirm"}),r.user_name=e||n,r.email=n,r.user_id=t,r.team_id=this.te
am_id,r.refresh_cb=i,r.show(),!1},show_remove_or_deactivate_modal:function(e,t,n
,i,r,o,s,a){var _;return _=new Zi({element_id:"dfe-remove-or-deactivate-user-mod
al",focus:".new-collab-input"}),_.user_name=t||i,_.email=i,_.user_id=n,_.team_id
=this.team_id,_.invited=r,_.limited=o,_.hide_transfer_wipe=s,_.refresh_cb=a,_.sh

ow(),!1},show_remove_modal:function(e,t,n,i,r,o,s,a,_,l){var u;return u=new er({


element_id:"dfe-remove-user-modal",focus:".new-collab-input"}),u.user_name=t||i,
u.email=i,u.user_id=n,u.team_id=this.team_id,u.invited=r,u.num_api_apps=o,u.hide
_transfer_setting=s,u.hide_remote_wipe_setting=a,u.refresh_cb=l,u.user_is_manage
d=_,u.show(),!1},remove_user:function(e,t){var n,i,r;return alert("in remove_use
r"),Event.stop(e),i=ke("input[type=submit]","#remove-user-modal"),i.attr("disabl
ed",1),r=pi.vars.user_id,n=t?!0:ke("input[name=should_disable]:checked","#remove
-user-modal").val(),
new Ajax.DBRequest("/account/team/remove_user",{parameters:{team_id:this.team_id
,user_id:r,should_disable:n},onSuccess:function(e){return function(t){var n,i,r;
return r=JSON.parse(t.responseText),null!=(n=window.active_team_member_table)&&n
.remove_user(pi.vars.user_id),null!=(i=window.removed_team_member_table)&&i.add_
users(r),e.decrement_used_licenses(),b.success(Pt("User removed."))}}(this),clea
nUp:function(){return pi.hide(),i.removeAttr("disabled")}})},show_reinvite_modal
:function(e,t,n,i){var r;return Gt.fillVal(i,"reinvite-user-email"),Gt.fillVal(t
,"reinvite-user-team"),r=Pt("Resend invite to %(email_address)s ").format({emai
l_address:_.em_snippet(i,18)}),pi.show(r,$("reinvite-user-modal"),{user_id:n,but
ton:e})},email_verification:this.email_verification=new Et("work"),show_email_ve
rification_modal:function(){return this.email_verification.show_verify_modal(nul
l,Ye.NEW_DFB_TEAM)},reinvite_user:function(e){var t;return Event.stop(e),t=pi.va
rs.user_id,new Ajax.DBRequest("/account/team/reinvite_user",{parameters:{team_id
:this.team_id,user_id:t},onSuccess:function(e){var n,i,r,o;return b.success(Pt("
Invite sent.")),null!=(i=$("team-member-info"))&&i.update(e.responseText),n=wind
ow.active_team_member_table,n?(o=n.data.users[t],o.invite_expired=!1,r={},r[t]=o
,n.update_user_data(r)):void 0},cleanUp:function(){return pi.hide()}})},show_req
uest_license_modal:function(e,t){var n;return n=Pt("Send upgrade request?"),pi.s
how(n,$("request-license-modal"),{user_id:t,button:e})},request_license:function
(e){var t;return Event.stop(e),t=pi.vars.user_id,new Ajax.DBRequest("/team/reque
st_license",{parameters:{team_id:this.team_id,user_id:t},onSuccess:function(){re
turn ke("#request_license_text").hide(),ke("#request-license-section").hide(),b.
success(Pt("Request sent."))},cleanUp:function(){return pi.hide()}})},show_user_
activity_log_modal:function(e,t,n){var i;return i=ke("#activity-log-modal"),i.fi
nd(".activity-log-email").text(t),i.find(".activity-log-name").text(n),i.find("#
activity-log-user-message").show(),pi.show(Pt("Create activity report"),i[0],{us
er_id:e})},show_team_activity_log_modal:function(e,t){var n;return n=ke("#activi
ty-log-modal"),n.find(".activity-log-email").text(e),n.find(".activity-log-name"
).text(t),n.find("#activity-log-team-message").show(),pi.show(Pt("Create full ac
tivity report"),n[0])},generate_activity_log:function(e){var t,n,i,r,o,s,a;retur
n Event.stop(e),n=ke("#activity-log-modal"),i=n.find("input[name= from_date ]").
val(),o=n.find("input[name= to_date ]").val(),i>o?void b.error(Pt("Your start da
te is after your end date.")):(r=this.team_id,a=pi.vars.user_id,s=(new Date).get
TimezoneOffset().toString(),t=ke(".activity-report-generator .freshbutton-blue")
,t.prop("disabled",!0),new Ajax.DBRequest("/team/events_report/csv",{parameters:
{from_date:i,to_date:o,team_id:r,user_id:a,tzoffset:s},onSuccess:function(){retu
rn b.success(Pt("Report started. We ll email you when it s ready."))},cleanUp:fu
nction(){return pi.hide(),t.prop("disabled",!1)}}))},show_reset_password_modal:f
unction(e,t,n){var i;return ke("#reset-password-modal .member-name").text(t),i=P
t("Reset password for %(user_name)s ").format({user_name:t}),pi.show(i,$("reset
-password-modal"),{user_id:n,button:e})},reset_password:function(e){var t;return
Event.stop(e),t=pi.vars.user_id,new Ajax.DBRequest("/account/team/reset_passwor
d",{parameters:{team_id:this.team_id,user_id:t},onSuccess:function(){return b.su
ccess(Pt("User s password reset."))},cleanUp:function(){return pi.hide()}})},sho
w_reset_all_passwords_modal:function(){return pi.show(Pt("Reset all passwords"),
$("reset-all-passwords-modal"))},set_async_password_reset:function(e){return thi
s._use_async_reset=e},reset_all_passwords:function(){return new Ajax.DBRequest("
/account/team/reset_all_passwords",{parameters:{team_id:this.team_id},job:this._
use_async_reset,subject_user:K.get_viewer().work_user,progress_text:Pt("Resettin
g all passwords..."),onSuccess:function(){return b.success(Pt("All passwords res
et."))},cleanUp:function(){return pi.hide()}})},show_admin_status_modal:function
(e,t,n,i,r,o){var s,a,_,l;return a=r.strip()||i,_=void 0,s=void 0,l=void 0,o?(l=

Pt("Add admin permissions for %(person_name)s ").format({person_name:a.escapeHT


ML()}),_=Pt("Are you sure you want to add admin permissions for <strong>%(person
_name)s</strong>?").format({person_name:a.escapeHTML()}),s=Pt("Add admin permiss
ions",{comment:"make this user an admin; give them the permissions an admin has"
})):(l=Pt("Remove admin privileges from %(person_name)s ").format({person_name:
a.escapeHTML()}),_=Pt("Are you sure you want to remove admin permissions from <s
trong>%(person_name)s</strong>?").format({person_name:a.escapeHTML()}),s=Pt("Rem
ove admin permissions",{comment:"clicking this button completes the action: it r
emoves a person s admin status"})),Gt.fillVal(i,"admin-status-email"),Gt.fillVal
(_,"admin-status-action"),Gt.fillVal(s,"admin-status-button-action"),pi.show(l,$
("admin-status-modal"),{user_id:n,button:e,admin_on:o}),!1},set_admin_status:fun
ction(e){var t;return Event.stop(e),t=pi.vars.user_id,new Ajax.DBRequest("/accou
nt/team/set_admin_status",{parameters:{team_id:this.team_id,user_id:t,on:pi.vars
.admin_on?"yes":"no"},onSuccess:function(e){var t,n;return t=Pt(pi.vars.admin_on
?"User s admin status granted.":"User s admin status removed."),null!=__CIRCULAR
_DEPENDENCY__.MembersReact?__CIRCULAR_DEPENDENCY__.MembersReact.refresh_member_s
tats():window.active_team_member_table?(n=JSON.parse(e.responseText),window.acti
ve_team_member_table.update_user_data(n),b.success(t)):window.location=pi.vars.a
dmin_on?"/team/admin/member?id=%d&msg=granted".format(pi.vars.user_id):"/team/ad
min/member?id=%d&msg=removed".format(pi.vars.user_id)},cleanUp:function(){return
pi.hide()}})},show_disable_2fa_modal:function(e,t,n){return ke("#disable-2fa-mo
dal .member-name").text(n),pi.show(Pt("Disable two-step verification"),$("disabl
e-2fa-modal"),{user_id:t,elm:e})},show_reset_2fa_modal:function(e,t,n){return ke
("#reset-2fa-modal .member-name").text(n),pi.show(Pt("Reset two-step verificatio
n"),$("reset-2fa-modal"),{user_id:t,user_name:n,elm:e})},reset_2fa:function(){re
turn new Ajax.DBRequest("/account/team/reset_2fa",{parameters:{team_id:this.team
_id,user_id:pi.vars.user_id},onSuccess:function(e){var t;return ke(".tfa_enabled
").replaceWith(Pt("Disabled")),t=JSON.parse(e.responseText),null!=__CIRCULAR_DEP
ENDENCY__.MembersReact?__CIRCULAR_DEPENDENCY__.MembersReact.refresh_member_stats
():window.active_team_member_table?window.active_team_member_table.update_user_d
ata(t):__CIRCULAR_DEPENDENCY__.MemberActionsMenu&&__CIRCULAR_DEPENDENCY__.Member
ActionsMenu.update_container_users(".buttons",t),b.success(Pt("Two-step verifica
tion reset for %(user_name)s").format({user_name:pi.vars.user_name})),pi.hide()}
})},disable_2fa:function(){return new Ajax.DBRequest("/account/team/disable_2fa"
,{parameters:{team_id:this.team_id,user_id:pi.vars.user_id},onSuccess:function(e
){var t;return ke(".tfa_enabled").replaceWith(Pt("Disabled")),t=JSON.parse(e.res
ponseText),null!=__CIRCULAR_DEPENDENCY__.MembersReact?__CIRCULAR_DEPENDENCY__.Me
mbersReact.refresh_member_stats():window.active_team_member_table?window.active_
team_member_table.update_user_data(t):__CIRCULAR_DEPENDENCY__.MemberActionsMenu&
&__CIRCULAR_DEPENDENCY__.MemberActionsMenu.update_container_users(".buttons",t),
b.success(Pt("Two-step verification disabled.")),pi.hide()}})},show_sso_preview_
email:function(e){return pi.show(Pt("Email preview"),$(e))},show_sso_sample_emai
l:function(e){return pi.show(Pt("Sample email"),$(e))},show_user_message_modal:f
unction(e,t,n){var i;return Gt.fillVal(n,"user-message-email"),i=Pt("Send email
to %(user_name)s ").format({user_name:e}),$("user-message").value="",pi.show(i,
$("user-message-modal"),{user_name:e,user_id:t}),Kt.focus.defer("user-message")}
,send_user_message:function(){var e,t;return t=pi.vars.user_id,e=$F("user-messag
e").strip(),new Ajax.DBRequest("/account/team/send_user_message",{parameters:{us
er_id:t,team_id:this.team_id,message:e},onSuccess:function(){var e;return e=pi.v
ars.user_name,b.success(Pt("Message successfully sent to %(user_name)s.").format
({user_name:e})),pi.hide()}})},hide_team_name_change_banner:function(){return ne
w Ajax.DBRequest("/account/team/name_change_notice_received",{parameters:{team_i
d:this.team_id}}),ke(".team_name_change_notice").hide(),!1},hide_pin_banner:func
tion(){return new Ajax.DBRequest("/team/invalidate_pin"),ke(".pin_notice").hide(
)},hide_pin_banner_with_user_id:function(e,t){var n;return n=function(){return k
e(t).closest("span").removeClass("on").addClass("off")},null===e?new Ajax.DBRequ
est("/team/invalidate_pin",{onSuccess:n}):new Ajax.DBRequest("/team/invalidate_p
in",{parameters:{user_id:e},onSuccess:n})},get_pin_with_user_id:function(e,t,n){
var i;return null==n&&(n=null),null===n&&(n=function(e,t){return ke(t).closest("
span").find(".pin-value").text(e.pin+" -"),ke(t).closest("span").removeClass("of

f").addClass("on")}),i=function(e){var i;return i=JSON.parse(e.responseText),n(i


,t)},null===e?new Ajax.DBRequest("/team/generate_pin",{onSuccess:i}):new Ajax.DB
Request("/team/generate_pin",{parameters:{user_id:e},onSuccess:i})},send_team_me
ssage:function(e){var t;return Event.stop(e),t=$F("team-message").strip(),t?new
Ajax.DBRequest("/account/team/send_team_message",{parameters:{team_id:this.team_
id,message:t},onSuccess:function(){return b.success(Pt("Message successfully sen
t to team.")),pi.hide()}}):void 0},show_security_message_modal:function(){return
(new rr).show()},send_team_security_message:function(e){var t,n;return Event.sto
p(e),n=$F("team-security-message").strip(),t=$("team-security-message-form"),new
Ajax.DBRequest("/account/team/send_team_message",{parameters:t.serialize(!0),on
Success:function(){return b.success(Pt("Message successfully sent.")),pi.hide()}
})},used_licenses:0,total_licenses:0,set_used_licenses:function(e,t){return this
.used_licenses=e,this.total_licenses=t},decrement_used_licenses:function(){retur
n this.set_used_licenses(this.used_licenses-1,this.total_licenses)},show_migrati
on_link:function(e,t){return $("migration-url").value=t,pi.show(Pt("Migration li
nk for %(email)s ").format({email:_.em_snippet(e,18)}),$("migrate-url-modal")),
$("migration-url").select()},show_end_session_modal:function(e,t,n){return gi.hi
de_all(),ke("#end-session-modal .member-name").text(ke("#member-name").text()),p
i.show(Pt("Close web session",{comment:"Log out of your current Dropbox web sess
ion"}),$("end-session-modal"),{login_id:e,user_id:t,elm:n})},end_session:functio
n(){return new Ajax.DBRequest("/logout_remote_session",{parameters:{remote_login
_id:pi.vars.login_id,team_id:this.team_id,user_id:pi.vars.user_id},onSuccess:fun
ction(){return pi.hide(),ir.remove_closest_row(pi.vars.elm),b.success(Pt("Web se
ssion closed."))}})},unlink_device:function(e,t,n,i,r,o,s){var a,_;return gi.hid
e_all(),a=$("unlink-device-modal-"+o),_=Pt("Unlink %(device_name)s").format({dev
ice_name:n}),pi.show(_,a,{app_id:t,user_id:r,elm:s,device_id:e,display_name:n})}
,unlink_device_submit:function(){return new Ajax.DBRequest("/account/unlink_team
_device",{parameters:{app_id:pi.vars.app_id,team_id:this.team_id,user_id:pi.vars
.user_id,device_id:JSON.stringify(pi.vars.device_id)},subject_user:K.get_viewer(
).work_user,onSuccess:function(){return pi.hide(),ir.remove_closest_row(pi.vars.
elm),b.success(Pt("%(device_name)s unlinked.").format({device_name:pi.vars.displ
ay_name}))}})},disable_app:function(e,t,n,i){return gi.hide_all(),ke("#disable-a
pp-modal .app-name").text(t),ke("#disable-app-modal .member-name").text(ke("#mem
ber-name").text()),pi.show(Pt("Disable %(app_name)s ?").format({app_name:t}),$(
"disable-app-modal"),{app_id:e,user_id:n,elm:i})},disable_app_submit:function(){
return new Ajax.DBRequest("/api/uninstall_app",{parameters:{app_id:pi.vars.app_i
d,keep_sandbox_files:!0,team_id:this.team_id,user_id:pi.vars.user_id},subject_us
er:K.get_viewer().work_user,onSuccess:function(e){return pi.hide(),ir.remove_clo
sest_row(pi.vars.elm),b.success(e.responseText)}})},remove_closest_row:function(
e){var t,n,i;return t=ke(e).closest(".team_admin_table_row"),n=ke(t).closest(".t
eam_admin_table"),1===n.find(".team_admin_table_row").length?(i=n.prev(".team_ad
min_table_title"),i.length||(i=ke(".team_apps_table_panel")),i.remove(),n.remove
()):t.remove()},submit_report_form:function(e){return ke(e.target.elements.tzoff
set).val(""+(new Date).getTimezoneOffset()),!0}},Gi=ut.BetaEnrollConfirmationMod
al=function(e){function t(e){this.feature_name=e,this.on_confirm_button_click=kn
(this.on_confirm_button_click,this),t.__super__.constructor.call(this,{element_i
d:"beta-enroll-confirmation-modal"})}return bn(t,e),t.prototype.on_confirm_butto
n_click=function(){return ke("<input>").attr({type:"hidden",name:"feature_name",
value:this.feature_name}).appendTo("#beta-enroll-confirmation-modal form"),this.
$modal_window.addClass("ajax-loading")},t}(xt),Qi=ut.BetaFeedbackModal=function(
e){function t(e){this.feature_name=e,this.success=kn(this.success,this),t.__supe
r__.constructor.call(this,{element_id:"beta-feedback-modal"}),this.on_confirm_bu
tton_click=function(e){return function(t){var n,i,r;return t.preventDefault(),n=
ke(t.target),i=n.closest("form"),r={feature_name:e.feature_name},li.ajax_submit(
i[0],!1,e.success,e.error,n[0],r)}}(this)}return bn(t,e),t.prototype.success=fun
ction(){return b.success(Pt("Thank you for your feedback.")),this.$modal_window.
hide()},t.prototype.error=function(e){return 200!==e.status?b.error(Pt("Failed t
o submit feedback. Please try again.")):void 0},t}(xt),Xi=ut.DemoSignupModal=fun
ction(e){function t(){return this.on_show=kn(this.on_show,this),this.on_confirm_
button_click=kn(this.on_confirm_button_click,this),t.__super__.constructor.apply

(this,arguments)}return bn(t,e),t.prototype.on_confirm_button_click=function(e){
var t,n,i,r,o,s,a,_,l,u,d,c;return e.preventDefault(),d=$("demo-signup-form"),_=
$("1210"),s=ke(d).find("input[name= first_name ]").val(),ke(_).find("input[name=
FirstName ]").attr("value",s),a=ke(d).find("input[name= last_name ]").val(),ke(
_).find("input[name= LastName ]").attr("value",a),o=ke(d).find("input[name= emai
l ]").val(),ke(_).find("input[name= Email ]").attr("value",o),u=ke(d).find("inpu
t[name= phone_number ]").val(),ke(_).find("input[name= Phone ]").attr("value",u)
,t=ke(d).find("input[name= company_name ]").val(),ke(_).find("input[name= Compan
y ]").attr("value",t),i=ke(d).find("select[name= company_size ]"),n=i.find("opti
on:selected").val(),ke(_).find("input[name= Company_size__c ]").attr("value",n),
r=$(this.$modal_window.find(".confirm-button")[0]),c=function(e){return function
(){return e.$modal_window.hide(),_.submit()}}(this),l=li.collect_form_vars(d,!0)
,li.ajax_submit(d,!1,c,!1,r,l,!0)},t.prototype.on_show=function(){return this.$m
odal_window.find(".db-modal-content").css({"overflow-y":""}),mi.init()},t}(xt),J
i=ut.AccountTransferBaseModal=function(e){function t(e,n,i){this.file_action_sel
ector=n,this.transfer_choice_selector=i,this._clearInput=kn(this._clearInput,thi
s),this._markInputInvalid=kn(this._markInputInvalid,this),this._markInputValid=k
n(this._markInputValid,this),this._tokenRemove=kn(this._tokenRemove,this),this._
tokenAdd=kn(this._tokenAdd,this),this._selectChange=kn(this._selectChange,this),
this._isTransferSelected=kn(this._isTransferSelected,this),this.checkAndApproveM
emberRemoval=kn(this.checkAndApproveMemberRemoval,this),this.on_cancel_button_cl
ick=kn(this.on_cancel_button_click,this),this.execute_form=kn(this.execute_form,
this),this.get_cancel_button=kn(this.get_cancel_button,this),this.get_confirm_bu
tton=kn(this.get_confirm_button,this),this.get_button_class=kn(this.get_button_c
lass,this),this.set_modal_class=kn(this.set_modal_class,this),this.handleAjaxFai
lure=kn(this.handleAjaxFailure,this),this.on_show=kn(this.on_show,this),t.__supe
r__.constructor.call(this,e,this.file_action_selector,this.transfer_choice_selec
tor)}return bn(t,e),t.prototype.on_show=function(){return 0!==this.$modal_window
.find("#manage-files-new-collab-input").length?(this.auto_completer=new Autocomp
leter.TeamTokenizer(K.get_viewer().get_user_by_role(D.ROLE_WORK),"manage-files-n
ew-collab-input","manage-files-new-whobulk","manage-files-hidden-input",{hide_im
port_contacts:!0,suggestions_disabled:!0,wrap_name:!0,single_token:!0,contact_fi
lter:function(e){return function(t){return t.excludeNonTeam().excludeNewStyleGro
ups().excludeByEmail(e.email)}}(this)}),this.tokenAdd=ke.proxy(this._tokenAdd,th
is),this.tokenRemove=ke.proxy(this._tokenRemove,this),this.$collab_input=this.$m
odal_window.find("#manage-files-new-collab-input")[0],this.$collab_input.on("tok
en:add",this.tokenAdd),this.$collab_input.on("token:remove",this.tokenRemove),th
is.$textinput=this.$modal_window.find(".tokenized_autocompleter_container .texti
nput"),this.selectChange=ke.proxy(this._selectChange,this),this.$modal_window.fi
nd(this.file_action_selector).on("change",this.selectChange)):void 0},t.prototyp
e.handleAjaxFailure=function(e){return 200===e.status&&this._isTransferSelected(
)?this._markInputInvalid():void 0},t.prototype.set_modal_class=function(e){var t
,n,i,r,o,s;return i="suspending deleting approve_transfer_to_suspended",r=this.g
et_form(),r.removeClass(i),null!=e&&r.addClass(e),null!=(o=ke(".suspend_option_c
ontent"))&&o.removeClass("title_bubble no_suspend"),n=null!=this.limited&&this.l
imited,t=null!=this.invited&&this.invited,n||t?(ke(".suspend_option_content").ad
dClass("title_bubble no_suspend"),s="",s=Pt(t?"Invited members can not be suspen
ded":"Limited members can not be suspended"),ke(".suspend_option_content").attr(
"data-title",s)):void 0},t.prototype.get_button_class=function(){var e;return e=
this.get_form(),e.hasClass("suspending")?".confirm_deactivate_button":e.hasClass
("deleting")?".confirm_delete_button":e.hasClass("approve_transfer_to_suspended"
)?".confirm_transfer_to_suspended_button":void 0},t.prototype.get_confirm_button
=function(){var e;return e=this.get_button_class(),$(null!=e?this.$modal_window.
find(e+" .confirm-button"):this.$modal_window.find(".confirm-button"))},t.protot
ype.get_cancel_button=function(){var e;return e=this.get_button_class(),$(null!=
e?this.$modal_window.find(e+" .cancel-button"):this.$modal_window.find(".cancelbutton"))},t.prototype.execute_form=function(){var e,t;return t=this.get_form()[
0],e=this.get_confirm_button(),li.ajax_submit(t,!1,this.success_callback,this.ha
ndleAjaxFailure,e)},t.prototype.on_cancel_button_click=function(e){var n;return
e.preventDefault(),n=this.get_form(),n.hasClass("approve_transfer_to_suspended")

?(this.reset_button_click(this.$confirm_button,this.on_confirm_button_click),thi
s.reset_button_click(this.$cancel_button,this.on_cancel_button_click)):t.__super
__.on_cancel_button_click.apply(this,arguments)},t.prototype.reset_button_click=
function(e,t){return e.off("click"),null!=t?e.on("click",t):void 0},t.prototype.
checkAndApproveMemberRemoval=function(e){var t,n;return!ke("#deactivate_option")
.is(":checked")&&ke("#transfer_files_on").is(":checked")&&!this.invited&&(t=ke("
.tokenized_autocompleter_container .token-display-text"),n=ke(".tokenized_autoco
mpleter_container .token-suspended"),t.length&&n.length)?(this.set_modal_class("
approve_transfer_to_suspended"),this.$modal_window.find(".target_user_name").tex
t(t.text()),this.$confirm_button=this.get_confirm_button(),this.reset_button_cli
ck(this.$confirm_button,function(e){return function(){return e.execute_form()}}(
this)),this.$cancel_button=this.get_cancel_button(),void this.$cancel_button.on(
"click",e)):this.execute_form()},t.prototype._isTransferSelected=function(){retu
rn ke(this.transfer_choice_selector).prop("checked")},t.prototype._selectChange=
function(){return this._isTransferSelected()?this.$textinput.removeClass("unsele
cted"):this.$textinput.addClass("unselected")},t.prototype._tokenAdd=function(e)
{return this.$collab_input.hide(),e.memo.valid?this._markInputValid():this._mark
InputInvalid()},t.prototype._tokenRemove=function(){return this.$collab_input.sh
ow(),this._clearInput()},t.prototype._markInputValid=function(){return this._cle
arInput(),this.$textinput.addClass("valid")},t.prototype._markInputInvalid=funct
ion(){return this._clearInput(),this.$textinput.addClass("invalid")},t.prototype
._clearInput=function(){return this.$textinput.removeClass("valid"),this.$textin
put.removeClass("invalid")},t}(xt),rr=ut.TwoFactorMessageModal=function(e){funct
ion t(){t.__super__.constructor.call(this,{element_id:"team-security-message-mod
al",focus:"#team-security-message"})}return bn(t,e),t.prototype.on_confirm_butto
n_click=function(e){return ir.send_team_security_message(e),this.hide()},t}(xt),
tr=ut.DfeUnsuspendUserModal=function(e){function t(e){this.on_confirm_button_cli
ck=kn(this.on_confirm_button_click,this),this.success_callback=kn(this.success_c
allback,this),t.__super__.constructor.call(this,e)}return bn(t,e),t.prototype.be
fore_show=function(){var e;return t.__super__.before_show.call(this),e=Pt("Unsus
pend %(user_name)s").format({user_name:this.user_name}),this.$modal_window.find(
".db-modal-title-text").text(e),this.$modal_window.find("[name=user_id]").attr("
value",this.user_id),this.$modal_window.find("[name=team_id]").attr("value",this
.team_id),this.$modal_window.find("[name=email]").attr("value",this.email),this.
$modal_window.find(".unsuspended_name").text(this.user_name),this.$modal_window.
find(".unsuspended_email").text(this.email)},t.prototype.success_callback=functi
on(){var e;return null!=(e=__CIRCULAR_DEPENDENCY__.MembersReact)&&e.refresh_memb
er_stats(),this.hide(),"function"==typeof this.refresh_cb?this.refresh_cb("unsus
pended"):void 0},t.prototype.on_confirm_button_click=function(e){var t,n;return
e.preventDefault(),n=this.$modal_window.find(".dfe-unsuspend-modal")[0],t=$(this
.$modal_window.find(".confirm-button")[0]),li.ajax_submit(n,!1,this.success_call
back,!1,t)},t}(xt),Zi=ut.DfeRemoveOrDeactivateUserModal=function(e){function t(e
){this.on_confirm_button_click=kn(this.on_confirm_button_click,this),this.succes
s_callback=kn(this.success_callback,this),this.on_show=kn(this.on_show,this),thi
s.handle_change_action=kn(this.handle_change_action,this),this.switch_to_removal
_mode=kn(this.switch_to_removal_mode,this),this.switch_to_deactivation_mode=kn(t
his.switch_to_deactivation_mode,this),this.show_removal_content=kn(this.show_rem
oval_content,this),this.show_deactivation_content=kn(this.show_deactivation_cont
ent,this),t.__super__.constructor.call(this,e,"input[name=transfer_files]","#tra
nsfer_files_on")}return bn(t,e),t.prototype.get_form=function(){return this.$mod
al_window.find(".dfe-remove-or-deactivate-user-modal")},t.prototype.set_form_act
ion_to_deactivate=function(){return ke(".dfe-remove-or-deactivate-user-modal").a
ttr("action","/account/team/suspend_user")},t.prototype.set_form_action_to_remov
e=function(){return ke(".dfe-remove-or-deactivate-user-modal").attr("action","/a
ccount/team/remove_user")},t.prototype.show_deactivation_content=function(){retu
rn this.set_modal_class("suspending")},t.prototype.show_removal_content=function
(){return this.set_modal_class("deleting")},t.prototype.switch_to_deactivation_m
ode=function(){return this.show_deactivation_content(),this.set_form_action_to_d
eactivate()},t.prototype.switch_to_removal_mode=function(){return this.show_remo
val_content(),this.set_form_action_to_remove(),this.invited?this.$modal_window.f

ind(".remote_wipe_setting").remove():void 0},t.prototype.handle_change_action=fu
nction(e){return e.preventDefault(),ke("#deactivate_option").is(":checked")?this
.switch_to_deactivation_mode():this.switch_to_removal_mode()},t.prototype.on_sho
w=function(){var e;return t.__super__.on_show.call(this),ke("input[name=deactiva
te_or_remove]").on("change",this.handle_change_action),this.$modal_window.find("
.deleted_user_name").text(this.user_name),e=Pt("Suspend or delete %(user_name)s"
).format({user_name:this.user_name}),this.limited||this.invited?(ke("#deactivate
_option").prop("disabled",!0),ke("#delete_option").attr("checked","checked"),thi
s.switch_to_removal_mode()):(ke("#deactivate_option").attr("checked","checked"),
this.switch_to_deactivation_mode()),this.$modal_window.find(".db-modal-title-tex
t").text(e),this.$modal_window.find("[name=user_id]").attr("value",this.user_id)
,this.$modal_window.find("[name=team_id]").attr("value",this.team_id),this.hide_
transfer_wipe?(this.$modal_window.find(".transfer_data_on_remove_setting").remov
e(),this.$modal_window.find(".remote_wipe_setting").remove()):void 0},t.prototyp
e.success_callback=function(){var e;return null!=__CIRCULAR_DEPENDENCY__.Members
React&&__CIRCULAR_DEPENDENCY__.MembersReact.refresh_member_stats(),e="",e=ke("#d
eactivate_option").is(":checked")?"suspended":"deleted",this.hide(),"function"==
typeof this.refresh_cb?this.refresh_cb(e):void 0},t.prototype.on_confirm_button_
click=function(e){return e.preventDefault(),this.checkAndApproveMemberRemoval(th
is.switch_to_removal_mode)},t}(Ji),er=ut.DfeRemoveUserModal=function(e){function
t(e){this.on_confirm_button_click=kn(this.on_confirm_button_click,this),this.sw
itch_to_removal_mode=kn(this.switch_to_removal_mode,this),this.success_callback=
kn(this.success_callback,this),this.on_show=kn(this.on_show,this),t.__super__.co
nstructor.call(this,e,"input[name=transfer_files]","#transfer_files_on")}return
bn(t,e),t.prototype.get_form=function(){return this.$modal_window.find(".dfe-rem
ove-user-modal")},t.prototype.on_show=function(){var e,n;return t.__super__.on_s
how.call(this),this.$modal_window.find(".remove_user_name").text(this.user_name)
,n=this.invited?Pt("Uninvite %(user_name)s").format({user_name:this.user_name}):
Pt("Delete %(user_name)s").format({user_name:this.user_name}),this.$modal_window
.find(".db-modal-title-text").text(n),this.num_api_apps?(e=Ft("%(num)s API app",
"%(num)s API apps",this.num_api_apps).format({num:this.num_api_apps}),this.$moda
l_window.find(".num_api_app").text(e)):this.$modal_window.find(".api_app_warning
").hide(),this.$modal_window.find("[name=user_id]").attr("value",this.user_id),t
his.$modal_window.find("[name=team_id]").attr("value",this.team_id),this.user_is
_managed?this.$modal_window.find(".remove-content-limited-member").remove():(thi
s.$modal_window.find(".remove_content").remove(),this.$modal_window.find(".remot
e_wipe_setting").remove()),this.invited&&(this.$modal_window.find(".transfer_fil
es_option").remove(),this.$modal_window.find(".remote_wipe_setting").remove(),th
is.get_form().addClass("invited")),this.hide_transfer_setting&&this.$modal_windo
w.find(".transfer_files_option").remove(),this.hide_remote_wipe_setting?this.$mo
dal_window.find(".remote_wipe_setting").remove():void 0},t.prototype.success_cal
lback=function(e){var t,n,i,r;return r=JSON.parse(e.responseText),null!=__CIRCUL
AR_DEPENDENCY__.MembersReact?__CIRCULAR_DEPENDENCY__.MembersReact.refresh_member
_stats():(null!=(n=window.active_team_member_table)&&n.remove_user(this.user_id)
,null!=(i=window.removed_team_member_table)&&i.add_users(r)),t="",t=this.invited
?"uninvited":"deleted",ir.decrement_used_licenses(),this.hide(),"function"==type
of this.refresh_cb?this.refresh_cb(t):void 0},t.prototype.switch_to_removal_mode
=function(){return this.set_modal_class()},t.prototype.on_confirm_button_click=f
unction(e){return e.preventDefault(),this.checkAndApproveMemberRemoval(this.swit
ch_to_removal_mode)},t}(Ji),nr=ut.ManageFilesModal=function(e){function t(e,n,i)
{this.source_user_id=e,this.source_user_name=n,this.options=i,this.on_confirm_bu
tton_click=kn(this.on_confirm_button_click,this),this.switch_to_manage_files=kn(
this.switch_to_manage_files,this),this.success_callback=kn(this.success_callback
,this),t.__super__.constructor.call(this,this.options,"input[name=file_action]",
"#transfer_files_on")}return bn(t,e),t.prototype.get_form=function(){return this
.$modal_window.find(".manage-files-modal")},t.prototype.on_show=function(){var e
;return t.__super__.on_show.call(this),this.$modal_window.find("[name= source_us
er_id ]").attr("value",this.source_user_id),this.$modal_window.find(".source-use
r-name").text(this.source_user_name),e=Pt("Manage %(team_member)s s files").form
at({team_member:this.source_user_name}),this.$modal_window.find(".db-modal-title

-text").text(e)},t.prototype.success_callback=function(e){var t;return t=JSON.pa


rse(e.responseText),null!=__CIRCULAR_DEPENDENCY__.MembersReact?__CIRCULAR_DEPEND
ENCY__.MembersReact.refresh_member_stats():window.removed_team_member_table?wind
ow.removed_team_member_table.update_user_data(t):null!=__CIRCULAR_DEPENDENCY__.M
emberActionsMenu&&__CIRCULAR_DEPENDENCY__.MemberActionsMenu.update_container_use
rs(".buttons",t),b.success(ke("#transfer_files_on").prop("checked")?Pt("Transfer
started",{comment:"This refers to the start of a file transfer from one Dropbox
to another"}):Pt("Permanently deleted files")),this.hide()},t.prototype.switch_
to_manage_files=function(){return this.set_modal_class("manage-files-modal")},t.
prototype.on_confirm_button_click=function(e){return e.preventDefault(),this.che
ckAndApproveMemberRemoval(this.switch_to_manage_files)},t}(Ji),sr=ut.show_manage
_files_modal=function(e,t){var n;return n=new nr(e,t,{element_id:"manage-files-m
odal",focus:".new-collab-input"}),n.show()},ar=function(){var e;return e=functio
n(e,t){var n,i;return ke(t).css("display","none"),n=ke(t).closest("#user_generat
e_liveops_pin"),i=n.find(".user_generate_liveops_pin_value"),i.text(e.pin),ke(t)
.addClass("liveops_pin_elem_invisible"),n.find(".user_generate_liveops_pin_text"
).removeClass("liveops_pin_elem_invisible")},ir.get_pin_with_user_id(null,this,e
),!1},ke("#user_generate_liveops_pin_button").click(ar),or=function(){return ke(
"#help_callus_title").hide(),ke("#help_callus_details").show(),!1},ke("#help_cal
lus_trigger").click(or);var _r;_r=ut.UpdateEvents={ADD:"db:add_file_objects",REM
OVE:"db:remove_file_objects",MOVE:"db:move_file_objects"};var lr;lr=ut.BrowseUti
l={THUMBS_BATCH_SIZE:16,make_browsefile:function(e,t){var n;return null==t&&(t=n
ull),n=Object.clone(e),n.is_dir?(n.ago="",n.ts=0):n.target_ns=!1,n.sort_key=Kt.d
ecode_sort_key(n.sort_key),n.request_id=null!=t?t:null,new mr(n)},filepreview_fr
om_selected:function(e,t,n,i){var r,o,s,a;return null==t&&(t=!1),null==n&&(n=!1)
,null==i&&(i=G.OREF_CONSTANTS.BROWSE_UNKNOWN),e.bytes<0||"download"===e.preview_
type?void window.open(e.href,"_blank"):void(ne.getGandalfRule("file-viewer-react
")?(o=this.getIndexOfFileInArray(Nr.files,e),we.open(Nr.files,o,Nr.active_user,"
react-file-viewer",{fileViewTarget:G.FileViewTargetType.PRIVATE,fileViewOrigin:G
.FileViewOriginType.BROWSE,fileViewAction:G.FileViewActionType.CLICK,shouldFocus
CommentInput:n})):(a=p.get_url(),s=p.deconstruct_url(a),r=0===a.indexOf("/s/"),i
o.show(e,Nr.active_user,{files:Nr.files,file_view_target:G.FileViewTargetType.PR
IVATE,should_focus_comment_input:n},i),t||r||s.qargs.preview===e.filename||io.se
t_preview_url()))},profile_files:function(e){var t,n,i,r,o;for(r={files:0,folder
s:0,shared_folders:0,team_shared_folders:0,deleted:0,public_folder:0,rejoinables
:0,sandboxes:0,target_namespaces:0,in_root_coll:0,compressible_count:0,can_perma
nently_delete:0},n=0,i=e.length;i>n;n++)t=e[n],t.dir?r.folders+=1:r.files+=1,t.i
s_sandbox()&&(r.sandboxes+=1),t.is_shared_folder()&&(r.shared_folders+=1),t.is_t
eam_shared_folder()&&(r.team_shared_folders+=1),-1===t.bytes&&(r.deleted+=1),t.t
arget_ns&&(r.target_namespaces+=1),"/public"===t.fq_path.toLowerCase()&&Nr.publi
c_folder_enabled&&(r.public_folder=1),t.in_root_coll&&(r.in_root_coll+=1),t.comp
ressible&&(r.compressible_count+=1),(null!=(o=Nr.permanent_delete_is_disabled_by
_ns_id)?o[t.ns_id]:void 0)||(r.can_permanently_delete+=1);return r},profile_summ
ary:function(e){var t,n;return t=Ft("%d file","%d files",e.files,{comment:"used
in a phrase such as x files and y folders "}).format(e.files),n=Ft("%d folder",
"%d folders",e.folders,{comment:"used in a phrase such as x files and y folders
"}).format(e.folders),e.files&&e.folders?Pt("%(x_files)s and %(y_folders)s",{co
mment:"x_files will either be 1 file or d files , similar for x_folders"}).fo
rmat({
x_files:t,y_folders:n}):e.files?t:e.folders?n:""},BROWSE_MODE:"browse",SEARCH_MO
DE:"search",SPECIAL_MODES:["search"],set_browse_mode:function(){var e,t,n,i,r,o,
s,a;for(e=ke("#browse"),n=e.find("#browse-root-actions"),i=e.find("#browse-sort"
),t=e.find("#browse-header-status"),a=this.SPECIAL_MODES,r=0,o=a.length;o>r;r++)
s=a[r],e.removeClass(s),n.removeClass(s),i.removeClass(s),t.removeClass(s);retur
n cr.reset_fulltext_search(!0),e.removeClass("fulltext_search"),n.removeClass("f
ulltext_search"),i.removeClass("fulltext_search"),t.removeClass("fulltext_search
"),ke("#fulltext-search-loading").hide(),ke("#fulltext-search-all-link").hide()}
,set_special_mode:function(e){var t,n,i,r,o,s,a,_;for(t=ke("#browse"),i=t.find("
#browse-root-actions"),r=t.find("#browse-sort"),n=t.find("#browse-header-status"
),ft(-1!==this.SPECIAL_MODES.indexOf(e),"unknown mode"),_=this.SPECIAL_MODES,o=0

,s=_.length;s>o;o++)a=_[o],a!==e&&(t.removeClass(a),i.removeClass(a),r.removeCla
ss(a),n.removeClass(a));return t.addClass(e),i.addClass(e),r.addClass(e),n.addCl
ass(e),e===this.SEARCH_MODE?(t.addClass("fulltext_search"),i.addClass("fulltext_
search"),r.addClass("fulltext_search"),n.addClass("fulltext_search")):void 0},ge
t_mode:function(){var e,t,n,i,r;for(r=this.BROWSE_MODE,i=this.SPECIAL_MODES,e=0,
t=i.length;t>e;e++)n=i[e],ke("#browse").hasClass(n)&&(r=n);return r},load_visibl
e_thumbs:function(){var e,t,n,i,r,o,s,a,_,l,u,d,c,h,f,p;for(a=this.get_files_in_
view(),t=a[1]-a[0],s=[Math.max(a[0]-t,0),a[0]],o=[Math.min(a[1],Nr.files.length)
,Math.min(a[1]+t,Nr.files.length)],e=[],f=[a,o,s],l=0,d=f.length;d>l;l++)for(r=f
[l],i=r[0],_=r[1],p=Nr.files.slice(i,+_+1||9e9),u=0,c=p.length;c>u;u++)n=p[u],n.
get_div()&&e.push(n.get_div().down("img"));return h=function(e){return e.src.end
sWith(Q.SPACER)?void 0:(e.addClassName("thumbnail"),e.__sert({before:new Element
("div",{"class":"thumbnail-border"})}))},tt.batch_load_thumbs(e,this.THUMBS_BATC
H_SIZE,h)},get_files_in_view:function(){var e,t,n,i,r,o,s,a,_,l,u;return s=[0,Nr
.files.length-1],l=Fe.viewport_dimensions().height,u=Fe.scroll_offsets().top,(o=
this._get_elm_height())?(e=ke("#browse-files"),i=parseInt(e.css("padding-top"),1
0),!e.length||isNaN(i)?s:("absolute"===ke("#browse-header").css("position")?(t=e
.offset().top+i,n=t-u,n>0?(a=0,r=l-n,_=r/o):(a=Math.abs(n/o),_=Math.abs(l-n)/o))
:(a=u/o,r=l-i,_=(r+u)/o),a=Math.max(Math.floor(a),0),_=Math.min(Math.floor(_),Nr
.files.length-1),[a,_])):s},_get_elm_height:function(){var e,t;return Nr.files.l
ength>=3&&Nr.files[1].get_div()?(e=ke(Nr.files[1].get_div()),t=e.outerHeight()+p
arseInt(e.css("margin-bottom"))+parseInt(e.css("margin-top"))):null},append_elli
psis:function(e){return Pt("%(action_text)s","web","action which requires further
user interaction").format({action_text:e})},getIndexOfFileInArray:function(e,t)
{var n,i,r,o,s;for(s=-1,i=r=0,o=e.length;o>r;i=++r)n=e[i],n.sjid===t.sjid&&(s=i)
;return s}};var ur;ur=ut.Sort=function(){var e,t,n,i,r,o,s;return n=function(e){
var t;return t=e?1:-1,function(e,n){return t*Kt.sort_by_rank_or_key(e,n)}},i=fun
ction(e){var t;return t=e?1:-1,function(e,n){return e.bytes>n.bytes?t:e.bytes<n.
bytes?-t:t*ur.FILES_BY_NAME(e,n)}},e=function(e){var t;return t=e?1:-1,function(
e,n){return t*(e.fq_path.toLowerCase()>n.fq_path.toLowerCase()?1:-1)}},t=functio
n(e){var t;return t=e?1:-1,function(e,n){var i;return i=e.ts===n.ts?0:e.ts>n.ts?
1:-1,t*i}},o=function(e){return function(t){var i,r;return r=e(t),i=n(!0),functi
on(e,t){return e.dir^t.dir?(e.dir?1:0)-(t.dir?1:0):r(e,t)||i(e,t)}}},r=function(
e){return function(t){var n,i;return ur.FOLDERS_FIRST?(i=e(t),n=t?1:-1,function(
e,t){var r;return e.dir^t.dir?(r=(e.dir?0:1)-(t.dir?0:1),n*r):i(e,t)}):e(t)}},s=
function(e){return function(t){var n,i;return i=ur.FILES_BY_NAME(t),n=t?1:-1,fun
ction(t,r){var o;return t.is_deleted^r.is_deleted?(t.is_deleted?1:0)-(r.is_delet
ed?1:0):(o=0,e?t.get_category()!==r.get_category()?o=t.get_category()<r.get_cate
gory()?-1:1:t.get_extension()!==r.get_extension()&&(o=t.get_extension()<r.get_ex
tension()?-1:1):t.get_extension()!==r.get_extension()?o=t.get_extension()<r.get_
extension()?-1:1:t.get_category()!==r.get_category()&&(o=t.get_category()<r.get_
category()?-1:1),n*o||i(t,r))}}},{FILES_BY_NAME:r(n),SHARED_WITH:r(n),FILES_BY_S
IZE:o(i),FILES_BY_LOCATION:o(e),FILES_BY_KIND:o(s(!0)),FILES_BY_EXTENSION:o(s(!1
)),FILES_BY_MODIFIED:o(t),FOLDERS_FIRST:!Kt.is_mac(),ALL_BY_MODIFIED:t}}();var d
r,Vn=[].indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(t in this&&thi
s[t]===e)return t;return-1};dr=ut.FlexColumn=function(){var e,t,n,i,r,o,s,a;for(
e=[{label:"SHARED_WITH",func:ur.FILES_BY_NAME,display:Pt("Shared With"),is_asc:!
0},{label:"FILES_BY_KIND",func:ur.FILES_BY_KIND,display:Pt("Kind"),is_asc:!0},{l
abel:"FILES_BY_EXTENSION",func:ur.FILES_BY_EXTENSION,display:Pt("Extension"),is_
asc:!0},{label:"FILES_BY_SIZE",func:ur.FILES_BY_SIZE,display:Pt("Size"),is_asc:!
1}],t={},n={},r=[],i=[],s=0,a=e.length;a>s;s++)o=e[s],r.push(o.func),t[o.label]=
o.display,n[o.label]=o.is_asc,i.push(o.label);return{SORT_FUNCTIONS:r,DISPLAY:t,
IS_ASC:n,LABELS:i,has_label:function(e){return Vn.call(this.LABELS,e)>=0},has_so
rt:function(e){return Vn.call(this.SORT_FUNCTIONS,e)>=0},next:function(t){var n;
return n=dr.LABELS.indexOf(t)+1,n===dr.LABELS.length&&(n=0),e[n]},set_column_dis
play:function(n,i){return e[dr.LABELS.indexOf(n)].display=i,t[n]=i}}}();var cr;c
r=ut.FileSearch={MAX_RESULTS:100,last_state:!1,last_fq_path:null,scoped_search:!
0,last_new_search_ts:{},is_loaded:!1,init:function(e,t){return this.firefly_enab
led=e,this.fulltext_search_enabled=t,ke(document).on("db:searchbar:submit",funct
ion(e){return function(t){return Nr.is_initialized?(t.preventDefault(),ke(t.targ

et).blur(),e.search(!0)):void 0}}(this)),ke(document).on("db:searchbar:preview",
function(e,t){return Nr.is_initialized?(e.preventDefault(),Nr.open_file(t.file,t
.force_new_window,!0,G.OREF_CONSTANTS.BROWSE_SEARCHBOX)):void 0})},get_state:fun
ction(){return x.queryParams(this.get_basic_query(),this.last_fq_path)},set_stat
e:function(e){return this.last_fq_path=null!=e.last_fq_path?e.last_fq_path:"",th
is.scoped_search=""!==this.last_fq_path,Nr.inside_dir=this.scoped_search,this.se
t_basic_query(e.query_unnormalized),this.do_search(!1,!0)},state_changed:functio
n(){var e,t;return e=this.get_state(),t=this.last_state,t===!1?!!e.query:e.query
!==t.query||e.last_fq_path!==t.last_fq_path},get_basic_query:function(){return t
his._get_browse_search_input().val()},set_basic_query:function(e){return e!==thi
s.get_basic_query()?this._get_browse_search_input().val(e):void 0},set_title:fun
ction(){var e,t;return e=this.get_state(),t=Pt("Search - Dropbox"),e.query_unnor
malized&&(t=e.query_unnormalized+" - "+t),document.title=t},_set_scope_path_to_b
rowse_location:function(){return this.last_fq_path=Nr.inside_dir?Nr.containing_f
q_path():""},do_search:function(e,t){var n,i,r,o;return null==t&&(t=!1),"functio
n"==typeof Nr.entered_search&&Nr.entered_search(),o=!t&&!Nr.in_search_mode(),o&&
this._set_scope_path_to_browse_location(),r=this.get_state(),(i=""===this.get_ba
sic_query())?void(Nr.in_search_mode()&&(this._clear_on_reload=!1,this.exit_searc
h())):(this.last_state=r,this._clear_on_reload=!0,xr.deselect_all(),Nr.clear(),l
r.set_special_mode("search"),this.scoped_search=""!==this.last_fq_path,t||(n=nul
l,p.push_state("/search/"+Nr.active_user.role,r)),this.set_title(),this.reset_fu
lltext_search(this.scoped_search),this.last_new_search_ts=new Date,ke("#fulltext
-search-loading").show(),this.ask_server("/ajax_fulltext_search",e,0,this.MAX_RE
SULTS,!1),Vt("search"))},search:function(e){return null==e&&(e=!1),e!==this.scop
ed_search&&(this.last_state=!1),this.scoped_search=this.scoped_search&&e,this.sc
oped_search||(this.last_fq_path=""),this.do_search(!1)},load_more_results:functi
on(){var e;return this.end_of_results?void 0:(e=this.search_pos,this.end_of_acti
ve_results&&(e=this.deleted_search_pos),this.ask_server("/ajax_fulltext_search",
!1,e,this.MAX_RESULTS,this.end_of_active_results))},firefly_filename_search:func
tion(){return this.do_search(!0)},update_empty:function(){var e;return e=Pt("No
results found"),this.scoped_search&&(e=Pt("No results found in %(path)s ").form
at({path:rt.filename(this.last_fq_path)})),ke("#noresults-header").text(e),ke("#
fulltext-search-all-link").hide(),ke("#noresults-directions").toggle(!this.scope
d_search),ke("#noresults-search-all-link").toggle(this.scoped_search)},show_empt
y:function(){return this.update_empty(),$("search-empty").show()},hide_empty:fun
ction(){return $("search-empty").hide()},reset_fulltext_search:function(e){retur
n xr.deselect_all(),Nr.clear(),Nr.reset_state(),Nr.update_header_status(""),this
.search_pos=0,this.deleted_search_pos=0,this.end_of_active_results=!1,this.end_o
f_results=!1,this.scoped_search=e,ke("#fulltext-search-all-link").hide()},exit_s
earch:function(){var e;return Nr.in_search_mode()&&(e=[Nr.inside_deleted_dir,Nr.
inside_deleted_sandbox,Nr.inside_deleted_shared_folder],v.any(e)||(Nr.deleted_sh
own=!1)),$("browse").removeClassName("pending-search"),this.hide_empty(),pr.set_
path_url(null,this.last_fq_path,Nr.deleted_shown)},force_reload:function(){retur
n this.search()},ask_server:function(e,t,n,i,r){var o,s,a,_,l,u;return u=this.ge
t_state(),l=null,_=new Date,l=r?Ge.DELETED:t?Ge.COMPLETION:Ge.FULLTEXT,o={firefl
y:this.firefly_enabled,infinite_scroll:n>0?!0:!1,path_scoped:!1,search_type:l,qu
ery_string:u.query},et.SearchClientActivityLogger.log("query_started",Nr.active_
user.id,o),n||ke("#web-search-results").html(Pt("Searching...")),ke("#browse").a
ddClass("pending-search"),s={query:u.query},n&&(s.start=n),i&&(s.max_results=i),
r&&(s.deleted=r),this.scoped_search&&(s.fq_path=this.last_fq_path),t||(this.last
_fulltext_query=u.query),t&&(s.filename_only=!0),a=!1,new Ajax.DBRequest(e,{no_w
atch:!0,evalJSON:!1,parameters:s,log_timing:!0,onSuccess:function(e){return func
tion(t){var n,i,r,s,l;if(Nr.in_search_mode())return s=t.request.parameters.paren
t_request_id,n=JSON.parse(t.responseText),l=n.file_info.length,u.query===e.last_
fulltext_query&&_>=e.last_new_search_ts&&(e.search_pos=e.search_pos+l,e.end_of_a
ctive_results&&(e.deleted_search_pos=e.deleted_search_pos+l),l<e.MAX_RESULTS&&(e
.end_of_results=!0&&e.end_of_active_results,e.end_of_active_results=!0,e.end_of_
results?ke("#fulltext-search-loading").hide():a=!0),e.update_results(n,a,s)),i=n
.file_info.length>0?n.file_info[0]:null,o=et.SearchClientActivityLogger.create_c
ompletion_log_dict(o,s,t.request.start_time,u.query,u.query===(null!=(r=e.last_s

tate)?r.query:void 0),l,null,i),et.SearchClientActivityLogger.log("query_complet
ed",Nr.active_user.id,o)}}(this),onFailure:function(e){return function(t){var n;
return o=et.SearchClientActivityLogger.create_completion_log_dict(o,t.request.pa
rameters.parent_request_id,t.request.start_time,u.query,u.query===(null!=(n=e.la
st_state)?n.query:void 0),null,t.status),et.SearchClientActivityLogger.log("quer
y_failed",Nr.active_user.id,o)}}(this),cleanUp:function(e){return function(){ret
urn a?e.load_more_results():ke("#browse").removeClass("pending-search")}}(this),
subject_user:Nr.active_user})},update_results:function(e,t,n){var i;return null=
=t&&(t=!1),null==n&&(n=null),i=this.get_state(),Nr.update(e,n),Nr.set_selection_
from_fq_paths_or_index(cr),t?void 0:(this._update_number_results(this.search_pos
),Nr.files.length?this.hide_empty():this.show_empty())},_update_number_results:f
unction(e){var t,n;return t=0===e?"":this.end_of_results?this.fulltext_search_en
abled?Ft("%(num_results)s result in files, folders, and content.","%(num_results
)s results in files, folders, and content.",e).format({num_results:e}):Ft("%(num
_results)s result in files and folders.","%(num_results)s results in files and f
olders.",e).format({num_results:e}):this.fulltext_search_enabled?Ft("Over %(num_
results)s result in files, folders, and content.","Over %(num_results)s results
in files, folders, and content.",e).format({num_results:e}):Ft("Over %(num_resul
ts)s result in files and folders.","Over %(num_results)s results in files and fo
lders.",e).format({num_results:e}),n=Pt("Search")+" - "+t,Nr.update_header_statu
s(t),n=Pt("Results for %(query)s ").format({query:this.get_state().query}),this
.scoped_search&&(n=Pt("Results for %(query)s in %(path)s ").format({query:thi
s.get_state().query,path:rt.filename(this.last_fq_path+" ")})),ke("#web-search-r
esults").text(n),this.scoped_search?ke("#fulltext-search-all-link").show():void
0},history_change_handler:function(e,t){var n,i,r;return i="string"==typeof this
._get_browse_search_input().find("input").attr("value"),r=i&&!this.is_loaded,t&&
(this.last_state=t),this.last_state?((this.state_changed()||r)&&this.set_state(t
his.last_state),io.shown()||key.setScope(Nr.KEY_SCOPE),xr.get_selected_files().l
ength&&(n=xr.get_selected_files()[0].get_div(),Nr.scrollToWithPadding(n,2*n.getH
eight())),this.is_loaded=!0):void pr.set_path_url(c.root_ns,"")},clear_searchbox
:function(){return this._get_browse_search_input().val("")},_get_browse_search_i
nput:function(){return ke("#browse-search-input")}};var hr;hr=ut.BrowseKeys={_ha
ndlers:{},init:function(){},init_advanced:function(){var e,t,n;n=this.advanced_d
ict;for(t in n)e=n[t],key(e.key,Nr.KEY_SCOPE,e.onPress);return this.customize_ch
art(),Kt.is_mac()&&Prototype.Browser.Gecko?document.observe("keypress",function(
e){return function(t){return 63!==t.charCode||Fe.focus_in_input()?void 0:e.advan
ced_dict.help.onPress()}}(this)):void 0},customize_chart:function(){var e,t,n,i;
for(e=Kt.is_mac()?".key-windows":".key-macos",n=0,t=void 0,i=[];;){if(t=$("keyschart").down(e,n++),!t)break;i.push(t.hide())}return i},toggle_chart:function(){
return"none"===$("keys-chart").style.display?this.show_chart():this.hide_chart()
},show_chart:function(){var e,t;return e=$("keys-chart"),e.style.position="fixed
",t=$("browse-sort"),Nr.in_search_mode()?t=$("browse-header-wrapper"):"none"===t
.getStyle("display")&&(t=$("browse-root-actions")),Fe.clone_position(ke(e),ke(t)
,{setHeight:!1}),e.style.top=t.cumulativeOffset()[1]+t.getHeight()+"px",e.setOpa
city(.9),e.show()},hide_chart:function(){return $("keys-chart").hide()},advanced
_dict:{rename:{title:Pt("Rename selected files",{comment:" selected means files
that have been highlighted by the user to be acted upon"}),key:"f2",onPress:fun
ction(){var e;return e=xr.get_selected_files(),e.length?e.first().edit():void 0}
},"delete":{title:Pt("Delete selected files",{comment:" selected means files th
at have been highlighted by the user to be acted upon"}),key:"delete, command+ba
ckspace, backspace",onPress:function(e){var t,n,i,r;if(Event.stop(e),Nr.inside_r
ead_only_shared_folder&&b.warning(Pt("You don t have permission to delete files
in this folder.")),r=xr.get_selected_files(),1===r.length)return n=r.first(),n.i
s_deleted?_i.show_purge(n.fq_path,n.dir):(t=n.mount_point?rt.filename(n.mount_po
int):null,_i.show_delete(Nr.active_user,n.fq_path,n.dir,void 0,t,n.is_shared_fol
der()));if(r.length>1){if(i=lr.profile_files(r),i.deleted===r.length)return _i.s
how_bulk_purge(r);if(0===i.deleted)return _i.show_bulk_delete(Nr.active_user,r)}
}},help:{title:Pt("Show/hide keyboard shorcuts"),key:"shift+/, "+key.main_modifi
er()+"+/",onPress:function(){return hr.toggle_chart()}},close_help:{title:Pt("Hi
de keyboard shorcuts"),key:"escape",onPress:function(){return hr.hide_chart()}},

up_dir:{title:Pt("Up a folder",{comment:"meaning, go from the current folder to


its containing (parent) folder. this is one step up only -- the parent, not the
root."}),key:"left",onPress:function(){var e,t;return Nr.keyboard_nav=!0,Nr.relo
ading?void 0:Nr.inside_dir?(Nr.containing_ns_path()||Nr.containing_ns_id()===c.r
oot_ns?(t=Nr.containing_ns_id(),e=rt.normalize(rt.parent_dir(Nr.containing_ns_pa
th()))):(t=c.root_ns,e=rt.normalize(rt.parent_dir(Nr.containing_fq_path()))),Nr.
containing_ns_path()!==e||Nr.containing_ns_id()!==t?(Nr.select_fq_paths=[Nr.cont
aining_fq_path()],pr.set_path_url(t,e)):xr.flicker_selected()):xr.flicker_select
ed()}},open_file:{title:Pt("Open highlighted file"),key:"enter",onPress:function
(){var e,t;return t=xr.get_selected_files(),1===t.length&&(e=t[0],Nr.open_file(e
,!1,!1,G.OREF_CONSTANTS.BROWSE_FILE_OPEN)),!1}},open_dir:{title:Pt("Open highlig
hted folder"),key:"right",onPress:function(){var e,t;return Nr.keyboard_nav=!0,t
=xr.get_selected_files(),1===t.length&&(e=t[0],e.dir?(Nr.select_index=0,Nr.open_
folder(e)):xr.flicker_selected()),!1}},undo:{title:Pt("Undo recent move/copy/ren
ame/delete"),key:key.main_modifier()+"+z",onPress:function(){return ee.perform_u
ndo(),!1}},search:{title:Pt("Search"),key:"/",onPress:function(){return ke(docum
ent).trigger("db:searchbar:focus"),!1}}}};var fr;fr=ut.BrowseSharedLink={store_s
hared_link_info:function(e,t,n){return"/"===e.charAt(0)&&(e=e.substring(1)),this
._shared_link_fq_dir=e,this._shared_link_file=n,this._shared_link_url=t},shared_
link_handler:function(e){return fr._shared_link_url==="/s/"+e||fr._shared_link_u
rl==="/scl/"+e&&0===e.indexOf("fi")?(pr.load_browse_view(void 0,encodeURICompone
nt(fr._shared_link_fq_dir)),Nr.open_preview(fr._shared_link_file)):fr._shared_li
nk_url==="/sh/"+e||fr._shared_link_url==="/scl/"+e&&0===e.indexOf("fo")?(pr.load
_browse_view(void 0,encodeURIComponent(fr._shared_link_fq_dir)),fr._shared_link_
file&&Nr.open_preview(fr._shared_link_file)):location.reload(),fr.highlight_user
()},close_shared_link_view:function(){return window.location.pathname===this._sh
ared_link_url?pr.set_path_url(null,"/"+this._shared_link_fq_dir):void 0},highlig
ht_user:function(){return Nr.active_user.role===D.ROLE_WORK?(ke("#work-nav-item"
).addClass("selected"),ke("#personal-nav-item").removeClass("selected")):(ke("#p
ersonal-nav-item").addClass("selected"),ke("#work-nav-item").removeClass("select
ed"))}};var pr;pr=ut.BrowseURL={_DEFAULTS:{d:!1,select:!1,open_preview:!1},_get_
helper:function(e){var t;return t=p.deconstruct_url().qargs,e in t?!!t[e]:(ft(e
in this._DEFAULTS,"bad query param in BrowseURL"),this._DEFAULTS[e])},get_del:fu
nction(){return this._get_helper("d")},ns_to_fq_path:function(e,t){var n;return
e===Nr.active_user.root_ns||e in Nr.ns_id_to_mount_point||(e=Nr.active_user.root
_ns),e===Nr.active_user.root_ns?t:(n=Nr.ns_id_to_mount_point[e],n+t)},make_brows
e_url_from_fq_path:function(e,n,i){var r,s,a,_;null==i&&(i={}),ft("string"==type
of n,"expected explicit fq_path string"),a=o({path:t.get_browse_root(e)+n}),s=p.
deconstruct_url().qargs;for(r in i)_=i[r],r in this._DEFAULTS&&!!_!==this._DEFAU
LTS[r]&&(s[r]=_);for(r in s)r in this._DEFAULTS||delete s[r];return p.construct_
url(String(a),s)},_make_url:function(e,t,n){var i;return null==n&&(n={}),e||(e=N
r.active_user.root_ns),ft("number"==typeof e,"expected ns_id as a number"),ft("s
tring"==typeof t,"expected explicit ns_path string"),i=this.ns_to_fq_path(e,t),t
his.make_browse_url_from_fq_path(Nr.active_user,i,n)},set_path_url:function(e,t,
n){var i,r,o;return e?(r=parseInt(e,10),e=isNaN(r)?c.root_ns:r):e=Nr.active_user
.root_ns,t=rt.normalize(t),o=null!=n?this._make_url(e,t,{d:n?1:0}):this._make_ur
l(e,t),i=p.deconstruct_url(o),p.push_state(i.path,i.qargs)},set_del_url:function
(e){var t,n,i;return i=p.deconstruct_url(),t=i.path,n=i.qargs,e?n.d="1":delete n
.d,p.push_state(t,n)},_first_load:!0,_last_ns_dir:null,_last_ns_id:null,load_bro
wse_view:function(e,t,n){var i,r,o;return null==n&&(n=!1),key.setScope(Nr.KEY_SC
OPE),t=rt.normalize(t),o=!1,this._first_load||(o=!Nr.inside_dir||t!==this._last_
ns_dir||e!==this._last_ns_id||Nr.in_search_mode()),i=n!==Nr.deleted_shown,Nr.del
eted_shown=n,(this._first_load||o||i)&&Nr.reload(e,t,!0),this._first_load=!1,thi
s._last_ns_dir=t,this._last_ns_id=e,xr.get_selected_files().length&&(r=xr.get_se
lected_files()[0].get_div())?Nr.scrollToWithPadding(r,2*r.getHeight()):void 0},h
istory_change_handler:function(e,n){var i,r,s,a,_;if(a=n.ns,_="1"===n.d,this.loa
d_browse_view(a,e,_),null!=n.preview){if(r="/"+o.encode(n.preview),e&&(r="/"+e+r
),i=Nr.find_file(o.decode(r)),null==i)return et.UserActivityLogger.log("web","br
owse_preview_does_not_exist"),p.replace_state(t.get_browse_root(Nr.active_user))
;if(ne.getGandalfRule("file-viewer-react"))return s=lr.getIndexOfFileInArray(Nr.

files,i),we.open(Nr.files,s,Nr.active_user,"react-file-viewer",{fileViewTarget:G
.FileViewTargetType.PRIVATE,fileViewOrigin:G.FileViewOriginType.BROWSE,fileViewA
ction:G.FileViewActionType.CLICK});if(!io.shown()||io.file!==i)return Nr.open_pr
eview(i,G.OREF_CONSTANTS.BROWSE_UNKNOWN,!0)}else{if(!ne.getGandalfRule("file-vie
wer-react")&&io.shown())return io.hide();if(ne.getGandalfRule("file-viewer-react
")&&we.isShown())return we.close()}},parse_b2_hash:function(e){var t,n,i,r,o;ret
urn r=e.split(":"),4!==r.length?!1:(i=r[0],t="1"===r[2],n=r[3],(o=!n||Kt.isNumbe
r(n))?(n=parseInt(n,10)||c.root_ns,{ns_id:n,ns_path:i,deleted:t}):!1)}};var mr;m
r=ut.BrowseFile=Class.create({initialize:function(e){var t,n,i,r;return t=rt.fil
ename(e.fq_path),this.can_hold_shared_folders=e.can_hold_shared_folders,this.all
ows_shared_link=e.allows_shared_link?1:0,this.icon=e.icon,this.filename=t,this.f
ilename_highlights=null!=(n=e.filename_highlights)?n:[],this.unresolved_comment_
count=e.unresolved_comment_count,this.unseen_comment_count=e.unseen_comment_coun
t,this.update_caption(),this.ns_id=e.ns_id,this.ns_path=e.ns_path,this.fq_path=e
.fq_path,this.mount_point=e.mount_point,this.hash=e.hash,this.href=e.href,this.s
ize="None"!==e.size?e.size:"",this.bytes=e.bytes,this.is_deleted=-1===this.bytes
,this.ago=e.ago,this.ts=e.ts,this.dir=e.is_dir?1:0,this.target_ns=e.target_ns,th
is.sort_rank=e.sort_rank,this.sort_key=e.sort_key||[""],this.sjid=e.sjid,this.tk
ey=void 0,this.thumbnail_url_tmpl=e.thumbnail_url_tmpl,this.large_thumbnail_url_
tmpl=e.large_thumbnail_url_tmpl,this.type=e.type,this.preview_type=e.preview_typ
e,e.last_modified_fname&&(this.last_modified_fname=_.em_snippet(e.last_modified_
fname,Rr),this.last_modified_name=e.last_modified_name),this.event_type=e.event_
type,this.htmlified_link=e.htmlified_link,this.linkfile_link=e.linkfile_link,thi
s.direct_blockserver_link=e.direct_blockserver_link,this.doc_preview_status=e.do
c_preview_status,this.in_root_coll=e.in_root_coll,this.compressible=e.compressib
le,this.user_id=e.user_id,this.sf_perm_role=e.sf_perm_role,this.fulltext_search=
e.fulltext_search,this.read_only=e.read_only?!0:!1,this.is_read_only_mount=e.is_
read_only_mount?!0:!1,this.request_id=null!=(i=e.request_id)?i:null,this.match_t
ype=null!=(r=e.match_type)?r:"UNKNOWN_MATCH",this.video_transcode_url=e.video_tr
anscode_url},track_in_browse:function(){return this.to_key()in mr._file_index?vo
id 0:(Nr.add_file(this),mr._file_index[this.to_key()]=this)},is_shared_folder:fu
nction(){return this.type===Tt.SHARED_FOLDER||this.type===Tt.TEAM_SHARED_FOLDER}
,is_team_shared_folder:function(){return this.type===Tt.TEAM_SHARED_FOLDER},coul
d_be_shared_link:function(){return this.allows_shared_link},could_be_shared_fold
er:function(){var e,t,n,i;return t=Nr.public_folder_enabled&&this.fq_path.toLowe
rCase().startsWith("/public/"),i=Nr.public_folder_enabled&&"/public"===this.fq_p
ath.toLowerCase(),n=this.target_ns,e=this.ns_id!==c.root_ns,!(this.type!==Tt.FOL
DER||n||t||i||this.is_sandbox()||e&&(!this.can_hold_shared_folders||Nr.inside_re
ad_only_shared_folder))},is_sandbox:function(){return this.type===Tt.SANDBOX},ge
t_div:function(){return $("f_"+this.to_key())},rename:function(e,t,n,i,r,o){var
a,_,l;return _=this.fq_path,Nr.pre_action_selection=[_],a=Nr.find_file(e),a&&Nr.
remove_file(a),this.filename=rt.filename(e),this.update_caption(),this.fq_path=e
,this.ns_path=t,this.htmlified_link=o,this.hash=n,this.sort_key=i,this.sort_rank
=null,this.last_modified_fname=null,this.dir?(this.href="/home"+Kt.urlquote(e),t
his.target_ns&&(Nr.ns_id_to_mount_point[this.target_ns]=e)):(l=this.href.split("
/"),l[l.length-1]=Kt.urlquote(this.filename)+("?w="+n),this.href=l.join("/"),thi
s.icon=r),Nr.in_search_mode()&&(this.filename_highlights=[]),mr._file_index[this
.to_key()]=this,Nr.update_file_pos(this),ke(document).trigger(s.RENAME,{old_fq_p
ath:_,file:this})},edit:function(){var e,t,n,i,r;return this.editing=!0,Nr.selec
table(),r=function(e){return function(t){var n,i,r,o,s,a,_,l,u,d;return d=t.resp
onseText.evalJSON(!0),ft(1===d.new_browse_files.length,"No new file data returne
d."),r=d.new_browse_files.first(),o=r.fq_path,s=r.hash,u=Kt.decode_sort_key(r.so
rt_key),_=r.icon,l=r.ns_path,a=r.htmlified_link,n=d.changesets,i=Pt("Rename comp
lete."),ee.notifyWithUndo(i,n,_i.do_rollback),e.rename(o,l,s,u,_,a),xr.set_selec
ted_files([e]),e.get_div().smoothScrollIntoView(),lr.load_visible_thumbs(),Nr.fi
re_visible_change_callbacks()}}(this),t=o({path:"/cmd/rename"+this.fq_path}).upd
ateQuery(D.UID_PARAM_NAME,Nr.active_user).toString(),n=Nr.in_search_mode()?".fil
ename-col":".filename-col a",e=new Ajax.InPlaceEditor(this.get_div().down(n),t,{
htmlResponse:!1,okControl:!1,cancelControl:!1,highlightColor:"transparent",highl
ightEndColor:"transparent",clickToEditText:"",cols:25,ajaxClass:Ajax.DBRequest,s

ubmitOnBlur:!0,initialText:this.filename,cancelIfSame:!0,clickToEdit:!1,onComple
te:function(e){return function(){return e.editing=!1}}(this),onFailure:function(
){},savingText:Pt("Saving..."),ajaxOptions:{job:!0,subject_user:Nr.active_user,h
tml_in_error_msg:!0,progress_text:Pt("Renaming..."),method:"POST",onCreate:b.cle
ar,onSuccess:r,onUninitialized:Nr.unselectable},callback:function(e){return func
tion(t,n){return{to_path:n||"",folder:e.dir?"yes":""}}}(this)}),e.enterEditMode(
),i=this.get_div().down(".editor_field"),"selectionEnd"in i&&this.filename.lastI
ndexOf(".")>-1?i.selectionEnd=this.filename.lastIndexOf("."):void 0},to_key:func
tion(){return this.ns_id+"_"+this.sjid},get_category:function(){var e,t;return t
his.dir&&(Nr.inside_dir&&""===Nr.containing_fq_path()&&"public"===this.filename.
toLowerCase()&&Nr.public_folder_enabled&&(e="PUBLIC_FOLDER"),null==e&&(e=this.ty
pe===Tt.FOLDER?"FOLDER":this.type===Tt.PACKAGE?"FOLDER":this.type===Tt.TEAM_SHAR
ED_FOLDER?"TEAM_SHARED_FOLDER":this.type===Tt.SHARED_FOLDER?"SHARED_FOLDER":this
.type===Tt.SANDBOX?"SANDBOX":this.target_ns?"SHARED_FOLDER":"FOLDER")),null==e&&
(e=mr.EXTENSION_TO_CATEGORY[this.get_extension()]||"FILE"),t=this.is_deleted?mr.
CATEGORY_TO_DELETED_TRANSLATION[e]:mr.CATEGORY_TO_TRANSLATION[e],ft(t,"CATEGORY
MISSING FOR "+e),t},get_icon_alt:function(){return this.dir?Pt(this.is_shared_fo
lder()?this.is_team_shared_folder()?this.is_read_only_mount?"Read-only team fold
er":"Team folder":this.is_read_only_mount?"Read-only shared folder":"Shared fold
er":this.is_read_only_mount?"Read-only folder":"Folder"):""},get_extension:funct
ion(){return this.dir||-1===this.filename.indexOf(".")?void 0:rt.file_extension(
this.filename).toLowerCase()},is_shmodelable:function(){return!this.is_deleted&&
Nr.is_shmodelable_path(this.fq_path)},update_caption:function(){var e;return e=N
r.inside_dir?Or:Mr,this.unresolved_comment_count>0&&(e-=Ir),this.caption=_.em_sn
ippet(this.filename,e)}}),mr._CATEGORIES={IMAGE:"bmp cr2 gif ico jpeg jpg nef pn
g psd tif tiff svg svgz",VIDEO:"3gp 3gpp 3gpp2 avi dv flv m2t m4v mkv mov mp4 mp
eg mpg mts ts vob wmv",AUDIO:"aif flac m4a m4p mp3 ogg wav wma",DOCUMENT:"ai cdr
csv doc docx docm eps fla indd keynote numbers otf pages pdf ppt pptx pptm pps
ppsx ppsm ps rtf swf txt wpd xls xlsx xlsm",COMPRESSED_FILE:"7z bz2 gz gzip rar
tar zip",CODE:"as as3 c coffee cpp cs css cxx h html java js less php py rb sass
scss sh sql vb xhtml xml",DISK_IMAGE:"dmg iso",EXECUTABLE:"exe",SHORTCUT:"lnk",
LINK:"url webloc",FONT:"ttf"},mr.EXTENSION_TO_CATEGORY={},mr.CATEGORY_TO_TRANSLA
TION={FILE:Pt("file"),FOLDER:Pt("folder"),SHARED_FOLDER:Pt("shared folder"),TEAM
_SHARED_FOLDER:Pt("team folder"),PUBLIC_FOLDER:Pt("folder"),IMAGE:Pt("image"),VI
DEO:Pt("video"),AUDIO:Pt("audio"),DOCUMENT:Pt("document"),COMPRESSED_FILE:Pt("ar
chive"),CODE:Pt("code"),DISK_IMAGE:Pt("disk image"),EXECUTABLE:Pt("executable"),
SHORTCUT:Pt("shortcut"),LINK:Pt("link"),FONT:Pt("font"),SANDBOX:Pt("app folder")
},mr.CATEGORY_TO_DELETED_TRANSLATION={FILE:Pt("deleted file"),FOLDER:Pt("deleted
folder"),SHARED_FOLDER:Pt("deleted shared folder"),TEAM_SHARED_FOLDER:Pt("delet
ed team folder"),PUBLIC_FOLDER:Pt("deleted folder"),IMAGE:Pt("deleted image"),VI
DEO:Pt("deleted video"),AUDIO:Pt("deleted audio"),DOCUMENT:Pt("deleted document"
),COMPRESSED_FILE:Pt("deleted archive"),CODE:Pt("deleted code"),DISK_IMAGE:Pt("d
eleted disk image"),EXECUTABLE:Pt("deleted executable"),SHORTCUT:Pt("deleted sho
rtcut"),LINK:Pt("deleted link"),FONT:Pt("deleted font"),SANDBOX:Pt("deleted app
folder")},function(){var e,t,n,i,r;i=mr._CATEGORIES,r=[];for(e in i)n=i[e],r.pus
h(function(){var i,r,o,s;for(o=n.trim().split(" "),s=[],i=0,r=o.length;r>i;i++)t
=o[i],s.push(mr.EXTENSION_TO_CATEGORY[t]=e);return s}());return r}(),mr._file_in
dex={},mr.from_key=function(e){return mr._file_index[e]},mr.from_elem=function(e
){var t;if(e)return t=e.readAttribute("data-identity"),t?mr.from_key(t):mr.from_
elem(e.up("[data-identity]"))};var vr,gr,wr,br,yr,kr,Vn=[].indexOf||function(e){
for(var t=0,n=this.length;n>t;t++)if(t in this&&this[t]===e)return t;return-1};v
r=INLINE_JS.BrowseActions=ut.BrowseActions=Class.create({initialize:function(e){
return this._set_files(e)},firefly_logging_helper:function(e){return Nr.in_searc
h_mode()&&e?(this._firefly_log_values.action_type=e,et.SearchClientActivityLogge
r.log("result_action",Nr.active_user.id,this._firefly_log_values)):void 0},unlis
ten:function(){},get_action_names:function(){var e;return e=this.get_files(),e.l
ength<2?this._get_actions_single(e.first()):this._get_actions_multi(e)},get_file
s:function(){return this._files},get_action_by_name:function(e){return this.eval
uate_action(vr.option_dict[e],e)},evaluate_action:function(e,t){var n,i,r;return
n=function(e){return function(t,n){return null!=n&&null==t?n:ke.isFunction(t)?t

.call(e):null!=t?t:n}}(this),r={icon_href:e.icon_href,target:e.target,click_hand
ler:e.click_handler,type:e.type,name:t||e.name,is_dropdown:!!e.is_dropdown,icon:
n(e.icon),text:n(e.text),detail_text:n(e.detail_text),href:n(e.href,""),kind:n(e
.kind,"icon"),button_label:n(e.button_label,e.text)},ke.isFunction(e.subactions)
?r.subactions=e.subactions.call(this):ke.isArray(e.subactions)?r.subactions=func
tion(){var t,n,r,o;for(r=e.subactions,o=[],t=0,n=r.length;n>t;t++)i=r[t],o.push(
this.get_action_by_name(i));return o}.call(this):e.subactions&&ft(0,"subactions
must be a function or an array of actions"),r},_set_files:function(e){var t;retu
rn this._files=$A(e),this._log_extras={},this.get_files().length>0?(t=e.first(),
this._log_extras={path:t.fq_path,ns_id:t.ns_id},this._firefly_log_values={file_n
sid:t.ns_id,file_sjid:t.sjid,firefly:cr.firefly_enabled,match_type:t.match_type,
position:t.sort_rank,request_id:t.request_id,viewport:"full-view"}):void 0},_get
_actions_single:function(e){var t,n,i,r,o,s,a,_,l,u,d,h,f,p,m,v,g,w,b,y;if(n=[],
!e)return[];if(r=Nr.public_folder_enabled&&e.fq_path.toLowerCase().startsWith("/
public/"),u=Nr.public_folder_enabled&&"/public"===e.fq_path.toLowerCase(),_=e.ta
rget_ns,i=e.ns_id!==c.root_ns,h=e.type===Tt.SHARED_FOLDER,d=e.type===Tt.SANDBOX,
l=e.type===Tt.PACKAGE,a=e.in_root_coll,s=e.compressible,e.is_deleted)n=n.concat(
["restore"]),(null!=(v=Nr.permanent_delete_is_disabled_by_ns_id)?v[e.ns_id]:void
0)||n.push("purge");else if(y=null!=__CONDITIONAL_JS__.UnityFeatures&&(null!=(g
=__CONDITIONAL_JS__.UnityCheckFileCache)?g.is_cached_and_locally_available(e.ns_
id,e.ns_path):void 0),m=y?"open":"download",e.dir?(d?n.push("app_info"):Nr.simpl
e_sharing_enabled?n.push("share_folder_and_token"):h?n.push("sharing_options"):i
||_||r||u||n.push("share"),e.is_shmodelable()&&!Nr.simple_sharing_enabled&&n.pus
h("token_share"),n.push(m),u||(n=n.concat(["delete","rename","move"]),l||_||n.pu
sh("copy")),Nr.can_use_photos_features&&Nr.can_use_photos_features&&n.push("albu
m_from_folder")):(r||Nr.public_app_token?n.push("copy_url"):Nr.simple_sharing_re
act_member_list_enabled?n.push("share_folder_and_token"):e.is_shmodelable()&&n.p
ush("token_share"),n.push(m),Nr.can_show_preview(e)&&Nr.browser_supports_comment
s&&n.push("comment"),n=n.concat(["delete","rename","move","copy","revisions"]),
a&&Nr.can_use_photos_features&&n.push("carousel"===Nr.photos_experience?"view_in
_carousel":"view_in_photos"),s&&n.push("compress")),!Nr.simple_sharing_enabled){
for(b=!1,w=["sharing_options","share","token_share"],f=0,p=w.length;p>f;f++)t=w[
f],o=n.indexOf(t),o>-1&&(n.splice(o,1),b=!0);n.unshift(e.is_shared_folder()||e.c
ould_be_shared_folder()?"single_entry_share_dropdown_variant_menu":"single_entry
_share_dropdown_variant_token_share_only")}return n},_get_actions_multi:function
(e){var t,n,i;return t=["download","delete","move","copy","restore","purge"],t.p
ush("carousel"===Nr.photos_experience?"view_in_carousel":"view_in_photos"),n=lr.
profile_files(e),(n.deleted>0||n.public_folder>0)&&(t.removeItem("move"),t.remov
eItem("copy"),t.removeItem("delete")),n.shared_folders>0&&t.removeItem("copy"),n
.deleted>0&&(t.removeItem("send_copy"),t.removeItem("delete"),t.removeItem("down
load")),Nr.inside_dir||t.removeItem("download"),(n.deleted!==e.length||0!==n.sha
red_folders&&(n.shared_folders!==(i=e.length)||1!==i))&&t.removeItem("restore"),
(n.deleted!==e.length||n.can_permanently_delete!==e.length)&&t.removeItem("purge
"),n.in_root_coll===e.length&&Nr.can_use_photos_features||(t.removeItem("view_in
_photos"),t.removeItem("view_in_carousel")),t},_show_appropriate_sharing_modals:
function(e,t){var n;return Nr.simple_sharing_enabled&&e.dir||Nr.simple_sharing_r
eact_member_list_enabled?void(Et.get_for_user(Nr.active_user).verified_or_show()
&&ei.createAndShowInbandModalFromBrowseFile(Nr.active_user,e)):e.is_shared_folde
r()?(et.ShmodelUILogger.log_with_target_file("sf_options",t,e),tn.show_shared_fo
lder_options_modal(e.fq_path,Nr.active_user)):e.could_be_shared_folder()?(et.Shm
odelUILogger.log_with_target_file("sf_invite",t,e),tn.show_share_existing_modal(
e.fq_path,Nr.active_user)):(et.ShmodelUILogger.log_with_target_file("token_share
",t,e),n=e.fq_path,ft(n,"token_share: expected non-root fq_path"),qn.shmodel(n,t
+"_token_share"))},get_disabled_action_names:function(){var e,t,n,i,r;for(e=!1,r
=this.get_files(),n=0,i=r.length;i>n;n++)if(t=r[n],e=!0,!t.read_only){e=!1;break
}return Nr.inside_read_only_shared_folder||e?["move","rename","delete","restore"
,"purge","upload","new_folder","compress"]:[]},show_disabled_action_warning:func
tion(e){return b.warning(Nr.inside_read_only_shared_folder?"move"===e?Pt("You do
n t have permission to move files in this folder."):"rename"===e?Pt("You don t h
ave permission to rename files in this folder."):"delete"===e?Pt("You don t have

permission to delete files in this folder."):"restore"===e?Pt("You don t have p


ermission to restore files in this folder."):"purge"===e?Pt("You don t have perm
ission to permanently delete files in this folder."):"upload"===e?Pt("You don t
have permission to upload files into this folder."):"new_folder"===e?Pt("You don
t have permission to create a new folder in this folder."):"compress"===e?Pt("Y
ou don t have permision to create a compressed file in this folder."):Pt("You on
ly have permission to view this folder."):Pt("You do not have permission to perf
orm the requested action."))}}),Object.extend(vr,{PUBLIC_FOLDER_PATH_LENGTH:7,sh
owCopyPublicUrlModal:function(e){var t,n;return pi.show(lr.append_ellipsis(Pt("C
opy public link")),Gt.fromElm("copy-public-url"),{wit_group:"copy_public_link"})
,pi.onHide=function(){return $("flash_copy_container").remove(),delete pi.onHide
,pi.hide()},t=ze.clipboard_overlay(e,ke("#real_copy"),function(){return b.succes
s(Pt("Link copied to clipboard!")),pi.hide()}),t.css({zIndex:1001}),n=$("modal-c
ontent").down("#public_url"),ft(n,"Text element not found for copy pulic link"),
n.setValue(e),n.select()},shortenPublicLink:function(){var e;return Kt.shorten_u
rl($F("public_url"),vr.updatePublicLink),e=new Element("img",{id:"publink_loadin
g",src:"/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif",className:"right"
}),$("modal-content").down("a").__date(e)},updatePublicLink:function(e){var t;re
turn $("public_url").setValue(e),$("public_url").select(),$("publink_loading").r
emove(),$("flash_copy_container").remove(),t=ze.clipboard_overlay(e,ke("#real_co
py"),function(){return b.success(Pt("Link copied to clipboard!")),pi.hide()}),t.
css({zIndex:1001})},option_dict:{new_folder:{icon:"folder_add",text:Pt("New fold
er"),click_handler:function(){return Nr.new_folder()}},global_restore:{icon:"res
tore",text:function(){return ft(Nr.inside_deleted_dir,"Global restore from not a
deleted dir"),Nr.inside_deleted_shared_folder?lr.append_ellipsis(Pt("Rejoin sha
red folder")):Pt(Nr.inside_deleted_sandbox?"Restore app folder":"Restore folder"
)},click_handler:function(){var e,t,n,i,r;return e=Nr.containing_fq_path(),n=e.t
oLowerCase(),Nr.inside_deleted_sandbox?(ft(Nr.old_path_to_ns_id[n],"Deleted sand
box missing nsid"),zr.restore_sandbox(Nr.active_user,e,Nr.old_path_to_ns_id[n]))
:Nr.inside_deleted_shared_folder?(ft(Nr.old_path_to_ns_id[n],"Deleted shared fol
der missing nsid"),tn.show_rejoin_modal(Nr.active_user,e,Nr.old_path_to_ns_id[n]
)):(t=o.parse(location.href).setFragment("").toString(),i={prev:t},i[D.UID_PARAM
_NAME]=Nr.active_user,r=o({path:"/restore"+e}).updateQuery(i),window.location.hr
ef=String(r))}},restore:{icon:"restore",text:function(){var e,t;return e=this.ge
t_files(),t=lr.profile_files(e),lr.append_ellipsis(t.shared_folders===e.length?F
t("Rejoin shared folder","Rejoin shared folders",e.length,{comment:"BUTTON"}):Pt
("Restore",{comment:"Restore a previously-deleted file"}))},click_handler:functi
on(){var e,t,n,i,r,s,a,_;if(t=this.get_files(),0===t.length);else{if(1!==t.lengt
h)return _i.show_bulk_restore(t,Nr.active_user);if(e=t.first(),!e.is_deleted)ret
urn;i=e.fq_path,n=i.toLowerCase(),e.type===Tt.SANDBOX?(ft(Nr.old_path_to_ns_id[n
],"Restore missing ns"),zr.restore_sandbox(Nr.active_user,i,Nr.old_path_to_ns_id
[n])):(a=e.type)===Tt.SHARED_FOLDER||a===Tt.TEAM_SHARED_FOLDER?(ft(Nr.old_path_t
o_ns_id[n],"Rejoin missing ns"),tn.show_rejoin_modal(Nr.active_user,i,Nr.old_pat
h_to_ns_id[n])):e.dir?(r=o.parse(location.href).updateQuery({select:e.filename})
,s={prev:String(r)},s[D.UID_PARAM_NAME]=Nr.active_user,_=o({path:"/restore"+e.fq
_path}).updateQuery(s),window.location=String(_)):_i.show_undelete(e)}}},global_
share:{icon:"rainbow_16",text:function(){return lr.append_ellipsis(Nr.inside_tea
m_folder?Pt("Team folder options",{comment:"BUTTON. please keep this as short as
possible"}):Nr.inside_shared_folder?Pt("Shared folder options",{comment:"BUTTON
. please keep this as short as possible."}):""===Nr.containing_fq_path()?Pt("Sha
re a folder",{comment:"BUTTON. this initiates a wizard that lets the user select
a folder to share."}):Pt("Share this folder",{comment:"BUTTON. this button lets
the user share the current folder that they re viewing."}))},click_handler:func
tion(e){var t,n;return e.preventDefault(),""===Nr.containing_fq_path()?tn.start_
wizard_for_user(Nr.active_user):Nr.simple_sharing_enabled?Et.get_for_user(Nr.act
ive_user).verified_or_show()?(t=Nr.inside_shared_folder&&!Nr.containing_ns_path(
),n=t?Nr.containing_ns_id():void 0,ei.createAndShowInbandModal(Nr.active_user,Nr
.containing_fq_path(),!0,n,t,!Nr.inside_shared_folder,Nr.containing_sf_perm_role
())):void 0:Nr.inside_shared_folder?tn.show_shared_folder_options_modal(Nr.conta
ining_mount_point(),Nr.active_user):tn.show_share_existing_modal(Nr.containing_f

q_path(),Nr.active_user)}},sharing_options:{icon:"rainbow_16",text:lr.append_ell
ipsis(Pt("Shared folder options",{comment:"BUTTON"})),click_handler:function(e,t
){var n;return n=this.get_files().first(),et.ShmodelUILogger.log_with_target_fil
e("sf_options",t,n),tn.show_shared_folder_options_modal(n.fq_path,Nr.active_user
)}},share:{icon:"rainbow_16",text:lr.append_ellipsis(Pt("Invite to folder",{comm
ent:"BUTTON"})),click_handler:function(e,t){var n;return n=this.get_files().firs
t(),et.ShmodelUILogger.log_with_target_file("sf_invite",t,n),tn.show_share_exist
ing_modal(n.fq_path,Nr.active_user)}},share_folder_and_token:{icon:"rainbow_16",
text:lr.append_ellipsis(Pt("Share",{comment:"BUTTON"})),click_handler:function(e
,t){var n;return n=this.get_files().first(),this._show_appropriate_sharing_modal
s(n,t)}},revisions:{icon:"previous_versions",click_handler:function(){return win
dow.location.href=_i.build_revisions_uri(this.get_files().first().fq_path,Nr.act
ive_user)},text:Pt("Previous versions",{comment:"BUTTON"})},token_share:{icon:"s
_link",text:lr.append_ellipsis(Pt("Share link",{comment:"BUTTON"})),click_handle
r:function(e,t){var n,i;return n=this.get_files().first(),et.ShmodelUILogger.log
_with_target_file("token_share",t,n),i=n.fq_path,ft(i,"token_share: expected non
-root fq_path"),qn.shmodel(i,t+"_token_share")}},global_token_share:{icon:"s_lin
k",text:lr.append_ellipsis(Pt("Share link",{comment:"BUTTON"})),click_handler:fu
nction(e,t){return et.ShmodelUILogger.log("via-global-toolbar"),qn.shmodel(Nr.co
ntaining_fq_path(),t+"_global_token_share")}},copy_url:{icon:"world_link",text:l
r.append_ellipsis(Pt("Copy public link",{comment:"BUTTON"})),click_handler:funct
ion(){var e,t;return e=this.get_files().first(),t=Nr.public_app_token?"/spa/"+Nr
.public_app_token+e.ns_path:"/u/"+Nr.active_user.id+e.fq_path.substring(vr.PUBLI
C_FOLDER_PATH_LENGTH),vr.showCopyPublicUrlModal(String(new o({scheme:"https",aut
hority:be.PUBSERVER,path:t})))}},download:{icon:"download",text:function(){retur
n Pt("Download",{comment:"BUTTON"})},click_handler:function(){var e,t,n,i,r,s,a,
_;return n=this.get_files(),1!==n.length||n[0].dir?_i.do_bulk_download(n):(t=n.f
irst(),a=[be.BLOCK_CLUSTER,t.fq_path,t.hash],e=a[0],r=a[1],i=a[2],s={w:i,dl:1},_
=o({scheme:"https",authority:e,path:"/get"+r,query:s}),window.location=String(_.
updateQuery(D.UID_PARAM_NAME,Nr.active_user)))}},view:{href:function(){var e,t,n
,i,r;return t=this.get_files().first(),r=[be.BLOCK_CLUSTER,Kt.urlquote(t.fq_path
),t.hash],e=r[0],i=r[1],n=r[2],"https://"+e+"/get"+i+"?w="+n},icon:"page_white_m
agnify",text:Pt("View file",{comment:"BUTTON"})},ignore:{click_handler:function(
){return tn.show_ignore_modal(this.get_files().first().fq_path)},icon:"folder_us
er_delete",text:Pt("Permanently remove",{comment:"BUTTON"})},show_del:{click_han
dler:function(){return Nr.toggle_deleted()},icon:"trash-can",text:Pt("Show delet
ed files",{comment:"BUTTON"})},hide_del:{click_handler:function(){return Nr.togg
le_deleted()},icon:"trash-can-open",text:Pt("Hide deleted files",{comment:"BUTTO
N"})},copy:{icon:"copy",text:lr.append_ellipsis(Pt("Copy",{comment:"BUTTON"})),c
lick_handler:function(){var e,t;return t=this.get_files(),1===t.length?(e=t.firs
t(),_i.show_copy(e.fq_path,e.dir)):t.length>1?_i.show_copy_bulk(t):void 0}},move
:{icon:"move_16",text:lr.append_ellipsis(Pt("Move",{comment:"BUTTON"})),click_ha
ndler:function(){var e,t;return t=this.get_files(),1===t.length?(e=t.first(),_i.
show_move(e.fq_path,e.dir)):t.length>1?_i.show_move_bulk(t):void 0}},rename:{ico
n:"rename",text:Pt("Rename",{comment:"BUTTON"}),click_handler:function(){return
this.get_files().first().edit()}},"delete":{icon:"delete_16",text:lr.append_elli
psis(Pt("Delete",{comment:"BUTTON"})),click_handler:function(){var e,t,n,i,r,o,s
,a;if(n=this.get_files(),s=n.length,s>=1){if(o=n[0].mount_point)for(i=r=1,a=s;a>
=1?a>r:r>a;i=a>=1?++r:--r)if(n[i].mount_point!==o){o="";break}if(e=o?rt.filename
(o):null,s>1)return _i.show_bulk_delete(Nr.active_user,n,e);if(1===s)return t=n[
0],_i.show_delete(Nr.active_user,t.fq_path,t.dir,void 0,e,t.is_shared_folder())}
}},global_purge:{icon:"cancel",text:lr.append_ellipsis(Pt("Permanently delete fo
lder")),click_handler:function(){return _i.show_purge(Nr.containing_fq_path(),!0
)}},purge:{icon:"cancel",text:lr.append_ellipsis(Pt("Permanently delete",{commen
t:"BUTTON"})),click_handler:function(){var e,t;return t=this.get_files(),1===t.l
ength?(e=t.first(),_i.show_purge(e.fq_path,e.dir)):_i.show_bulk_purge(t)}},uploa
d:{icon:"upload_16",text:lr.append_ellipsis(Pt("Upload")),click_handler:function
(){return _i.show_upload()}},app_info:{icon:"application_double",text:lr.append_
ellipsis(Pt("Application info")),click_handler:function(){return window.location
.href="/account/security"}},more_actions:{is_dropdown:!0,text:Pt("More",{comment

:"Show more options"}),click_handler:Prototype.emptyFunction},more_global_action


s:{text:Pt("More actions"),click_handler:function(){return yr.show_secondary(),d
ocument.body.observe("click",yr.hide_secondary)}},view_in_photos:{icon:"s_photo"
,text:function(){return Pt("View in Photos")},click_handler:function(){var e;ret
urn e=this.get_files(),_i.do_bulk_photo_view(Nr.active_user,e)}},compress:{icon:
"s_photo",text:function(){return Pt("Compress (experimental)")},click_handler:fu
nction(){var e;return e=this.get_files(),_i.show_compress_bulk(Nr.active_user,e)
}},view_in_carousel:{icon:"s_carousel",text:function(){return Pt("View in Timeli
ne")},click_handler:function(){var e;return e=this.get_files(),_i.do_bulk_photo_
view(Nr.active_user,e)}},album_from_folder:{icon:"create-album",text:function(){
return Pt("Create album")},click_handler:function(){var e,t;return e=this.get_fi
les(),t=e.first(),_i.create_album_from_folder(t.fq_path,t.filename)}},open:{icon
:"open",text:function(){return Pt("Open")},click_handler:function(){var e;return
e=this.get_files().first(),__CONDITIONAL_JS__.UnityFeatures.open_file(e.ns_id,e
.ns_path,e.user_id,__CONDITIONAL_JS__.UnityFeatures.standard_open_file_handler,f
unction(){return __CONDITIONAL_JS__.UnityFeatures.standard_open_file_handler(!1)
})}},comment:{icon:"s_file_comment",text:function(){return Pt("Comment",{comment
:"BUTTON"})},click_handler:function(e){var t;return t=this.get_files().first(),N
r.open_preview(t,e,!1,!0)}},single_entry_share_dropdown_variant_token_share_only
:{icon:"s_rainbow",text:lr.append_ellipsis(Pt("Share")),click_handler:function(e
,t){var n;return n=this.get_files().first(),et.ShmodelUILogger.log_with_target_f
ile("single_entry_share_click",t,n),qn.shmodel(n.fq_path,t)}},single_entry_share
_dropdown_variant_menu:{icon:"s_rainbow",text:lr.append_ellipsis(Pt("Share")),is
_dropdown:!0,subactions:["single_entry_share_dropdown_variant_menu_invite_option
","single_entry_share_dropdown_variant_menu_token_share_option"],click_handler:f
unction(){},hover_handler:function(e,t){var n;return n=this.get_files().first(),
et.ShmodelUILogger.log_with_target_file("single_entry_share_hover",t,n)}},single
_entry_share_dropdown_variant_menu_invite_option:{icon:"user_add",text:lr.append
_ellipsis(Pt("Invite people to collaborate")),click_handler:function(e,t){var n,
i,r,o;if(n=this.get_files().first(),n.is_shared_folder()){if(Et.get_for_user(Nr.
active_user).verified_or_show())return et.ShmodelUILogger.log_with_target_file("
sf_options",t,n),i=new on(Nr.active_user,n.fq_path),i.show()}else if(o=Nr.verify
_email_after_share_experiment_variant,r=o&&"VERIFY_LAST"===o,r?et.UserActivityLo
gger.log("web","email_verify_last_experiment_shown"):o&&et.UserActivityLogger.lo
g("web","email_verify_last_experiment_not_shown"),r||Et.get_for_user(Nr.active_u
ser).verified_or_show())return et.ShmodelUILogger.log_with_target_file("sf_invit
e",t,n),i=new Tn(Nr.active_user,{folder_name:n.fq_path,element_id:"invite-to-new
-sf-wizard-modal-"+Nr.active_user.id,must_check_verified:r}),i.show()}},single_e
ntry_share_dropdown_variant_menu_token_share_option:{icon:"s_link",text:lr.appen
d_ellipsis(Pt("Send link")),click_handler:function(e,t){var n;return n=this.get_
files().first(),et.ShmodelUILogger.log_with_target_file("token_share",t,n),qn.sh
model(n.fq_path,t)}}}}),wr=ut.BrowseActionsContext=Class.create(vr,{initialize:f
unction($super,e){return $super(e),this._listen()},_listen:function(){return $("
context-menu-container").stopObserving("click"),$("context-menu-container").stop
Observing("contextmenu"),ke("#context-menu-container").off("mouseenter"),$("cont
ext-menu-container").on("click",".action button",this._click.bind(this)),$("cont
ext-menu-container").on("contextmenu",".action button",this._click.bind(this)),k
e("#context-menu-container").on("mouseover","li.primary",this._over.bind(this)),
ke("#context-menu-container").on("mouseout","li.primary",this._out.bind(this)),k
e("#context-menu-container").on("mouseenter",".action button",this._enter.bind(t
his))},_click:function(e,t){var n,i;return n=t.readAttribute("data-value"),Vn.ca
ll(this.get_disabled_action_names(),n)>=0?(this.show_disabled_action_warning(n),
!1):(et.TimeToFirstActionLogger.log(Nr.active_user.id,n),this.firefly_logging_he
lper(n),i=vr.option_dict[n],et.BrowseActionsContextMenuLogger.log(this.get_files
(),n),(!i.is_dropdown||t.hasAttribute("submenu-index"))&&Dr.hide(),e.preventDefa
ult(),i.click_handler.call(this,G.OREF_CONSTANTS.BROWSE_COMMENT_CONTEXTMENU,e,"b
rowse_actions_context"),"sharing_options"===n&&et.SharedFolderActivityLogger.log
("web","browse_view_options",Nr.active_user,this._log_extra,!0),"share"===n?et.S
haredFolderActivityLogger.log("web","browse_view_share_existing",Nr.active_user,
this._log_extras,!0):void 0)},_reset_all_submenus:function(){return ke("#context

-menu-container .hover").removeClass("hover")},_reset_submenu:function(e){return
ke(e).removeClass("hover")},_enter:function(e){var t,n,i;return t=ke(e.currentT
arget).data("value"),ft(t),n=vr.option_dict[t],ft(n,"Action info is missing for
"+t),null!=(i=n.hover_handler)?i.call(this,e,"browse_actions_context"):void 0},_
over:function(e){return ke(e.currentTarget).children(".secondary").length?(clear
Timeout(this.timeoutID),this._reset_all_submenus(),ke(e.currentTarget).addClass(
"hover")):void 0},_out:function(e){return ke(e.currentTarget).children(".seconda
ry").length?this.timeoutID=setTimeout(function(t){return function(){return t._re
set_submenu(e.currentTarget)}}(this),300):void 0}}),gr=ut.BrowseActionsBasic=Cla
ss.create(vr,{initialize:function($super){var e;return e=xr.get_selected_files()
,$super(e),this._render(),this._listen()},_listen:function(){var e;return this.b
ound_update=this._update.bind(this),this.bound_disable=this._disable.bind(this),
this.bound_enable=this._enable.bind(this),this.bound_click=this._click.bind(this
),document.observe(xr.UPDATED_EVT,this.bound_update),document.observe(Dr.SHOW_EV
T,this.bound_disable),document.observe(Dr.HIDE_EVT,this.bound_enable),e=$("brows
e-root-actions"),e.stopObserving("click"),e.on("click",".action button",this.bou
nd_click)},unlisten:function(){return document.stopObserving(xr.UPDATED_EVT,this
.bound_update),document.stopObserving(Dr.SHOW_EVT,this.bound_disable),document.s
topObserving(Dr.HIDE_EVT,this.bound_enable),$("browse-root-actions").stopObservi
ng("click",this.bound_click)},_update:function(){return this._set_files(xr.get_s
elected_files()),this._render()},_disable:function(){return $("browse-root-actio
ns").stopObserving("click"),$("browse-root-actions").down(".secondary")&&$("brow
se-root-actions").down(".secondary").addClassName("disabled"),$$("#browse-root-a
ctions .action *").invoke("setStyle",{cursor:"default"})},_disable_action:functi
on(e){var t,n;return n="#browse-root-actions #"+e+"_action_button",t=ke(n),t.add
Class("disabled"),t.click(function(t){return function(){return t.show_disabled_a
ction_warning(e),!1}}(this))},_enable:function(){return $("browse-root-actions")
.stopObserving("click"),$("browse-root-actions").on("click",".action button",thi
s._click.bind(this)),$("browse-root-actions").down(".secondary")&&$("browse-root
-actions").down(".secondary").removeClassName("disabled"),$$("#browse-root-actio
ns .action *").invoke("setStyle",{cursor:"pointer"})},_render:function(){var e,t
,n,i,r,o,s,a,l,u,d,c,h,f,p,m,v,g,w,b,y,k,E,x,S,C,T,A,D,O,N,I;if(c=this.get_files
(),n=this.get_action_names(),!Nr.simple_sharing_enabled)for(D=["single_entry_sha
re_dropdown_variant_token_share_only","single_entry_share_dropdown_variant_menu"
],m=0,w=D.length;w>m;m++)if(t=D[m],p=n.indexOf(t),p>-1){n.splice(p,1);break}for(
e=13.5,l="",h="",1===c.length?(l=_.em_snippet(c[0].filename,e),!c[0].dir&&c[0].b
ytes>=0&&(h=c[0].size)):1<c.length&&(C=lr.profile_files(c),k=[],C.files&&(E=Ft("
%d file","%d files",C.files).format(C.files),k.push(E)),C.folders&&(E=Ft("%d fol
der","%d folders",C.folders).format(C.folders),k.push(E)),l=Kt.nice_list(k)),o=$
("browse-root-actions"),r=o.getLayout().get("width"),f=o.getStyle("font-size"),f
t(f.endsWith("px"),"Invalid font size "+f),f=parseInt(f,10),u=new _(l).length*f,
O=new _(h).length*f,r-=u+O,N=[],A=[],r-=30,v=0,b=n.length;b>v;v++)x=n[v],t=this.
get_action_by_name(x),I=new _(t.text).length*f,s=I+16+8+10+9,r>s?N.push(x):(0===
A.length&&(S=N.pop(),A.push(S)),A.push(x)),r-=s;for(A.length&&N.push("more_actio
ns"),i=function(){var e,t,n;for(n=[],e=0,t=N.length;t>e;e++)x=N[e],n.push(this.g
et_action_by_name(x));return n}.call(this),A.length&&(i[i.length-1].subactions=f
unction(){var e,t,n;for(n=[],e=0,t=A.length;t>e;e++)x=A[e],n.push(this.get_actio
n_by_name(x));return n}.call(this)),a=ot.tmpl("actions_bar_tmpl",{context:this,d
escription:l,filesize:h,has_actions:!!n.length,actions:i,_:Pt,Sprite:Q}),$("brow
se-root-actions").__date(a),d=this.get_disabled_action_names(),T=[],g=0,y=d.leng
th;y>g;g++)t=d[g],T.push(this._disable_action(t));return T},_click:function(e,t)
{var n,i;return n=t.readAttribute("data-value"),ft(n),this.firefly_logging_helpe
r(n),i=vr.option_dict[n],ft(i,"Action info is missing for "+n),e.preventDefault(
),et.TimeToFirstActionLogger.log(Nr.active_user.id,n),i.click_handler.call(this,
G.OREF_CONSTANTS.BROWSE_COMMENT_BUTTON,e,"browse_actions_basic"),"sharing_option
s"===n&&et.SharedFolderActivityLogger.log("web","browse_view_select_folder_optio
ns",Nr.active_user,this._log_extras,!0),"share"===n?et.SharedFolderActivityLogge
r.log("web","browse_view_select_share_existing",Nr.active_user,this._log_extras,
!0):void 0}}),Object.extend(gr,{STANDARD_ACTIONS:["share","sharing_options","app
_info","token_share","copy_url","download","delete","rename","restore","purge","

view_in_photos","view_in_carousel","compress"]}),br=ut.GlobalActions=Class.creat
e(vr,{initialize:function($super){return $super()},get_action_names:function(){v
ar e;return Nr.inside_dir?(e=[],Nr.inside_deleted_dir?e=e.concat(["global_restor
e"]):(e=e.concat(["upload","new_folder"]),this._should_show_shared_folder_option
s()&&e.push("global_share"),this._should_show_share_link()&&e.push("global_token
_share"),e.push(Nr.deleted_shown?"hide_del":"show_del")),e):[]},_should_show_sha
red_folder_options:function(){return!Nr.is_in_subfolder_of_shared_folder()&&!Nr.
inside_sandbox},_should_show_share_link:function(){return!Nr.inside_team_folder&
&Nr.is_shmodelable_path(Nr.containing_fq_path())}}),yr=ut.GlobalActionsBasic=Cla
ss.create(br,{initialize:function($super){return $super(),this._listen(),this._r
ender()},_listen:function(){return $("global-actions").stopObserving("click"),$(
"global-actions").on("click","a",this._click.bind(this)),document.observe(Dr.SHO
W_EVT,this._disable.bind(this)),document.observe(Dr.HIDE_EVT,this._enable.bind(t
his))},_render:function(){var e,t,n,i,r,o,s,a,_,l,u,d,c;for(t=this.get_action_na
mes(),c=t.intersect(yr.STANDARD_ACTIONS),u=t.without.apply(t,yr.STANDARD_ACTIONS
),1===u.length&&(c=t,u=[]),u.length&&c.push("more_global_actions"),d=function(){
var e,t,n;for(n=[],e=0,t=c.length;t>e;e++)a=c[e],n.push(this.get_action_by_name(
a));return n}.call(this),n=function(){var t,n,i;for(i=[],t=0,n=d.length;n>t;t++)
e=d[t],"button"===e.kind&&i.push(e);return i}(),_=function(){var t,n,i;for(i=[],
t=0,n=d.length;n>t;t++)e=d[t],"button"!==e.kind&&i.push(e);return i}(),i=ot.tmpl
("global_actions_tmpl",{context:this,standard_actions:n.concat(_),secondary_acti
ons:function(){var e,t,n;for

Das könnte Ihnen auch gefallen