PageSourceSearch

https://www.charitywater.org/vite/assets/Photo-CzCLlOJw.js

js charitywater.org collected 2026-09-24 06:54:50 UTC 3,310 bytes, 2 lines download raw bytes

1var i=Object.defineProperty;var h=(a,o,t)=>o in a?i(a,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[o]=t;var s=(a,o,t)=>h(a,typeof o!="symbol"?o+"":o,t);import{aP as e}from"./store-DUosIV5A.js";import n from"./PhotoModal-WVw-Cg9o.js";import r from"./Modal-CeM2dICs.js";import{c as l}from"./index-B_D4uYdN.js";import{a as d}from"./application-CegkUz9G.js";class b extends d.Component{constructor(t){super(t);s(this,"componentDidMount",()=>{this.props.currentUrl&&this.renderImage(this.props.currentUrl)});s(this,"triggerFileDialog",t=>{t.preventDefault(),this.file.click()});s(this,"handleChange",()=>{const t=new FileReader;t.addEventListener("load",()=>{this.setState({chosenPhoto:null}),this.renderImage(t.result)}),event.target.files[0]&&t.readAsDataURL(event.target.files[0]),this.maybeUpdatePhotoOrigin("uploaded")});s(this,"renderImage",t=>{this.image.src=t});s(this,"toggleModal",t=>{t.preventDefault(),this.modal.toggle()});s(this,"choosePhoto",t=>{this.modal.toggle(),this.renderImage(t.url),this.setState({chosenPhoto:t.rawUrl}),this.maybeUpdatePhotoOrigin("chose-cw-photo")});s(this,"maybeUpdatePhotoOrigin",t=>{this.props.updatePhotoOrigin&&this.props.updatePhotoOrigin(t)});s(this,"buttonText",()=>this.props.buttonText!=null?this.props.buttonText:"Choose <span class='em'>one of ours</span>");this.state={attrName:t.attrName||"hero",chosenAttrName:t.chosenAttrName||"chosen_photo",chosenPhoto:null,disableChoosePhotoHistory:this.props.disableChoosePhotoHistory||!1,subheaderText:t.subheaderText!=null?t.subheaderText:"For best results, upload a photo in landscape orientation.",showHint:t.showHint!=null?t.showHint:!0,showLabel:t.showLabel!=null?t.showLabel:!0,showUploadButton:t.showUploadButton!=null?t.showUploadButton:!0}}render(){return e.jsxs("div",{className:`photo ${this.props.containerClasses}`,children:[this.state.showLabel&&e.jsx("label",{children:"Campaign Photo"}),e.jsxs("p",{className:l("",{"hint--top":this.state.showHint}),"data-hint":"16:9 images and 1920x1080 resolutions work the best.",children:[this.state.subheaderText,this.state.showHint&&e.jsx("i",{className:"cw-icon cw-icon-question-sign text-xs"})]}),e.jsxs("div",{className:"preview-container",children:[e.jsx("div",{className:"mt-2 pointer-events-none preview attached",children:e.jsx("img",{className:"object-cover w-full h-full",ref:t=>this.image=t})}),e.jsxs("div",{className:"flex justify-between",children:[this.state.showUploadButton&&e.jsxs("button",{className:"button images upload",onClick:this.triggerFileDialog,children:["Upload",e.jsx("span",{className:"em",children:"your own photo"})]}),e.jsx("button",{className:"button images choose",dangerouslySetInnerHTML:{__html:this.buttonText()},onClick:this.toggleModal,ref:t=>this.modalToggler=t})]})]}),e.jsx("input",{accept:"image/*",name:`campaign[${this.state.attrName}]`,onChange:this.handleChange,ref:t=>this.file=t,type:"file"}),this.state.chosenPhoto&&e.jsx("input",{name:this.state.chosenAttrName,type:"hidden",value:this.state.chosenPhoto}),e.jsx(r,{containerClassName:"choose-ours",disableHistory:this.state.disableChoosePhotoHistory,modalId:"choose-ours",ref:t=>this.modal=t,children:e.jsx(n,{choosePhoto:this.choosePhoto,defaultPhotos:this.props.defaultPhotos})})]})}}export{b as default};
2//# sourceMappingURL=Photo-CzCLlOJw.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.