PageSourceSearch

https://www.mindko.com/static/js/support/support-flow-config.js

js mindko.com collected 2026-10-01 14:15:38 UTC 14,578 bytes, 410 lines download raw bytes

1// Define help articles globally
2window.HELP_ARTICLES = {
3  'account-help': [
4    {
5      title: 'I forgot my Mindko password',
6      description: 'If you’ve forgotten your Mindko account password, don\'t worry! You can easily recover your account by following the steps below.',
7      url: 'https://help.mindko.com/article/10-i-forgot-my-college-tools-account-login',
8      icon: 'far fa-key'
9    },
10    {
11      title: 'How do I set a password if I registered using Google?',
12      description: 'Learn how to set a password for your Mindko account if you registered using Google.',
13      url: 'https://help.mindko.com/article/11-how-do-i-set-a-password-if-i-registered-using-google',
14      icon: 'fa-brands fa-google'
15    },
16    {
17      title: 'Managing multiple devices',
18      description: 'When you sign in on a new device, you\'ll be automatically signed out of any other devices where you were previously logged in',
19      url: 'https://help.mindko.com/article/13-managing-multiple-devices',
20      icon: 'far fa-laptop'
21    }
22  ],
23  'billing-questions': [
24    {
25      title: 'How can I pay for Mindko?',
26      description: 'Mindko accepts the following payment methods:',
27      url: 'https://help.mindko.com/article/34-how-can-i-pay-for-college-tools',
28      icon: 'far fa-credit-card'
29    },
30    {
31      title: 'How do I pause my Mindko subscription?',
32      description: 'Mindko allows you to pause your subscription for up to 6 months, maintaining your account without being charged. To pause your subscription, follow these steps:',
33      url: 'https://help.mindko.com/article/23-how-do-i-pause-my-college-tools-subscription',
34      icon: 'far fa-clock'
35    },
36    {
37      title: 'Does Mindko offer a free trial?',
38      description: 'Yes, we offer a 3-day trial specifically designed for students to explore our product and determine whether it meets their requirements.',
39      url: 'https://help.mindko.com/article/29-does-college-tools-offer-a-trial',
40      icon: 'far fa-money-bill-wave'
41    },
42    {
43      title: 'How can I make payment changes with PayPal?',
44      description: 'As PayPal has additional restrictions on their end, it usually makes it harder for us to directly make changes you may want to your plan',
45      url: 'https://help.mindko.com/article/113-how-can-i-make-payment-changes-with-paypals',
46      icon: 'fab fa-paypal'
47    },
48    {
49      title: 'How can I stop paying during my semester abroad?',
50      description: 'Mindko allows you to pause your subscription for up to 6 months, maintaining your account without being charged. To pause your subscription, follow these steps:',
51      url: 'https://help.mindko.com/article/35-how-can-i-stop-paying-during-my-semester-abroad',
52      icon: 'far fa-plane'
53    }
54  ],
55  'privacy-security': [
56      {
57        "title": "Will my school know I'm using Mindko?",
58        "description": "We don't share any usage data with educational institutions. Your identity and activities remain private and anonymous.",
59        "url": "https://help.mindko.com/article/65-will-my-school-know-im-using-college-tools",
60        "icon": "far fa-user-secret"
61      },
62      {
63        "title": "Is Mindko safe?",
64        "description": "Maintaining customer trust is crucial for our mission, and we prioritize security and our users' privacy.",
65        "url": "https://help.mindko.com/article/77-is-college-tools-safe",
66        "icon": "far fa-lock"
67      },
68      {
69        "title": "Does Mindko sell my data?",
70        "description": "No. We have not, do not, and will not sell user data—period.",
71        "url": "https://help.mindko.com/article/66-does-college-tools-sell-my-data",
72        "icon": "far fa-user-shield"
73      },
74      {
75        "title": "How does Mindko Protect my academic data?",
76        "description": "Your academic work is encrypted end-to-end and never stored. We process data in real-time and immediately discard it.",
77        "url": "https://help.mindko.com/article/121-how-does-college-tools-protect-my-academic-data",
78        "icon": "far fa-shield-check"
79      }
80      
81  ],
82  'ask-about-college-tools': [
83    {
84      title: 'Everything about the extension',
85      description: 'Learn about all the extension features and how to use them.',
86      url: 'https://www.mindko.com/browser/chrome-extension',
87      icon: 'far fa-puzzle-piece'
88    },
89    {
90      title: 'Does Mindko support languages other than English?',
91      description: 'Yes, we support over 15+ languages in order to make it accessible for any user around the world.',
92      url: 'https://help.mindko.com/article/76-does-college-tools-support-languages-other-than-english',
93      icon: 'far fa-language'
94    },
95    {
96      title: 'Browser compatibility',
97      description: 'Supported browsers and operating systems for optimal performance.',
98      url: 'https://help.mindko.com/article/64-browser-compatibility',
99      icon: 'far fa-browser'
100    },
101    {
102      title: 'How to change the Screenshot shortcut',
103      description: 'The screenshot feature is a popular and powerful feature allowing Mindko to work with complex math and image-based questions.',
104      url: 'https://help.mindko.com/article/84-how-to-change-the-screenshot-shortcut',
105      icon: 'far fa-keyboard'
106    }
107  ]
108};
109
110// Flow configuration and navigation logic
111const FLOW_PAGES = {
112 'cancel-features': {
113   next: 'cancel-feedback',
114   back: null, // First page
115   continueText: null,
116   title: 'Contact us',
117   currentId: 'contact-options'
118 },
119 'cancel-feedback': {
120   next: (state) => {
121     if (state.selectedReason === 'technical-issues') return 'cancel-platforms';
122     if (state.selectedReason === 'feature-request') return 'cancel-feature-request';
123     if (state.selectedReason === 'accuracy-of-answers') return 'cancel-supercharge';
124     if (['account-help', 'billing-questions', 'privacy-security', 'ask-about-college-tools'].includes(state.selectedReason)) {
125       return 'cancel-confirm-plus';
126     }
127     return 'cancel-confirm';
128   },
129   back: null,
130   continueText: null,
131   title: 'What do you need help with?',
132   currentId: 'cancel-feedback'
133 },
134 'cancel-supercharge': {
135   next: 'cancel-confirm',
136   back: 'cancel-feedback',
137   continueText: 'Continue',
138   title: 'Have you tried our new supercharged mode?',
139   currentId: 'winback-supercharge'
140 },
141 'cancel-platforms': {
142   next: 'cancel-features-feedback',
143   back: 'cancel-feedback',
144   continueText: 'Continue',
145   title: 'Which learning platform do you use?',
146   currentId: 'platform-choice'
147 },
148 'cancel-features-feedback': {
149   next: 'cancel-additional',
150   back: 'cancel-platforms',
151   continueText: 'Continue',
152   title: 'Which feature didn\'t work?',
153   currentId: 'cancel-integrations-selection'
154 },
155 'cancel-additional': {
156   next: 'cancel-confirm',
157   back: 'cancel-features-feedback',
158   continueText: 'Continue',
159   title: 'Help us improve',
160   currentId: 'additional-feedback'
161 },
162 'cancel-confirm': {
163   next: null,
164   back: 'cancel-feedback',
165   continueText: null,
166   title: 'How can we help?',
167   currentId: 'support-form'
168 },
169 'cancel-feature-request': {
170   next: null,
171   back: 'cancel-feedback',
172   continueText: null,
173   title: 'Help shape our next features',
174   currentId: 'winback-feature-request'
175 },
176 'cancel-confirm-plus': {
177   next: null,
178   back: 'cancel-feedback',
179   continueText: null,
180   title: 'How can we help?',
181   currentId: 'support-form-plus'
182 }
183};
184
185// Track current page and states
186let currentPage = 'cancel-features';
187let selectedReason = null;
188
189// Navigation handlers
190function handleContinue() {
191  continueCancellationTrack();
192  const nextPage = FLOW_PAGES[currentPage].next;
193  if (nextPage) {
194    const nextPageId = typeof nextPage === 'function' ? 
195      nextPage({ selectedReason }) : nextPage;
196    
197    if (nextPageId) {
198      navigateToPage(nextPageId);
199    }
200  } else {
201    console.log('No next page found');
202  }
203}
204
205function handleBack() {
206  backCancellationTrack();
207  const prevPage = FLOW_PAGES[currentPage].back;
208  if (prevPage) {
209    navigateToPage(prevPage);
210    
211    if (prevPage === 'cancel-features-feedback') {
212      additionalFeedback.issues.clear();
213    }
214  } else {
215    window.history.back();
216  }
217}
218
219function navigateToPage(pageId) {
220 // Safety check for page existence
221 const targetPage = document.getElementById(pageId);
222 if (!targetPage) {
223   console.error(`Page ${pageId} not found`);
224   return;
225 }
226
227 // Hide all pages
228 Object.keys(FLOW_PAGES).forEach(page => {
229   const pageElement = document.getElementById(page);
230   if (pageElement) {
231     pageElement.style.display = 'none';
232   }
233 });
234
235 // Show target page
236 targetPage.style.display = 'block';
237 
238 // Update UI elements if they exist
239 const continueBtn = document.querySelector('.cancel-flow-continue');
240 const pauseBtn = document.querySelector('.cancel-flow-pause');
241 const stayBtn = document.querySelector('.cancel-flow-stay');
242 const backBtn = document.querySelector('.back-button');
243 const titleElement = document.querySelector('.cancel-flow-title');
244
245 if (continueBtn) {
246   continueBtn.textContent = FLOW_PAGES[pageId].continueText;
247   
248   // Handle continue button state
249   if (pageId === 'cancel-feedback') {
250     // Always disable initially or if no reason selected
251     continueBtn.classList.add('disabled');
252     continueBtn.style.pointerEvents = 'none';
253     
254     // Only enable if a reason was previously selected
255     if (selectedReason) {
256       continueBtn.classList.remove('disabled');
257       continueBtn.style.pointerEvents = 'auto';
258     }
259   } else if (pageId === 'cancel-platforms') {
260     // Always disable initially or if no platforms selected
261     continueBtn.classList.add('disabled');
262     continueBtn.style.pointerEvents = 'none';
263     
264     // Only enable if platforms were previously selected
265     if (selectedPlatforms.size > 0) {
266       continueBtn.classList.remove('disabled');
267       continueBtn.style.pointerEvents = 'auto';
268     }
269   } else {
270     continueBtn.classList.remove('disabled');
271     continueBtn.style.pointerEvents = 'auto';
272   }
273 }
274 
275 if (titleElement) {
276   titleElement.textContent = FLOW_PAGES[pageId].title;
277 }
278 
279 if (pauseBtn) {
280   pauseBtn.style.display = pageId === 'cancel-reason' ? 'flex' : 'none';
281 }
282 
283 if (stayBtn) {
284   stayBtn.style.display = (pageId === 'cancel-feedback' || 
285                           pageId === 'cancel-platforms' || 
286                           pageId === 'cancel-features-feedback' ||
287                           pageId === 'cancel-additional' ||
288                           pageId === 'cancel-feature-request' ||
289                           pageId === 'cancel-referral') ? 'flex' : 'none';
290 }
291 
292 if (backBtn) {
293   backBtn.style.visibility = FLOW_PAGES[pageId].back ? 'visible' : 'hidden';
294 }
295 
296 // Update navigation buttons based on the page
297 const navigation = document.getElementById('flow-navigation-real');
298 
299 if (navigation) {
300   // Special navigation for supercharge and shortcut pages
301   if (pageId === 'cancel-supercharge' || pageId === 'cancel-shortcut') {
302     navigation.innerHTML = `
303       <a href="javascript:void(0)" class="back-button" onclick="handleBack()">
304         <i class="fas fa-chevron-left"></i>
305         <span>Back</span>
306       </a>
307       <a href="javascript:void(0)" class="try-supercharge" onclick="handleTryFeature('${pageId}')">
308         Try it now
309         <i class="fas fa-external-link-alt"></i>
310       </a>
311       <a href="javascript:void(0)" class="cancel-flow-continue" onclick="handleContinue()">Continue</a>
312     `;
313   } else {
314     // Default navigation with conditional buttons
315     navigation.innerHTML = `
316       <a href="javascript:void(0)" class="back-button" onclick="handleBack()">
317         <i class="fas fa-chevron-left"></i>
318         <span>Back</span>
319       </a>
320       ${pageId === 'cancel-reason' ? 
321         '<a href="javascript:void(0)" class="cancel-flow-pause disabled" onclick="handlePause()">Pause</a>' 
322         : ''}
323       <a href="javascript:void(0)" class="cancel-flow-continue" ${FLOW_PAGES[pageId].continueText ? '' : 'style="display: none"'} onclick="handleContinue()">${FLOW_PAGES[pageId].continueText}</a>
324     `;
325   }
326
327   // Update button states after navigation is rebuilt
328   const continueBtn = navigation.querySelector('.cancel-flow-continue');
329   if (continueBtn) {
330     if (pageId === 'cancel-feedback' && !selectedReason) {
331       continueBtn.classList.add('disabled');
332       continueBtn.style.pointerEvents = 'none';
333     } else if (pageId === 'cancel-platforms' && selectedPlatforms.size === 0) {
334       continueBtn.classList.add('disabled');
335       continueBtn.style.pointerEvents = 'none';
336     }
337   }
338
339   // Update back button visibility
340   const backBtn = navigation.querySelector('.back-button');
341   if (backBtn) {
342     backBtn.style.visibility = FLOW_PAGES[pageId].back ? 'visible' : 'hidden';
343   }
344 }
345
346 // Update current page tracker
347 currentPage = pageId;
348 
349 // Generate feature sections when navigating to features feedback page
350 if (pageId === 'cancel-features-feedback') {
351   generateFeatureSections();
352   checkIncompatiblePlatforms();
353 }
354 
355 if (pageId === 'cancel-confirm') {
356   // Disable continue button until passwords match
357   if (continueBtn) {
358     continueBtn.classList.add('disabled');
359     continueBtn.style.pointerEvents = 'none';
360   }
361   
362   // Add password input listeners
363   const passwordInputs = document.querySelectorAll('.password-input-group input');
364   passwordInputs.forEach(input => {
365     input.addEventListener('input', validatePasswords);
366   });
367 }
368
369 if (pageId === 'cancel-additional') {
370   generateAdditionalFeedback();
371 }
372}
373
374
375function handleStay() {
376  stayCancellationTrack();
377  //change url to /dashboard
378  window.location.href = '/dashboard';
379}
380
381
382
383// Initialize flow
384document.addEventListener('DOMContentLoaded', () => {
385
386  navigateToPage('cancel-feedback');
387}); 
388
389// Update the existing handleReasonSelect function
390function handleReasonSelect(reason) {
391  window.selectedReason = reason; // Make it globally accessible
392  
393  // Update button states
394  const buttons = document.querySelectorAll('.reason-button');
395  buttons.forEach(button => {
396    button.classList.toggle('selected', button.dataset.reason === reason);
397  });
398
399  // Enable continue button
400  const continueBtn = document.querySelector('.cancel-flow-continue');
401  if (continueBtn) {
402    continueBtn.classList.remove('disabled');
403    continueBtn.style.pointerEvents = 'auto';
404  }
405
406  // If it's one of the help article categories, preload the articles
407  if (['account-help', 'billing-questions', 'privacy-security', 'ask-about-college-tools'].includes(reason)) {
408    loadHelpArticles(reason);
409  }
410} 

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.