{"version":3,"sources":["webpack:///./src/services/organisation-service.ts","webpack:///./src/services/grant-directory-service.ts","webpack:///./src/shared/utils/scroll-into-view.ts","webpack:///./node_modules/clamp-js/clamp.js","webpack:///./node_modules/readmore-js/readmore.js","webpack:///./assets/images/accountSelectionList.png","webpack:///./src/shared/utils/responsive-layout-service.ts","webpack:///./assets/images/appNav.png","webpack:///./assets/images/appNavBottom.png","webpack:///./assets/video/introduction.mp4","webpack:///./assets/images/recoverPass.png","webpack:///./assets/images/enterUID.png","webpack:///./assets/images/confirmEmail.png","webpack:///./assets/video/manageProfileAccess.mp4","webpack:///./assets/images/changeprofile.png","webpack:///./assets/images/profileSelection.png","webpack:///./assets/images/profileLocation.png","webpack:///./assets/video/createOrgProfile.mp4","webpack:///./assets/images/orgUserAccess.png","webpack:///./assets/images/orgUserList.png","webpack:///./assets/video/orgUserAccess.mp4","webpack:///./assets/video/joinOrg.mp4","webpack:///./assets/images/grantSearch.png","webpack:///./assets/images/grantsNav.png","webpack:///./assets/images/grantsNavHeader.png","webpack:///./assets/images/viewApp.png","webpack:///./assets/images/editApplicationMenu.png","webpack:///./src/services/slugify-service.ts","webpack:///./src/grants/search.ts?ef67","webpack:///./src/grants/view.ts?1d55","webpack:///./src/grants/apply/apply.ts","webpack:///./src/grants/apply/apply.html","webpack:///./src/grants/controls/search-filter-panel.ts","webpack:///./src/grants/controls/search-filter-panel.html","webpack:///./src/grants/enquire/enquire-modal.ts","webpack:///./src/grants/enquire/enquire-modal.html","webpack:///./src/grants/preview/preview.ts","webpack:///./src/grants/preview/preview.html","webpack:///./src/grants/preview/warning-modal.ts","webpack:///./src/grants/preview/warning-modal.html","webpack:///./src/grants/router.ts","webpack:///./src/grants/router.html","webpack:///./src/grants/search.ts","webpack:///./src/grants/search.html","webpack:///./src/grants/view.ts","webpack:///./src/grants/view.html","webpack:///./src/help/help.ts","webpack:///./src/help/help.html","webpack:///./src/help/help/FAQ.ts","webpack:///./src/help/help/FAQ.html","webpack:///./src/help/help/applyForGrant/applyForGrant.ts","webpack:///./src/help/help/applyForGrant/applyForGrant.html","webpack:///./src/help/help/applyForGrant/applyForGrantLanding.ts","webpack:///./src/help/help/applyForGrant/applyForGrantLanding.html","webpack:///./src/help/help/applyForGrant/grantEnquiry.ts","webpack:///./src/help/help/applyForGrant/grantEnquiry.html","webpack:///./src/help/help/applyForGrant/grantSearch.ts","webpack:///./src/help/help/applyForGrant/grantSearch.html","webpack:///./src/help/help/applyForGrant/grantSubscription.ts","webpack:///./src/help/help/applyForGrant/grantSubscription.html","webpack:///./src/help/help/compHelp/compHelp.ts","webpack:///./src/help/help/compHelp/compHelp.html","webpack:///./src/help/help/introduction.ts","webpack:///./src/help/help/introduction.html","webpack:///./src/help/help/manageGrant/applicationManagement.ts","webpack:///./src/help/help/manageGrant/applicationManagement.html","webpack:///./src/help/help/manageGrant/correspondence.ts","webpack:///./src/help/help/manageGrant/correspondence.html","webpack:///./src/help/help/manageGrant/manageGrantLanding.ts","webpack:///./src/help/help/manageGrant/manageGrantLanding.html","webpack:///./src/help/help/manageGrant/reporting.ts","webpack:///./src/help/help/manageGrant/reporting.html","webpack:///./src/help/help/manageGrant/roi.ts","webpack:///./src/help/help/manageGrant/roi.html","webpack:///./src/help/help/manageGrant/viewAwarded.ts","webpack:///./src/help/help/manageGrant/viewAwarded.html","webpack:///./src/help/help/setup/createOrgProfile.ts","webpack:///./src/help/help/setup/createOrgProfile.html","webpack:///./src/help/help/setup/joinAnOrg.ts","webpack:///./src/help/help/setup/joinAnOrg.html","webpack:///./src/help/help/setup/manageProfileAccess.ts","webpack:///./src/help/help/setup/manageProfileAccess.html","webpack:///./src/help/help/setup/orgUserAccess.ts","webpack:///./src/help/help/setup/orgUserAccess.html","webpack:///./src/help/help/setup/setupLanding.ts","webpack:///./src/help/help/setup/setupLanding.html","webpack:///./src/shared/controls/grants-directory/grant-card-view.ts","webpack:///./src/shared/controls/grants-directory/grant-card-view.html","webpack:///./src/shared/controls/grants-directory/grant-detail-view.ts","webpack:///./src/shared/controls/grants-directory/grant-detail-view.html","webpack:///./src/shared/controls/grants-directory/grant-summary-view.ts","webpack:///./src/shared/controls/grants-directory/grant-summary-view.html","webpack:///./src/welcome.ts","webpack:///./src/welcome.html"],"names":["requestHandler","validateAbn","organisation","this","post","validateOrganisation","model","updateOrganisation","put","createOrganisation","getOrganisation","organisationId","get","getOrganisationRegulatoryAuthority","getOrganisationAuditByFilter","filter","canAdministerOrganisation","organisationUserId","getBankDetailsByOrganisation","getOrganisationBankDetailsById","bankDetailsId","addOrganisationBankDetails","request","updateOrgansiationBankDetails","deleteOrganisationBankDetails","delete","getAvailableOrganisationByGrantAndRoundIdentifier","grantIdentifier","roundIdentifier","OrganisationService","profileService","authManager","router","getApplyCheck","contentId","roundId","getActiveProfile","then","profile","query","profileType","profileIdentifier","getGrantById","grantId","getGrantByIdOrSlug","identifier","getApplyCheckByIdOrSlug","contentIdentifier","hasOldUrl","slug","type","latestSlug","Constants","SlugType","PublicContent","navigateToRoute","ExternalPageRoutes","GrantsDetail","GrantRound","getMostRecentGrants","searchGrants","searchRequest","grantEnquiry","enquiry","GrantDirectoryService","scrollIntoViewExternal","element","offset","document","body","clientWidth","align","top","topOffset","options","truncationHTMLContainer","win","window","opt","clamp","useNativeClamp","splitOnChars","animate","truncationChar","truncationHTML","sty","style","originalText","innerHTML","supportsNativeClamp","clampValue","isCSSValue","indexOf","computeStyle","elem","prop","getComputedStyle","el","pseudo","getPropertyValue","re","test","replace","arguments","toUpperCase","currentStyle","getMaxLines","height","availHeight","clientHeight","lineHeight","getLineHeight","Math","max","floor","lh","parseInt","createElement","chunks","lastChunk","clampedText","clmp","slice","splitChar","getLastChild","lastChild","children","length","Array","prototype","call","pop","nodeValue","parentNode","removeChild","applyEllipsis","str","overflow","textOverflow","webkitBoxOrient","display","webkitLineClamp","truncate","target","maxHeight","shift","split","join","setTimeout","$","defaults","speed","collapsedHeight","heightMargin","moreLink","lessLink","embedCSS","blockCSS","startOpen","beforeToggle","afterToggle","cssEmbedded","uniqueIdCounter","setBoxHeights","clone","css","width","insertAfter","expandedHeight","outerHeight","cssMaxHeight","defaultHeight","data","remove","func","wait","immediate","timeout","resizeBoxes","each","current","isExpanded","attr","context","args","later","apply","callNow","clearTimeout","Readmore","extend","selector","styles","d","u","styleSheet","cssText","appendChild","createTextNode","getElementsByTagName","_defaults","_name","init","addEventListener","attachEvent","id","prefix","String","uniqueId","useLink","after","on","_this","event","toggle","trigger","preventDefault","$element","newHeight","newLink","expanded","off","replaceWith","destroy","next","removeData","fn","readmore","instance","module","exports","eventAggregator","that","resize","refreshValue","value","querySelector","publish","DeviceLayoutChangedEvent","ResponsiveLayoutService","grantDirectoryService","permanentRedirect","contentSlug","getContentSlug","isNumber","n","isNaN","parseFloat","SlugifyService","cb","require","applicationFormService","applicationService","dialogService","notifier","confirm","logger","organisationService","modelchecker","isSaving","canDeactivate","isLoggedIn","checkUnchanged","formInstance","oldFormInstance","canActivate","params","routeConfig","navigationInstruction","promises","push","activeProfile","getAccount","account","content","availableOrganisationProfiles","Promise","all","isValid","warning","loggedInWithCorrectProfileCheck","isNew","checkResult","result","redirectUrl","isIndividual","successful","warnings","publicContentId","grantRoundSlug","generateApplyUrl","generate","activate","isPreview","getBlankApplicationBySlugOrId","application","applicationForm","formTemplate","catch","error","previousPage","navigate","hasOwnProperty","errors","forEach","e","attached","JSON","parse","stringify","findSystemQuestionTemplate","code","temp","concat","steps","map","x","sections","y","questions","find","systemQuestion","findQuestionAnswer","questionId","sectionGroups","questionGroups","q","templateQuestionId","save","validateForSave","valid","Error","applicationId","createApplicationBySlug","info","Apply","namePrefix","collapsed","disabled","toggleCollapse","collapsedChanged","newValue","oldValue","slideToggle","SearchFilterPanel","Element","label","dialogController","dataService","controllerFactory","recaptchaEnabled","loggedIn","getRecaptchaKey","recaptchaSiteKey","enabled","setupValidation","ensure","m","contactEmail","required","email","contactName","matches","withMessage","maxLength","contactPhone","recaptchaResponse","when","submit","isBusy","controller","validate","ok","onVerified","response","Enquire","formService","isSubmitting","p","formId","as","showIndividualPreview","showOrganisationPreview","console","log","detached","closeAll","getIndividualFormTemplate","getNewIndividualForm","getOrganisationFormTemplate","getNewOrganisationForm","open","viewModel","saved","submitted","Preview","WarningModal","configureRouter","config","name","GrantsSearch","route","nav","title","moduleId","settings","breadcrumb","auth","parent","Detail","bindingEngine","selectedAgencies","selectedCategories","selectedBeneficiaries","selectedWhoCanApply","selectedContentTypes","selectedGrantsAvailable","benes","page","pageSize","sortFilter","grantsList","whoCanApply","contentTypes","PublicContentType","Applicant","ThirdPartyApplicant","ThirdPartySupplier","grantsAvailable","getAgencies","agencies","sort","a","b","description","localeCompare","getCategoryByLevel","categories","getBeneficiaries","beneficiaries","beneficiaryId","agency","category","term","search","c","doSearch","menu","MmenuLight","offCanvasElement","drawer","offcanvas","position","collectionObserver","subscribe","clearAllFilters","removePill","pill","thingToRemove","source","index","splice","openFilter","pageChanged","newVal","oldVal","undefined","keywordSearchElement","pageSizeChanged","sortFilterChanged","sortClosingSoon","sortOpeningSoon","sortNewlyListed","publicContentTypes","sortColumn","sortDirection","SortDirection","Desc","keywords","Asc","w","individualsCanApply","nonProfitCanApply","forProfitCanApply","g","applicationsOpenFrom","format","add","res","results","totalRecords","i","SearchPill","Search","slugify","canView","canEdit","grantSearchRoute","supplierLink","invitation","determineActivationStrategy","supplierContentId","supplierContentIdentifier","setMetaInformation","navModel","grantName","userDetails","notFound","setArticle","deactivate","setKeywords","descriptionElm","setAttribute","mainDescriptionString","descriptionString","overviewHtml","getAttribute","htmlIn","reg","RegExp","keys","elm","getElementById","setup","googleArticleScriptElem","innerText","googleBreadcrumbScriptElem","location","origin","Date","toISOString","enquire","enquireBusy","getIndividualProfile","resolve","profiles","contactModel","profileUserFullname","emailAddress","mobilePhoneNumber","contactType","contactOrganisation","profileDisplayName","rejectOnCancel","whenClosed","output","success","profileInterstitial","orgProfileType","FormProfileType","Organisation","indProfileType","Individual","otherProfileType","currentProfileName","singleExistingApplication","existingApplications","canPotentiallyApplyNow","nonConcurrentAndStillProcessing","applyNow","ProfileSelect","redirect","currentInstruction","parentInstruction","fragment","queryString","supplierPublicContentId","GrantDetailsView","Help","FAQ","ApplyForGrant","ApplyForGrantLanding","GrantEnquiry","GrantSearch","GrantSubscription","CompHelp","Introduction","ApplicationManagement","Correspondence","ManageGrantLanding","Reporting","ROI","ViewAwarded","CreateOrgProfile","JoinAnOrg","ManageProfileAccess","OrgUserAccess","SetupLanding","agencySpan","overviewElement","startIndex","endIndex","substr","isIndividualEligible","isOrganisationEligible","showGlobalMaxFunding","globalFundingMax","returnString","defaultBindingMode","twoWay","GrantCardView","publicContentType","GrantDetailView","GrantSummaryView","grantsDirectoryService","responsiveLayoutService","featuredGrantService","rows","routeGrantsDirectory","latestGrantsPage","latestGrantsPageSize","latestGrantsCarouselDirectionClass","grants","getFeaturedGrant","featuredGrants","adjustPageSizeBasedOnDeviceWidth","screenSize","searchParams","selectedCategory","selectedAgency","searchTerm","generateGrantUrl","latestGrants","latestGrantsNextPage","latestGrantsPreviousPage","Welcome"],"mappings":"4mBAMA,aACI,WAA6BA,GAAA,KAAAA,iBA8DjC,OA3DI,YAAAC,YAAA,SAAYC,GACR,OAAOC,KAAKH,eAAeI,KACvB,oCAAqCF,IAG7C,YAAAG,qBAAA,SAAqBC,GACjB,OAAOH,KAAKH,eAAeI,KAA2D,gCAAiCE,IAG3H,YAAAC,mBAAA,SAAmBD,GACf,OAAOH,KAAKH,eAAeQ,IACvB,uBAAwBF,IAGhC,YAAAG,mBAAA,SAAmBH,GACf,OAAOH,KAAKH,eAAeI,KACvB,uBAAwBE,IAGhC,YAAAI,gBAAA,SAAgBC,GACZ,OAAOR,KAAKH,eAAeY,IAA0B,wBAAwBD,IAGjF,YAAAE,mCAAA,SAAmCF,GAC/B,OAAOR,KAAKH,eAAeY,IAA+C,wBAAwBD,EAAc,0BAGpH,YAAAG,6BAAA,SAA6BC,GACzB,OAAOZ,KAAKH,eAAeI,KACvB,6BAA8BW,IAG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mB,IACxB9lB,KAAKgmB,mCAAqC,cAC1ChmB,KAAK8lB,iBAAmB9lB,KAAK8lB,iBAAmB,IAKxD,sBAAI,uCAAwB,C,IAA5B,WAEI,SAAI9lB,KAAKimB,QAAUjmB,KAAKimB,OAAOre,QAAU5H,KAAK8lB,iBAAmB9lB,KAAK+lB,uB,gCAO1E,sBAAI,2CAA4B,C,IAAhC,WACI,OAAO/lB,KAAK8lB,iBAAmB,G,gCAInC,sBAAI,iCAAkB,C,IAAtB,WACI,OAAO9lB,KAAKmmB,gBAAkBnmB,KAAKmmB,eAAeve,OAAS,G,gCA/GjD,GAAb,c,gEACa,GAAb,c,oEACa,GAAb,c,kFAgED,GADC,YAAa,SAAU,mBAAoB,wB,qFA+B5C,GADC,YAAa,SAAU,mBAAoB,wB,iGAU5C,GADC,YAAa,SAAU,mBAAoB,wB,qGAM5C,GADC,YAAa,kB,2FAzHLkf,EAAO,GADnB,I,uBAiBwD,IACnB,IACL,IACiB,IACH,IACL,OArB7BA,GAAb,I,iDCdA5Y,EAAOC,QAAU","file":"assets/js/grants-directory.43f796a1d8fc24c4ac85.chunk.js","sourcesContent":["import { autoinject } from 'aurelia-framework';\r\nimport { Dto } from \"project/project\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { RequestHandler } from './request-handler';\r\n\r\n@autoinject\r\nexport class OrganisationService {\r\n constructor(private readonly requestHandler: RequestHandler) {\r\n }\r\n\r\n validateAbn(organisation: SharedDto.IValidateAbnRequest): Promise {\r\n return this.requestHandler.post(\r\n 'profile/organisation/validate/abn', organisation);\r\n }\r\n\r\n validateOrganisation(model: Dto.IOrganisationDto): Promise {\r\n return this.requestHandler.post('profile/organisation/validate', model);\r\n }\r\n\r\n updateOrganisation(model: Dto.IOrganisationDto): Promise {\r\n return this.requestHandler.put(\r\n 'profile/organisation', model);\r\n }\r\n\r\n createOrganisation(model: Dto.IOrganisationDto): Promise {\r\n return this.requestHandler.post(\r\n 'profile/organisation', model);\r\n }\r\n\r\n getOrganisation(organisationId: number): Promise {\r\n return this.requestHandler.get(`profile/organisation/${organisationId}`);\r\n }\r\n\r\n getOrganisationRegulatoryAuthority(organisationId: number): Promise {\r\n return this.requestHandler.get(`profile/organisation/${organisationId}/regulatory-authority`);\r\n }\r\n\r\n getOrganisationAuditByFilter(filter: Dto.IOrganisationAuditRequestDto): Promise {\r\n return this.requestHandler.post(\r\n `profile/organisation/audit`, filter);\r\n }\r\n\r\n canAdministerOrganisation(organisationUserId: number) {\r\n return this.requestHandler.get(`security/canadministerorganisation/${organisationUserId}`);\r\n }\r\n\r\n getBankDetailsByOrganisation(organisationId: number): Promise {\r\n return this.requestHandler.get(`profile/organisation/${organisationId}/bank-details`);\r\n }\r\n\r\n getOrganisationBankDetailsById(organisationId: number, bankDetailsId: number): Promise {\r\n return this.requestHandler.get(`profile/organisation/${organisationId}/bank-details/${bankDetailsId}`);\r\n }\r\n\r\n addOrganisationBankDetails(organisationId: number, request: SharedDto.IBankDetailsDto) {\r\n return this.requestHandler.post(`profile/organisation/${organisationId}/bank-details`, request);\r\n }\r\n\r\n updateOrgansiationBankDetails(organisationId: number, bankDetailsId: number, request: SharedDto.IBankDetailsDto) {\r\n return this.requestHandler.put(`profile/organisation/${organisationId}/bank-details/${bankDetailsId}`, request);\r\n }\r\n\r\n deleteOrganisationBankDetails(organisationId: number, bankDetailsId: number) {\r\n return this.requestHandler.delete(`profile/organisation/${organisationId}/bank-details/${bankDetailsId}`);\r\n }\r\n\r\n getAvailableOrganisationByGrantAndRoundIdentifier(grantIdentifier: string | number, roundIdentifier: string | number): Promise {\r\n return this.requestHandler.get(`profile/organisation/${grantIdentifier}/${roundIdentifier}`);\r\n }\r\n}","import { RequestHandler } from \"./request-handler\"\r\nimport { autoinject } from \"aurelia-framework\";\r\n\r\nimport { ProfileService } from \"services/profile-service\";\r\nimport { AuthManager } from \"auth/auth-manager\";\r\nimport { Dto } from \"project/project\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { Router } from \"aurelia-router\";\r\n\r\n@autoinject\r\nexport class GrantDirectoryService {\r\n constructor(private requestHandler: RequestHandler, private readonly profileService: ProfileService, private authManager: AuthManager, private readonly router: Router) { }\r\n\r\n getApplyCheck(contentId: number, roundId: number): Promise {\r\n return this.profileService.getActiveProfile().then((profile) => {\r\n let query = `?roundId=${roundId}`;\r\n if (profile != null && profile.profileType == \"Organisation\") {\r\n query = `${query}&organisationId=${profile.profileIdentifier}`\r\n }\r\n return this.requestHandler.get(`grants/${contentId}/apply-check${query}`);\r\n });\r\n }\r\n\r\n getGrantById(grantId: number): Promise {\r\n return this.profileService.getActiveProfile().then(profile => {\r\n let query = '';\r\n if (profile != null && profile.profileType == \"Organisation\") {\r\n query = `?organisationId=${profile.profileIdentifier}`\r\n }\r\n return this.requestHandler.get(`grants/${grantId}${query}`);\r\n });\r\n }\r\n\r\n getGrantByIdOrSlug(identifier: string | number): Promise {\r\n return this.profileService.getActiveProfile().then(profile => {\r\n let query = '';\r\n if (profile != null && profile.profileType == \"Organisation\") {\r\n query = `?organisationId=${profile.profileIdentifier}`\r\n }\r\n return this.requestHandler.get(`grants/${identifier}${query}`);\r\n });\r\n }\r\n\r\n getApplyCheckByIdOrSlug(contentIdentifier: number | string, roundIdentifier: number | string): Promise {\r\n return this.profileService.getActiveProfile().then((profile) => {\r\n let query = `?roundId=${roundIdentifier}`;\r\n if (profile != null && profile.profileType == \"Organisation\") {\r\n query = `${query}&organisationId=${profile.profileIdentifier}`\r\n }\r\n return this.requestHandler.get(`grants/${contentIdentifier}/apply-check${query}`);\r\n });\r\n }\r\n\r\n hasOldUrl(slug: string, type: string): void {\r\n this.requestHandler.get(`application/latest-slug/${slug}/${type}`).then(latestSlug => {\r\n //redirect to the latest slug?\r\n if (type == Dto.Constants.SlugType[Dto.Constants.SlugType.PublicContent]) {\r\n this.router.navigateToRoute(Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail], {\r\n contentIdentifier: latestSlug\r\n });\r\n } else if (type == Dto.Constants.SlugType[Dto.Constants.SlugType.GrantRound]) {\r\n //??\r\n }\r\n });\r\n }\r\n\r\n getMostRecentGrants(): Promise { \r\n return this.requestHandler.post(`grants/search`); \r\n }\r\n\r\n searchGrants(searchRequest: Dto.IPublicContentSearchFilterRequestDto): Promise {\r\n return this.requestHandler.post(\r\n `grants/search`, searchRequest);\r\n }\r\n\r\n grantEnquiry(contentId: number, enquiry: Dto.IPublicContentEnquiryDto): Promise {\r\n return this.requestHandler.post(`grants/${contentId}/enquire`, enquiry);\r\n }\r\n}\r\n","\nimport scrollIntoView from \"scroll-into-view\";\n\nexport function scrollIntoViewExternal(element: Element) {\n\n let offset = 10;\n \n //note 768 is the SM breakpoint where the nav gets larger, so we're offsetting the nav.\n if (document.body.clientWidth >= 768) {\n offset = 130;\n }\n\n scrollIntoView(element, { align: { top: 0, topOffset: offset } });\n}\n","/*!\n * Clamp.js 0.7.0\n *\n * Copyright 2011-2013, Joseph Schmitt http://joe.sh\n * Released under the WTFPL license\n * http://sam.zoy.org/wtfpl/\n */\n\n(function(root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD\n define([], factory);\n } else if (typeof exports === 'object') {\n // Node, CommonJS-like\n module.exports = factory();\n } else {\n // Browser globals\n root.$clamp = factory();\n }\n}(this, function() {\n /**\n * Clamps a text node.\n * @param {HTMLElement} element. Element containing the text node to clamp.\n * @param {Object} options. Options to pass to the clamper.\n */\n function clamp(element, options) {\n options = options || {};\n\n var self = this,\n win = window,\n opt = {\n clamp: options.clamp || 2,\n useNativeClamp: typeof(options.useNativeClamp) != 'undefined' ? options.useNativeClamp : true,\n splitOnChars: options.splitOnChars || ['.', '-', '–', '—', ' '], //Split on sentences (periods), hypens, en-dashes, em-dashes, and words (spaces).\n animate: options.animate || false,\n truncationChar: options.truncationChar || '…',\n truncationHTML: options.truncationHTML\n },\n\n sty = element.style,\n originalText = element.innerHTML,\n\n supportsNativeClamp = typeof(element.style.webkitLineClamp) != 'undefined',\n clampValue = opt.clamp,\n isCSSValue = clampValue.indexOf && (clampValue.indexOf('px') > -1 || clampValue.indexOf('em') > -1),\n truncationHTMLContainer;\n\n if (opt.truncationHTML) {\n truncationHTMLContainer = document.createElement('span');\n truncationHTMLContainer.innerHTML = opt.truncationHTML;\n }\n\n\n // UTILITY FUNCTIONS __________________________________________________________\n\n /**\n * Return the current style for an element.\n * @param {HTMLElement} elem The element to compute.\n * @param {string} prop The style property.\n * @returns {number}\n */\n function computeStyle(elem, prop) {\n if (!win.getComputedStyle) {\n win.getComputedStyle = function(el, pseudo) {\n this.el = el;\n this.getPropertyValue = function(prop) {\n var re = /(\\-([a-z]){1})/g;\n if (prop == 'float') prop = 'styleFloat';\n if (re.test(prop)) {\n prop = prop.replace(re, function() {\n return arguments[2].toUpperCase();\n });\n }\n return el.currentStyle && el.currentStyle[prop] ? el.currentStyle[prop] : null;\n };\n return this;\n };\n }\n\n return win.getComputedStyle(elem, null).getPropertyValue(prop);\n }\n\n /**\n * Returns the maximum number of lines of text that should be rendered based\n * on the current height of the element and the line-height of the text.\n */\n function getMaxLines(height) {\n var availHeight = height || element.clientHeight,\n lineHeight = getLineHeight(element);\n\n return Math.max(Math.floor(availHeight / lineHeight), 0);\n }\n\n /**\n * Returns the maximum height a given element should have based on the line-\n * height of the text and the given clamp value.\n */\n function getMaxHeight(clmp) {\n var lineHeight = getLineHeight(element);\n return lineHeight * clmp;\n }\n\n /**\n * Returns the line-height of an element as an integer.\n */\n function getLineHeight(elem) {\n var lh = computeStyle(elem, 'line-height');\n if (lh == 'normal') {\n // Normal line heights vary from browser to browser. The spec recommends\n // a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.\n lh = parseInt(computeStyle(elem, 'font-size')) * 1.2;\n }\n return parseInt(lh);\n }\n\n\n // MEAT AND POTATOES (MMMM, POTATOES...) ______________________________________\n var splitOnChars = opt.splitOnChars.slice(0),\n splitChar = splitOnChars[0],\n chunks,\n lastChunk;\n\n /**\n * Gets an element's last child. That may be another node or a node's contents.\n */\n function getLastChild(elem) {\n //Current element has children, need to go deeper and get last child as a text node\n if (elem.lastChild.children && elem.lastChild.children.length > 0) {\n return getLastChild(Array.prototype.slice.call(elem.children).pop());\n }\n //This is the absolute last child, a text node, but something's wrong with it. Remove it and keep trying\n else if (!elem.lastChild || !elem.lastChild.nodeValue || elem.lastChild.nodeValue === '' || elem.lastChild.nodeValue == opt.truncationChar) {\n elem.lastChild.parentNode.removeChild(elem.lastChild);\n return getLastChild(element);\n }\n //This is the last child we want, return it\n else {\n return elem.lastChild;\n }\n }\n\n /**\n * Removes one character at a time from the text until its width or\n * height is beneath the passed-in max param.\n */\n function truncate(target, maxHeight) {\n if (!maxHeight) {\n return;\n }\n\n /**\n * Resets global variables.\n */\n function reset() {\n splitOnChars = opt.splitOnChars.slice(0);\n splitChar = splitOnChars[0];\n chunks = null;\n lastChunk = null;\n }\n\n var nodeValue = target.nodeValue.replace(opt.truncationChar, '');\n\n //Grab the next chunks\n if (!chunks) {\n //If there are more characters to try, grab the next one\n if (splitOnChars.length > 0) {\n splitChar = splitOnChars.shift();\n }\n //No characters to chunk by. Go character-by-character\n else {\n splitChar = '';\n }\n\n chunks = nodeValue.split(splitChar);\n }\n\n //If there are chunks left to remove, remove the last one and see if\n // the nodeValue fits.\n if (chunks.length > 1) {\n // console.log('chunks', chunks);\n lastChunk = chunks.pop();\n // console.log('lastChunk', lastChunk);\n applyEllipsis(target, chunks.join(splitChar));\n }\n //No more chunks can be removed using this character\n else {\n chunks = null;\n }\n\n //Insert the custom HTML before the truncation character\n if (truncationHTMLContainer) {\n target.nodeValue = target.nodeValue.replace(opt.truncationChar, '');\n element.innerHTML = target.nodeValue + ' ' + truncationHTMLContainer.innerHTML + opt.truncationChar;\n }\n\n //Search produced valid chunks\n if (chunks) {\n //It fits\n if (element.clientHeight <= maxHeight) {\n //There's still more characters to try splitting on, not quite done yet\n if (splitOnChars.length >= 0 && splitChar !== '') {\n applyEllipsis(target, chunks.join(splitChar) + splitChar + lastChunk);\n chunks = null;\n }\n //Finished!\n else {\n return element.innerHTML;\n }\n }\n }\n //No valid chunks produced\n else {\n //No valid chunks even when splitting by letter, time to move\n //on to the next node\n if (splitChar === '') {\n applyEllipsis(target, '');\n target = getLastChild(element);\n\n reset();\n }\n }\n\n //If you get here it means still too big, let's keep truncating\n if (opt.animate) {\n setTimeout(function() {\n truncate(target, maxHeight);\n }, opt.animate === true ? 10 : opt.animate);\n } else {\n return truncate(target, maxHeight);\n }\n }\n\n function applyEllipsis(elem, str) {\n elem.nodeValue = str + opt.truncationChar;\n }\n\n\n // CONSTRUCTOR ________________________________________________________________\n\n if (clampValue == 'auto') {\n clampValue = getMaxLines();\n } else if (isCSSValue) {\n clampValue = getMaxLines(parseInt(clampValue));\n }\n\n var clampedText;\n if (supportsNativeClamp && opt.useNativeClamp) {\n sty.overflow = 'hidden';\n sty.textOverflow = 'ellipsis';\n sty.webkitBoxOrient = 'vertical';\n sty.display = '-webkit-box';\n sty.webkitLineClamp = clampValue;\n\n if (isCSSValue) {\n sty.height = opt.clamp + 'px';\n }\n } else {\n var height = getMaxHeight(clampValue);\n if (height <= element.clientHeight) {\n clampedText = truncate(getLastChild(element), height);\n }\n }\n\n return {\n 'original': originalText,\n 'clamped': clampedText\n };\n }\n\n return clamp;\n}));\n","/*!\n * @preserve\n *\n * Readmore.js jQuery plugin\n * Author: @jed_foster\n * Project home: http://jedfoster.github.io/Readmore.js\n * Licensed under the MIT license\n *\n * Debounce function from http://davidwalsh.name/javascript-debounce-function\n */\n\n/* global jQuery */\n\n(function(factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD\n define(['jquery'], factory);\n } else if (typeof exports === 'object') {\n // CommonJS\n module.exports = factory(require('jquery'));\n } else {\n // Browser globals\n factory(jQuery);\n }\n}(function($) {\n 'use strict';\n\n var readmore = 'readmore',\n defaults = {\n speed: 100,\n collapsedHeight: 200,\n heightMargin: 16,\n moreLink: 'Read More',\n lessLink: 'Close',\n embedCSS: true,\n blockCSS: 'display: block; width: 100%;',\n startOpen: false,\n\n // callbacks\n beforeToggle: function(){},\n afterToggle: function(){}\n },\n cssEmbedded = {},\n uniqueIdCounter = 0;\n\n function debounce(func, wait, immediate) {\n var timeout;\n\n return function() {\n var context = this, args = arguments;\n var later = function() {\n timeout = null;\n if (! immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) {\n func.apply(context, args);\n }\n };\n }\n\n function uniqueId(prefix) {\n var id = ++uniqueIdCounter;\n\n return String(prefix == null ? 'rmjs-' : prefix) + id;\n }\n\n function setBoxHeights(element) {\n var el = element.clone().css({\n height: 'auto',\n width: element.width(),\n maxHeight: 'none',\n overflow: 'hidden'\n }).insertAfter(element),\n expandedHeight = el.outerHeight(),\n cssMaxHeight = parseInt(el.css({maxHeight: ''}).css('max-height').replace(/[^-\\d\\.]/g, ''), 10),\n defaultHeight = element.data('defaultHeight');\n\n el.remove();\n\n var collapsedHeight = cssMaxHeight || element.data('collapsedHeight') || defaultHeight;\n\n // Store our measurements.\n element.data({\n expandedHeight: expandedHeight,\n maxHeight: cssMaxHeight,\n collapsedHeight: collapsedHeight\n })\n // and disable any `max-height` property set in CSS\n .css({\n maxHeight: 'none'\n });\n }\n\n var resizeBoxes = debounce(function() {\n $('[data-readmore]').each(function() {\n var current = $(this),\n isExpanded = (current.attr('aria-expanded') === 'true');\n\n setBoxHeights(current);\n\n current.css({\n height: current.data( (isExpanded ? 'expandedHeight' : 'collapsedHeight') )\n });\n });\n }, 100);\n\n function embedCSS(options) {\n if (! cssEmbedded[options.selector]) {\n var styles = ' ';\n\n if (options.embedCSS && options.blockCSS !== '') {\n styles += options.selector + ' + [data-readmore-toggle], ' +\n options.selector + '[data-readmore]{' +\n options.blockCSS +\n '}';\n }\n\n // Include the transition CSS even if embedCSS is false\n styles += options.selector + '[data-readmore]{' +\n 'transition: height ' + options.speed + 'ms;' +\n 'overflow: hidden;' +\n '}';\n\n (function(d, u) {\n var css = d.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) {\n css.styleSheet.cssText = u;\n }\n else {\n css.appendChild(d.createTextNode(u));\n }\n\n d.getElementsByTagName('head')[0].appendChild(css);\n }(document, styles));\n\n cssEmbedded[options.selector] = true;\n }\n }\n\n function Readmore(element, options) {\n this.element = element;\n\n this.options = $.extend({}, defaults, options);\n\n embedCSS(this.options);\n\n this._defaults = defaults;\n this._name = readmore;\n\n this.init();\n\n // IE8 chokes on `window.addEventListener`, so need to test for support.\n if (window.addEventListener) {\n // Need to resize boxes when the page has fully loaded.\n window.addEventListener('load', resizeBoxes);\n window.addEventListener('resize', resizeBoxes);\n }\n else {\n window.attachEvent('load', resizeBoxes);\n window.attachEvent('resize', resizeBoxes);\n }\n }\n\n\n Readmore.prototype = {\n init: function() {\n var current = $(this.element);\n\n current.data({\n defaultHeight: this.options.collapsedHeight,\n heightMargin: this.options.heightMargin\n });\n\n setBoxHeights(current);\n\n var collapsedHeight = current.data('collapsedHeight'),\n heightMargin = current.data('heightMargin');\n\n if (current.outerHeight(true) <= collapsedHeight + heightMargin) {\n // The block is shorter than the limit, so there's no need to truncate it.\n return true;\n }\n else {\n var id = current.attr('id') || uniqueId(),\n useLink = this.options.startOpen ? this.options.lessLink : this.options.moreLink;\n\n current.attr({\n 'data-readmore': '',\n 'aria-expanded': this.options.startOpen,\n 'id': id\n });\n\n current.after($(useLink)\n .on('click', (function(_this) {\n return function(event) {\n _this.toggle(this, current[0], event);\n };\n })(this))\n .attr({\n 'data-readmore-toggle': '',\n 'aria-controls': id\n }));\n\n if (! this.options.startOpen) {\n current.css({\n height: collapsedHeight\n });\n }\n }\n },\n\n toggle: function(trigger, element, event) {\n if (event) {\n event.preventDefault();\n }\n\n if (! trigger) {\n trigger = $('[aria-controls=\"' + _this.element.id + '\"]')[0];\n }\n\n if (! element) {\n element = _this.element;\n }\n\n var $element = $(element),\n newHeight = '',\n newLink = '',\n expanded = false,\n collapsedHeight = $element.data('collapsedHeight');\n\n if ($element.height() <= collapsedHeight) {\n newHeight = $element.data('expandedHeight') + 'px';\n newLink = 'lessLink';\n expanded = true;\n }\n else {\n newHeight = collapsedHeight;\n newLink = 'moreLink';\n }\n\n // Fire beforeToggle callback\n // Since we determined the new \"expanded\" state above we're now out of sync\n // with our true current state, so we need to flip the value of `expanded`\n this.options.beforeToggle(trigger, $element, ! expanded);\n\n $element.css({'height': newHeight});\n\n // Fire afterToggle callback\n $element.on('transitionend', (function(_this) {\n return function() {\n _this.options.afterToggle(trigger, $element, expanded);\n\n $(this).attr({\n 'aria-expanded': expanded\n }).off('transitionend');\n }\n })(this));\n\n $(trigger).replaceWith($(this.options[newLink])\n .on('click', (function(_this) {\n return function(event) {\n _this.toggle(this, element, event);\n };\n })(this))\n .attr({\n 'data-readmore-toggle': '',\n 'aria-controls': $element.attr('id')\n }));\n },\n\n destroy: function() {\n $(this.element).each(function() {\n var current = $(this);\n\n current.attr({\n 'data-readmore': null,\n 'aria-expanded': null\n })\n .css({\n maxHeight: '',\n height: ''\n })\n .next('[data-readmore-toggle]')\n .remove();\n\n current.removeData();\n });\n }\n };\n\n\n $.fn.readmore = function(options) {\n var args = arguments,\n selector = this.selector;\n\n options = options || {};\n\n if (typeof options === 'object') {\n return this.each(function() {\n if ($.data(this, 'plugin_' + readmore)) {\n var instance = $.data(this, 'plugin_' + readmore);\n instance.destroy.apply(instance);\n }\n\n options.selector = selector;\n\n $.data(this, 'plugin_' + readmore, new Readmore(this, options));\n });\n }\n else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {\n return this.each(function () {\n var instance = $.data(this, 'plugin_' + readmore);\n if (instance instanceof Readmore && typeof instance[options] === 'function') {\n instance[options].apply(instance, Array.prototype.slice.call(args, 1));\n }\n });\n }\n };\n\n}));\n\n","module.exports = __webpack_public_path__ + \"assets/images/accountSelectionList.png\";","import { EventAggregator } from \"aurelia-event-aggregator\";\r\nimport { autoinject, singleton } from \"aurelia-dependency-injection\";\r\nimport \"./responsive-layout-service.less\";\r\n\r\n//adapted from this lightweight solution to enable javascript behaviours based on css breakpoints: https://www.lullabot.com/articles/importing-css-breakpoints-into-javascript\r\n@autoinject\r\nexport class ResponsiveLayoutService {\r\n\r\n value: \"xs\" | \"sm\" | \"md\" | \"lg\";\r\n\r\n constructor(private readonly eventAggregator: EventAggregator) {\r\n //register to resize events, and immediately trigger the resize event.\r\n var that = this;\r\n $(window).resize(function () {\r\n that.refreshValue();\r\n }).resize();\r\n }\r\n\r\n private refreshValue() {\r\n this.value = window.getComputedStyle(document.querySelector('body'), ':before').getPropertyValue('content').replace(/\\\"/g, '') as \"xs\" | \"sm\" | \"md\" | \"lg\";\r\n this.eventAggregator.publish(DeviceLayoutChangedEvent, this.value);\r\n }\r\n}\r\n\r\nexport const DeviceLayoutChangedEvent = \"device-layout-breakpoint-changed\";","module.exports = __webpack_public_path__ + \"assets/images/appNav.png\";","module.exports = __webpack_public_path__ + \"assets/images/appNavBottom.png\";","module.exports = __webpack_public_path__ + \"assets/video/introduction.mp4\";","module.exports = __webpack_public_path__ + \"assets/images/recoverPass.png\";","module.exports = __webpack_public_path__ + \"assets/images/enterUID.png\";","module.exports = __webpack_public_path__ + \"assets/images/confirmEmail.png\";","module.exports = __webpack_public_path__ + \"assets/video/manageProfileAccess.mp4\";","module.exports = __webpack_public_path__ + \"assets/images/changeprofile.png\";","module.exports = __webpack_public_path__ + \"assets/images/profileSelection.png\";","module.exports = __webpack_public_path__ + \"assets/images/profileLocation.png\";","module.exports = __webpack_public_path__ + \"assets/video/createOrgProfile.mp4\";","module.exports = __webpack_public_path__ + \"assets/images/orgUserAccess.png\";","module.exports = __webpack_public_path__ + \"assets/images/orgUserList.png\";","module.exports = __webpack_public_path__ + \"assets/video/orgUserAccess.mp4\";","module.exports = __webpack_public_path__ + \"assets/video/joinOrg.mp4\";","module.exports = __webpack_public_path__ + \"assets/images/grantSearch.png\";","module.exports = __webpack_public_path__ + \"assets/images/grantsNav.png\";","module.exports = __webpack_public_path__ + \"assets/images/grantsNavHeader.png\";","module.exports = __webpack_public_path__ + \"assets/images/viewApp.png\";","module.exports = __webpack_public_path__ + \"assets/images/editApplicationMenu.png\";","import { autoinject } from \"aurelia-framework\";\r\nimport { Dto } from \"project/project\";\r\nimport { GrantDirectoryService } from \"./grant-directory-service\";\r\nimport { Router } from \"aurelia-router\";\r\nimport { RequestHandler } from \"./request-handler\";\r\n\r\n@autoinject\r\nexport class SlugifyService {\r\n router:Router;\r\n\r\n constructor(\r\n router: Router,\r\n private readonly grantDirectoryService: GrantDirectoryService, private readonly requestHandler: RequestHandler) {\r\n this.router = router;\r\n }\r\n\r\n permanentRedirect(id:number): void {\r\n this.grantDirectoryService.getGrantById(id).then(data => {\r\n \r\n this.router.navigateToRoute(\r\n Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\r\n {contentIdentifier: data.contentSlug}\r\n );\r\n });\r\n }\r\n\r\n getContentSlug(id: number): Promise {\r\n return this.requestHandler.get(`grants/${id}/slug`);\r\n }\r\n\r\n isNumber(n:any) { \r\n return !isNaN(parseFloat(n)) && !isNaN(n - 0) \r\n }\r\n}\r\n","module.exports = function(cb) {\n\trequire.ensure([], function(require) {\n\t\tcb(require(\"!!../../node_modules/awesome-typescript-loader/dist/entry.js??ref--8-0!./search.ts\"));\n\t}, \"grants-directory\");\n}","module.exports = function(cb) {\n\trequire.ensure([], function(require) {\n\t\tcb(require(\"!!../../node_modules/awesome-typescript-loader/dist/entry.js??ref--8-0!./view.ts\"));\n\t}, \"grants-directory\");\n}","import { autoinject, PLATFORM } from \"aurelia-framework\";\r\nimport { NavigationInstruction, RouteConfig, Router, RedirectToRoute, Redirect } from \"aurelia-router\";\r\nimport { Dto } from \"project/project\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { ApplicationFormService } from \"services/application-form-service\";\r\nimport { ApplicationService, IApplyCheckResult } from \"services/application-service\";\r\nimport { GrantDirectoryService } from \"services/grant-directory-service\";\r\nimport { Notifier } from \"services/notifier\";\r\nimport { ProfileService } from \"services/profile-service\";\r\nimport { ApplicationFormCustomElement } from \"shared/controls/online-form/application-form\";\r\nimport { ValidationError } from \"shared/controls/validation-error\";\r\nimport { ModelChecker } from \"shared/utils/model-checker\";\r\nimport { AuthManager } from \"auth/auth-manager\";\r\nimport { generateApplicationUrl, generateGrantUrl } from \"services/url-generators\";\r\nimport { Logger } from \"aurelia-logging\";\r\nimport { IApplyNowModalConditionsEnum, IApplyNowModalParams } from \"grants/modals/apply-now-modal/apply-now-modal\";\r\nimport { ActiveProfile } from \"models/active-profile\";\r\nimport { ILoginOrRegisterModalParams } from \"grants/modals/login-or-register-modal/login-or-register-modal\";\r\nimport { DialogService } from \"aurelia-dialog\";\r\nimport { Confirm } from \"shared/controls/confirm-modal/confirm\";\r\nimport { Messages } from \"utils/messages\";\r\nimport { OrganisationService } from \"services/organisation-service\";\r\n\r\n@autoinject\r\nexport class Apply {\r\n publicContentId: number | string;\r\n roundIdentifier: number | string;\r\n formTemplate: SharedDto.OnlineForm.Form.IApplicationFormTemplateDto;\r\n formInstance: SharedDto.OnlineForm.Application.IApplicationFormDto;\r\n oldFormInstance: SharedDto.OnlineForm.Application.IApplicationFormDto;\r\n\r\n applicationForm: ApplicationFormCustomElement;\r\n isSaving: boolean = false;\r\n\r\n activeProfile: ActiveProfile;\r\n account: Dto.IUserResponse;\r\n availableOrganisationProfiles: Dto.IUserOrganisationProfile[];\r\n content: SharedDto.PublicContent.IPublicContentDetailViewDto;\r\n applyCheckByIdOrSlug: Dto.INotification; \r\n\r\n constructor(private readonly applicationFormService: ApplicationFormService,\r\n private readonly grantDirectoryService: GrantDirectoryService,\r\n private readonly applicationService: ApplicationService,\r\n private readonly profileService: ProfileService,\r\n private readonly dialogService: DialogService,\r\n private readonly router: Router,\r\n private readonly notifier: Notifier,\r\n private readonly confirm: Confirm,\r\n private readonly logger: Logger,\r\n private readonly organisationService: OrganisationService,\r\n private readonly modelchecker: ModelChecker,\r\n private readonly authManager: AuthManager) { }\r\n\r\n canDeactivate() {\r\n return !this.authManager.isLoggedIn || this.modelchecker.checkUnchanged(this.formInstance, this.oldFormInstance);\r\n }\r\n\r\n async canActivate(params: { contentIdentifier: number | string, roundIdentifier: number | string, isNew: boolean }, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction) {\r\n\r\n let promises = [];\r\n //load all required data in parallel\r\n promises.push(\r\n this.profileService.getActiveProfile().then(data => this.activeProfile = data),\r\n this.profileService.getAccount().then(data => this.account = data),\r\n this.grantDirectoryService.getGrantByIdOrSlug(params.contentIdentifier).then(data => this.content = data),\r\n );\r\n\r\n if(this.authManager.isLoggedIn) {\r\n promises.push(\r\n this.organisationService.getAvailableOrganisationByGrantAndRoundIdentifier(params.contentIdentifier, params.roundIdentifier).then(data => this.availableOrganisationProfiles = data),\r\n );\r\n }\r\n\r\n await Promise.all(promises);\r\n\r\n // validate if user has a valid individual account\r\n // this is for old accounts in the current production environment\r\n if(this.account && ! this.account.isValid) {\r\n this.notifier.warning('To apply for this grant you must update your individual profile.');\r\n return new Redirect(`/account/contact-information/edit?redirect=${generateGrantUrl(params.contentIdentifier)}`);\r\n } \r\n\r\n let checkResult = await this.applicationService.loggedInWithCorrectProfileCheck(this.activeProfile, this.content, this.account, params.isNew, this.availableOrganisationProfiles);\r\n \r\n if (checkResult.result === \"redirect\") {\r\n //the user has opted to login or be redirected somewhere to be able to apply - send them there\r\n return new Redirect(checkResult.redirectUrl)\r\n } else if (checkResult.result === \"cancelled\") {\r\n //return the user to the content view - they cancelled any options to rectify invalid login/profile pre requisites\r\n return new Redirect(generateGrantUrl(params.contentIdentifier));\r\n }\r\n\r\n // checkResult.result === 'valid' beyond this point.\r\n\r\n this.applicationFormService.isIndividual = this.activeProfile.profileType == \"Individual\";\r\n\r\n return this.grantDirectoryService\r\n .getApplyCheckByIdOrSlug(params.contentIdentifier, params.roundIdentifier)\r\n .then((result: Dto.INotification) => {\r\n if (result.successful) {\r\n return true;\r\n } else {\r\n if (result.warnings instanceof Array && result.warnings.length > 0) {\r\n for (let warning of result.warnings) {\r\n this.notifier.warning(warning);\r\n }\r\n }\r\n return new Redirect(generateGrantUrl(params.contentIdentifier));\r\n }\r\n });\r\n }\r\n\r\n apply(model: SharedDto.PublicContent.IPublicContentDetailViewDto, router: Router): void {\r\n router.navigateToRoute(\"Apply\", { contentIdentifier: model.contentSlug ? model.contentSlug : model.publicContentId, roundIdentifier: model.grantRoundSlug ? model.grantRoundSlug : model.roundId });\r\n }\r\n\r\n generateApplyUrl(model: SharedDto.PublicContent.IPublicContentDetailViewDto, router: Router): string {\r\n return router.generate(\"Apply\", { contentIdentifier: model.contentSlug ? model.contentSlug : model.publicContentId, roundIdentifier: model.grantRoundSlug ? model.grantRoundSlug : model.roundId });\r\n }\r\n\r\n activate(params: { contentIdentifier: number | string, roundIdentifier: number | string }) {\r\n this.publicContentId = params.contentIdentifier;\r\n this.roundIdentifier = params.roundIdentifier;\r\n this.applicationFormService.isPreview = false;\r\n\r\n return this.applicationService.getBlankApplicationBySlugOrId(params.contentIdentifier, params.roundIdentifier).then((application: any) => {\r\n this.formInstance = application.applicationForm;\r\n this.formTemplate = application.formTemplate; \r\n }).catch(error => {\r\n var previousPage = this.router.generate(Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail], {'contentIdentifier' : params.contentIdentifier})\r\n this.router.navigate(previousPage)\r\n\r\n if (error.hasOwnProperty('noContinue')) {\r\n return;\r\n }\r\n if (error instanceof ValidationError) {\r\n if (error.errors) {\r\n error.errors.forEach(e => {\r\n this.notifier.error(e);\r\n });\r\n return;\r\n }\r\n }\r\n \r\n this.logger.error(error); \r\n });\r\n }\r\n\r\n attached() {\r\n this.oldFormInstance = JSON.parse(JSON.stringify(this.formInstance));\r\n }\r\n\r\n public findSystemQuestionTemplate(code: SharedDto.Constants.SystemQuestion): SharedDto.OnlineForm.Form.IQuestionDto {\r\n var temp = [].concat.apply([], this.formTemplate.steps.map(x => x.sections.map(y => y.questions)));\r\n var templateQuestions = [].concat.apply([], temp);\r\n var questionTemplate = (templateQuestions as SharedDto.OnlineForm.Form.IQuestionDto[])\r\n .find(x => x.systemQuestion == code)\r\n\r\n return questionTemplate;\r\n }\r\n\r\n findQuestionAnswer(questionId) {\r\n for (var step of this.formInstance.formInstance.steps) {\r\n for (var sg of step.sectionGroups) {\r\n for (var sec of sg.sections) {\r\n for (var qg of sec.questionGroups) {\r\n for (var q of qg.questions) {\r\n if (q.templateQuestionId == questionId) {\r\n return q;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n save() {\r\n if (!this.isSaving) {\r\n this.isSaving = true;\r\n this.applicationForm.validateForSave().then(valid => {\r\n if (!valid) {\r\n let error = new Error;\r\n error['noContinue'] = true;\r\n throw error;\r\n }\r\n let applicationId = this.applicationService.createApplicationBySlug(this.formInstance, this.publicContentId, this.roundIdentifier);\r\n this.notifier.info('Application saved.')\r\n return applicationId;\r\n }).then((applicationId) => {\r\n this.oldFormInstance = JSON.parse(JSON.stringify(this.formInstance));\r\n return applicationId;\r\n }).then((applicationId) => {\r\n this.router.navigate(generateApplicationUrl(applicationId));\r\n }).catch(error => {\r\n this.isSaving = false;\r\n if (error.hasOwnProperty('noContinue')) {\r\n return;\r\n }\r\n if (error instanceof ValidationError) {\r\n if (error.errors) {\r\n error.errors.forEach(e => {\r\n this.notifier.error(e);\r\n });\r\n return;\r\n }\r\n }\r\n this.notifier.error(\"There was an error saving your application.\");\r\n this.logger.error(error);\r\n });\r\n }\r\n }\r\n}\r\n","module.exports = \"\";","import { bindable, customElement, bindingMode, autoinject, computedFrom } from \"aurelia-framework\";\r\nimport { SharedDto } from \"project/project-shared\";\r\n\r\n\r\n@autoinject\r\n@customElement(\"search-filter-panel\")\r\n\r\nexport class SearchFilterPanel {\r\n @bindable() title: string;\r\n @bindable() options: Array;\r\n @bindable() selectedValues: Array;\r\n @bindable() namePrefix: string = \"changeme\";\r\n @bindable() collapsed: boolean = true;\r\n @bindable() disabled: boolean = false;\r\n\r\n constructor(private element: Element) {\r\n }\r\n\r\n\r\n toggleCollapse() {\r\n this.collapsed = !this.collapsed;\r\n }\r\n\r\n collapsedChanged(newValue, oldValue) {\r\n var panel = $(this.element).find('.filter-body');\r\n panel.slideToggle(200);\r\n }\r\n\r\n @computedFrom(\"collapsed\")\r\n get iconClass() {\r\n return this.collapsed ? \"fa fa-fw fa-chevron-down\" : \"fa fa-fw fa-chevron-up\";\r\n }\r\n\r\n}\r\n\r\nexport class SearchPanelCheckboxItem {\r\n value: number;\r\n label: string;\r\n\r\n constructor(value: number, label: string) {\r\n this.value = value;\r\n this.label = label\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from \"aurelia-framework\";\r\nimport { DialogController } from \"aurelia-dialog\";\r\nimport { ValidationControllerFactory, ValidationRules } from \"aurelia-validation\";\r\n\r\nimport { DataService } from \"services/data-service\";\r\nimport { ValidationBase } from \"base-class\";\r\nimport { Dto } from \"project/project\";\r\nimport { AuthManager } from \"auth/auth-manager\";\r\n\r\nexport interface IContactProfileModel extends Dto.IPublicContentEnquiryDto {\r\n contactType: string,\r\n contactOrganisation: string\r\n};\r\n\r\n@autoinject\r\nexport class Enquire extends ValidationBase {\r\n loggedIn: boolean;\r\n isBusy: boolean;\r\n model: IContactProfileModel\r\n\r\n recaptchaSiteKey: string;\r\n recaptchaEnabled: boolean = true;\r\n\r\n constructor(public readonly dialogController: DialogController,\r\n private readonly dataService: DataService,\r\n private readonly authManager: AuthManager,\r\n controllerFactory: ValidationControllerFactory) { \r\n super(controllerFactory)\r\n }\r\n\r\n activate(model: IContactProfileModel) {\r\n this.model = model;\r\n \r\n this.loggedIn = this.authManager.isLoggedIn;\r\n return this.dataService.getRecaptchaKey().then((data: { value: string, enabled: boolean }) => {\r\n this.recaptchaSiteKey = data.value;\r\n this.recaptchaEnabled = data.enabled;\r\n }).then(() => this.setupValidation());\r\n }\r\n\r\n setupValidation() { \r\n ValidationRules\r\n .ensure((m: IContactProfileModel) => m.contactEmail).required().email()\r\n .ensure((m: IContactProfileModel) => m.contactName).required().matches(/^[A-Za-z '-]+$/).withMessage(\"Name may contain alphabetic characters, spaces, hyphens and apostrophes\")\r\n .ensure((m: IContactProfileModel) => m.enquiry).required().maxLength(4000)\r\n .ensure((m: IContactProfileModel) => m.contactPhone).required()\r\n .ensure((m: IContactProfileModel) => m.recaptchaResponse)\r\n .required()\r\n .when(m => !this.loggedIn && this.recaptchaEnabled)\r\n .withMessage(\"You must complete the reCaptcha test.\")\r\n .on(this.model);\r\n }\r\n\r\n submit() {\r\n this.isBusy = true;\r\n this.controller.validate().then((result) => {\r\n if (result.valid) {\r\n this.dialogController.ok(this.model);\r\n }\r\n else {\r\n this.isBusy = false;\r\n }\r\n }).catch(() => {\r\n this.isBusy = false;\r\n });\r\n }\r\n \r\n onVerified(response: string) {\r\n this.model.recaptchaResponse = response;\r\n }\r\n}","module.exports = \" \";","import { DialogService } from \"aurelia-dialog\";\r\nimport { autoinject, PLATFORM } from \"aurelia-framework\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { ApplicationFormService } from \"services/application-form-service\";\r\nimport { OnlineFormService } from \"services/online-form-service\";\r\nimport { ApplicationFormCustomElement } from \"shared/controls/online-form/application-form\";\r\nimport { IWarningModal, WarningModal } from \"./warning-modal\";\r\n\r\nPLATFORM.moduleName(\"./warning-modal\");//workaround for template bug and dialog service/webpack.\r\n\r\nexport interface IFormPreviewParams {\r\n formId: number;\r\n contentIdentifier: number;\r\n as: \"individual\" | \"organisation\";\r\n}\r\n\r\n@autoinject\r\nexport class Preview {\r\n contentId: number;\r\n isBusy: boolean = true;\r\n error: boolean = false;\r\n formTemplate: SharedDto.OnlineForm.Form.IApplicationFormTemplateDto;\r\n formInstance: SharedDto.OnlineForm.Application.IApplicationFormDto;\r\n\r\n applicationForm: ApplicationFormCustomElement;\r\n isSaving: boolean = false;\r\n isSubmitting: boolean = false;\r\n formId: number;\r\n\r\n constructor( private readonly dialogService: DialogService,\r\n private readonly formService: OnlineFormService,\r\n private readonly applicationFormService: ApplicationFormService) { }\r\n\r\n activate(params: IFormPreviewParams) {\r\n this.contentId = params.contentIdentifier;\r\n this.formId = params.formId;\r\n\r\n this.isBusy = true;\r\n let p: Promise;\r\n this.applicationFormService.isPreview = true;\r\n if (params.as == \"individual\") {\r\n this.applicationFormService.isIndividual = true;\r\n p = this.showIndividualPreview();\r\n }\r\n else {\r\n this.applicationFormService.isIndividual = false;\r\n p = this.showOrganisationPreview();\r\n }\r\n\r\n p.catch(error => {\r\n this.error = true;\r\n console.log(error);\r\n }).then(() => {\r\n this.isBusy = false;\r\n });\r\n return p;\r\n }\r\n\r\n attached() {\r\n if (!this.error) {\r\n this.warning(false, false, this.contentId);\r\n }\r\n }\r\n\r\n detached() {\r\n this.dialogService.closeAll();\r\n }\r\n\r\n save() {\r\n this.isSaving = true;\r\n this.applicationForm.validateForSave().then(valid => {\r\n if (valid) {\r\n this.warning(true, false, this.contentId);\r\n }\r\n }).catch(() => {\r\n }).then(() => {\r\n this.isSaving = false;\r\n });\r\n }\r\n\r\n submit() {\r\n this.isSubmitting = true;\r\n this.applicationForm.validateForSave().then(valid => {\r\n if (valid) {\r\n this.warning(false, true, this.contentId);\r\n }\r\n }).catch(() => {\r\n }).then(() => {\r\n this.isSubmitting = false;\r\n });\r\n }\r\n\r\n private showIndividualPreview() {\r\n var promises = [];\r\n\r\n promises.push(this.formService.getIndividualFormTemplate(this.formId).then(data => {\r\n this.formTemplate = data;\r\n }));\r\n\r\n promises.push(this.formService.getNewIndividualForm(this.formId).then(data => {\r\n this.formInstance = data;\r\n }));\r\n\r\n return Promise.all(promises);\r\n }\r\n\r\n private showOrganisationPreview() {\r\n var promises = [];\r\n\r\n promises.push(this.formService.getOrganisationFormTemplate(this.formId).then(data => {\r\n this.formTemplate = data;\r\n }));\r\n\r\n promises.push(this.formService.getNewOrganisationForm(this.formId).then(data => {\r\n this.formInstance = data;\r\n }));\r\n\r\n return Promise.all(promises);\r\n }\r\n\r\n private warning(save: boolean, submit: boolean, contentId: number): Promise {\r\n return this.dialogService.open({\r\n viewModel: PLATFORM.moduleName(\"grants/preview/warning-modal\"),\r\n model: {\r\n saved: save, submitted: submit, contentId: contentId\r\n } as IWarningModal\r\n });\r\n }\r\n\r\n public findSystemQuestionTemplate(code: SharedDto.Constants.SystemQuestion): SharedDto.OnlineForm.Form.IQuestionDto {\r\n var temp = [].concat.apply([], this.formTemplate.steps.map(x => x.sections.map(y => y.questions)));\r\n var templateQuestions = [].concat.apply([], temp);\r\n var questionTemplate = (templateQuestions as SharedDto.OnlineForm.Form.IQuestionDto[])\r\n .find(x => x.systemQuestion == code)\r\n\r\n return questionTemplate;\r\n }\r\n\r\n findQuestionAnswer(questionId) {\r\n for (var step of this.formInstance.formInstance.steps) {\r\n for(var sg of step.sectionGroups) {\r\n for(var sec of sg.sections) {\r\n for(var qg of sec.questionGroups) {\r\n for(var q of qg.questions) {\r\n if(q.templateQuestionId == questionId) {\r\n return q;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","module.exports = \" \";","import { DialogController } from \"aurelia-dialog\";\r\nimport { autoinject, computedFrom } from \"aurelia-framework\";\r\nimport { generateGrantUrl } from \"services/url-generators\";\r\n\r\nexport interface IWarningModal {\r\n saved: boolean,\r\n submitted: boolean,\r\n contentId: number\r\n}\r\n\r\n@autoinject\r\nexport class WarningModal {\r\n contentId: number;\r\n saved: boolean = false;\r\n submitted: boolean = false;\r\n\r\n constructor(public readonly dialogController: DialogController) {\r\n\r\n }\r\n\r\n activate(params: IWarningModal) {\r\n this.contentId = params.contentId;\r\n this.saved = params.saved;\r\n this.submitted = params.submitted;\r\n }\r\n\r\n @computedFrom(\"contentId\")\r\n get grantLink(): string {\r\n return generateGrantUrl(this.contentId);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from \"aurelia-dependency-injection\";\nimport { PLATFORM } from \"aurelia-pal\";\nimport { Router, RouterConfiguration } from \"aurelia-router\";\nimport { Dto } from \"project/project\";\nimport { ROUTE_APPLICATION_OUTCOME_SUMMARY } from \"utils/router-constants\";\n\n\n@autoinject\nexport class Detail {\n router: Router;\n\n configureRouter(config: RouterConfiguration, router: Router) {\n config.map([\n {\n name: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsSearch],\n route: \"\",\n nav: false,\n title: \"Grant search\",\n moduleId: PLATFORM.moduleName(\"grants/search\", \"grants-directory\"),\n settings: {\n breadcrumb: false,\n auth: false\n }\n },\n {\n name: \"supplier-content\",\n route: \":contentIdentifier/supplier-information/:supplierContentIdentifier\",\n nav: false,\n title: \"Supplier information\",\n moduleId: PLATFORM.moduleName(\"grants/view\", \"grants-directory\"),\n settings: {\n breadcrumb: true,\n parent: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\n auth: false\n }\n },\n {\n name: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\n route: \":contentIdentifier\",\n nav: false,\n title: \"Grant information\",\n moduleId: PLATFORM.moduleName(\"grants/view\", \"grants-directory\"),\n settings: {\n breadcrumb: true,\n parent: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsSearch],\n auth: false\n }\n },\n {\n route: \":contentIdentifier/apply/:roundIdentifier\", name: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.Apply],\n moduleId: PLATFORM.moduleName(\"grants/apply/apply\"), title: \"Apply\",\n settings: {\n breadcrumb: true,\n parent: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\n auth: false\n }\n },\n {\n route: \":contentIdentifier/preview/:formId\", name: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.Preview],\n moduleId: PLATFORM.moduleName(\"grants/preview/preview\"), title: \"Preview form\",\n settings: {\n breadcrumb: true,\n parent: Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail],\n auth: false\n }\n },\n ]);\n this.router = router;\n }\n\n}\n","module.exports = \" \";","import { autoinject, observable, singleton, bindable } from 'aurelia-framework';\r\nimport { ModuleBase } from 'base-class';\r\nimport { DataService } from 'services/data-service';\r\nimport { Dto } from \"project/project\";\r\nimport { SharedDto } from 'project/project-shared';\r\nimport { SearchPanelCheckboxItem } from './controls/search-filter-panel'\r\nimport { computedFrom } from 'aurelia-binding';\r\nimport { GrantDirectoryService } from 'services/grant-directory-service';\r\nimport * as moment from 'moment'\r\nimport { Notifier } from 'services/notifier';\r\nimport { BindingEngine } from 'aurelia-binding';\r\nimport { scrollIntoViewExternal } from 'shared/utils/scroll-into-view';\r\n\r\ntype SortFilterType = \"NewlyListed\" | \"OpenDate\" | \"CloseDate\";\r\n\r\n@autoinject\r\n@singleton()\r\nexport class Search extends ModuleBase {\r\n\r\n totalRecords: number;\r\n grantsList: Array;\r\n\r\n agencies: Array;\r\n selectedAgencies: Array = [];\r\n\r\n categories: Array;\r\n selectedCategories: Array = [];\r\n\r\n beneficiaries: Array;\r\n selectedBeneficiaries: Array = [];\r\n\r\n whoCanApply: Array;\r\n selectedWhoCanApply: Array = [];\r\n\r\n contentTypes: Array;\r\n selectedContentTypes: Array = [];\r\n\r\n grantsAvailable: Array;\r\n selectedGrantsAvailable: Array = [];\r\n\r\n @bindable() benes: number[] = [];\r\n @observable() search: string;\r\n\r\n @observable() page: number = 1;\r\n @observable() pageSize: number = 5;\r\n isBusy: boolean;\r\n\r\n offCanvasElement: HTMLElement;\r\n\r\n @observable() sortFilter: SortFilterType = \"NewlyListed\";\r\n\r\n keywordSearchElement: Element;\r\n drawer: any;\r\n\r\n constructor(dataService: DataService,\r\n private readonly grantDirectoryService: GrantDirectoryService,\r\n private readonly notifier: Notifier,\r\n private readonly bindingEngine: BindingEngine) {\r\n super(dataService);\r\n this.grantsList = [];\r\n\r\n this.whoCanApply = [\r\n new SearchPanelCheckboxItem(1, \"Individuals\"),\r\n new SearchPanelCheckboxItem(2, \"Non Profit Organisations\"),\r\n new SearchPanelCheckboxItem(3, \"For Profit Organisations\"),\r\n ];\r\n\r\n this.contentTypes = [\r\n new SearchPanelCheckboxItem(SharedDto.Constants.PublicContentType.Applicant, \"Grant funding\"),\r\n new SearchPanelCheckboxItem(SharedDto.Constants.PublicContentType.ThirdPartyApplicant, \"Vouchers\"),\r\n new SearchPanelCheckboxItem(SharedDto.Constants.PublicContentType.ThirdPartySupplier, \"To be a supplier\"),\r\n ];\r\n\r\n this.grantsAvailable = [\r\n new SearchPanelCheckboxItem(1, \"Open today\"),\r\n new SearchPanelCheckboxItem(2, \"Open in the next week\"),\r\n new SearchPanelCheckboxItem(3, \"Open in the next fortnight\"),\r\n new SearchPanelCheckboxItem(4, \"Open in the next month\"),\r\n ]\r\n }\r\n\r\n activate(params: { agency?: string, category?: string, term?: string }) {\r\n var promises = [];\r\n promises.push(this.dataService.getAgencies().then((data: Array) => {\r\n this.agencies = data.sort((a, b) => a.description.localeCompare(b.description)).map((m: SharedDto.ICodeListItemDto) => new SearchPanelCheckboxItem(m.id, m.description));\r\n }));\r\n\r\n promises.push(this.dataService.getCategoryByLevel(1).then((data: Array) => {\r\n this.categories = data.map((m: SharedDto.ICodeListItemDto) => new SearchPanelCheckboxItem(m.id, m.description));\r\n }));\r\n\r\n promises.push(this.dataService.getBeneficiaries().then((data: Array) => {\r\n this.beneficiaries = data.map((m: SharedDto.IBeneficiaryDto) => new SearchPanelCheckboxItem(m.beneficiaryId, m.display));\r\n }));\r\n\r\n return Promise.all(promises).then(() => {\r\n if (params.agency || params.category || params.term) {\r\n this.selectedAgencies = [];\r\n this.selectedCategories = [];\r\n this.search = \"\";\r\n }\r\n params.agency && this.agencies.find(a => a.value == parseInt(params.agency)) && this.selectedAgencies.push(params.agency);\r\n params.category && this.categories.find(c => c.value == parseInt(params.category)) && this.selectedCategories.push(params.category);\r\n params.term && (this.search = params.term);\r\n return this.doSearch();\r\n });\r\n }\r\n\r\n attached() {\r\n var menu = new MmenuLight(this.offCanvasElement);\r\n this.drawer = menu.offcanvas({ position: 'left' });\r\n\r\n //setup collection observers on selectedX criteria - note, there's no subscriptions being collected for disposal later because this class is a singleton and there's probably no need for an overhead\r\n this.bindingEngine.collectionObserver(this.selectedAgencies).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedCategories).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedBeneficiaries).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedWhoCanApply).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedGrantsAvailable).subscribe(() => this.doSearch());\r\n this.bindingEngine.collectionObserver(this.selectedContentTypes).subscribe(() => this.doSearch());\r\n }\r\n\r\n clearAllFilters() {\r\n while (this.selectedAgencies.length > 0) {\r\n this.selectedAgencies.pop();\r\n }\r\n while (this.selectedBeneficiaries.length > 0) {\r\n this.selectedBeneficiaries.pop();\r\n }\r\n while (this.selectedWhoCanApply.length > 0) {\r\n this.selectedWhoCanApply.pop();\r\n }\r\n while (this.selectedCategories.length > 0) {\r\n this.selectedCategories.pop();\r\n }\r\n while (this.selectedGrantsAvailable.length > 0) {\r\n this.selectedGrantsAvailable.pop();\r\n }\r\n }\r\n\r\n removePill(pill: SearchPill) {\r\n var thingToRemove: Array;\r\n switch (pill.source) {\r\n case \"categories\": thingToRemove = this.selectedCategories; break;\r\n case \"agencies\": thingToRemove = this.selectedAgencies; break;\r\n case \"beneficiaries\": thingToRemove = this.selectedBeneficiaries; break;\r\n case \"whoCanApply\": thingToRemove = this.selectedWhoCanApply; break;\r\n case \"grantsAvailable\": thingToRemove = this.selectedGrantsAvailable; break;\r\n }\r\n let index = thingToRemove.indexOf(\"\" + pill.id);\r\n thingToRemove = thingToRemove.splice(index, 1);\r\n }\r\n\r\n openFilter() {\r\n this.drawer.open();\r\n }\r\n\r\n pageChanged(newVal: number, oldVal: number) {\r\n if (oldVal == undefined) {\r\n return;\r\n }\r\n scrollIntoViewExternal(this.keywordSearchElement);\r\n this.doSearch();\r\n }\r\n\r\n pageSizeChanged(newVal: number, oldVal: number) {\r\n if (oldVal == undefined) {\r\n return;\r\n }\r\n scrollIntoViewExternal(this.keywordSearchElement);\r\n this.doSearch();\r\n }\r\n\r\n sortFilterChanged(newVal: SortFilterType, oldVal: SortFilterType) {\r\n if (oldVal == undefined) {\r\n return;\r\n }\r\n this.doSearch();\r\n }\r\n\r\n sortClosingSoon() {\r\n this.sortFilter = \"CloseDate\";\r\n }\r\n\r\n sortOpeningSoon() {\r\n this.sortFilter = \"OpenDate\";\r\n }\r\n\r\n sortNewlyListed() {\r\n this.sortFilter = \"NewlyListed\";\r\n }\r\n\r\n doSearch(): Promise {\r\n let searchRequest: Dto.IPublicContentSearchFilterRequestDto = {\r\n agencies: this.selectedAgencies.map(m => parseInt(m)).filter(m => !isNaN(m)),\r\n categories: this.selectedCategories.map(m => parseInt(m)).filter(m => !isNaN(m)),\r\n beneficiaries: this.selectedBeneficiaries.map(m => parseInt(m)).filter(m => !isNaN(m)),\r\n publicContentTypes: this.selectedContentTypes.map(m => parseInt(m)).filter(m => !isNaN(m)),\r\n pageSize: this.pageSize,\r\n page: this.page,\r\n sortColumn: \"\",\r\n sortDirection: SharedDto.Constants.SortDirection.Desc,\r\n keywords: this.search,\r\n contentSlug: \"\"\r\n }\r\n\r\n switch (this.sortFilter) {\r\n default:\r\n case \"NewlyListed\":\r\n searchRequest.sortColumn = \"PublishDateFrom\";\r\n searchRequest.sortDirection = SharedDto.Constants.SortDirection.Desc;\r\n break;\r\n case \"CloseDate\":\r\n searchRequest.sortColumn = \"ApplicationsClose\";\r\n searchRequest.sortDirection = SharedDto.Constants.SortDirection.Asc;\r\n break;\r\n case \"OpenDate\":\r\n searchRequest.sortColumn = \"ApplicationsOpen\";\r\n searchRequest.sortDirection = SharedDto.Constants.SortDirection.Asc;\r\n break;\r\n }\r\n\r\n this.selectedWhoCanApply.forEach(m => {\r\n let who = this.whoCanApply.find(w => w.value == parseInt(m));\r\n switch (who.label) {\r\n case \"Individuals\": searchRequest.individualsCanApply = true; break;\r\n case \"Non Profit Organisations\": searchRequest.nonProfitCanApply = true; break;\r\n case \"For Profit Organisations\": searchRequest.forProfitCanApply = true; break;\r\n }\r\n });\r\n\r\n // somehow this nasty thing works. but it needs to be changed to a radio control - not checkbox.\r\n this.selectedGrantsAvailable.forEach(m => {\r\n let when = this.grantsAvailable.find(g => g.value == parseInt(m));\r\n switch (when.label) {\r\n case \"Open today\": searchRequest.applicationsOpenFrom = moment().format(); break;\r\n case \"Open in the next week\": searchRequest.applicationsOpenFrom = moment().add(7, 'days').format(); break;\r\n case \"Open in the next fortnight\": searchRequest.applicationsOpenFrom = moment().add(14, 'days').format(); break;\r\n case \"Open in the next month\": searchRequest.applicationsOpenFrom = moment().add(1, 'month').format(); break;\r\n }\r\n })\r\n this.isBusy = true;\r\n return this.grantDirectoryService.searchGrants(searchRequest).then((res: Dto.IPublicContentSearchResultsDto) => {\r\n this.grantsList = res.results;\r\n this.totalRecords = res.totalRecords;\r\n this.isBusy = false;\r\n }).catch(error => {\r\n this.notifier.error(\"An unexpected error happened while processing your request.\")\r\n this.isBusy = false;\r\n });\r\n }\r\n\r\n @computedFrom(\"selectedAgencies.length\", \"selectedCategories.length\", \"selectedBeneficiaries.length\", \"selectedWhoCanApply.length\", \"selectedGrantsAvailable.length\")\r\n get selectedOptions() {\r\n let val = this.selectedAgencies.map((m) => this.agencies.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"agencies\"))\r\n .concat(\r\n this.selectedBeneficiaries.map(m => this.beneficiaries.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"beneficiaries\"))\r\n )\r\n .concat(\r\n this.selectedCategories.map(m => this.categories.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"categories\"))\r\n )\r\n .concat(\r\n this.selectedGrantsAvailable.map(m => this.grantsAvailable.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"grantsAvailable\"))\r\n )\r\n .concat(\r\n this.selectedWhoCanApply.map(m => this.whoCanApply.find(i => i.value == parseInt(m)))\r\n .filter(a => a != undefined)\r\n .map(a => new SearchPill(a.value, a.label, \"whoCanApply\"))\r\n );\r\n return val.sort((a: SearchPill, b: SearchPill) => a.description.length - b.description.length);\r\n }\r\n}\r\n\r\nclass SearchPill {\r\n id: number;\r\n description: string;\r\n source: \"agencies\" | \"categories\" | \"beneficiaries\" | \"whoCanApply\" | \"grantsAvailable\";\r\n\r\n constructor(id: number, description: string, source: \"agencies\" | \"categories\" | \"beneficiaries\" | \"whoCanApply\" | \"grantsAvailable\") {\r\n this.id = id;\r\n this.description = description;\r\n this.source = source;\r\n }\r\n}\r\n","module.exports = \" \";","import { DialogService } from \"aurelia-dialog\";\r\nimport { autoinject, computedFrom, PLATFORM } from \"aurelia-framework\";\r\nimport { activationStrategy, NavigationInstruction, Redirect, RouteConfig, Router } from \"aurelia-router\";\r\nimport { AuthManager } from \"auth/auth-manager\";\r\nimport { IContactProfileModel } from \"grants/enquire/enquire-modal\";\r\nimport { ActiveProfile } from \"models/active-profile\";\r\nimport { Dto } from \"project/project\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { ApplicationService } from \"services/application-service\";\r\nimport { GrantDirectoryService } from \"services/grant-directory-service\";\r\nimport { Notifier } from \"services/notifier\";\r\nimport { ProfileService } from \"services/profile-service\";\r\nimport { SlugifyService } from \"services/slugify-service\";\r\nimport { generateApplicationUrl } from \"services/url-generators\";\r\nimport { Confirm } from \"shared/controls/confirm-modal/confirm\";\r\nimport { ROUTE_APPLICATIONS, ROUTE_GRANTS_DIRECTORY } from \"utils/router-constants\";\r\n\r\n@autoinject\r\nexport class GrantDetailsView {\r\n\r\n model: SharedDto.PublicContent.IPublicContentDetailViewDto;\r\n notFound: boolean;\r\n queryString: string;\r\n currentRoute: string;\r\n\r\n enquireBusy: boolean;\r\n isBusy: boolean = false;\r\n canView: boolean = false;\r\n canEdit: boolean = false;\r\n\r\n profile: ActiveProfile;\r\n userDetails: Dto.IUserResponse;\r\n\r\n mainDescriptionString: string;\r\n descriptionElm: Element;\r\n contentId: string | number;\r\n supplierContentId: string | number;\r\n\r\n googleBreadcrumbScriptElem: HTMLScriptElement;\r\n googleArticleScriptElem: HTMLScriptElement;\r\n\r\n grantSearchRoute = ROUTE_GRANTS_DIRECTORY;\r\n\r\n constructor(private authManager: AuthManager,\r\n private readonly notifier: Notifier,\r\n private readonly dialogService: DialogService,\r\n private readonly profileService: ProfileService,\r\n private readonly grantDirectoryService: GrantDirectoryService,\r\n private readonly router: Router,\r\n private readonly slugify: SlugifyService,\r\n private readonly applicationService: ApplicationService,\r\n private readonly confirm: Confirm) {\r\n }\r\n\r\n canActivate(params: { contentIdentifier: any, supplierContentIdentifier?: any, invitation?: any }) {\r\n //a catch to redirect links still using the old identifiers\r\n if (this.slugify.isNumber(params.contentIdentifier)) {\r\n return this.slugify.getContentSlug(+params.contentIdentifier).then(slug => {\r\n if (slug != null && slug != \"\") {\r\n let supplierLink = this.router.generate(Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.GrantsDetail], { contentIdentifier: slug, invitation: params.invitation });\r\n return new Redirect(supplierLink);\r\n }\r\n return true;\r\n })\r\n }\r\n return true;\r\n }\r\n\r\n determineActivationStrategy() {\r\n //to get the animation of the page changing when switching between applicant and supplier public contents\r\n return activationStrategy.replace;\r\n }\r\n\r\n activate(params: { contentIdentifier: string | number, supplierContentIdentifier?: number }, routeConfig: RouteConfig, navigationInstruction: NavigationInstruction) {\r\n this.contentId = params.contentIdentifier;\r\n this.supplierContentId = params.supplierContentIdentifier;\r\n\r\n return this.grantDirectoryService.getGrantByIdOrSlug(this.supplierContentId || this.contentId).then(data => {\r\n this.model = data;\r\n\r\n if (data == null) {\r\n //if no content returned, show the no-content page.\r\n this.notFound = true;\r\n return;\r\n }\r\n\r\n this.canView = this.canEdit = true;\r\n\r\n //Set page title on load and populate description field with data for google\r\n this.setMetaInformation();\r\n routeConfig.navModel.title = this.model.grantName;\r\n\r\n this.profileService.getActiveProfile().then(profile => {\r\n this.profile = profile;\r\n })\r\n\r\n this.profileService.getAccount().then(account => {\r\n this.userDetails = account;\r\n });\r\n }).catch(data => {\r\n //todo: the flow of this seems strange. What if the error is not slug related?\r\n this.grantDirectoryService.hasOldUrl(this.contentId, 'GrantDetail')\r\n });\r\n }\r\n\r\n attached() {\r\n this.setArticle(true);\r\n }\r\n\r\n deactivate() {\r\n //reset description/keywords for google SEO\r\n this.setKeywords([]);\r\n this.setArticle(false);\r\n if (this.descriptionElm) {\r\n this.descriptionElm.setAttribute(\"content\", this.mainDescriptionString);\r\n }\r\n }\r\n\r\n private setMetaInformation() {\r\n let description = this.descriptionString(this.model.overviewHtml);\r\n this.descriptionElm = document.querySelector(\"meta[name=description]\");\r\n if (this.descriptionElm) {\r\n this.mainDescriptionString = this.descriptionElm.getAttribute(\"content\");\r\n this.descriptionElm.setAttribute(\"content\", description);\r\n }\r\n this.setKeywords(this.model.categories);\r\n }\r\n\r\n private descriptionString(htmlIn: String): string {\r\n let reg: RegExp = new RegExp('\\|\\<\\/p\\>', 'gi');\r\n return htmlIn.replace(reg, \"\");\r\n }\r\n\r\n private setKeywords(keys: string[]) {\r\n let elm = document.getElementById(\"grantKeys\");\r\n if (keys.length > 0) {\r\n elm.setAttribute(\"content\", keys.join(\",\"));\r\n } else {\r\n elm.setAttribute(\"content\", \"\");\r\n }\r\n }\r\n\r\n private setArticle(setup: Boolean) {\r\n if(this.notFound) {\r\n return;\r\n }\r\n if (!setup) {\r\n this.googleArticleScriptElem.innerText = \"\";\r\n this.googleBreadcrumbScriptElem.innerText = \"\";\r\n return;\r\n }\r\n //Google Article setup\r\n this.googleArticleScriptElem.innerText = JSON.stringify({\r\n '@context': \"https://schema.org\",\r\n '@type': 'NewsArticle',\r\n 'mainEntityOfPage': {\r\n \"@type\": \"WebPage\",\r\n \"@id\": window.location.origin + \"/grants/search\"\r\n },\r\n 'headline': this.model.grantName,\r\n \"image\": [window.location.origin + \"/App/assets/images/ntg-Google.png\"],\r\n \"datePublished\": new Date().toISOString(),\r\n \"dateModified\": new Date().toISOString(),\r\n \"author\": {\r\n \"@type\": \"Organization\",\r\n \"name\": this.model.agency\r\n },\r\n \"publisher\": {\r\n \"@type\": \"Organization\",\r\n \"name\": \"Northern Territory Government\",\r\n \"logo\": {\r\n \"@type\": \"ImageObject\",\r\n \"url\": window.location.origin + \"/App/assets/images/ntg-Google.png\"\r\n }\r\n },\r\n \"description\": this.descriptionString(this.model.overviewHtml)\r\n });\r\n\r\n //Bread crumb setup\r\n this.googleBreadcrumbScriptElem.innerText = JSON.stringify({\r\n \"@context\": \"https://schema.org\",\r\n \"@type\": \"BreadcrumbList\",\r\n \"itemListElement\": [\r\n {\r\n \"@type\": \"ListItem\",\r\n \"position\": 1,\r\n \"name\": \"GrantsNT\",\r\n \"item\": window.location.origin\r\n },\r\n {\r\n \"@type\": \"ListItem\",\r\n \"position\": 2,\r\n \"name\": \"Grants List\",\r\n \"item\": window.location.origin + \"/grants/search\"\r\n },\r\n {\r\n \"@type\": \"ListItem\",\r\n \"position\": 3,\r\n \"name\": this.model.grantName,\r\n \"item\": window.location.origin + \"/grants/\" + this.model.publicContentId\r\n }\r\n ]\r\n });\r\n }\r\n\r\n enquire() {\r\n this.enquireBusy = true;\r\n let promises: [Promise, Promise] = (\r\n this.authManager.isLoggedIn\r\n ? [this.profileService.getActiveProfile(), this.profileService.getIndividualProfile()]\r\n : [Promise.resolve(null), Promise.resolve(null)]\r\n );\r\n //todo: move this logic into the modal, have the modal close once complete.\r\n Promise.all(promises).catch(() => [null, null]).then(profiles => {\r\n let contactModel = {\r\n contactName: profiles[0] ? profiles[0].profileUserFullname : null,\r\n contactEmail: profiles[1] ? profiles[1].emailAddress : null,\r\n contactPhone: profiles[1] ? profiles[1].mobilePhoneNumber : null,\r\n contactType: profiles[0] ? profiles[0].profileType : null,\r\n contactOrganisation: profiles[0] ? profiles[0].profileDisplayName : null,\r\n organisationId: profiles[0] && profiles[0].profileType === 'Organisation' ? profiles[0].profileIdentifier : null,\r\n enquiry: null\r\n } as IContactProfileModel;\r\n return this.dialogService.open({\r\n viewModel: PLATFORM.moduleName('grants/enquire/enquire-modal'),\r\n model: contactModel,\r\n rejectOnCancel: true\r\n }).whenClosed((response) => {\r\n return this.grantDirectoryService.grantEnquiry(this.model.publicContentId, {\r\n contactEmail: response.output.contactEmail,\r\n contactName: response.output.contactName,\r\n contactPhone: response.output.contactPhone,\r\n enquiry: response.output.enquiry,\r\n recaptchaResponse: response.output.recaptchaResponse,\r\n organisationId: response.output.organisationId\r\n });\r\n });\r\n }).then(() => {\r\n this.notifier.success(\"Your enquiry has been submitted\");\r\n }).catch(error => {\r\n if (error.hasOwnProperty('wasCancelled')) { return; }\r\n this.notifier.error(\"Your enquiry could not be submitted. Please try again.\");\r\n console.log(error);\r\n }).then(() => {\r\n this.enquireBusy = false;\r\n });\r\n }\r\n\r\n async apply() {\r\n this.router.navigateToRoute(\"Apply\", { contentIdentifier: this.model.contentSlug ? this.model.contentSlug : this.model.publicContentId, roundIdentifier: this.model.grantRoundSlug ? this.model.grantRoundSlug : this.model.roundId });\r\n }\r\n\r\n // application is both available for organisations and individuals\r\n profileInterstitial() {\r\n let orgProfileType = SharedDto.Constants.FormProfileType[SharedDto.Constants.FormProfileType.Organisation]\r\n let indProfileType = SharedDto.Constants.FormProfileType[SharedDto.Constants.FormProfileType.Individual]\r\n\r\n let otherProfileType = this.profile.profileType === orgProfileType ? indProfileType : orgProfileType;\r\n let currentProfileName = this.profile.profileDisplayName ? this.profile.profileDisplayName : this.profile.profileUserFullname;\r\n //common profile switcher modal might be handy here - force certain profile type selection or cancel kind of workflow.\r\n return this.confirm.confirm(`This application will be created for ${currentProfileName}, however it is also open to ${otherProfileType}. Please confirm you are submitting for the right profile.`)\r\n .then(response => {\r\n if (response) {\r\n this.isBusy = true;\r\n this.router.navigateToRoute(\"Apply\", { contentIdentifier: this.model.contentSlug ? this.model.contentSlug : this.model.publicContentId, roundIdentifier: this.model.grantRoundSlug ? this.model.grantRoundSlug : this.model.roundId });\r\n }\r\n });\r\n }\r\n\r\n @computedFrom(\"model.roundId\", \"singleExistingApplication\")\r\n get existingApplciationLink(): string {\r\n if (this.singleExistingApplication) {\r\n return generateApplicationUrl(this.singleExistingApplication);\r\n }\r\n if (this.model.existingApplications.length > 1) {\r\n return this.router.generate(ROUTE_APPLICATIONS, { roundId: this.model.roundId })\r\n }\r\n return null;\r\n }\r\n\r\n @computedFrom(\"model.canPotentiallyApplyNow\")\r\n get showApplyNow(): boolean {\r\n return this.model.canPotentiallyApplyNow && !this.model.nonConcurrentAndStillProcessing;\r\n }\r\n\r\n @computedFrom(\"model.applyNow\", \"isBusy\")\r\n get applyNowDisabled(): boolean {\r\n return !this.model.applyNow.successful //some check failed..\r\n || this.isBusy;//we're already procesing something\r\n }\r\n\r\n @computedFrom(\"model.applyNow\")\r\n get applyNowWarning(): string {\r\n if (!this.model || !this.model.applyNow) {\r\n return null;\r\n }\r\n if (!this.model.applyNow.successful) {\r\n if (this.model.applyNow.warnings instanceof Array && this.model.applyNow.warnings.length > 0) {\r\n return this.model.applyNow.warnings[0];\r\n }\r\n } else {\r\n return null;\r\n }\r\n }\r\n\r\n @computedFrom(\"router.currentInstruction\")\r\n get changeProfilesHref(): string {\r\n return this.router.generate(Dto.Constants.ExternalPageRoutes[Dto.Constants.ExternalPageRoutes.ProfileSelect], {\r\n redirect: this.router.currentInstruction.parentInstruction.fragment,\r\n q: this.router.currentInstruction.parentInstruction.queryString\r\n });\r\n }\r\n\r\n @computedFrom(\"canView\", \"canEdit\", \"model.existingApplications\")\r\n get showOpenExistingApplication(): boolean {\r\n return this.model.existingApplications && (this.canView || this.canEdit);\r\n }\r\n\r\n @computedFrom(\"canView\", \"canEdit\", \"model.existingApplications\")\r\n get singleExistingApplication(): number | null {\r\n if (this.model.existingApplications && (this.canView || this.canEdit) && this.model.existingApplications.length == 1) {\r\n return this.model.existingApplications[0];\r\n }\r\n return null;\r\n }\r\n\r\n @computedFrom(\"model.supplierPublicContentId\", \"model.publicContentId\")\r\n get displaySupplierLink(): boolean {\r\n //do not display if there is no supplier content link\r\n if (!this.model.supplierPublicContentId) {\r\n return false;\r\n }\r\n //display if we're not already viewing the supplier content\r\n return this.model.supplierPublicContentId !== this.model.publicContentId;\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\n\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\n\r\n@autoinject\r\nexport class Help extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class FAQ extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ApplyForGrant extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ApplyForGrantLanding extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class GrantEnquiry extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class GrantSearch extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class GrantSubscription extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\n\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\n\r\n@autoinject\r\nexport class CompHelp extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../assets/video/introduction.mp4\";\r\nimport \"../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class Introduction extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ApplicationManagement extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class Correspondence extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ManageGrantLanding extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class Reporting extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ROI extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ViewAwarded extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/video/createOrgProfile.mp4\"\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class CreateOrgProfile extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\nimport \"../../../../assets/video/joinOrg.mp4\";\r\n\r\n@autoinject\r\nexport class JoinAnOrg extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/video/manageProfileAccess.mp4\"\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class ManageProfileAccess extends ModuleBase {\r\n\tconstructor(dataService: DataService) {\r\n\t\tsuper(dataService);\r\n\t}\r\n}\r\n","module.exports = \" \";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/video/orgUserAccess.mp4\"\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class OrgUserAccess extends ModuleBase {\r\n\tconstructor(dataService: DataService) {\r\n\t\tsuper(dataService);\r\n\t}\r\n}\r\n","module.exports = \"\";","import { autoinject } from 'aurelia-framework';\r\nimport { DataService } from 'services/data-service';\r\nimport { ModuleBase } from 'base-class';\r\nimport \"../../../../assets/css/grantsnt/gnt-help.less\";\r\nimport \"../../../../assets/images/ntg-logo-white.png\";\r\n\r\n@autoinject\r\nexport class SetupLanding extends ModuleBase {\r\n constructor(dataService: DataService) {\r\n super(dataService);\r\n }\r\n}\r\n","module.exports = \"\";","import { autoinject } from \"aurelia-dependency-injection\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { computedFrom } from \"aurelia-binding\";\r\nimport { bindable } from \"aurelia-templating\";\r\nimport { bindingMode } from \"aurelia-binding\";\r\nimport $clamp from \"clamp-js\";\r\nimport \"./grant-card-view.less\";\r\nrequire('readmore-js');\r\n\r\n@autoinject\r\nexport class GrantCardView {\r\n\r\n @bindable({ defaultBindingMode: bindingMode.twoWay }) model: SharedDto.PublicContent.IPublicContentSummaryViewDto;\r\n overviewElement: HTMLDivElement;\r\n agencySpan: HTMLSpanElement;\r\n\r\n attached() {\r\n $clamp(this.agencySpan, { clamp: 2 });\r\n $clamp(this.overviewElement, { clamp: 4 });\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get overviewFirstParagraph(): string {\r\n var startIndex = this.model.overviewHtml.indexOf(\"

\")\r\n var endIndex = this.model.overviewHtml.indexOf(\"

\") + 4;\r\n return this.model.overviewHtml.substr(startIndex, endIndex - startIndex);\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get availableTo(): string {\r\n if (this.model) {\r\n if (this.model.isIndividualEligible && this.model.isOrganisationEligible) {\r\n return \"Individuals and Organisations\"\r\n }\r\n else if (this.model.isIndividualEligible) {\r\n return \"Individuals\"\r\n }\r\n else {\r\n return \"Organisations\"\r\n }\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get showFunding(): boolean {\r\n return this.model.showGlobalMaxFunding && this.model.globalFundingMax !== null && this.model.globalFundingMax > 0;\r\n }\r\n\r\n get firstCategory(): string {\r\n if (this.model && this.model.categories.length > 0) {\r\n return this.model.categories[0];\r\n }\r\n return null;\r\n }\r\n\r\n get otherCategoriesText(): string {\r\n if (this.model && this.model.categories.length > 1) {\r\n var returnString = \"\";\r\n for (let i = 1; i < this.model.categories.length; i++) {\r\n if (i > 1) {\r\n returnString += \", \";\r\n }\r\n returnString += this.model.categories[i];\r\n }\r\n return returnString;\r\n }\r\n return null;\r\n }\r\n}\r\n","module.exports = \" \";","import { bindingMode, computedFrom } from \"aurelia-binding\";\r\nimport { autoinject } from \"aurelia-dependency-injection\";\r\nimport { bindable } from \"aurelia-templating\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport \"./grant-detail-view.less\";\r\n\r\n@autoinject\r\nexport class GrantDetailView {\r\n\r\n @bindable({ defaultBindingMode: bindingMode.twoWay }) model: SharedDto.PublicContent.IPublicContentDetailViewDto;\r\n\r\n @computedFrom(\"model\")\r\n get availableTo(): string {\r\n if (this.model) {\r\n if (this.model.isIndividualEligible && this.model.isOrganisationEligible) {\r\n return \"Individuals and Organisations\"\r\n }\r\n else if (this.model.isIndividualEligible) {\r\n return \"Individuals\"\r\n }\r\n else {\r\n return \"Organisations\"\r\n }\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n @computedFrom(\"model.publicContentType\")\r\n get showSupplierListLink(): boolean {\r\n return this.model.publicContentType === SharedDto.Constants.PublicContentType.ThirdPartyApplicant ||\r\n this.model.publicContentType === SharedDto.Constants.PublicContentType.ThirdPartySupplier;\r\n }\r\n}\r\n","module.exports = \" \";","import { autoinject } from \"aurelia-dependency-injection\";\r\nimport { SharedDto } from \"project/project-shared\";\r\nimport { computedFrom } from \"aurelia-binding\";\r\nimport { bindable } from \"aurelia-templating\";\r\nimport { bindingMode } from \"aurelia-binding\";\r\nimport \"./grant-summary-view.less\";\r\nrequire('readmore-js');\r\n\r\n@autoinject\r\nexport class GrantSummaryView {\r\n\r\n @bindable({ defaultBindingMode: bindingMode.twoWay }) model: SharedDto.PublicContent.IPublicContentSummaryViewDto;\r\n overviewElement: Element;\r\n\r\n attached() {\r\n $(this.overviewElement).readmore({\r\n collapsedHeight: 75,\r\n moreLink: '
+ Read more',\r\n lessLink: ' - Show less'\r\n });\r\n }\r\n\r\n detached() {\r\n $(this.overviewElement).readmore('destroy');\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get availableTo(): string {\r\n if (this.model) {\r\n if (this.model.isIndividualEligible && this.model.isOrganisationEligible) {\r\n return \"Individuals and Organisations\"\r\n }\r\n else if (this.model.isIndividualEligible) {\r\n return \"Individuals\"\r\n }\r\n else {\r\n return \"Organisations\"\r\n }\r\n } else {\r\n return \"\";\r\n }\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get overviewFirstParagraph(): string {\r\n var startIndex = this.model.overviewHtml.indexOf(\"

\")\r\n var endIndex = this.model.overviewHtml.indexOf(\"

\") + 4;\r\n return this.model.overviewHtml.substr(startIndex, endIndex - startIndex);\r\n }\r\n\r\n get firstCategory(): string {\r\n if (this.model && this.model.categories.length > 0) {\r\n return this.model.categories[0];\r\n }\r\n return null;\r\n }\r\n\r\n @computedFrom(\"model\")\r\n get showFunding(): boolean {\r\n return this.model.showGlobalMaxFunding && this.model.globalFundingMax !== null && this.model.globalFundingMax > 0;\r\n }\r\n\r\n get otherCategoriesText(): string {\r\n if (this.model && this.model.categories.length > 1) {\r\n var returnString = \"\";\r\n for (let i = 1; i < this.model.categories.length; i++) {\r\n if (i > 1) {\r\n returnString += \", \";\r\n }\r\n returnString += this.model.categories[i];\r\n }\r\n return returnString;\r\n }\r\n return null;\r\n }\r\n}\r\n","module.exports = \"\";","import { computedFrom, observable } from 'aurelia-binding';\r\nimport { EventAggregator } from 'aurelia-event-aggregator';\r\nimport { autoinject } from 'aurelia-framework';\r\nimport { Router } from 'aurelia-router';\r\nimport { SharedDto } from 'project/project-shared';\r\nimport { FeaturedGrantService } from 'services/featured-grant-service';\r\nimport { generateGrantUrl } from 'services/url-generators';\r\nimport { DeviceLayoutChangedEvent, ResponsiveLayoutService } from 'shared/utils/responsive-layout-service';\r\nimport { ROUTE_GRANTS_DIRECTORY } from 'utils/router-constants';\r\nimport { Dto } from \"./project/project\";\r\nimport { DataService } from './services/data-service';\r\nimport { GrantDirectoryService } from \"./services/grant-directory-service\";\r\n\r\n@autoinject\r\nexport class Welcome {\r\n\r\n grants: Array;\r\n rows: Array> = [];\r\n agencies: Array;\r\n categories: Array;\r\n selectedCategory: number;\r\n selectedAgency: number;\r\n searchTerm: string;\r\n routeGrantsDirectory: string = ROUTE_GRANTS_DIRECTORY;\r\n featuredGrants: SharedDto.FeaturedGrant.IExternalHomePageFeaturedGrantDto[];\r\n \r\n @observable() latestGrantsPage: number = 1;\r\n @observable() latestGrantsPageSize: number = 3;\r\n @observable() latestGrantsCarouselDirectionClass: \"moving-left\" | \"moving-right\" = null;\r\n\r\n constructor(private readonly grantsDirectoryService: GrantDirectoryService,\r\n private readonly dataService: DataService,\r\n private readonly router: Router,\r\n private readonly responsiveLayoutService: ResponsiveLayoutService,\r\n private readonly featuredGrantService: FeaturedGrantService,\r\n private readonly eventAggregator: EventAggregator) {\r\n }\r\n\r\n activate() {\r\n let promises = [\r\n this.grantsDirectoryService.getMostRecentGrants().then((res: Dto.IPublicContentSearchResultsDto) => {\r\n this.grants = res.results;\r\n }),\r\n this.dataService.getAgencies().then((res: Array) => {\r\n this.agencies = res;\r\n }),\r\n this.dataService.getCategoryByLevel(1).then((res: Array) => {\r\n this.categories = res;\r\n }),\r\n this.featuredGrantService.getFeaturedGrant(5, false).then((res: SharedDto.FeaturedGrant.IExternalHomePageFeaturedGrantDto[]) => {\r\n this.featuredGrants = res; \r\n }), \r\n ];\r\n\r\n return Promise.all(promises);\r\n }\r\n\r\n attached() {\r\n this.adjustPageSizeBasedOnDeviceWidth(this.responsiveLayoutService.value);\r\n this.eventAggregator.subscribe(DeviceLayoutChangedEvent, (screenSize: \"xs\" | \"sm\" | \"md\" | \"lg\") => this.adjustPageSizeBasedOnDeviceWidth(screenSize));\r\n }\r\n\r\n adjustPageSizeBasedOnDeviceWidth(screenSize: \"xs\" | \"sm\" | \"md\" | \"lg\") {\r\n switch (screenSize) {\r\n case \"xs\":\r\n this.latestGrantsPageSize = 1;\r\n break;\r\n case \"sm\":\r\n this.latestGrantsPageSize = 2;\r\n break;\r\n case \"md\":\r\n case \"lg\":\r\n this.latestGrantsPageSize = 3;\r\n break;\r\n }\r\n }\r\n\r\n doSearch() {\r\n let searchParams = {\r\n category: this.selectedCategory,\r\n agency: this.selectedAgency,\r\n term: this.searchTerm\r\n };\r\n\r\n this.router.navigateToRoute(ROUTE_GRANTS_DIRECTORY, searchParams);\r\n }\r\n\r\n generateGrantUrl(contentIdentifier: string | number): string {\r\n return generateGrantUrl(contentIdentifier);\r\n }\r\n\r\n @computedFrom(\"grants\", \"latestGrantsPage\", \"latestGrantsPageSize\")\r\n get visibleGrants() {\r\n //if we've navigated to a page that doesn't exist (or the screen size results in showing less), reset page to 1.\r\n if ((this.latestGrantsPage * this.latestGrantsPageSize) - this.latestGrantsPageSize >= this.grants.length) {\r\n this.latestGrantsPage = 1;\r\n }\r\n //find the starting index to start taking records\r\n var index = this.latestGrantsPage > 1 ? (this.latestGrantsPage * this.latestGrantsPageSize) - this.latestGrantsPageSize : 0;\r\n //take 3 records\r\n var latestGrants = [];\r\n for (let i = index; i < this.grants.length && i < index + this.latestGrantsPageSize; i++) {\r\n latestGrants.push(this.grants[i]);\r\n }\r\n return latestGrants;\r\n }\r\n\r\n latestGrantsNextPage() {\r\n if (this.grants && this.grants.length > this.latestGrantsPage * this.latestGrantsPageSize) {\r\n this.latestGrantsCarouselDirectionClass = \"moving-right\";\r\n this.latestGrantsPage = this.latestGrantsPage + 1;\r\n }\r\n }\r\n\r\n latestGrantsPreviousPage() {\r\n if (this.latestGrantsPage > 1) {\r\n this.latestGrantsCarouselDirectionClass = \"moving-left\";\r\n this.latestGrantsPage = this.latestGrantsPage - 1;\r\n }\r\n }\r\n\r\n @computedFrom(\"grants\", \"latestGrantsPage\", \"latestGrantsPageSize\")\r\n get latestGrantsNextDisabled(): boolean {\r\n //next should be disabled when page * 3 >= length\r\n if (this.grants && this.grants.length <= this.latestGrantsPage * this.latestGrantsPageSize) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n @computedFrom(\"grants\", \"latestGrantsPage\", \"latestGrantsPageSize\")\r\n get latestGrantsPreviousDisabled(): boolean {\r\n return this.latestGrantsPage < 2;\r\n }\r\n\r\n @computedFrom(\"featuredGrants\")\r\n get featureGrantActive(): boolean { \r\n return this.featuredGrants && this.featuredGrants.length > 0;\r\n }\r\n}\r\n","module.exports = \" \";"],"sourceRoot":""}