1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7b3d3553-611e-5d1d-b82e-7b2664c1bc41")}catch(e){}}(); 3(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7429,9983],{6118:(e,t,r)=>{"use strict";r.d(t,{k:()=>l});var n=r(81882),i=r(15531),a=r.n(i),o=r(76768);let l=e=>{let t=document.getElementById(e);return t?new(a())(t,{navbar:2,title:2,toolbar:!1,movable:!0,rotatable:!1,zoomable:!0,transition:!1,url(e){try{return n.exclude(e.src,["w","h"])}catch(t){return o.v.warn("this url is invalid",t),e.src}}}):(o.v.info("[initImageGallery] container not found, so do nothing"),null)}},6585:(e,t,r)=>{"use strict";r.d(t,{M:()=>o});var n=r(94653),i=r.n(n);let a="https://storage.googleapis.com",o=(e,t,r="")=>((e,t,r="",n="")=>{if(!e.startsWith(a))return e;let o=e.replace(a,""),l=i().join("/api/fileproxy",r,o),c=n&&`&filename=${n}`,s=`?tenantId=${t}${c}`;return`${l}${s}`})(e,t,"/file",r)},11345:(e,t,r)=>{"use strict";var n=r(3396);t.A=void 0;var i=n(r(70348)),a=r(2183);t.A=(0,i.default)((0,a.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert")},11591:(e,t,r)=>{var n=r(48649),i=r(39881),a=r(95617),o=r(69413),l=r(13573),c=r(50017);e.exports=function(e,t,r){var s=-1,h=i,d=e.length,u=!0,f=[],g=f;if(r)u=!1,h=a;else if(d>=200){var p=t?null:l(e);if(p)return c(p);u=!1,h=o,g=new n}else g=t?[]:f;e:for(;++s<d;){var m=e[s],v=t?t(m):m;if(m=r||0!==m?m:0,u&&v==v){for(var x=g.length;x--;)if(g[x]===v)continue e;t&&g.push(v),f.push(m)}else h(g,v,r)||(g!==f&&g.push(v),f.push(m))}return f}},13573:(e,t,r)=>{var n=r(60853),i=r(1410),a=r(50017);e.exports=n&&1/a(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i},37721:(e,t,r)=>{"use strict";r.d(t,{N:()=>_});var n=r(45023),i=r(2004),a=r.n(i),o=r(36439),l=r(25008),c=r.n(l),s=r(38356),h=r.n(s),d=r(90524),u=r(41471),f=r(22136),g=r(95415),p=r(28442);let m={q:50,fit:"max"},v=o.forwardRef((e,t)=>{let r="image",{className:i}=e,a=encodeURI(e.src);if((0,p.a)(a))return(0,n.Y)("img",{className:c()("card-img",r,i),src:a,alt:"",ref:t,onClick:e.onClick,style:e.style});let o="640px";e.width?o=`${e.width}px`:e.height&&(o=`${2*e.height}px`);let l=e.imgixParams??m;return(0,n.Y)(f.Ay,{htmlAttributes:{alt:e.alt,onClick:e.onClick,style:e.style},src:(0,g.p)(a),className:c()(r,i),imgixParams:l,sizes:o,ref:t,height:e.height,width:e.width})});var x=r(8089),b=r(28115),y=r(2759),w=r(6118),C=r(6585),A=r(9688);function k(e){let{videos:t=[]}=e;return(0,A.I)(t)?null:(0,n.Y)(n.FK,{children:t.map((e,t)=>(0,n.Y)(I,{src:e.video,thumbnail:e.thumbnail,"data-cy":"attached-video"},t))})}function I({src:e,thumbnail:t,...r}){let i=(0,u.useSelector)(y.M),a=t&&(0,C.M)(t,i);return(0,n.Y)("video",{className:"card-img",src:e,poster:a,controls:!0,...r})}function N(e){let{showDetail:t,enableImageGallery:r,containerWidth:i,height:l}=e,c=(e.images||[]).filter(e=>!!e);if((0,A.I)(c))return null;let[s,d]=(0,o.useState)(void 0);if((0,o.useEffect)(()=>d(`_VP${h()()}`),[]),(0,o.useEffect)(()=>{s&&r&&(0,w.k)(s)},[s]),t)return(0,n.FD)("section",{id:s,className:a().dynamic([["23ec5f6130a346bf",[l?`${l}px`:"initial",l?"contain":"inherit"]]]),children:[c.map((e,t)=>(0,n.Y)("div",{id:`img${t}`,"data-cy":"attached-image",className:a().dynamic([["23ec5f6130a346bf",[l?`${l}px`:"initial",l?"contain":"inherit"]]]),children:(0,n.Y)(v,{src:e,className:"w-100",height:l,width:x.A.BOX_CONTENT_MAX_WIDTH})},t)),(0,n.Y)(a(),{id:"23ec5f6130a346bf",dynamic:[l?`${l}px`:"initial",l?"contain":"inherit"],children:`div.__jsx-style-dynamic-selector .image{height:${l?`${l}px`:"initial"};object-fit:${l?"contain":"inherit"}}`})]});let u=(0,o.useCallback)(e=>{if(0===e)return{height:void 0,maxHeight:i};switch(!0){case c.length<3:return{height:void 0,maxHeight:i};case 3===c.length:return{height:i/2-3,maxHeight:void 0};case c.length>3:return{height:Number((i/3).toFixed())-4.5,maxHeight:void 0};default:return{height:void 0,maxHeight:void 0}}},[c,i]);return(0,n.Y)("section",{id:s,children:(0,n.Y)(Y,{children:c.map((t,r)=>{let{height:a,maxHeight:o}=u(r);return(0,n.Y)($,{route:e.route,src:t,index:r,isDisabledLink:e.isDisabledLink,width:i,height:a,maxHeight:o},r)})})})}function Y({children:e}){let{t}=(0,d.B)(["components/organisms/site"]),r=e[0],i=e.slice(1,4),l=(0,o.useMemo)(()=>3===e.length?"square-photo-3":e.length>
33?"square-photo-more-than-3":"",[e.length]),s=(0,o.useCallback)(t=>e.length>4&&2===t,[e.length]),h=e.length>2,u=e.length-4;return(0,n.FD)(n.FK,{children:[(0,n.Y)("div",{"data-cy":"long-photo",className:"jsx-b50c826026edca41 long-photo",children:r}),(0,n.Y)("div",{className:`jsx-b50c826026edca41 ${h&&"flex-wrap-photos"}`,children:i.map((e,r)=>(0,n.FD)("div",{"data-cy":"square-photo",className:"jsx-b50c826026edca41 "+(c()("square-photo",l)||""),children:[e,s(r)&&(0,n.Y)("div",{"data-cy":"more-photo-badge",className:"jsx-b50c826026edca41 more-photo-badge",children:t("and other {{count}} item",{count:u})})]},r))}),(0,n.Y)(a(),{id:"b50c826026edca41",children:".long-photo.jsx-b50c826026edca41{margin-top:8px}.flex-wrap-photos.jsx-b50c826026edca41{display:flex;flex-wrap:wrap;justify-content:space-between;position:relative}.square-photo.jsx-b50c826026edca41{margin-top:6px}.square-photo-3.jsx-b50c826026edca41{flex-basis:calc(50% - 6px/2)}.square-photo-more-than-3.jsx-b50c826026edca41{flex-basis:calc(33% - 6px/2)}.more-photo-badge.jsx-b50c826026edca41{position:absolute;bottom:8px;right:8px;width:fit-content;height:20px;background:#212121;font-size:12px;color:#fff;padding:0 6px;display:flex;align-items:center;border-radius:10px}"})]})}function $(e){let t=(0,b.R)();return(0,n.Y)(n.FK,{children:(0,n.FD)("div",{onClick:async()=>{if(e.isDisabledLink)return;let r=`img${e.index}`;await t.pushRoute(`${e.route}#${r}`)},className:a().dynamic([["fa224e819365cd8",[e.height?`${e.height}px`:"initial",e.maxHeight?`${e.maxHeight}px`:"initial"]]]),children:[(0,n.Y)(v,{src:e.src,className:"card-img",width:x.A.BOX_CONTENT_MAX_WIDTH,height:e.height}),(0,n.Y)(a(),{id:"fa224e819365cd8",dynamic:[e.height?`${e.height}px`:"initial",e.maxHeight?`${e.maxHeight}px`:"initial"],children:`div.__jsx-style-dynamic-selector .image{cursor:pointer;height:${e.height?`${e.height}px`:"initial"};max-height:${e.maxHeight?`${e.maxHeight}px`:"initial"};width:100%;object-fit:cover}`})]})})}function _(e){let t=(0,o.useRef)(null),[r,i]=(0,o.useState)(0);return(0,o.useEffect)(()=>{i(t?.current?.parentNode?.clientWidth||0)},[]),(0,n.FD)("section",{ref:t,children:[(0,n.Y)(k,{...e,containerWidth:r}),(0,n.Y)(N,{...e,containerWidth:r})]})}},38356:(e,t,r)=>{var n=r(11158),i=0;e.exports=function(e){var t=++i;return n(e)+t}},44464:(e,t,r)=>{"use strict";r.d(t,{k5:()=>c});var n=r(36439),i={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},a=n.createContext&&n.createContext(i),o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},l=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&(r[n[i]]=e[n[i]]);return r};function c(e){return function(t){return n.createElement(s,o({attr:o({},e.attr)},t),function e(t){return t&&t.map(function(t,r){return n.createElement(t.tag,o({key:r},t.attr),e(t.child))})}(e.child))}}function s(e){var t=function(t){var r,i=e.size||t.size||"1em";t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className);var a=e.attr,c=e.title,s=l(e,["attr","title"]);return n.createElement("svg",o({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,a,s,{className:r,style:o({color:e.color||t.color},t.style,e.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),c&&n.createElement("title",null,c),e.children)};return void 0!==a?n.createElement(a.Consumer,null,function(e){return t(e)}):t(i)}},60733:(e,t,r)=>{"use strict";var n=r(3396);t.A=void 0;var i=n(r(70348)),a=r(2183);t.A=(0,i.default)((0,a.jsx)("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59zm7 6V3.5L18.5 9H14c-.55 0-1-.45-1-1"}),"InsertDriveFileRounded")},60827:(e,t,r)=>{var n=r(62718),i=r(42767),a=r(27854);e.exports=function(e){return"string"==typeof e||!i(e)&&a(e)&&"[object String]"==n(e)}},67305:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/view/challenge/[challengeId]/aid",function(){return r(93850)}])},93103:(e,t,r)=>{var n=r(11591);e.exports=function(e){return e&&e.length?n(e):[]}},93850:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>S});var n=r(45023),i=r(87314),a=r(62786),o=r(8538),l=r(26139),c=r(23545),s=r(78195),h=r(90524),d=r(41471),u=r(33026),f=r(382),g=r(55165);let p={[u.CategoryIndex.Accepting]:"Try",[u.CategoryIndex.Completed]:"Completed",[u.CategoryIndex.Ended]:"Closed"},m=({categoryIndex:e,onClick:t})=>{let{t:r}=(0,h.B)(["pages/view/challenge"]),i=(0,d.useSelector)(g.Gi),a=e===u.CategoryIndex.Accepting,o=p[e]??"";return(0,n.Y)(f.M,{charColor:a?i.vote.color:void 0,color:a?i.vote.backgroundColor:"#8c8c8c",onClick:a?t:void 0,disabled:!a,children:r(o)})};var v=r(6871),x=r(2783),b=r(23265),y=r(12753),w=r(95880),C=r(76036),A=r(21097),k=r(20764),I=r(88816),N=r(8819),Y=r(57968),$=r(33922),_=r(12787),j=r(7191),E=r(7172),T=r(37240),O=r(76768),D=r(98611),H=r(66432);let P=({boxId:e,challengeId:t})=>{let{t:r}=(0,h.B)(["pages/view"]),i=(0,d.useDispatch)(),u=(0,k.useRouter)(),{data:f,translationState:g,isLoading:p,toggleTranslationState:D}=(0,T.iu)(t),P=(0,d.useSelector)(_.sw),S=(0,d.useSelector)(j.i),q=(0,d.useSelector)(e=>e.site.top.boxes.item.findIndex(t=>t.id===e.app.challenge.detail.data?.aidBoxId));(0,E.hY)(e),(0,I.A)(()=>{window.scrollTo(0,0)});let M=()=>p?null:f?(0,n.Y)(x.E,{...f,showDetail:!0,onTranslationToggle:D,translationState:g,children:(0,n.Y)("section",{className:"mx-auto mb-5",style:{width:140},children:(0,n.Y)(m,{categoryIndex:f.categoryIndex,onClick:()=>(e=>{if(!P)return i((0,$.A)(Y.Eu.OPEN)());let{contentType:n,aidBoxType:s,aidBoxId:h,aidCategoryIndex:d}=e;n!==o.ContentType.AidCheckIn&&i(N.YB.request({inProgress:!0,challengeId:t,contentType:n})),q>=0&&i((0,N.mg)(q)),i((0,c.xM)(s,d,h));let f=((e,t,r)=>{let{contentType:n,aidBoxId:i,aidCategoryIndex:c}=e;switch(n){case o.ContentType.AidProfileImg:return"/view/settings/profile";case o.ContentType.AidAppDownload:return"/view/notification/app_recommend";case o.ContentType.AidPost:let s;return s="/view/editpost",i?`${s}?id=${i}&categoryIndex=${c}`:s;case o.ContentType.AidLike:case o.ContentType.AidComment:return`${(0,H.Hs)(a.default.VIEW_BOX)}?boxId=${i}&categoryIndex=${c??"99"}`;case o.ContentType.AidCheckIn:{let{isFlutterApp:n,appVersion:i}=(0,l.nr)(t);if(n){if(i&&!(0,l.cc)(i,"3.13.0"))return void alert(r("You need the latest app to check-in. Please take a moment to update the app."));window.flutter_inappwebview&&window.flutter_inappwebview.callHandler("checkinChallenge",e.id);return}return"/view/notification/app_recommend"}default:O.v.error("contentType does not match any",n)}})(e,S,r);f&&u.push(f)})(f)})})}):(0,n.Y)(w.M,{statusCode:404});return(0,n.FD)(b.w,{children:[(0,n.Y)(v.e,{keyPhrase:f?.title,de
3scription:f?.body,imageUrl:f?.eyecatchImage}),(0,n.Y)(A.default,{renderPc:()=>(0,n.Y)(C.z,{content:(0,n.Y)(s.Z,{className:"my-3",children:M()})}),renderSp:()=>(0,n.Y)(y.D,{children:(0,n.Y)("section",{className:"px-3",children:M()})})})]})};P.getInitialProps=({ctx:e})=>{let{dispatch:t}=e.store,r=e.store.getState();if("string"!=typeof e.query.challengeId)throw Error(`challengeId is not a string: ${e.query.challengeId}`);let n=+e.query.challengeId;n!==r.app.challenge.detail.data?.id&&t((0,$.A)(Y.vB.SET)()),t(N.Jh.request({id:n,errCb:t=>{let r=t?.response?.status;r&&404!==r&&(0,D.V2)(e,a.default.VIEW_SIGNIN)}}));let o=i._D.Challenge;return t(N.D7.request({boxId:o,contentId:n})),{challengeId:n,boxId:o}};let S=P},94653:e=>{!function(){"use strict";var t={431:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,a=-1,o=0,l=0;l<=e.length;++l){if(l<e.length)r=e.charCodeAt(l);else if(47===r)break;else r=47;if(47===r){if(a===l-1||1===o);else if(a!==l-1&&2===o){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2)){if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",i=0):i=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),a=l,o=0;continue}}else if(2===n.length||1===n.length){n="",i=0,a=l,o=0;continue}}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),i=l-a-1;a=l,o=0}else 46===r&&-1!==o?++o:o=-1}return n}var n={resolve:function(){for(var e,n,i="",a=!1,o=arguments.length-1;o>=-1&&!a;o--)o>=0?n=arguments[o]:(void 0===e&&(e=""),n=e),t(n),0!==n.length&&(i=n+"/"+i,a=47===n.charCodeAt(0));if(i=r(i,!a),a)if(i.length>0)return"/"+i;else return"/";return i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!n)).length||n||(e="."),e.length>0&&i&&(e+="/"),n)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var a=e.length,o=a-i,l=1;l<r.length&&47===r.charCodeAt(l);++l);for(var c=r.length-l,s=o<c?o:c,h=-1,d=0;d<=s;++d){if(d===s){if(c>s){if(47===r.charCodeAt(l+d))return r.slice(l+d+1);else if(0===d)return r.slice(l+d)}else o>s&&(47===e.charCodeAt(i+d)?h=d:0===d&&(h=0));break}var u=e.charCodeAt(i+d);if(u!==r.charCodeAt(l+d))break;47===u&&(h=d)}var f="";for(d=i+h+1;d<=a;++d)(d===a||47===e.charCodeAt(d))&&(0===f.length?f+="..":f+="/..");return f.length>0?f+r.slice(l+h):(l+=h,47===r.charCodeAt(l)&&++l,r.slice(l))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,a=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!a){i=o;break}}else a=!1;return -1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var n,i=0,a=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,c=-1;for(n=e.length-1;n>=0;--n){var s=e.charCodeAt(n);if(47===s){if(!o){i=n+1;break}}else -1===c&&(o=!1,c=n+1),l>=0&&(s===r.charCodeAt(l)?-1==--l&&(a=n):(l=-1,a=c))}return i===a?a=c:-1===a&&(a=e.length),e.slice(i,a)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!o){i=n+1;break}}else -1===a&&(o=!1,a=n+1);return -1===a?"":e.slice(i,a)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,a=!0,o=0,l=e.length-1;l>=0;--l){var c=e.charCodeAt(l);if(47===c){if(!a){n=l+1;break}continue}-1===i&&(a=!1,i=l+1),46===c?-1===r?r=l:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===i||0===o||1===o&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var i=e.charCodeAt(0),a=47===i;a?(n.root="/",r=1):r=0;for(var o=-1,l=0,c=-1,s=!0,h=e.length-1,d=0;h>=r;--h){if(47===(i=e.charCodeAt(h))){if(!s){l=h+1;break}continue}-1===c&&(s=!1,c=h+1),46===i?-1===o?o=h:1!==d&&(d=1):-1!==o&&(d=-1)}return -1===o||-1===c||0===d||1===d&&o===c-1&&o===l+1?-1!==c&&(0===l&&a?n.base=n.name=e.slice(1,c):n.base=n.name=e.slice(l,c)):(0===l&&a?(n.name=e.slice(1,o),n.base=e.slice(1,c)):(n.name=e.slice(l,o),n.base=e.slice(l,c)),n.ext=e.slice(o,c)),l>0?n.dir=e.slice(0,l-1):a&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};n.posix=n,e.exports=n}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var a=r[e]={exports:{}},o=!0;try{t[e](a,a.exports,n),o=!1}finally{o&&delete r[e]}return a.exports}n.ab="//",e.exports=n(431)}()},95617:e=>{e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}}},e=>{e.O(0,[51,2136,4819,6328,7912,5013,970,5879,2442,3909,7172,2783,8119,636,6593,8792],()=>e(e.s=67305)),_N_E=e.O()}]); 4//# sourceMappingURL=aid-85eca6c25f746acb.js.map 5//# debugId=7b3d3553-611e-5d1d-b82e-7b2664c1bc41
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.