if (self.CavalryLogger) { CavalryLogger.start_js(["c3J6m"]); } __d("ProfileWizardProfilePictureManager",["Arbiter","TimelineProfilePicConfig","tidyEvent"],(function(a,b,c,d,e,f){__p&&__p();a=function(){"use strict";__p&&__p();function a(){this.$1=!1,this.$2=!1}var c=a.prototype;c.informProfilePictureUploaded=function(a){b("Arbiter").inform("profileChanged",a)};c.isOpen=function(){return this.$1};c.hasProfileChanged=function(){return this.$2};c.setIsOpen=function(a){this.$1=a};c.subscribeOnceProfilePictureUploaded=function(a){b("tidyEvent")([b("Arbiter").subscribeOnce("profileChanged",a),b("Arbiter").subscribeOnce(b("TimelineProfilePicConfig").success,a)])};return a}();e.exports=new a()}),null); __d("XProfilePicCropAsyncController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/profile/picture/crop_profile_pic/",{photo_id:{type:"Int",required:!0},profile_id:{type:"Int",required:!0},height:{type:"Float",required:!0},width:{type:"Float",required:!0},x:{type:"Float",required:!0},y:{type:"Float",required:!0},source:{type:"Enum",defaultValue:"timeline",enumType:1},method:{type:"Enum",defaultValue:"existing",enumType:1},redirect_uri:{type:"String"},sticker_id:{type:"Int"},expiration_duration:{type:"Int"},caption:{type:"String"},overlay_source_object_id:{type:"FBID"},payment_id:{type:"FBID"},set_profile_photo_shield:{type:"String"},sessionid:{type:"String"}})}),null); __d("XProfilePicMakeAsyncController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/profile/picture/make_profile_pic/",{end_x:{type:"Float"},end_y:{type:"Float"},photo_id:{type:"Int",required:!0},profile_id:{type:"Int",required:!0},source:{type:"Enum",defaultValue:"timeline",enumType:1},start_x:{type:"Float"},start_y:{type:"Float"},method:{type:"Enum",defaultValue:"existing",enumType:1},expiration_duration:{type:"Int"},caption:{type:"String"},sticker_source_object_id:{type:"Int"}})}),null); __d("XProfilePicSaver",["ArbiterMixin","AsyncRequest","AsyncUploadRequest","ProfilePictureFlowLogging","XProfilePicCropAsyncController","XProfilePicMakeAsyncController","mixin","tidyEvent"],(function(a,b,c,d,e,f){__p&&__p();var g=b("ProfilePictureFlowLogging").step;a=function(a){"use strict";__p&&__p();babelHelpers.inheritsLoose(c,a);function c(c,d,e,f){var g;f===void 0&&(f=b("XProfilePicCropAsyncController").getURIBuilder());g=a.call(this)||this;g.$XProfilePicSaver1=c;g.$XProfilePicSaver2=d;g.$XProfilePicSaver3=e;g.$XProfilePicSaver10=f;return g}var d=c.prototype;d.setProfilePhotoSource=function(a){this.$XProfilePicSaver4=a;return this};d.setProfilePhotoMethod=function(a){this.$XProfilePicSaver5=a;return this};d.setFlowType=function(a){this.$XProfilePicSaver6=a;return this};d.setProfilePhotoShield=function(a){a&&(this.$XProfilePicSaver8="true");return this};d.setSessionID=function(a){this.$XProfilePicSaver9=a;return this};d.saveCroppedProfilePic=function(a,b,c,d,e){a=this.$XProfilePicSaver10.setFloat("x",a.x).setFloat("y",a.y).setFloat("width",Math.min(a.width,1)).setFloat("height",Math.min(a.height,1));b&&a.setInt("sticker_id",b.id);e&&a.setFBID("payment_id",e);this.$XProfilePicSaver8&&a.setString("set_profile_photo_shield",this.$XProfilePicSaver8);this.$XProfilePicSaver9&&a.setString("sessionid",this.$XProfilePicSaver9);this.$XProfilePicSaver7=!0;this.$XProfilePicSaver11(a,b,c,d);this.$XProfilePicSaver12(g.CROP_SAVING)};d.saveAsProfilePic=function(){this.$XProfilePicSaver13()};d.saveAsProfilePicWithPosition=function(a,b){this.$XProfilePicSaver13(a,b)};d.$XProfilePicSaver13=function(a,c){this.$XProfilePicSaver7=!1;var d=b("XProfilePicMakeAsyncController").getURIBuilder();a&&d.setFloat("start_x",100*a.startX).setFloat("start_y",100*a.startY).setFloat("end_x",100*a.endX).setFloat("end_y",100*a.endY);this.$XProfilePicSaver11(d,null,c);this.$XProfilePicSaver12(g.PREVIOUS_PIC_SAVING)};d.$XProfilePicSaver14=function(a){this.inform("error",a),this.$XProfilePicSaver12(this.$XProfilePicSaver7?g.CROP_FAIL:g.PREVIOUS_PIC_FAIL)};d.$XProfilePicSaver12=function(a){this.$XProfilePicSaver6&&b("ProfilePictureFlowLogging").setFlowType(this.$XProfilePicSaver6),b("ProfilePictureFlowLogging").log(a)};d.$XProfilePicSaver11=function(a,c,d,e){__p&&__p();var f=this;a.setInt("photo_id",this.$XProfilePicSaver1).setInt("profile_id",this.$XProfilePicSaver2).setEnum("source",this.$XProfilePicSaver4||"photo_view").setInt("expiration_duration",this.$XProfilePicSaver3);this.$XProfilePicSaver5&&a.setEnum("method",this.$XProfilePicSaver5);d&&a.setString("caption",d);e&&a.setFBID("overlay_source_object_id",e);c&&c.canvas?c.canvas.toBlob(function(c){c=new(b("AsyncUploadRequest"))().setFiles({farr:c}).setAllowCrossOrigin(!0).setURI(a.getURI());b("tidyEvent")([c.subscribe("success",f.$XProfilePicSaver15.bind(f)),c.subscribe("failure",f.$XProfilePicSaver16.bind(f))]);c.send()}):new(b("AsyncRequest"))(a.getURI()).setErrorHandler(this.$XProfilePicSaver14.bind(this)).setHandler(this.$XProfilePicSaver17.bind(this)).send();this.$XProfilePicSaver12(g.LOADING)};d.$XProfilePicSaver15=function(a,b){this.$XProfilePicSaver17(b.getResponse())};d.$XProfilePicSaver16=function(a,b){this.$XProfilePicSaver14(b.getResponse())};d.$XProfilePicSaver17=function(a){this.inform("success",a),this.$XProfilePicSaver12(this.$XProfilePicSaver7?g.CROP_SUCCESS:g.PREVIOUS_PIC_SUCCESS),this.$XProfilePicSaver12(g.SUCCESS)};return c}(b("mixin")(b("ArbiterMixin")));e.exports=a}),null); __d("AdminToDosUtils",["ActorURI","AsyncRequest","PagesCreationTypedLogger","XPagesAdminToDosSaveCurrentStepAsyncController","XPagesCoverPhotoSaveAsyncController","XProfilePicSaver"],(function(a,b,c,d,e,f){"use strict";__p&&__p();var g={uploadProfilePictureAndRedirect:function(a,c,d){a=new(b("XProfilePicSaver"))(a,c);a.saveAsProfilePic();g.logEvent("pages_creation_click","admin_to_dos","add_profile_picture",null,c);new(b("AsyncRequest"))().setURI(b("XPagesAdminToDosSaveCurrentStepAsyncController").getURIBuilder().setFBID("page_id",c).setEnum("step",d).setEnum("event","profile_picture_upload_button_click").getURI()).setMethod("POST").send()},uploadCoverPhotoAndRedirect:function(a,c,d){new(b("AsyncRequest"))().setURI(b("ActorURI").create(b("XPagesCoverPhotoSaveAsyncController").getURIBuilder().setFBID("page_id",c).setFBID("photo_id",a).setFloat("focus_x",0).setFloat("focus_y",0).getURI(),c)).send(),g.logEvent("pages_creation_click","admin_to_dos","add_cover_photo","success",c),new(b("AsyncRequest"))().setURI(b("XPagesAdminToDosSaveCurrentStepAsyncController").getURIBuilder().setFBID("page_id",c).setEnum("step",d).setEnum("event","cover_photo_upload_button_click").getURI()).setMethod("POST").send()},appointmentSetupAndRedirect:function(a){g.logEvent("pages_creation_click","admin_to_dos","setup_appointments",null,a),new(b("AsyncRequest"))().setURI(b("XPagesAdminToDosSaveCurrentStepAsyncController").getURIBuilder().setFBID("page_id",a).setEnum("step","appointment_setup").setEnum("event","appointment_setup_button_click").getURI()).setMethod("POST").send()},logEvent:function(a,c,d,e,f){new(b("PagesCreationTypedLogger"))().setEvent(a).setEventRef(c).setEventTarget(d).setEventResult(e).setPageID(f).log()}};e.exports=g}),null); __d("PhotoZoomCropStrings",["fbt"],(function(a,b,c,d,e,f,g){a={BUTTON_ZOOM_IN:g._("Zoom in"),BUTTON_ZOOM_OUT:g._("Zoom out")};e.exports=a}),null); __d("PhotoZoomCropSlider.react",["cx","AbstractRangeInput.react","PhotoZoomCropStrings","React","clamp","joinClasses"],(function(a,b,c,d,e,f,g){__p&&__p();a=b("React").PropTypes;var h=6;c=b("React").createClass({displayName:"PhotoZoomCropSlider",propTypes:{onZoom:a.func.isRequired,position:a.number,zoom:a.number,zoomRange:a.object.isRequired},render:function(){var a=this.props.zoomRange,c=a.max===this.props.zoom,d=a.min===this.props.zoom;return b("React").createElement("div",{className:b("joinClasses")(this.props.className,"_55vh")},b("React").createElement("button",{className:(d?"_4nc5":"")+" _4nc6",onClick:this._minus,tabIndex:d?-1:0,title:b("PhotoZoomCropStrings").BUTTON_ZOOM_OUT}),b("React").createElement(b("AbstractRangeInput.react"),{className:"_55vj",disabled:a.max===a.min,max:a.max,min:a.min,onChange:this._logarithmicZoom,values:[this.props.position]}),b("React").createElement("button",{className:(c?"_4nc5":"")+" _4nc7",onClick:this._plus,tabIndex:c?-1:0,title:b("PhotoZoomCropStrings").BUTTON_ZOOM_IN}))},_logarithmicZoom:function(a){__p&&__p();var c=this.props.zoomRange,d=c.max;c=c.min;var e=Math.log2(d),f=Math.log2(c);a=a[0];e=(e-f)/d;var g=Math.exp(f+e*d),h=Math.exp(f+e*c);f=Math.exp(f+e*a);e=b("clamp")((f-h)/(g-h),0,100);f=c+e*(d-c);this.props.onZoom([f],a)},_zoomInDirection:function(a){var c=this.props.zoomRange,d=c.max;c=c.min;this.props.onZoom([b("clamp")(this.props.zoom+a*(d-c)/h,c,d)])},_minus:function(){this._zoomInDirection(-1)},_plus:function(){this._zoomInDirection(1)}});e.exports=c}),null); __d("ProfilePicCoordinatesUtil",[],(function(a,b,c,d,e,f){a={getThumbnailCoordinates:function(a,b){return{endX:Math.abs((a.x+a.width)/b.width),endY:Math.abs((a.y+a.height)/b.height),startX:Math.abs(a.x/b.width),startY:Math.abs(a.y/b.height)}}};e.exports=a}),null); __d("ProfilePicCropViewerStrings",["fbt"],(function(a,b,c,d,e,f,g){a={BUTTON_CANCEL:g._("Cancel"),BUTTON_CLOSE:g._("Close"),BUTTON_EDIT:g._("Edit"),BUTTON_MAKE_TEMPORARY:g._("Make Temporary"),BUTTON_SAVE:g._("Save"),CAPTION_INPUT_PLACEHOLDER:g._("Add a description..."),CROP_AND_SAVE:g._("Crop Photo"),CROP_EXPLANATION:g._("Crop this photo before saving it as your profile picture."),CROP_INSTRUCTIONS:g._("Move the box to where you want to crop your photo. Drag the corners in or out to adjust the size."),CROP_SAVING:g._("Saving Profile Picture..."),DIALOG_TITLE:g._("Switch back to previous profile picture at"),LEAVE_WARNING_BODY:g._("The changes you made to your profile picture won't be saved if you close this dialog."),LEAVE_WARNING_CANCEL:g._("Stay on This Page"),LEAVE_WARNING_OK:g._("Leave This Page"),LEAVE_WARNING_TITLE:g._("Changes Not Saved"),LEAVE_WARNING_UNLOAD:g._("The changes you made to your profile picture haven't been saved."),LOADING:g._("Loading..."),PREV_PHOTO_ADJUST_THUMBNAIL:g._("This photo is a previous profile picture."),FRAME_PREVENTS_CROP:g._("You cannot crop the photo after adding a frame."),PREVIOUS_PIC:g._("This photo is a previous profile picture. Do you want to use it again?"),PROFILE_PIC_VISIBILITY:g._("Your current profile picture is always public."),TEMPORARY_PROFILE_PIC_CONTROL:g._("Switch back to previous profile picture in"),TEMPORARY_OPTION_ONE_HOUR:g._("1 Hour"),TEMPORARY_OPTION_ONE_DAY:g._("1 Day"),TEMPORARY_OPTION_ONE_WEEK:g._("1 Week"),TEMPORARY_OPTION_NEVER:g._("Never"),TEMPORARY_OPTION_CUSTOM:g._("Custom"),HIDDEN_FROM_NEWS_FEED:g._("Changes will not appear in News Feed."),SAVE_AND_CROP:g._("Crop and Save"),SAVED_BODY:g._("Your profile picture was successfully saved."),SAVED_TITLE:g._("Profile Picture Saved"),SET_THUMBNAIL:g._("Set Thumbnail"),SKIP_CROP:g._("Skip Cropping"),SKIP_CROP_EXPLANATION:g._("Save the entire photo as your profile picture and set the thumbnail."),THUMBNAIL_MODE_EXPLANATION:g._("The entire photo will be saved as your profile picture. Reposition the photo to set the thumbnail."),UMG_TITLE:g._("Create Profile Picture"),UPLOADING:g._("Uploading..."),USE_AS_PROFILE_PICTURE:g._("Use as Profile Picture"),SMALL_PHOTO_WARNING:g._("This photo is small and your profile picture will be less clear."),ZOOM_WARNING:g._("Zooming in this close will make your profile picture less clear.")};e.exports=a}),null); __d("JobApplicationFormEmailValidator",[],(function(a,b,c,d,e,f){"use strict";var g=new RegExp("^[A-Za-z0-9_!#$%&'*+/=?^`{|}~-]+(?:\\.[A-Za-z0-9_!#$%&'*+/=?^`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?$");e.exports=function(a){return a===void 0||a===null?!1:g.test(a)}}),null); __d("XPhotoCropSaverAsyncController",["XController"],(function(a,b,c,d,e,f){e.exports=b("XController").create("/photo/crop/upload/",{photo_id:{type:"Int",required:!0},height:{type:"Float",required:!0},width:{type:"Float",required:!0},x:{type:"Float",required:!0},y:{type:"Float",required:!0},source:{type:"Enum",enumType:0}})}),null);