1const liteMonthlyPrice = 70; 2const liteAnnuallyPrice = 28; 3const liteParticipantsUnitRate = 1.4; 4const nLiteParticipantsIncluded = 10; 5 6const proMonthlyPrice = 100; 7const proAnnuallyPrice = 40; 8const proParticipantsUnitRate = 1.8; 9const nProParticipantsIncluded = 30; 10 11const enterpriseMonthlyPrice = 1100; 12const enterpriseAnnuallyPrice = 1100; 13let monthlySelected = true; 14let mobileTabSelected = 0; 15const USDtoAUDRate = 1.37; 16 17const faqs = [ 18 { 19 id: 0, 20 question: "What currency are the prices in?", 21 answer: "All prices are in US dollars (USD).", 22 }, 23 { 24 id: 1, 25 question: "What are the payment options?", 26 answer: 27 "We use Stripe to process our payments, which accepts all credit cards, Google Pay and Apple Pay.", 28 }, 29 { 30 id: 2, 31 question: "Can I cancel my paid subscription at any time?", 32 answer: 33 "Yes, you can. You will be downgraded to the Free plan at your next renewal date. Your subscription will remain active at its current level through the end of the billing period that youâve already paid for.", 34 }, 35 { 36 id: 3, 37 question: 38 "Can I let other members of my team host their own activities on Brightful?", 39 answer: 40 'Yes. Please email <a href="mailto:[email protected]">[email protected]</a> and we can provide more information regarding pricing and features to you.', 41 }, 42 43 { 44 id: 4, 45 question: 46 "I want to sign up for Brightful but I need to convince my manager or teammates. Can you help me?", 47 answer: 48 'Definitely! Please send us an email at <a href="mailto:[email protected]">[email protected]</a> about what kind of help you need, and weâll get you the right information.', 49 }, 50]; 51 52let selectedTenure = "annually"; 53function planPriceStringify(num) { 54 if (num % 1 != 0) return num.toFixed(2); 55 return num; 56} 57function updateAUD() { 58 if (countryCode == "AU") { 59 let litePlanAUD, proPlanAUD; 60 61 if (selectedTenure == "monthly") { 62 litePlanAUD = (liteMonthlyPrice * USDtoAUDRate).toFixed(2); 63 proPlanAUD = (proMonthlyPrice * USDtoAUDRate).toFixed(2); 64 } else { 65 litePlanAUD = (liteAnnuallyPrice * USDtoAUDRate).toFixed(2); 66 proPlanAUD = (proAnnuallyPrice * USDtoAUDRate).toFixed(2); 67 } 68 document.getElementById( 69 "basic_plan_aud" 70 ).innerHTML = `<span>($${litePlanAUD} AUD)</span>`; 71 document.getElementById( 72 "professional_plan_aud" 73 ).innerHTML = `<span>($${proPlanAUD} AUD)</span>`; 74 } 75} 76function documentIdData(documentId, data) { 77 document.getElementById(documentId).innerHTML = data; 78} 79 80function onChangeTenure(Selected) { 81 try { 82 if (Selected == "Yearly") { 83 document.getElementById("best-value").style.display = "inline"; 84 85 monthlySelected = false; 86 documentIdData("lite_billed_text", "Billed annually"); 87 documentIdData("pro_billed_text", "Billed annually"); 88 documentIdData( 89 "lite_plan_price", 90 `$${planPriceStringify(liteAnnuallyPrice)}` 91 ); 92 documentIdData( 93 "pro_plan_price", 94 `$${planPriceStringify(proAnnuallyPrice)}` 95 ); 96 documentIdData( 97 "plan_toggle_text", 98 'Switch to monthly plan <i class="material-icons"> east </i>' 99 ); 100 } else { 101 document.getElementById("best-value").style.display = "none"; 102 monthlySelected = true; 103 documentIdData("lite_billed_text", ""); 104 documentIdData("pro_billed_text", ""); 105 documentIdData( 106 "lite_plan_price", 107 `$${planPriceStringify(liteMonthlyPrice)}` 108 ); 109 documentIdData( 110 "pro_plan_price", 111 `$${planPriceStringify(proMonthlyPrice)}` 112 ); 113 documentIdData( 114 "plan_toggle_text", 115 'Switch to annual plan <i class="material-icons"> east </i>' 116 ); 117 } 118 } catch (err) { 119 console.log(err); 120 } 121} 122 123function planPriceStringify(num) { 124 if (num % 1 != 0) return num.toFixed(2); 125 return num; 126} 127function giveData() { 128 let litePlanPrice; 129 let proPlanPrice; 130 let enterprisePlanPrice; 131 132 switch (selectedTenure) { 133 case "monthly": 134 litePlanPrice = liteMonthlyPrice; 135 proPlanPrice = proMonthlyPrice; 136 enterprisePlanPrice = enterpriseMonthlyPrice; 137 updateAUD(); 138 break; 139 case "annually": 140 litePlanPrice = liteAnnuallyPrice; 141 proPlanPrice = proAnnuallyPrice; 142 enterprisePlanPrice = enterpriseAnnuallyPrice; 143 updateAUD(); 144 break; 145 } 146 147 document.getElementById("lite_plan_price").innerHTML = `$${planPriceStringify( 148 litePlanPrice 149 )}`; 150 document.getElementById("pro_plan_price").innerHTML = `$${planPriceStringify( 151 proPlanPrice 152 )}`; 153 document.getElementById( 154 "enterprise_plan_price" 155 ).innerHTML = `$${planPriceStringify(enterprisePlanPrice)}`; 156 document.getElementById("lite_subtitle").innerHTML = 157 selectedTenure == "monthly" ? `/mo` : `/yr`; 158 document.getElementById("pro_subtitle").innerHTML = 159 selectedTenure == "monthly" ? `/mo` : `/yr`; 160 document.getElementById("enterprise_subtitle").innerHTML = 161 selectedTenure == "monthly" 162 ? `USD per month` 163 : `USD per month, billed annually`; 164} 165 166// Start :: mobile switch tab for plan 167function mobielSwitchTabPlan(name) { 168 if (name == "lite") { 169 mobileTabSelected = 0; 170 $("#lite").addClass("active"); 171 $("#pro").removeClass("active"); 172 $("#event").removeClass("active"); 173 $("#switch_plan_toggle").removeClass("invisible"); 174 $(".pricing-box-v3.lite").addClass("active"); 175 $(".pricing-box-v3.pro").removeClass("active"); 176 $(".one-off-event-box").removeClass("active"); 177 $(".tab-head").removeClass("disabled"); 178 } else if (name == "pro") { 179 // == PRO 180 mobileTabSelected = 1; 181 $("#lite").removeClass("active"); 182 $("#pro").addClass("active"); 183 $("#event").removeClass("active"); 184 $("#switch_plan_toggle").removeClass("invisible"); 185 $(".pricing-box-v3.lite").removeClass("active"); 186 $(".pricing-box-v3.pro").addClass("active"); 187 $(".one-off-event-box").removeClass("active"); 188 $(".tab-head").removeClass("disabled"); 189 } else if (name == "event") { 190 // == ENTERPRISE 191 mobileTabSelected = 2; 192 $("#lite").removeClass("active"); 193 $("#pro").removeClass("active"); 194 $("#event").addClass("active"); 195 $("#switch_plan_toggle").addClass("invisible"); 196 $(".pricing-box-v3.lite").removeClass("active"); 197 $(".pricing-box-v3.pro").removeClass("active"); 198 $(".one-off-event-box").addClass("active"); 199 $(".tab-head").addClass("disabled"); 200 } 201} 202// END :: mobile switch tab for plan 203 204function loadFaq() { 205 let ul = "<ul>"; 206 for (let i = 0; i < faqs.length; i++) { 207 ul += `<li> 208 <h4>${faqs[i].question}</h4> 209 <p>${faqs[i].answer}</p> 210 </li>`; 211 } 212 ul += "</ul>"; 213 document.getElementById("faq").innerHTML = ul; 214} 215 216function redirectToPricing(source) { 217 if (isPlayground) 218 return (location.href = `https://dev.orric.app/pricing/?source=${source}`); 219 else if (isDev) 220 return (location.href = `https://dev.orric.app/pricing/?source=${source}`); 221 else 222 return (location.href = `https://app.brightful.me/pricing/?source=${source}`); 223} 224 225function onSelectedAction(action) { 226 if (isPlayground) 227 return (location.href = `https://localhost:5000/?selected=${action}`); 228 else if (isDev) 229 return (location.href = `https://dev.orric.app/dashboard/?selected=${action}`); 230 else 231 return (location.href = `https://app.brightful.me/dashboard/?selected=${action}`); 232} 233function pricingInputValue(inputValue) { 234 document.getElementById("pricing_calculator_lite_price").innerHTML = 235 inputValue <= nLiteParticipantsIncluded 236 ? "$0" 237 : `$${ 238 Math.round( 239 liteParticipantsUnitRate * 240 (inputValue - nLiteParticipantsIncluded) * 241 100 242 ) / 100 243 }`; 244 document.getElementById("pricing_calculator_pro_price").innerHTML = 245 inputValue <= nProParticipantsIncluded 246 ? "$0" 247 : `$ ${ 248 Math.round( 249 proParticipantsUnitRate * 250 (inputValue - nProParticipantsIncluded) * 251 100 252 ) / 100 253 }`; 254} 255function onInputChange() { 256 console.log("Changing range value"); 257 // let rangeValue = document.getElementById("pricing_calculator_range").value; 258 // let inputValue = document.getElementById("pricing_calculator_range").value; 259 260 document.getElementById("pricing_calculator_range").value = 261 document.getElementById("pricing_calculator_input").value; 262 let inputValue = document.getElementById("pricing_calculator_input").value; 263 pricingInputValue(inputValue); 264} 265 266function onRangeChange() { 267 console.log("Changing input value"); 268 269 document.getElementById("pricing_calculator_input").value = 270 document.getElementById("pricing_calculator_range").value; 271 let inputValue = document.getElementById("pricing_calculator_input").value; 272 pricingInputValue(inputValue); 273} 274
275const joinGameModalFormSubmit = (event) => { 276 event.preventDefault(); 277 const data = formToJSON(join_game_modal_form.elements); 278 const hypenDigitGameRoomId = data["gameRoomId"]; 279 let targetUrl; 280 identifyAmplitude("setOnce", "firstExperience", "Participant"); 281 if (isPlayground) 282 targetUrl = "http://localhost:54576/room/" + hypenDigitGameRoomId; 283 else if (isDev) 284 targetUrl = "https://dev.orric.app/room/" + hypenDigitGameRoomId; 285 else targetUrl = "https://app.brightful.me/room/" + hypenDigitGameRoomId; 286 return (location.href = targetUrl); 287}; 288 289function filteredValue(value) { 290 let result = value.replace("-", ""); 291 if (result.length >= 4) { 292 return result.substring(0, 4) + "-" + result.substring(4, result.length); 293 } 294 return result; 295} 296function setIDFilter(id) { 297 let gameRoomId = $(`#${id} #gameRoomId`); 298 gameRoomId.keydown(function (e) { 299 // ctrl-a/c/v 300 if ( 301 (e.which == 65 || e.which == 67 || e.which == 86) && 302 (e.ctrlKey == true || e.metaKey == true) 303 ) { 304 return true; 305 } 306 307 // no value 308 if (gameRoomId.val().length === 0) { 309 if ( 310 (e.which >= 65 && e.which <= 90) || 311 (e.which >= 48 && e.which <= 57) || 312 (e.which >= 96 && e.which <= 105) 313 ) { 314 return true; 315 } else { 316 return false; 317 } 318 } 319 320 // number room id 321 if (gameRoomId.val()[0] >= "0" && gameRoomId.val()[0] <= "9") { 322 if (
323 e.which != 13 && 324 e.which != 8 && 325 e.which != 0 && 326 e.which != 46 && 327 (e.which < 37 || e.which > 40) && 328 !(e.which >= 48 && e.which <= 57) && 329 !(e.which >= 96 && e.which <= 105) 330 ) { 331 return false; 332 } 333 if ( 334 ((e.which >= 48 && e.which <= 57) || 335 (e.which >= 96 && e.which <= 105)) && 336 gameRoomId.val().length >= 9 337 ) { 338 return false; 339 } 340 if ((e.which === 8 || e.which === 46) && gameRoomId.val().length === 5) { 341 const selectionStart = e.target.selectionStart; 342 gameRoomId.val(gameRoomId.val().substring(0, 4)); 343 setSelectionPos(gameRoomId[0], selectionStart); 344 } 345 if (e.which === 13) { 346 return gameRoomId.val().length === 9; 347 } 348 } else { 349 // custom game room id 350 if ( 351 e.which != 13 && 352 e.which != 8 && 353 e.which != 0 && 354 e.which != 46 && 355 (e.which < 37 || e.which > 40) && 356 !(e.which >= 48 && e.which <= 57) && 357 !(e.which >= 96 && e.which <= 105) && 358 !(e.which >= 65 && e.which <= 90) 359 ) { 360 return false; 361 } 362 if ( 363 ((e.which >= 48 && e.which <= 57) || 364 (e.which >= 96 && e.which <= 105) || 365 (e.which >= 65 && e.which <= 90)) && 366 gameRoomId.val().length >= 20 367 ) { 368 return false; 369 } 370 if (e.which === 13) { 371 return gameRoomId.val().length <= 20 && gameRoomId.val().length >= 3; 372 } 373 } 374 }); 375 gameRoomId.keyup(function (e) { 376 // number room id 377 if (gameRoomId.val()[0] >= "0" && gameRoomId.val()[0] <= "9") { 378 const selectionStartToEnd = 379 gameRoomId.val().length - e.target.selectionStart; 380 gameRoomId.val(filteredValue(gameRoomId.val())); 381 setSelectionPos( 382 gameRoomId[0], 383 gameRoomId.val().length - selectionStartToEnd 384 ); 385 } 386 }); 387} 388const join_game_modal_form = document.getElementById("join-game-modal-form"); 389join_game_modal_form.addEventListener("submit", joinGameModalFormSubmit); 390$("#joinAGameModal").on("shown.bs.modal", function (e) { 391 setIDFilter("joinAGameModal"); 392}); 393 394$(function () { 395 setIDFilter("join-a-game"); 396});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.