Publicador de Conteúdos e Mídias

Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing:
==> themeDisplay.getURLCurrent()?split("/")[2]  [in template "20102#20129#23798944" at line 348, column 41]

----
Tip: It's the final [] step that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign friendlyURLTipoCurso = themeD...  [in template "20102#20129#23798944" in function "getTipoCursoFirendlyUrl" at line 348, column 9]
----
1<#-- 
2Name: Unidade - Tipos de Curso 
3Type: Asset Publisher Widget Template 
4Path: ROOT/assets/unidades-tipos-de-curso/widget-templates/unidades_tipos_de_curso.html 
5--> 
6<#assign prefix = "ssp" /> 
7<#assign companyId = themeDisplay.getCompanyId() /> 
8<#assign siteGroupId = themeDisplay.getSiteGroupId() /> 
9<#assign friendlyUrlTipoCurso = getTipoCursoFirendlyUrl() /> 
10<#assign friendlyUrlUnidade = getUnidadeFirendlyUrl() /> 
11 
12<#assign categoryId = 0 /> 
13 
14<#if friendlyUrlTipoCurso?contains("livre") ||  friendlyUrlTipoCurso?contains("extensao")> 
15    <#assign friendlyUrlTemaFirst = getTemaFirstLevelFriendly() /> 
16    <#assign friendlyUrlTemaSecond = getTemaSecondLevelFriendly() /> 
17    <#assign friendlyUrlTemaThird = getTemaThirdLevelFriendly() /> 
18     
19    <#if friendlyUrlTipoCurso?contains("livre") >  
20        <#assign tipoCurso = "Livre" /> 
21    <#else> 
22        <#assign tipoCurso = "Extensão" /> 
23    </#if>   
24<#-- cursos tecnicos nao tem 2o e 3o nivel de temas conforme prototipo GCR --> 
25<#elseif  friendlyUrlTipoCurso?contains("tecnico")> 
26    <#assign tipoCurso = "Técnico" /> 
27    <#assign friendlyUrlTemaFirst = getTemaFirstLevelFriendly() /> 
28    <#assign friendlyUrlTemaSecond = "#erro#" /> 
29    <#assign friendlyUrlTemaThird = "#erro#" /> 
30 
31<#else>  
32</#if> 
33 
34<#assign groupService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService") /> 
35<#assign groupObj = groupService.fetchFriendlyURLGroup(companyId, "/"+friendlyUrlUnidade) /> 
36<#assign groupIdUnidade = groupObj.getGroupId() /> 
37 
38        <#assign journal = getJournalArticle(groupIdUnidade) > 
39        <#if !journal?contains("#erro#")> 
40             <#assign groupIdUnidade = groupId /> 
41             <#assign journalArticleUnidade = journal> 
42            <#assign document = saxReaderUtil.read(journalArticleUnidade.getContent()) /> 
43            <#assign rootElement = document.getRootElement() /> 
44             
45                <#-- Get fields --> 
46 
47                     <#--  Nome da unidade  --> 
48                    <#assign xPathSelector_nomeUnidadeParaBreadCrumb = saxReaderUtil.createXPath("dynamic-element[@field-reference='nomeUnidade']")> 
49                    <#assign nomeUnidadeParaBreadCrumb = xPathSelector_nomeUnidadeParaBreadCrumb.selectSingleNode(rootElement).getStringValue()> 
50 
51                    <#--  Nome da unidade  --> 
52                    <#assign xPathSelector_nome = saxReaderUtil.createXPath("dynamic-element[@field-reference='nomeUsualUnidade']")> 
53                    <#assign nomeUnidade = xPathSelector_nome.selectSingleNode(rootElement).getStringValue()> 
54 
55                    <#assign xPathSelector_codigoUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='codigoUnidade']")> 
56                    <#assign codigoUnidade = xPathSelector_codigoUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
57                     
58                        <#if nomeUnidade?? > 
59                            <#assign nome = nomeUnidade > 
60                            <#else> 
61                            <#assign nome = "" > 
62                        </#if> 
63 
64                <#--  Endereço 1  --> 
65 
66                        <#--  Rua  --> 
67                        <#assign xPathSelector_enderecoUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='enderecoUnidade']")> 
68                        <#assign enderecoUnidade = xPathSelector_enderecoUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
69 
70                            <#if enderecoUnidade?? > 
71                                <#assign endereco = enderecoUnidade > 
72                                <#else> 
73                                <#assign endereco = "" > 
74                            </#if> 
75 
76                        <#--  número  --> 
77                        <#assign xPathSelector_numEnderecoUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='numEnderecoUnidade']")> 
78                        <#assign numeroUnidade = xPathSelector_numEnderecoUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
79 
80                            <#if numeroUnidade?? > 
81                                <#assign numero = numeroUnidade > 
82                                <#else> 
83                                <#assign numero = "" > 
84                            </#if> 
85 
86                        <#--  Bairro  --> 
87                        <#assign xPathSelector_bairroUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='bairroUnidade']")> 
88                        <#assign bairroUnidade = xPathSelector_bairroUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
89 
90                            <#if bairroUnidade?? > 
91                                <#assign bairro = bairroUnidade > 
92                                <#else> 
93                                <#assign bairro = "" > 
94                            </#if> 
95                         
96                        <#--  Cidade  --> 
97                        <#assign xPathSelector_cidadeUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='cidadeUnidade']")> 
98                        <#assign cidadeUnidade = xPathSelector_cidadeUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
99 
100                            <#if cidadeUnidade?? > 
101                                <#assign cidade = cidadeUnidade > 
102                                <#else> 
103                                <#assign cidade = "" > 
104                            </#if> 
105 
106                        <#--  Cep  --> 
107                        <#assign xPathSelector_cepUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='cepUnidade']")> 
108                        <#assign cepUnidade = xPathSelector_cepUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
109 
110                            <#if cepUnidade?? > 
111                                <#assign cep = cepUnidade > 
112                                <#else> 
113                                <#assign cep = "" > 
114                            </#if>  
115 
116            <#-- Fim endereço 1 -->   
117 
118            <#--  Endereço 2  --> 
119 
120                        <#--  Rua  --> 
121                        <#assign xPathSelector_enderecoUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='enderecoUnidade2']")> 
122                        <#assign enderecoUnidade2 = xPathSelector_enderecoUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
123 
124                            <#if enderecoUnidade2?? > 
125                                <#assign endereco2 = enderecoUnidade2 > 
126                                <#else> 
127                                <#assign endereco2 = "" > 
128                            </#if> 
129 
130                        <#--  número  --> 
131                        <#assign xPathSelector_numeroUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='numeroUnidade2']")> 
132                        <#assign numeroUnidade2 = xPathSelector_numeroUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
133 
134                            <#if numeroUnidade2?? > 
135                                <#assign numero2 = numeroUnidade2 > 
136                                <#else> 
137                                <#assign numero2 = "" > 
138                            </#if> 
139 
140                        <#--  Bairro  --> 
141                        <#assign xPathSelector_bairroUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='bairroUnidade2']")> 
142                        <#assign bairroUnidade2 = xPathSelector_bairroUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
143 
144                            <#if bairroUnidade2?? > 
145                                <#assign bairro2 = bairroUnidade2 > 
146                                <#else> 
147                                <#assign bairro2 = "" > 
148                            </#if> 
149                         
150                        <#--  Cidade  --> 
151                        <#assign xPathSelector_cidadeUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='cidadeUnidade2']")> 
152                        <#assign cidadeUnidade2 = xPathSelector_cidadeUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
153 
154                            <#if cidadeUnidade2?? > 
155                                <#assign cidade2 = cidadeUnidade2 > 
156                                <#else> 
157                                <#assign cidade2 = "" > 
158                            </#if> 
159 
160                        <#--  Cep  --> 
161                        <#assign xPathSelector_cepUnidade2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='cepUnidade2']")> 
162                        <#assign cepUnidade2 = xPathSelector_cepUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
163 
164                            <#if cepUnidade2?? > 
165                                <#assign cep2 = cepUnidade2 > 
166                                <#else> 
167                                <#assign cep2 = "" > 
168                            </#if>  
169 
170            <#-- Fim endereço 2 --> 
171 
172 
173 
174                        <#--  Horário  --> 
175                        <#assign xPathSelector_horarioUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='horarioUnidade']")> 
176                        <#assign horarioUnidade = xPathSelector_horarioUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
177 
178                            <#if horarioUnidade?? > 
179                                <#assign horario = horarioUnidade > 
180                                <#else> 
181                                <#assign horario = "" > 
182                            </#if> 
183 
184                        <#--  DDD  --> 
185                        <#assign xPathSelector_dddUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='dddTelefoneUnidade']")> 
186                        <#assign dddUnidade = xPathSelector_dddUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
187 
188                            <#if dddUnidade?? > 
189                                <#assign ddd = dddUnidade > 
190                                <#else> 
191                                <#assign ddd = "" > 
192                            </#if> 
193 
194                        <#--  telefone  --> 
195                        <#assign xPathSelector_telefoneUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='telefoneUnidade']")> 
196                        <#assign telefoneUnidade = xPathSelector_telefoneUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
197 
198                            <#if telefoneUnidade?? > 
199                                <#assign telefone = telefoneUnidade > 
200                                <#else> 
201                                <#assign telefone = "" > 
202                            </#if>                         
203 
204                        <#--  UF  --> 
205                        <#assign xPathSelector_ufUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='ufUnidade']")> 
206                        <#assign ufUnidade = xPathSelector_ufUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
207 
208                            <#if ufUnidade?? > 
209                                <#assign UF = ufUnidade > 
210                                <#else> 
211                                <#assign UF = "" > 
212                            </#if> 
213 
214                        <#-- Estacionamento --> 
215                        <#assign xPathSelector_estacionamento = saxReaderUtil.createXPath("dynamic-element[@field-reference='estacionamentoUnidade']")> 
216                        <#assign estacionamentoUnidade = xPathSelector_estacionamento.selectSingleNode(rootElement).getStringValue()>  
217 
218                            <#if estacionamentoUnidade?? > 
219                                <#assign estacionamento = estacionamentoUnidade > 
220                                <#else> 
221                                <#assign estacionamento = "" > 
222                            </#if> 
223 
224                         <#-- Estacionamento Unidade 2 --> 
225                        <#assign xPathSelector_estacionamento2 = saxReaderUtil.createXPath("dynamic-element[@field-reference='estacionamentoUnidade2']")> 
226                        <#assign estacionamentoUnidade2 = xPathSelector_estacionamento2.selectSingleNode(rootElement).getStringValue()>  
227 
228                            <#if estacionamentoUnidade2?? > 
229                                <#assign estacionamento2 = estacionamentoUnidade2 > 
230                                <#else> 
231                                <#assign estacionamento2 = "" > 
232                            </#if>          
233 
234                        <#--  Facebook  --> 
235                        <#assign xPathSelector_facebookUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='facebookUnidade']")> 
236                        <#assign facebookUnidade = xPathSelector_facebookUnidade.selectSingleNode(rootElement).getStringValue()> 
237 
238                            <#if facebookUnidade?? > 
239                                <#assign facebook = facebookUnidade > 
240                                <#else> 
241                                <#assign facebook = "" > 
242                            </#if> 
243 
244                        <#--  Instagram  --> 
245                        <#assign xPathSelector_instagramUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='instagramUnidade']")> 
246                        <#assign instagramUnidade = xPathSelector_instagramUnidade.selectSingleNode(rootElement).getStringValue()> 
247 
248                            <#if instagramUnidade?? > 
249                                <#assign instagram = instagramUnidade > 
250                                <#else> 
251                                <#assign instagram = "" > 
252                            </#if> 
253 
254                        <#--  Maps  --> 
255                        <#assign xPathSelector_googlemapsUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='googlemapsUnidade']")> 
256                        <#assign googlemapsUnidade = xPathSelector_googlemapsUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
257 
258                            <#if googlemapsUnidade?? > 
259                                <#assign googlemaps = googlemapsUnidade > 
260                                <#else> 
261                                <#assign googlemaps = "" > 
262                            </#if> 
263 
264                        <#assign  hasMaps = (googlemaps?trim?length > 0) > 
265 
266                         
267 
268                        <#--  Waze  --> 
269                        <#assign xPathSelector_wazeUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='wazeUnidade']")> 
270                        <#assign wazeUnidade = xPathSelector_wazeUnidade.selectSingleNode(rootElement).getStringValue()> 
271 
272                            <#if wazeUnidade?? > 
273                                <#assign waze = wazeUnidade > 
274                                <#else> 
275                                <#assign waze = "" > 
276                            </#if> 
277                                 
278                    <#--  Imagem  --> 
279 
280                    <#assign imagem = getImagemURL('imagemUnidade')> 
281                    <#assign imagem2 = getImagemURL('imagemUnidade2')>   
282                     
283                    <#--  Estação próxima  -->                     
284					<#assign xPathSelector_estacaoProxima = saxReaderUtil.createXPath("dynamic-element[@field-reference='estacaoProxima']")> 
285		 
286					<#assign estacaoProxima = xPathSelector_estacaoProxima.selectSingleNode(rootElement).getStringValue()> 
287		 
288					<#assign  hasEstacaoProxima = (estacaoProxima?trim?length > 0) > 
289                     
290            </#if> 
291 
292    <#function getImagemURL fieldName> 
293 
294        <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@field-reference='${fieldName}']")> 
295     
296        <#assign imagemStr = xPathSelector.selectSingleNode(rootElement).getStringValue()> 
297     
298        <#if imagemStr?contains("classPK") > 
299            <#assign 
300                imagemJson = jsonFactoryUtil.createJSONObject(imagemStr) 
301                imagemId = getterUtil.getInteger(imagemJson.get('fileEntryId')) 
302                dl = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService") 
303                dlURLHelper = serviceLocator.findService("com.liferay.document.library.util.DLURLHelper") 
304                fileEntry = dl.getFileEntry(imagemId) 
305                imagemURL = dlURLHelper.getImagePreviewURL(fileEntry, themeDisplay) 
306                imagem = { 
307                    "alt" : imagemJson.get('alt'), 
308                    "url" : imagemURL 
309                }  
310            /> 
311            <#return imagem> 
312        </#if> 
313         
314        <#return {"alt":"", "url":""}> 
315     
316    </#function> 
317 
318 <#function getJournalArticle groupId> 
319    <#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
320    <#assign friendlyURL = getUnidadeFirendlyUrl()> 
321    
322    <#attempt> 
323   
324      <#if !friendlyURL?contains("fragment_collections") > 
325         
326        <#return journalArticleService.getArticleByUrlTitle(groupId,friendlyURL)> 
327         
328      </#if> 
329       
330    <#recover> 
331         
332      <#return '#erro#'> 
333    </#attempt> 
334 </#function> 
335 
336 <#function getUnidadeFirendlyUrl > 
337     <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
338     <#if friendly?contains("web") > 
339    	 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[3]?split("?")?first> 
340    </#if> 
341     
342    <#return friendly /> 
343     
344 </#function> 
345      
346 <#function getTipoCursoFirendlyUrl > 
347     
348 	<#assign friendlyURLTipoCurso = themeDisplay.getURLCurrent()?split("/")[2]?split("?")?first /> 
349    <#if friendlyURLTipoCurso?contains("guest") > 
350        <#assign friendlyURLTipoCurso = themeDisplay.getURLCurrent()?split("/")[4]?split("?")?first> 
351  </#if> 
352         
353    <#return friendlyURLTipoCurso /> 
354     
355 </#function> 
356      
357 <#function getTemaFirstLevelFriendly > 
358     <#attempt> 
359        <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
360         <#if !friendly?contains("web") > 
361             <#if themeDisplay.getURLCurrent()?split("/")?size gt 3 > 
362                <#assign friendly = themeDisplay.getURLCurrent()?split("/")[3]?split("?")?first /> 
363            <#else> 
364                <#assign friendly = "" /> 
365            </#if>   
366                 
367        <#else> 
368            <#if themeDisplay.getURLCurrent()?split("/")?size gt 5 > 
369                <#assign friendly = themeDisplay.getURLCurrent()?split("/")[5]?split("?")?first> 
370             <#else> 
371                <#assign friendly = "" /> 
372            </#if> 
373         </#if> 
374              
375        <#return friendly /> 
376    <#recover> 
377        <#return '#erro#'> 
378    </#attempt> 
379     
380</#function>  
381 
382 <#function getTemaSecondLevelFriendly > 
383     <#attempt> 
384         <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
385         
386         <#if !friendly?contains("web") > 
387             <#if themeDisplay.getURLCurrent()?split("/")?size gt 4 > 
388                <#assign friendly = themeDisplay.getURLCurrent()?split("/")[4]?split("?")?first /> 
389             <#else> 
390                <#assign friendly = "" /> 
391            </#if>       
392        <#else> 
393             <#if themeDisplay.getURLCurrent()?split("/")?size gt 6 > 
394                 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[6]?split("?")?first> 
395            <#else> 
396                <#assign friendly = "" /> 
397            </#if>    
398        </#if> 
399     
400        <#return friendly /> 
401    <#recover> 
402        <#return '#erro#'> 
403    </#attempt> 
404     
405</#function>  
406  
407 <#function getTemaThirdLevelFriendly > 
408     <#attempt> 
409         <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
410          
411         <#if !friendly?contains("web") > 
412            <#if themeDisplay.getURLCurrent()?split("/")?size gt 5 > 
413                <#assign friendly = themeDisplay.getURLCurrent()?split("/")[5]?split("?")?first /> 
414            <#else> 
415                <#assign friendly = "" /> 
416            </#if>   
417        <#else> 
418            <#if themeDisplay.getURLCurrent()?split("/")?size gt 7 > 
419                <#assign friendly = themeDisplay.getURLCurrent()?split("/")[7]?split("?")?first> 
420            <#else> 
421                <#assign friendly = "" /> 
422            </#if>   
423        </#if> 
424            <#return friendly /> 
425    <#recover> 
426        <#return '#erro#'> 
427    </#attempt> 
428     
429</#function>  
430 
431<style> 
432	 
433	body { 
434     background: #fafafa; 
435   } 
436 
437.stop-scrolling { 
438    height: 100%; 
439    overflow: hidden; 
440} 
441 
442/*Header Unidade*/ 
443 
444.ssp-header-unidade__content-info-body{ 
445    padding-top:30px; 
446} 
447 
448.ssp-header-unidade__atendimento-container > p > a { 
449    color:white!important; 
450} 
451 
452.ssp-header-unidade__atendimento-container > p > a:hover { 
453    color:white!important; 
454    font-weight: normal!important; 
455} 
456 
457.creditoFotoMob{ 
458 
459    margin: 0 auto; 
460    background: #FFF7D6; 
461    font-family: 'Montserrat'; 
462    font-size: 14px; 
463    line-height: 1.6em; 
464    border-radius: 3px; 
465    max-width: 240px; 
466    height: auto; 
467    color: #4F596F; 
468    padding: 5px; 
469    position: relative;     
470    float: right;     
471    top: 70%; 
472    max-height: 40px; 
473    font-weight: 500; 
474    right: 15%; 
475    flex-wrap: unset; 
476} 
477 
478.creditoFotoMob:after{ /*Triangulo*/ 
479    content: ""; 
480    width: 0; 
481    height: 0; 
482    position: absolute; 
483    border-left: 10px solid transparent; 
484    border-right: 10px solid transparent; 
485    /*Faz seta "apontar para baixo. Definir o valor como 'top' fará ela "apontar para cima" */ 
486    /*Aqui entra a cor da "aba" do balão */ 
487    border-bottom: 10px solid #FFF7D6; 
488    top: -9px; /*localização. Experimente alterar para 'bottom'*/ 
489    left: 20%; 
490} 
491.tooltip-inner { 
492    max-width: 230px; 
493    padding: 0.75rem 0.75rem; 
494    color: #4F596F; 
495    text-align: center; 
496    background-color: #FFF7D6; 
497    border-radius: 0.3125rem; 
498} 
499.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^="top"] .arrow::before { 
500    top: 0; 
501    border-width: 0.4rem 0.4rem 0; 
502    border-top-color: #FFF7D6; 
503} 
504.ssp-header-title-bloco { 
505    font-size: 20px; 
506    font-weight: 600; 
507} 
508 
509.ssp:not(.liferay-instance) .ssp-header-unidade__imagem-box-imagem{ 
510    height:100%; 
511} 
512/*#slider { 
513    width: 80%; 
514    max-width: 500px; 
515    height: 25vw; 
516    max-height: 150px; 
517 
518    position: relative; 
519}*/ 
520 
521#slider .ssp-header-unidade__imagem-box-imagem{ 
522    opacity: 0; 
523    position: absolute; 
524    /*width: 100%; 
525    height: 100%;*/ 
526    object-fit: cover; 
527    transition: opacity 2000ms; 
528} 
529 
530#slider .ssp-header-unidade__imagem-box-imagem.selected {  
531    opacity: 1; 
532} 
533 
534@media only screen and (max-width: 1024px) { 
535     
536#slider .ssp-header-unidade__imagem-box-imagem{  
537    margin-top: -240px; 
538    height: 248px; 
539 
540 } 
541 .ssp-header-unidade__container-info { 
542    margin-top: 240px!important; 
543 } 
544 
545} 
546 
547 @media only screen and (max-width: 768px){ 
548 
549  .ssp:not(.liferay-instance) .ssp-header-unidade__imagem-box-imagem{ 
550    height:228px; 
551  } 
552  .ssp-header-title-bloco { 
553    font-size: 14px;     
554}    
555 
556  .creditoFotoMob{ 
557    font-size: 9px!important; 
558    max-width: 161px!important; 
559    max-height: 30px!important; 
560    padding: 8.5px 9.5px!important; 
561    line-height: 0.6em!important; 
562     
563  } 
564}  
565 
566/* Final Header Unidade*/ 
567 
568.btn-nivel-livre-ead{ 
569        background-color: #ff9057; 
570        border-color: #ff9057; 
571        box-shadow: none; 
572    } 
573 
574    .icon-ao-vivo{ 
575    font-size:12px; 
576    margin:0 3px; 
577    } 
578 
579 
580.subtema-ativo{ 
581 
582    color:#fcc080!important; 
583} 
584 
585.separador-subtemas{ 
586    width:100% !important; 
587    margin-top: -1em !important; 
588    margin-bottom: 2.25rem!important; 
589} 
590 
591.bg-nivel-extensao { 
592    background-color: #3ECCA6 !important; } 
593    a.bg-nivel-extensao:hover, a.bg-nivel-extensao:focus, 
594    button.bg-nivel-extensao:hover, 
595    button.bg-nivel-extensao:focus { 
596    background-color: #3ECCA6 !important; } 
597     
598 
599/*novo forma de exibir o menu de areas*/ 
600 
601.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema { 
602	font-size: 15px; 
603	color: #454F63; 
604} 
605 
606 
607 
608.ssp:not(.liferay-instance) .ssp-section-tema__container-menu { 
609    flex-wrap: wrap; 
610} 
611 
612.tema i{ 
613	margin-right: 8px; 
614} 
615 
616/* novo style tags tipo de curso */ 
617  
618section#section-links div.container.text-left { 
619    max-width: none!important; 
620    padding: 0 28px!important; 
621} 
622 
623 
624.btn-nivel-panelinha{ 
625    background-color: #F9C5B5 !important; 
626    order: 12; 
627    color: black; 
628} 
629 
630.ssp:not(.liferay-instance) .ssp-btns-horizontal-area{ 
631   max-width: 1090px; 
632   gap: 16px; 
633} 
634 
635.btn-nivel-panelinha:hover { 
636    background-color: #E56C5A !important; 
637} 
638 
639.btn-nivel-panelinha:active { 
640    background-color: #E1523D !important; 
641} 
642 
643.ssp:not(.liferay-instance) .ssp-btns-horizontal-area a.btn.btn-nivel{ 
644  color: #000!important; 
645	border: none!important; 
646	font-size: 16px!important; 
647	padding-left: unset!important; 
648	padding-right: unset!important; 
649	padding-top: unset!important; 
650	padding-bottom: unset!important; 
651	padding: 16px!important; 
652	border-radius: 20px; 
653  margin: 0!important; 
654	max-height: 52px; 
655 
656} 
657 
658.ssp:not(.liferay-instance) .ssp-btns-horizontal-area a.btn.btn-nivel[target=_blank]::after { 
659    font-family: "Font Awesome 6 Pro"; 
660    content: "\f08e"; 
661    font-size: 1rem; 
662	  margin-left: 8px; 
663} 
664 
665.ssp-btns-horizontal-area .btn-nivel-especializacao-tecnica{ 
666  background-color: #FDF2D7; 
667	order: 1; 
668} 
669.ssp-btns-horizontal-area .btn-nivel-especializacao-tecnica:hover{ 
670  background-color: #FACA5C; 
671} 
672.ssp-btns-horizontal-area .btn-nivel-especializacao-tecnica:active{ 
673  background-color: #F6BC39; 
674} 
675 
676 
677.ssp-btns-horizontal-area .btn-nivel-tecnico{ 
678  background-color: #FDF2D7; 
679	order: 2; 
680} 
681.ssp-btns-horizontal-area .btn-nivel-tecnico:hover{ 
682  background-color: #FACA5C; 
683} 
684.ssp-btns-horizontal-area .btn-nivel-tecnico:active{ 
685  background-color: #F6BC39; 
686} 
687 
688 
689.ssp-btns-horizontal-area .btn-nivel-ensino-medio-tecnico{ 
690  background-color: #F4E0F4; 
691	order: 3; 
692} 
693.ssp-btns-horizontal-area .btn-nivel-ensino-medio-tecnico:hover{ 
694  background-color: #D281D5; 
695} 
696.ssp-btns-horizontal-area .btn-nivel-ensino-medio-tecnico:active{ 
697  background-color: #C665C9; 
698} 
699 
700 
701.ssp-btns-horizontal-area .btn-nivel-livre{ 
702  background-color: #FFE9DF; 
703	order: 4; 
704} 
705.ssp-btns-horizontal-area .btn-nivel-livre:hover{ 
706  background-color: #FFA47B; 
707} 
708.ssp-btns-horizontal-area .btn-nivel-livre:active{ 
709  background-color: #FD905E; 
710} 
711 
712 
713.ssp-btns-horizontal-area .btn-nivel-idiomas{ 
714  background-color: #FFE9DF; 
715	order: 5; 
716} 
717.ssp-btns-horizontal-area .btn-nivel-idiomas:hover{ 
718  background-color: #FFA47B; 
719} 
720.ssp-btns-horizontal-area .btn-nivel-idiomas:active{ 
721  background-color: #FD905E; 
722} 
723 
724 
725.ssp-btns-horizontal-area .btn-nivel-graduacao{ 
726  background-color: #DCEBF9; 
727	order: 6; 
728} 
729.ssp-btns-horizontal-area .btn-nivel-graduacao:hover{ 
730  background-color: #6EACEA; 
731} 
732.ssp-btns-horizontal-area .btn-nivel-graduacao:active{ 
733  background-color: #4E99E3; 
734} 
735.ssp-btns-horizontal-area .btn-nivel-graduacao-ead{ 
736  background-color: #DCEBF9; 
737	order: 7; 
738} 
739.ssp-btns-horizontal-area .btn-nivel-graduacao-ead:hover{ 
740  background-color: #6EACEA; 
741} 
742.ssp-btns-horizontal-area .btn-nivel-graduacao-ead:active{ 
743  background-color: #4E99E3!important; 
744} 
745 
746 
747.ssp-btns-horizontal-area .btn-nivel-pos-graduacao{ 
748  background-color: #E1E0FE; 
749	order: 8; 
750} 
751.ssp-btns-horizontal-area .btn-nivel-pos-graduacao:hover{ 
752  background-color: #8280FE; 
753} 
754.ssp-btns-horizontal-area .btn-nivel-pos-graduacao:active{ 
755  background-color: #6764FB; 
756} 
757.ssp-btns-horizontal-area .btn-nivel-pos-graduacao-ead{ 
758  background-color: #E1E0FE; 
759	order: 9; 
760} 
761.ssp-btns-horizontal-area .btn-nivel-pos-graduacao-ead:hover{ 
762  background-color: #8280FE; 
763} 
764.ssp-btns-horizontal-area .btn-nivel-pos-graduacao-ead:active{ 
765  background-color: #6764FB; 
766} 
767 
768 
769.ssp-btns-horizontal-area .btn-nivel-extensao{ 
770  background-color: #DAF5ED; 
771	order: 10!important; 
772} 
773.ssp-btns-horizontal-area .btn-nivel-extensao:hover{ 
774  background-color: #68D7B8; 
775} 
776.ssp-btns-horizontal-area .btn-nivel-extensao:active{ 
777  background-color: #47CBA7; 
778} 
779.ssp-btns-horizontal-area .btn-nivel-extensao-ead{ 
780  background-color: #DAF5ED; 
781	order: 11; 
782} 
783.ssp-btns-horizontal-area .btn-nivel-extensao-ead:hover{ 
784  background-color: #68D7B8; 
785} 
786.ssp-btns-horizontal-area .btn-nivel-extensao-ead:active{ 
787  background-color: #47CBA7; 
788} 
789 
790.ssp-btns-horizontal-area .btn-nivel-jovem-aprendiz{ 
791  background-color: #DAF5F9; 
792} 
793.ssp-btns-horizontal-area .btn-nivel-jovem-aprendiz:hover{ 
794  background-color: #66D7E8; 
795} 
796.ssp-btns-horizontal-area .btn-nivel-jovem-aprendiz:active{ 
797  background-color: #44CCE0; 
798} 
799 
800 
801 
802@media only screen and (max-width: 768px){ 
803   .ssp:not(.liferay-instance) .ssp-btns-horizontal-area a.btn.btn-nivel{ 
804	     padding: 8px!important; 
805     	 border-radius: 12px; 
806} 
807	.ssp:not(.liferay-instance) .ssp-btns-horizontal-area{ 
808       justify-content: center; 
809		   align-items: center; 
810} 
811} 
812 
813</style> 
814 
815<#if tipoCurso == "Livre"> 
816 
817    <style> 
818    .ssp:not(.liferay-instance) .ativo{ 
819      background-color: #FF9057!important; 
820      color:white!important; 
821      font-weight: 600!important; 
822    } 
823     
824    .tema-ativo{ 
825      background-color: #FF9057!important; 
826      color:white!important; 
827      font-weight: 600!important; 
828    } 
829 
830		.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema:hover { 
831			background-color: #FF9057; 
832			color: white; 
833			font-weight: 600 !important; 
834		} 
835		.subtema.btn-nivel-3.subtema-ativo { 
836			background: #FF9057!important; 
837			color: white!important; 
838			border-color: #FF9057!important; 
839		} 
840    </style> 
841 
842<#elseif tipoCurso == "Técnico"> 
843 
844 
845    <style> 
846/* curso tecnico */    
847    .ssp:not(.liferay-instance) .ativo{ 
848      background-color: #F7BD23!important; 
849      color:white!important; 
850      font-weight: 600!important; 
851    } 
852     
853    .tema-ativo{ 
854      background-color: #F7BD23!important; 
855      color:white!important; 
856      font-weight: 600!important; 
857    } 
858 
859		.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema:hover { 
860			background-color: #F7BD23; 
861			color: white; 
862			font-weight: 600 !important; 
863		} 
864		.subtema.btn-nivel-3.subtema-ativo { 
865			background: #F7BD23!important; 
866			color: white!important; 
867			border-color: #F7BD23!important; 
868		} 
869    </style> 
870 
871<#else> 
872 
873    <style> 
874/* curso extensao */ 
875    .ssp:not(.liferay-instance) .ativo{ 
876      background-color: #3ECCA6!important; 
877      color:white!important; 
878      font-weight: 600!important; 
879    } 
880     
881    .tema-ativo{ 
882      background-color: #3ECCA6!important; 
883      color:white!important; 
884      font-weight: 600!important; 
885    } 
886 
887		.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema:hover { 
888			background-color: #3ECCA6; 
889			color: white; 
890			font-weight: 600 !important; 
891		} 
892		.subtema.btn-nivel-3.subtema-ativo { 
893			background: #3ECCA6!important; 
894			color: white!important; 
895			border-color: #3ECCA6!important; 
896		} 
897    </style> 
898 
899</#if> 
900 
901<style> 
902 
903/* css para link no nome da unidade */ 
904 
905.ssp-header-unidade__title a{ 
906     
907    text-decoration: none!important; 
908    font-family: Montserrat; 
909    font-size: 44px; 
910    max-width: 440px; 
911    font-weight: 600!important; 
912    line-height: 1.23; 
913    text-align: left; 
914    color: white; 
915} 
916 
917.ssp-section-tema__subtitle-curso-section { 
918 
919    margin-left: 40px!important; 
920 
921} 
922 
923.ssp-page-busca__section-resultado__ver-todos{ 
924    margin-right: 40px!important; 
925} 
926 
927.submenu-tema-ativo{ 
928  background-color: #34495e!important; 
929  color:white!important; 
930  font-weight: 600!important; 
931} 
932 
933.submenu-tema-ativo-hover{ 
934  background-color: #34495e!important; 
935  color:white!important; 
936  font-size:50px; 
937  font-weight: 600!important; 
938} 
939 
940.slider-curso>.slick-area__item{ 
941 
942width:100%; 
943     
944} 
945 
946.custom-card-curso-tema{ 
947  
948 height:288px!important;  
949   
950} 
951 
952@media only screen and (max-width: 768px){ 
953     
954  .ssp:not(.liferay-instance) .custom-card-curso-tema { 
955      width: 100% !important; 
956      height:auto!important; 
957  } 
958   
959   
960  .ssp-page-busca__section-resultado__ver-todos { 
961    display:none; 
962  } 
963   
964  .filtroInscBolsa{ 
965    display:none!important; 
966  } 
967   
968} 
969   
970.ssp:not(.liferay-instance) .ssp-container__cursos-sem-slick { 
971    display: flex; 
972    justify-content: center; 
973    flex-wrap: wrap; 
974} 
975 
976/*Novas funcionalidades*/ 
977    #filtro-temas-nivel-3{ 
978        padding-bottom: 2em; 
979    } 
980     
981 .switch { 
982          position: relative; 
983          display: inline-block; 
984          width: 63px; 
985          height: 31.5px; 
986          margin: 0; 
987        } 
988         
989        .switch input {  
990          opacity: 0; 
991          width: 0; 
992          height: 0; 
993        } 
994         
995        .slider { 
996          position: absolute; 
997          cursor: pointer; 
998          top: 0; 
999          left: 0; 
1000          right: 0; 
1001          bottom: 0; 
1002          background-color: #454F63; 
1003          -webkit-transition: .4s; 
1004          transition: .4s; 
1005        } 
1006         
1007        .slider:before { 
1008          position: absolute; 
1009          content: ""; 
1010          height: 21px; 
1011          width: 21px; 
1012          left: 7px; 
1013          bottom: 5.5px; 
1014          background-color: #454F63; 
1015          -webkit-transition: .4s; 
1016          transition: .4s; 
1017        } 
1018         
1019        input:checked + .slider { 
1020          background-color: #2967F4; 
1021        } 
1022         
1023        input:focus + .slider { 
1024          box-shadow: 0 0 1px #2967F4; 
1025        } 
1026         
1027        input:checked + .slider:before { 
1028          -webkit-transform: translateX(26px); 
1029          -ms-transform: translateX(26px); 
1030          transform: translateX(26px); 
1031        } 
1032         
1033        /* Rounded sliders */ 
1034        .slider.round { 
1035          border-radius: 35px; 
1036        } 
1037         
1038        .slider.round:before { 
1039          border-radius: 50%; 
1040        } 
1041 
1042        /* content filter */ 
1043 
1044        .ssp-slider-check__container{ 
1045 
1046            display: flex; 
1047            justify-content: flex-end; 
1048 
1049        } 
1050 
1051 
1052     
1053     .ssp-slider-check__content-itens{ 
1054 
1055            display: flex; 
1056            width: 800px!important; 
1057         
1058            justify-content: flex-end!important; 
1059             
1060        } 
1061         
1062         .ssp-slider-check__content-item{ 
1063 
1064            display: flex; 
1065            align-items: center; 
1066            padding: 0 20px; 
1067        } 
1068         
1069        
1070        .ssp-slider-check__label{ 
1071 
1072            font-family: Montserrat; 
1073            color: #78849E; 
1074            font-size: 16px; 
1075            padding-left: 10px; 
1076            font-weight: 600; 
1077 
1078        } 
1079         
1080        .ssp-section-tema__container-menu { 
1081            padding-bottom: 15px; 
1082        } 
1083 
1084        .ssp-section-tema__subtitle-desconto{ 
1085            display: block; 
1086            font-size: 30px; 
1087        } 
1088 
1089        @media only screen and (max-width: 1024px) { 
1090 
1091            .ssp-section-tema__subtitle-desconto{ 
1092                font-size: 19px; 
1093            } 
1094 
1095            .ssp-header-unidade__title a{ 
1096                 
1097                font-size: 24px; 
1098            } 
1099 
1100            .ssp-section-tema__subtitle-curso-section { 
1101 
1102                margin-left: 0px!important; 
1103 
1104            } 
1105 
1106            #filtro-ativo-nivel-2{ 
1107                justify-content: center; 
1108            } 
1109 
1110            .ssp-slider-check__label{ 
1111 
1112                font-size: 11px; 
1113 
1114            } 
1115 
1116            .tema-slick-area { 
1117     
1118                display: flex; 
1119                align-items: center; 
1120                justify-content: flex-start; 
1121                font-size: 0; 
1122                flex-wrap: wrap; 
1123            } 
1124 
1125            /* custom  itens */ 
1126             
1127             
1128            .ssp-unidade-temas__label-filtre-por{ 
1129                font-size: 15px!important; 
1130                padding-left: 5px!important; 
1131            } 
1132            
1133 
1134            .ssp-section-tema__container-menu { 
1135                height: auto!important; 
1136            } 
1137 
1138            .tema-slick-area-mobile { 
1139                display: flex; 
1140                align-items: center; 
1141                justify-content: center; 
1142                font-size: 0; 
1143                flex-wrap: wrap; 
1144            } 
1145 
1146            .ssp-section-tema__container-submenu-nivel3 { 
1147 
1148                justify-content: center; 
1149            } 
1150             
1151             .ssp-slider-check__container{ 
1152                padding-top:10px!important; 
1153            } 
1154      }      
1155</style> 
1156 
1157<#if tipoCurso == "Livre" || tipoCurso == "Extensão"> 
1158 
1159    <style>     
1160        @media only screen and (max-width: 768px){      
1161            .tema-ativo::after{ 
1162                font-family: "Font Awesome 5 Free";  
1163                font-weight: 900;  
1164                content: "\f00d"; 
1165                font-size: 12px; 
1166                margin: 0 5px; 
1167                  } 
1168         } 
1169    </style>             
1170</#if> 
1171<style> 
1172        @media only screen and (max-width: 768px){      
1173            .subtema-ativo::after{ 
1174                font-family: "Font Awesome 5 Free";  
1175                font-weight: 900;  
1176                content: "\f00d"; 
1177                font-size: 12px; 
1178                margin: 0 5px; 
1179            } 
1180             
1181            .ssp:not(.liferay-instance) .ssp-page-busca__section-resultado__ver-todos-mobile { 
1182                font-family: Montserrat; 
1183                font-size: 16px; 
1184                font-weight: 600; 
1185                line-height: 1.21; 
1186                color: #78849e; 
1187                text-decoration: none !important; 
1188                transition: 0.3s; 
1189                text-align: center !important; 
1190                 padding-left: 7em; 
1191            } 
1192             
1193            .ssp:not(.liferay-instance) .ssp-page-busca__section-resultado__ver-todos-mobile::after { 
1194                font-family: FontAwesome; 
1195                font-weight: 900; 
1196                content: '\f054'; 
1197                font-size: 12px; 
1198                margin-left: 5px; 
1199            } 
1200 
1201        } 
1202 
1203        /* Custom css para unidades */ 
1204 
1205        .ssp-unidade-temas__label-filtre-por{ 
1206 
1207            font-family: Montserrat; 
1208            font-size: 20px; 
1209            font-weight: 600; 
1210            padding: 15px; 
1211            padding-left: 30px; 
1212            color: #78849E; 
1213 
1214        } 
1215 
1216        .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 { 
1217            margin: 15px 10px; 
1218           
1219        } 
1220 
1221 
1222        .ssp-line-nivel-divisor { 
1223            width: 100%; 
1224            height: 1px; 
1225            background: #78849E; 
1226            margin: 15px 0; 
1227        } 
1228 
1229     .ssp-header-unidade__content-info{ 
1230            z-index: 0!important; 
1231        } 
1232 
1233        .ssp-btn-tema-mobile--active{ 
1234            background-color: #FE9057!important; 
1235            color: white!important; 
1236        } 
1237 
1238        .ssp-btn-tema-mobile--active::after{ 
1239            font-family: "Font Awesome 5 Free";  
1240            font-weight: 900;  
1241            content: "\f00d"; 
1242            font-size: 12px; 
1243            margin: 0 5px; 
1244        } 
1245 
1246        .ssp-btn-subtema-mobile--active{ 
1247            background-color: #78849E!important; 
1248            color: white!important; 
1249        } 
1250         
1251        
1252 
1253        /* Botão Visualizar mais */ 
1254 
1255        .ssp-btn__visualizar-mais-content{ 
1256            display: flex; 
1257            flex-wrap: nowrap; 
1258            align-items: center; 
1259            justify-content: center; 
1260        } 
1261 
1262        .ssp-btn__visualizar-mais{ 
1263            cursor: pointer; 
1264            font-size: 14px; 
1265        } 
1266         
1267        #visualizar-mais{ 
1268            font-family:montserrat; 
1269        } 
1270         
1271        .tema{ 
1272            box-shadow: none !important; 
1273        } 
1274        .separador-subtemas{ 
1275            margin:10px 0px 30px 0px!important; 
1276        } 
1277         
1278        .py-5{ 
1279            padding-bottom: 0px!important; 
1280            padding-top: 5px!important; 
1281        } 
1282         
1283        .ssp-section-tema__title{ 
1284            margin: 40px 0px 25px 0px!important; 
1285        } 
1286@media only screen and (min-width: 1025px){ 
1287    .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 { 
1288        margin-bottom: 20px!important; 
1289    } 
1290     
1291    .filtroTextoMobile{ 
1292        display: none; 
1293    } 
1294}    
1295 
1296/* novo botao ver todos os cursos */ 
1297 
1298.ver-todos-cursos-link{ 
1299    color: #78849E!important; 
1300} 
1301 
1302.ver-todos-cursos-link:hover{ 
1303    color: #515A6B!important; 
1304} 
1305 
1306.ver-todos-cursos-link:hover p{ 
1307    color: #515A6B!important; 
1308} 
1309 
1310.custom-card-curso-tema{ 
1311  
1312 height:282px!important;  
1313   
1314} 
1315 
1316.container-fluid .row{ 
1317    margin: 0 !important; 
1318} 
1319 
1320 
1321.container-fluid .col-md-12{ 
1322    padding: 0 !important; 
1323} 
1324 
1325.ver-todos-no-click{ 
1326    text-decoration: none !important; 
1327    pointer-events: none !important; 
1328} 
1329 
1330.slick-area__item.card-curso-nivel-2 .custom-card-curso-tema__title{ 
1331    height: 70px; 
1332} 
1333 
1334#slider .ssp-header-unidade__imagem-box-imagem img{ 
1335    position: absolute; 
1336    width: 100%; 
1337    height: 100%; 
1338    object-fit: cover; 
1339} 
1340 
1341/* Transporte próximo */ 
1342 
1343.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento { 
1344    display:block; 
1345    padding-top: 5px; 
1346} 
1347 
1348.ssp:not(.liferay-instance) .ssp-header-unidade__endereco-container { 
1349    display: flex; 
1350    align-items: center; 
1351    justify-content: space-between; 
1352    flex-flow: column; 
1353    align-items: flex-start; 
1354    gap: 15px; 
1355} 
1356 
1357.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento a{ 
1358    color:white; 
1359} 
1360 
1361.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento a:hover{ 
1362    font-weight:normal!important; 
1363} 
1364 
1365.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento p{ 
1366    display:inline-block; 
1367    margin: 0; 
1368} 
1369 
1370.ssp:not(.liferay-instance) .ssp-header-unidade__endereco { 
1371    max-width: 100%; 
1372} 
1373 
1374@media only screen and (max-width: 768px){ 
1375 
1376    .ssp:not(.liferay-instance) .ssp-header-unidade__container-info .container { 
1377        padding: 0; 
1378    } 
1379 
1380    .ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento p{ 
1381        display:inline; 
1382        font-size: 13px; 
1383    } 
1384} 
1385     
1386 
1387/* Alteracoes para 10019 */ 
1388.ssp:not(.liferay-instance) .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 { 
1389  font-weight: 600; 
1390  color: #454F63; 
1391} 
1392#filtro-temas-nivel-2 .subtema.subtema-ativo:not(.todos){ 
1393  margin: 0 auto 30px auto!important; 
1394} 
1395#filtro-temas-nivel-2 .btn-nivel-3{ 
1396  display: inline-flex; 
1397  height: 40.061px; 
1398  padding: 16.868px; 
1399  justify-content: center; 
1400  align-items: center; 
1401  gap: 16.868px; 
1402  flex-shrink: 0; 
1403  border-radius: 8px; 
1404  border: 1.054px solid #C3CAD9; 
1405} 
1406.tema-ativo::after{ 
1407  font-family: "Font Awesome 5 Free";  
1408  font-weight: 900;  
1409  content: "\f00d"; 
1410  font-size: 12px; 
1411  margin: 0 5px; 
1412}   
1413.subtema-ativo:not(.subtema-ativo.todos)::after{ 
1414  font-family: "Font Awesome 5 Free";  
1415  font-weight: 900;  
1416  content: "\f00d"; 
1417  font-size: 12px; 
1418  margin: 0 5px; 
1419} 
1420#filtro-temas-nivel-3{ 
1421	margin-bottom: 20px; 
1422} 
1423#filtro-temas-nivel-3 a:not(.todos, .subtema-ativo)::after{ 
1424	content: "+"; 
1425  padding-left: 10px; 
1426  font-size: 16px; 
1427} 
1428.ssp:not(.liferay-instance) .ssp-section-tema__title{ 
1429	color: #78849E; 
1430  text-align: center; 
1431  font-family: Montserrat; 
1432  font-size: 32px; 
1433  font-style: normal; 
1434  font-weight: 600; 
1435  line-height: normal; 
1436} 
1437.ssp:not(.liferay-instance) .ssp-section-tema__title.selected { 
1438  font-size: 24px; 
1439  font-weight: 400; 
1440} 
1441.ssp:not(.liferay-instance) .ssp-section-tema__title::after { 
1442  display: none!important; 
1443} 
1444.ssp-title-filtrar-mais { 
1445  color: #454F63; 
1446  font-family: Montserrat; 
1447  font-size: 20px; 
1448  font-style: normal; 
1449  font-weight: 600; 
1450  line-height: normal; 
1451  margin-top: 58px; 
1452  margin-bottom: 24px; 
1453  margin-left: 10px; 
1454} 
1455#filtro-temas-nivel-3 .subtema { 
1456  border-radius: 32px; 
1457  border: 1.054px solid #C3CAD9; 
1458  display: flex; 
1459  height: 32px; 
1460  padding: 16.868px 16px; 
1461  justify-content: center; 
1462  align-items: center; 
1463  gap: 12px; 
1464  color: var(--boto, #636C7E); 
1465  text-align: center; 
1466  font-family: Montserrat; 
1467  font-size: 16px; 
1468  font-style: normal; 
1469  font-weight: 600; 
1470  line-height: normal; 
1471} 
1472.ssp-divider { 
1473  content: " "; 
1474  display: block; 
1475  background-color: #78849E; 
1476  width: 127px; 
1477  height: 3px; 
1478  margin: 25px auto 50px; 
1479} 
1480.ssp-section-tema__container-menu-item:has(.tema-ativo) { 
1481  margin-left: auto; 
1482  margin-right: auto; 
1483} 
1484 
1485@media only screen and (max-width: 1024px) { 
1486  .ssp-title-filtrar-mais { 
1487    color: #454F63; 
1488    font-family: Montserrat; 
1489    font-size: 18px; 
1490    font-style: normal; 
1491    font-weight: 600; 
1492    line-height: normal; 
1493    margin-top: 48px; 
1494    margin-bottom: 40px; 
1495    margin-left: 0px; 
1496  } 
1497  .ssp:not(.liferay-instance) .ssp-section-tema__title { 
1498    color: #78849E; 
1499    text-align: center; 
1500    font-family: Montserrat; 
1501    font-size: 21px; 
1502    font-style: normal; 
1503    font-weight: 700; 
1504    line-height: normal; 
1505  } 
1506 
1507  .ssp:not(.liferay-instance) .ssp-section-tema__title.selected { 
1508    font-size: 16px; 
1509    font-weight: 400; 
1510  } 
1511 
1512  .ssp-divider { 
1513    margin: 0px auto 30px; 
1514  } 
1515} 
1516 
1517.ssp:not(.liferay-instance) .ssp-card-curso, .ssp:not(.liferay-instance) .ssp-card-todos-cursos{ 
1518 
1519box-shadow: 0 0 15px rgba(0, 0, 0, 0.20); 
1520 
1521} 
1522</style>      
1523      
1524      
1525<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")> 
1526<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")> 
1527<#assign groupId = themeDisplay.getSiteGroupId()> 
1528 
1529<#assign vocabularyTemaMercadologico = assetVocabularyLocalService.getGroupVocabulary(groupId, "Tema(Mercadológico)")> 
1530 
1531<input type="hidden" id="ssp-vocabulary-id-tema-mercadologico" value="${vocabularyTemaMercadologico.getVocabularyId()}"> 
1532      
1533      
1534<#--  Header da Unidade  --> 
1535 
1536 
1537<section style="position:relative;"> 
1538    <div class="ssp-header-unidade__imagem-box">     
1539        <div class="ssp-header-unidade__imagem-box-box-linha"></div> 
1540 
1541        <div class="ssp-header-unidade__imagem-box-box-linha2"></div> 
1542 
1543        <div id="slider">      
1544 
1545            <div class="ssp-header-unidade__imagem-box-imagem selected">  
1546 
1547                <img src="${imagem.url}" loading="lazy" <#if imagem.alt?length != 0> alt="${imagem.alt}"</#if> >  
1548               
1549            </div> 
1550        
1551            <#if endereco2?length != 0> 
1552 
1553                <div class="ssp-header-unidade__imagem-box-imagem"> 
1554                    <img src="${imagem2.url}" loading="lazy" <#if imagem2.alt?length != 0> alt="${imagem2.alt}"</#if> >   
1555                </div>  
1556 
1557            </#if>     
1558                         
1559                 
1560        </div> 
1561        <!--div class="ssp-header-unidade__imagem-box-imagem" style="background-image: url(img/bg-fale-com-gente.jpg)"></div--> 
1562 
1563        <#--  dados de compartilhamento  --> 
1564        <@liferay_util["html-top"]> 
1565            <meta name="image" property="og:image" content="${imagem.url}"> 
1566            <meta property="og:image:width" content="1024"> 
1567        </@> 
1568        <#--  dados de compartilhamento  --> 
1569     
1570        <#if tipoCurso == "Livre" > 
1571            <div class="ssp-header-tema__tag-tipo-curso"></div> 
1572        <#elseif tipoCurso == "Técnico"> 
1573            <!-- Tag de Tipo de Curso --> 
1574            <div class="ssp-header-tema__tag-tipo-curso bg-nivel-tecnico"></div> 
1575             
1576        <#else> 
1577            <!-- Tag de Extensão --> 
1578            <div class="ssp-header-tema__tag-tipo-curso bg-nivel-extensao"></div> 
1579             
1580        </#if> 
1581        <div class="ssp-header-unidade__container-info"> 
1582 
1583            <div class="container"> 
1584 
1585                <div class="ssp-header-unidade__content-info" style="height: auto;"> 
1586 
1587                    <div class="ssp-header-unidade__content-info-container"> 
1588 
1589                        <div> 
1590 
1591                            <div> 
1592                                <small class="ssp-header-unidade__subtitle">Senac</small> 
1593                            </div> 
1594 
1595                            <div class="ssp-header-unidade__title-container"> 
1596 
1597                                <div> 
1598 
1599                                    <h1 class="ssp-header-unidade__title"> 
1600					<a href="https://www.sp.senac.br/${friendlyUrlUnidade}"> 
1601                                            ${nome} 
1602                                        </a>     
1603                                    </h1> 
1604                                     
1605 
1606                                </div> 
1607                                 
1608                                <#-- o código da unidade é usado para referência de unidade no --> 
1609                                <span id="codUnidadeReferencia" class="d-none">${codigoUnidade}</span> 
1610                                <span id="friendlyUnidade" class="d-none">${friendlyUrlUnidade}</span> 
1611                                <span id="friendlyTipoCurso" class="d-none">${friendlyUrlTipoCurso}</span> 
1612                                <span id="nomeUnidadeParaBreadCrumb" class="d-none">${nomeUnidadeParaBreadCrumb}</span> 
1613                                 
1614                                <#if friendlyUrlTipoCurso?contains("livre")> 
1615                                    <span id="tipoCursoText" class="d-none">Livre</span> 
1616                                <#elseif friendlyUrlTipoCurso?contains("tecnico")> 
1617                                    <span id="tipoCursoText" class="d-none">Técnico</span> 
1618                                <#else> 
1619                                     <span id="tipoCursoText" class="d-none">Extensão</span>     
1620                               </#if> 
1621                                <#if friendlyUrlTemaFirst?contains("#erro#")> 
1622                                    <span id="friendlyTemaNv1" class="d-none"></span> 
1623                                 <#else> 
1624                                    <span id="friendlyTemaNv1" class="d-none">${friendlyUrlTemaFirst}</span> 
1625                               </#if> 
1626                                <#if friendlyUrlTemaSecond?contains("#erro#")> 
1627                                    <span id="friendlyTemaNv2" class="d-none"></span> 
1628                                <#else> 
1629                                  <span id="friendlyTemaNv2" class="d-none">${friendlyUrlTemaSecond}</span> 
1630                               </#if> 
1631                               <#if friendlyUrlTemaThird?contains("#erro#")> 
1632                                    <span id="friendlyTemaNv3" class="d-none"></span> 
1633                                 <#else> 
1634                                     <span id="friendlyTemaNv3" class="d-none">${friendlyUrlTemaThird}</span> 
1635                               </#if> 
1636                                
1637                            </div> 
1638 
1639                        </div> 
1640 
1641                        <div class="ssp-header-unidade__endereco-container"> 
1642 
1643                            <div class="d-flex flex-wrap"> 
1644                                 
1645                                <div> 
1646                                 
1647                                    <#if endereco2?length != 0> 
1648                                        <span class="ssp-header-title-bloco">Bloco I</span><br> 
1649                                    </#if> 
1650 
1651                                    <address class="ssp-header-unidade__endereco"> 
1652                                        ${endereco}, ${numero}<br>  
1653                                        ${bairro}, ${cidade} - ${UF}, ${cep} 
1654                                    </address> 
1655 
1656                                    <span class="ssp-header-unidade__estacionamento"> 
1657 
1658                                    <i class="fas fa-car"></i> 
1659 
1660                                        <#if estacionamento?contains("true")> 
1661                                            <strong>Possui estacionamento?</strong> Sim 
1662                                            <#else> 
1663                                            <strong>Possui estacionamento?</strong> Não 
1664                                        </#if> 
1665 
1666                                    </span> 
1667                                </div> 
1668 
1669                                <#if endereco2?length != 0> 
1670 
1671                                    <div class="pt-5"> 
1672                                        <span class="ssp-header-title-bloco">Bloco II</span><br> 
1673                                        <address class="ssp-header-unidade__endereco"> 
1674                                            ${endereco2}, ${numero2}<br>  
1675                                            ${bairro2}, ${cidade2}, ${cep2} 
1676                                        </address> 
1677                                        <span class="ssp-header-unidade__estacionamento"> 
1678                                            <i class="fas fa-car"></i> 
1679 
1680                                                <#if estacionamento2?contains("true")> 
1681                                                    <strong>Possui estacionamento?</strong> Sim 
1682                                                    <#else> 
1683                                                    <strong>Possui estacionamento?</strong> Não 
1684                                                </#if> 
1685 
1686                                        </span> 
1687                                    </div> 
1688 
1689								</#if> 
1690 
1691								<#if hasEstacaoProxima> 
1692                                            
1693									<span class="ssp-header-unidade__estacionamento"> 
1694										<i class="fa-solid fa-train-subway" aria-hidden="true"></i> 
1695										<strong>Estação mais próxima:</strong> 
1696										${estacaoProxima} 
1697									</span> 
1698 
1699                                </#if> 
1700 
1701                            </div>   
1702 
1703                            <div class="ssp-header-unidade__content-info-maps"> 
1704 
1705 
1706                                <a class="btn btn-nivel border-white ssp-header-unidade__btn" href="${googlemaps}" target="_blank"> 
1707                                    <i class="fas fa-map-marker-alt mr-2 ssp-header-unidade__btn-icon"></i>Google Maps 
1708                                </a> 
1709 
1710                                <a class="btn btn-nivel border-white ml-2  d-sm-inline-block d-md-none d-lg-none d-xl-none ssp-header-unidade__btn" href="${waze}" target="_blank"> 
1711                                    <i class="fab fa-waze mr-2 ssp-header-unidade__btn-icon"></i>Waze 
1712                                </a> 
1713 
1714                            </div>                         
1715                             
1716                        </div> 
1717 
1718                    </div> 
1719 
1720                    <div class="ssp-header-unidade__content-info-body"> 
1721 
1722                        <div class="ssp-header-unidade__atendimento-container"> 
1723                            <p><strong>Atendimento:</strong></p> 
1724                            <p>${horario}</p> 
1725                        </div> 
1726                         
1727                    </div> 
1728 
1729                     
1730            </div> 
1731             
1732        </div> 
1733 
1734        </div>  
1735                     
1736    </div> 
1737         
1738 
1739<script> 
1740     
1741    if ( $.trim($('.ssp-header-unidade__title').html()) === 'Santo Amaro'){ 
1742 
1743    $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac') 
1744 
1745    } else if ( $.trim($('.ssp-header-unidade__title').html()) === 'Campos do Jordão'){ 
1746 
1747        $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac') 
1748 
1749    } else if ( $.trim($('.ssp-header-unidade__title').html()) === 'Águas de São Pedro'){ 
1750 
1751        $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac') 
1752 
1753    } 
1754 
1755//Animação de Crédito da imagem 
1756 
1757$(document).ready(function(){       
1758    let larguraTela = $(window).width(); 
1759 
1760    if(larguraTela < 1024){ 
1761 
1762        animateCreditImage() 
1763 
1764        $(window).scroll(function() { 
1765            ScrollPagina() 
1766        }); 
1767 
1768    }else{ 
1769 
1770        $(".ssp-header-unidade__imagem-box-imagem" ).mouseover(function() { 
1771            $(".creditoFotoMob").removeClass('d-none') 
1772         
1773        });   
1774 
1775        $(".ssp-header-unidade__imagem-box-imagem" ).mouseout(function() { 
1776                $(".creditoFotoMob").addClass('d-none') 
1777                 
1778        });  
1779 
1780    } 
1781 
1782    //verifica posição do Top 
1783 
1784    function ScrollPagina(){ 
1785 
1786        let scrollPage = $(window).scrollTop(); 
1787 
1788        if(scrollPage == 0){ 
1789 
1790            animateCreditImage() 
1791 
1792        } 
1793    } 
1794 
1795    function animateCreditImage(){ 
1796 
1797        $( ".creditoFotoMob" ).removeClass('d-none').fadeIn( 200 ).delay( 2500 ).fadeOut( 5000 ); 
1798 
1799    } 
1800 
1801    //anima Slider fotos unidades de 
1802 
1803    let time = 5000, 
1804        currentImageIndex = 0, 
1805        images = document 
1806                    .querySelectorAll("#slider .ssp-header-unidade__imagem-box-imagem") 
1807        max = images.length; 
1808 
1809    function nextImage() { 
1810 
1811        images[currentImageIndex] 
1812            .classList.remove("selected") 
1813 
1814        currentImageIndex++ 
1815 
1816        if(currentImageIndex >= max) 
1817            currentImageIndex = 0 
1818 
1819        images[currentImageIndex] 
1820            .classList.add("selected") 
1821    } 
1822 
1823    function start() { 
1824 
1825        let enderecos = document.querySelectorAll('address'); 
1826 
1827        if(enderecos.length >= 2){     
1828 
1829            setInterval(() => { 
1830                // troca de image 
1831                nextImage() 
1832            }, time) 
1833        } 
1834        
1835    } 
1836 
1837    window.addEventListener("load", start) 
1838 
1839});  
1840     
1841</script> 
1842     
1843 
1844     
1845</section> 
1846 
1847<!--  Fim Header Unidade --> 
1848 
1849 
1850      
1851<#--  Conteúdo dinâmico que carrega os temas, subtemas e cursos  --> 
1852 
1853<section> 
1854 
1855    <div> 
1856 
1857        <h2 class="ssp-section-tema__title" data-section="title"> 
1858          Qual a sua área de interesse? 
1859        </h2> 
1860 
1861        <div class="ssp-divider"></div> 
1862 
1863        <div class="container"> 
1864 
1865            <div id="temas" class="ssp-section-tema__container-menu"> 
1866 
1867                <div class="ssp-section-tema__container-menu-item"> 
1868					<a href="#a" class="tema todos" data-nvl="0"> 
1869						<i class="fa-solid fa-dice-d6"></i> 
1870						Todos 
1871					</a> 
1872                </div> 
1873 
1874            </div> 
1875 
1876            <!-- Botão Visualizar Mais --> 
1877 
1878            <div class="ssp-btn__visualizar-mais-content d-md-none d-lg-none d-xl-none"> 
1879 
1880                <p id="visualizar-mais" class="ssp-btn__visualizar-mais">Visualizar mais</p> 
1881 
1882                <i class="fas fa-chevron-down mx-2 visualizar-mais-seta" style="font-size: 14px;"></i> 
1883                 
1884            </div> 
1885 
1886            <!-- filtros ativos para Mobile --> 
1887 
1888            <div id="filtro-ativo" class="tema-slick-area-mobile py-2"> 
1889 
1890                <!-- filtro nivel 1 --> 
1891                <div id="filtro-ativo-nivel-1" class="ssp-section-tema__container-menu-item mega-menu"> 
1892                     
1893                </div> 
1894 
1895                <div id="filtro-ativo-nivel-2" class="container ssp-section-tema__container-submenu-nivel3"> 
1896                             
1897                </div> 
1898 
1899            </div> 
1900 
1901        </div> 
1902 
1903    </div> 
1904 
1905</section> 
1906 
1907<section  id="tema-nivel2-container"> 
1908     
1909    <div id="tema-atual"> 
1910      <h2 class="ssp-section-tema__title"></h2> 
1911      <div class="ssp-divider"></div> 
1912    </div> 
1913         
1914    <#--   
1915    <div id="subtemas-lista-mobile" 
1916        class="container d-none ssp-section-tema__container-submenu-nivel3"></div>  --> 
1917 
1918    <div id="filtro-temas-nivel-2" class="container ssp-section-tema__container-submenu-nivel3 d-none"></div> 
1919     
1920    <div id="filtro-temas-nivel-3" class="container ssp-section-tema__container-submenu-nivel3 d-none"></div> 
1921 
1922</section> 
1923 
1924<section id="cursos-por-categoria-container" 
1925    style="padding-bottom:30px"> 
1926 
1927    <section class="py-5"> 
1928 
1929        <div class="container"> 
1930            <!-- <hr class="filtroInscBolsa"> --> 
1931            <div class="filtroTextoMobile">  
1932                <span style="font-family: 'Montserrat';font-size: 15px;font-weight: 600;color: #454F63;" > Filtrar por:</span>  
1933            </div> 
1934            <div class="ssp-slider-check__container" style="padding: 20px 0px;" id="container-filtros"> 
1935                <div class="ssp-slider-check__content-itens"> 
1936 
1937					<div class="ssp-slider-check__content-item">	 
1938		 
1939						<label id="inscricao-aberta" class="switch">	 
1940							<input id="chkInscricao" type="checkbox">	 
1941							<span class="slider round"></span>	 
1942						</label>	 
1943						 
1944						<span class="ssp-slider-check__label">Comprar agora</span> 
1945							 
1946                    </div> 
1947                    
1948                <#if tipoCurso == "Livre" || tipoCurso == "Técnico">     
1949				 
1950                    <div class="ssp-slider-check__content-item"> 
1951     
1952                        <label id="bolsas-estudo" class="switch"> 
1953                            <input id="chkBolsa" type="checkbox"> 
1954                            <span class="slider azul round"></span> 
1955                        </label> 
1956             
1957                        <span class="ssp-slider-check__label">Bolsas de estudo</span> 
1958     
1959                    </div> 
1960                </#if> 
1961                </div>     
1962 
1963            </div> 
1964 
1965            <!-- <hr class="filtroInscBolsa"> --> 
1966        </div> 
1967         
1968    </section> 
1969 
1970    <div style="padding-bottom: 30px;"> 
1971 
1972      <section id="cursos-por-subtema-container" class="container d-none"> 
1973     
1974        <!--h2 id="subtema-atual" class="ssp-section-tema__title-subtema"></h2--> 
1975         
1976        <div id="subsubtemas-lista"   class="ssp-section-tema__container-submenu-nivel3"></div> 
1977         
1978        <div id="curso-sem-slick" class="ssp-container__cursos-sem-slick"></div> 
1979         
1980         
1981      </section> 
1982     
1983    </div> 
1984 
1985    <div id="filtroSemCurso" class="ssp-bolsa-formulario__card-aviso-atencao d-none container text-left" style="width: 100%;"> 
1986                     
1987        <i class="fas fa-exclamation-circle ssp-bolsa-formulario__card-aviso-atencao-icon" aria-hidden="true"></i> 
1988     
1989        <div class="ssp-bolsa-formulario__card-aviso-texto"><p>Sem cursos para o filtro selecionado</p> 
1990        </div> 
1991     
1992     </div> 
1993     
1994     
1995</section> 
1996 
1997 
1998<#-- Template para card de cursos por categoria --> 
1999<section id="cursos-por-categoria-template" 
2000    class="cursos-por-categoria ssp-section container d-none"> 
2001 
2002 
2003    <div class="ssp-page-busca__section-resultado-container" 
2004        id="container-slider-cursos-livres"> 
2005 
2006        <a href="#a" data-nvl="" data-tema="" 
2007        class="ver-todos-cursos-link d-none-mobile"> 
2008    <p 
2009        class="ssp-page-busca__section-resultado__title-outros tema-nome ssp-section-tema__subtitle-curso-section"></p></a> 
2010         
2011    </div> 
2012 
2013    <div class="slider-curso" style="display: flex;"></div> 
2014 
2015</section> 
2016 
2017<#--  Estrutura com botões de tipos de curso -  os únicos que precisam ser dinâmicos são Livre e Técnico  --> 
2018 
2019<section class="ssp-section ssp-section-lg-top"> 
2020 
2021 
2022    <div class="container text-left"> 
2023 
2024        <h2 class="ssp-section-title"> 
2025            
2026          Cursos oferecidos 
2027             
2028        </h2> 
2029     
2030        <div class="ssp-btns-horizontal-area"> 
2031 
2032            <#function getCategorias primaryKey> 
2033   
2034            <#assign categoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /> 
2035            <#attempt> 
2036           
2037                <#return categoryService.getCategories("com.liferay.journal.model.JournalArticle", primaryKey)> 
2038           
2039            <#recover> 
2040               
2041              <#return '#erro#'> 
2042            </#attempt> 
2043          </#function> 
2044 
2045            <#assign  
2046             
2047 
2048                categoriesList = getCategorias(journal.getResourcePrimKey())  
2049                normalizer = serviceLocator.findService("com.liferay.portal.kernel.util.FriendlyURLNormalizer")  
2050                vocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") 
2051                vocabularies = vocabularyLocalService.getAssetVocabularies(-1,-1) 
2052                 
2053            /> 
2054 
2055 
2056            <#list vocabularies as vocabulary > 
2057              <#if vocabulary.getName() == 'Unidades'> 
2058                   
2059                  <#assign  
2060                      xPathSelector_nomeUsualUnidade = saxReaderUtil.createXPath("dynamic-element[@field-reference='nomeUsualUnidade']") 
2061                        nomeUsual = xPathSelector_nomeUsualUnidade.selectSingleNode(rootElement).getStringValue() 
2062                        categories = vocabulary.getCategories() 
2063                  > 
2064                  <#list categories as category> 
2065                      <#if  category.getName()?trim == nomeUsual?trim> 
2066                           
2067                          <#assign categoryId = category.getCategoryId() > 
2068                      </#if> 
2069                  </#list> 
2070              </#if> 
2071          </#list> 
2072 
2073            <#list categoriesList![] as category> 
2074  
2075                <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim /> 
2076  
2077                <#if normalizer.normalize(vocabularyName) == "tipo-de-curso"> 
2078                    <#assign normalizedCategoryName = normalizer.normalize(category.getName()) /> 
2079                     
2080                 
2081 
2082                     <#if normalizedCategoryName == "livre"> 
2083                        <a href="/${friendlyUrlUnidade}/cursos-livres" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}"> 
2084                            ${category.getName()} 
2085                        </a> 
2086                     
2087                    <#elseif normalizedCategoryName == "tecnico"> 
2088                        <a href="/${friendlyUrlUnidade}/cursos-tecnicos" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}"> 
2089                            ${category.getName()} 
2090                        </a> 
2091 
2092                    <#elseif normalizedCategoryName == "extensao"> 
2093                        <a href="/${friendlyUrlUnidade}/extensao-universitaria" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}"> 
2094                            ${category.getName()} 
2095                        </a> 
2096                     
2097                    <#elseif normalizedCategoryName == "extensao-ead"> 
2098                        <a href="https://www.ead.senac.br/extensao-universitaria" target="_blank" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}"> 
2099                            ${category.getName()} 
2100                        </a> 
2101 
2102                    <#elseif normalizedCategoryName == "graduacao-ead"> 
2103                        <a href="https://www.ead.senac.br/graduacao" target="_blank" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}"> 
2104                            ${category.getName()} 
2105                        </a> 
2106 
2107                    <#elseif normalizedCategoryName == "pos-graduacao-ead"> 
2108                        <a href="https://www.ead.senac.br/pos-graduacao" target="_blank" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}"> 
2109                            ${category.getName()} 
2110                        </a> 
2111                    <#elseif normalizedCategoryName == "jovem-aprendiz"> 
2112                        <a href="/jovem-aprendiz" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}"> 
2113                            ${category.getName()} 
2114                        </a> 
2115 
2116                    <#else> 
2117                        <a href="/${friendlyUrlUnidade}/${normalizedCategoryName}" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}"> 
2118                            ${category.getName()} 
2119                        </a> 
2120                    </#if> 
2121                     
2122 
2123                </#if> 
2124  
2125            </#list> 
2126 
2127            <#-- Verifica se a unidade oferta curso de Idiomas--> 
2128 
2129            <#list categoriesList![] as category> 
2130 
2131                <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim /> 
2132 
2133                <#if normalizer.normalize(vocabularyName) == "tema-mercadologico-">  
2134 
2135                    <#assign normalizedCategoryName = normalizer.normalize(category.getName()) /> 
2136 
2137                    <#if category.getName() == "Idiomas"> 
2138                            <a href="/${friendlyUrlUnidade}/cursos-livres/${normalizedCategoryName}" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">${category.getName()}</a> 
2139                        <#else> 
2140                    </#if> 
2141 
2142                </#if> 
2143 
2144            </#list>  
2145             
2146            <#list categoriesList![] as category> 
2147 
2148                <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim /> 
2149 
2150                <#if normalizer.normalize(vocabularyName) == "modalidade">  
2151 
2152                    <#assign normalizedCategoryName = normalizer.normalize(category.getName()) /> 
2153 
2154                    <#if normalizedCategoryName == "espec.-tecnica-de-nivel-medio"> 
2155                    	<a href="/${friendlyUrlUnidade}/especializacao-tecnica" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-especializacao-tecnica" style="order: 1">Especialização Técnica</a> 
2156                   	</#if> 
2157 
2158                </#if> 
2159 
2160            </#list>    
2161 
2162    </div> 
2163 
2164    </div> 
2165 
2166 
2167</section> 
2168  
2169 <script> 
2170 
2171const isMobile = $(window).width() <= 1024 
2172 
2173var temas = []; 
2174var subtemasStorage = new Map(); 
2175var activeCategory = 'all'; 
2176var activeCategoryLevel = 0; 
2177var limit = 2; 
2178var offset = 0; 
2179var todosText = ''; 
2180var limitTodosCursos = 16; 
2181var offsetTodosCursos = 0; 
2182var groupId = 0; 
2183var tipoCursoNome = "${tipoCurso}"; 
2184var categoryIdTipoCurso = 0; 
2185var tipoCursoNomeBreadCrumb = ""; 
2186var cookieName = ""; 
2187var tam = $(window).width(); 
2188var urlUnidade = ""; 
2189var urlTipoCurso = "";  
2190var categoryIdUnidade = ""; 
2191var urlTemasStorage = new Map(); 
2192var urlTemaNv1 = ""; 
2193var urlTemaNv2 = ""; 
2194var urlTemaNv3 = ""; 
2195let urlParamTemaNv3 = '' 
2196var acessoDireto = 0; 
2197var categoryIdTemaNv1 = ""; 
2198var categoryIdTemaNv2 = ""; 
2199var categoryIdTemaNv3 = ""; 
2200const HOST = window.location.origin; 
2201var filtrarInscricoesAbertas = 0; 
2202var filtrarBolsaEstudo = 0; 
2203var activeModeloExibicao = 1; 
2204var limitCursos = isMobile ? 4 : 11; 
2205var cliqueFiltroMobile = 0; 
2206var carregandoMais = false; 
2207var urlSearchTipoCurso = '/o/senac-content-services/idTipoCursoPorNome/{groupId}/{tipoCursoNome}'; 
2208var cardVerTodosTipoCursoClass = '' 
2209let categorias = [] 
2210let categoryWithoutCourse = [] 
2211let friendlyUrlUnidade = '' 
2212 
2213$(document).ready(function(){   
2214    init() 
2215 
2216    //Associa eventos 
2217    $(document).on("click", ".ver-todos-cursos-link", verTodosCursos); 
2218    $(document).on("click", ".card-ver-todos-cursos-link", verTodosCursos); 
2219}) 
2220 
2221function montaBreadCrumb(){ 
2222    var breadCrumb = $(".breadcrumb"); 
2223    var nomeUnidade = $("#nomeUnidadeParaBreadCrumb").text().trim(); 
2224     
2225    breadCrumb.empty(); 
2226     
2227    //Home 
2228    breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/" title="Home"><span class="breadcrumb-text-truncate">Home</span></a></li>'); 
2229     
2230    //Unidades 
2231    breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/unidades" title="Unidades"><span class="breadcrumb-text-truncate">Unidades</span></a></li>'); 
2232     
2233    //Unidade 
2234    breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/'+getFriendlyUrlUnidade()+'" title="'+nomeUnidade+'"><span class="breadcrumb-text-truncate">'+nomeUnidade+'</span></a></li>'); 
2235     
2236    //Tipo de Curso 
2237    breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/'+getFriendlyUrlUnidade()+'/'+getUrlTipoCurso()+'" title="'+tipoCursoNomeBreadCrumb+'"><span class="breadcrumb-text-truncate">'+tipoCursoNomeBreadCrumb+'</span></a></li>'); 
2238     
2239} 
2240 
2241function carregaLinkBotoesLivreETecnico(){ 
2242 
2243  urlUnidade = $("#friendlyUnidade").text().trim(); 
2244  urlTipoCurso = $("#friendlyTipoCurso").text().trim();  
2245       
2246  $.ajax({ 
2247      url : '/o/senac-content-services/url-tipos-de-curso/'+groupId, 
2248      type : 'get', 
2249      dataType: 'json', 
2250  }).done(function(res) { 
2251      $(res).each(function(key , value){ 
2252          if(value.name == 'tecnico'){ 
2253              //botao livre 
2254              $("#linkTecnico").attr('href', "/"+urlUnidade+"/"+value.friendlyURL); 
2255          }else 
2256              if(value.name == 'livre'){ 
2257                  $("#linkLivre").attr('href', "/"+urlUnidade+"/"+ value.friendlyURL); 
2258          } 
2259      });       
2260  }); 
2261} 
2262 
2263 
2264// Botao para filtro de cursos com inscricoes abertas e bolsas 
2265$('#inscricao-aberta input, #bolsas-estudo input').click(function(){ 
2266   
2267  //Atualiza as variaveis globais dos dois filtros 
2268  $("#inscricao-aberta input").is(":checked") == true ? filtrarInscricoesAbertas = 1 : filtrarInscricoesAbertas = 0; 
2269  $("#bolsas-estudo input").is(":checked") == true ? filtrarBolsaEstudo = 1 : filtrarBolsaEstudo = 0; 
2270   
2271  //Refaz a busca com os filtros atualizados 
2272  switch(getCurrentLevel()){ 
2273    case 1: 
2274    case 2:       
2275      //Verifica se esta exibindo todos ou algum tema 
2276      var botaoTodos = $('.todos'); 
2277       
2278      if(botaoTodos.hasClass('ativo') || botaoTodos.hasClass('tema-ativo'))  
2279          $('.todos:first').trigger('click'); 
2280       
2281      //Se estiver ativo um tema, verifica se possui ativo um subtema 
2282      else 
2283        //Verifica o nivel do tema clicado 
2284        $('.subtema-ativo:not(.todos)').length == 0 ? $('.subtema-ativo.todos').trigger('click') : $('.subtema-ativo:first').trigger('click', [$(this)]); 
2285        break; 
2286 
2287    case 3: 
2288      if($('#filtro-temas-nivel-3 .subtema-ativo:not(.todos)').length) { 
2289        const preSelecteds = [] 
2290        document.querySelectorAll('#filtro-temas-nivel-3 .subtema-ativo:not(.todos)') 
2291        .forEach(el => { 
2292          preSelecteds.push(el) 
2293          el.classList.remove('subtema-ativo') 
2294        }) 
2295 
2296        preSelecteds.forEach(async el => await clickTema(el.getAttribute('data-tema'))) 
2297      } else { 
2298        const el = $('#filtro-temas-nivel-3 .todos') 
2299        el.trigger('click') 
2300      } 
2301      break; 
2302  } 
2303}) 
2304 
2305//carrega url com tema clicado 
2306function atualizaUrlBrowser(urlTema,nivel){ 
2307	var path = window.location.pathname; 
2308	var urlFinal = ""; 
2309	 
2310	if(path.indexOf('staging') > 1){ 
2311		urlFinal = "/web/guest-staging"; 
2312	}else 
2313		if(path.indexOf('guest') > 1){ 
2314			urlFinal = "/web/guest"; 
2315		} 
2316 
2317  const pathnames = window.location.pathname.split('/').filter(str => !!str) 
2318	urlFinal += '/' + pathnames[0] + '/' + pathnames[1] 
2319	 
2320	//se for todos os cursos a url fica so /unidade/tipo-curso 
2321	if(nivel > 0){ 
2322    const urlParams = new URLSearchParams(window.location.search); 
2323 
2324		switch(nivel){ 
2325		 
2326			case 1: 
2327				urlTemaNv1 = urlTema; 
2328				urlFinal += "/"+urlTemaNv1; 
2329			break; 
2330			 
2331			case 2: 
2332				urlTemaNv2 = urlTema; 
2333        		urlFinal += tipoCursoNome != "Técnico" ? "/"+urlTemaNv1+"/"+urlTemaNv2 : "/"+urlTemaNv1;				 
2334			break; 
2335			 
2336			case 3: 
2337        		urlTemaNv3 = urlTema; 
2338        		 
2339        		if(tipoCursoNome != "Técnico" ) 
2340        			urlParams.set('q', urlTemaNv3) 
2341 
2342        		urlFinal += tipoCursoNome != "Técnico" ? "/"+urlTemaNv1+"/"+urlTemaNv2: "/"+urlTemaNv1;					 
2343			break; 
2344		 
2345		} 
2346 
2347    	urlFinal += (urlParams.toString() ? '?' + urlParams.toString() : '') 
2348		 
2349	}	 
2350	 
2351	urlFinal = new URL(window.location.origin + urlFinal); 
2352	  if($("#inscricao-aberta input").is(":checked")){ 
2353	    urlFinal.searchParams.set("inscricao", true); 
2354	  }  
2355	  if($("#bolsas-estudo input").is(":checked")){ 
2356	    urlFinal.searchParams.set("bolsa", true); 
2357	  }  
2358	  window.history.pushState('', 'Categoria JavaScript', decodeURIComponent(urlFinal.toString())) 
2359} 
2360 
2361function getUrlTipoCurso(){ 
2362	return $('#friendlyTipoCurso').text().trim(); 
2363} 
2364 
2365function buscaFriendlyUrlTemaEAtualizaBrowser(temaId, nivelClicado){ 
2366	 
2367	var friendlyUrlTema = urlTemasStorage.get(temaId); 
2368	 
2369  if(typeof  friendlyUrlTema === "undefined"){ 
2370    //se ainda nao tem no map, busco via ajax e armazeno no map a url do tema clicado para nao precisar buscar novamente 
2371		$.ajax({ 
2372      url : '/o/senac-content-services/friendlyUrlPorCategoria/'+temaId, 
2373			type : 'get', 
2374			dataType: 'json', 
2375      async: false 
2376		}).done(function(res) { 
2377       
2378      urlTemasStorage.set(temaId,res.url); 
2379			friendlyUrlTema = res.url 
2380 
2381		}) 
2382  } 
2383 
2384  if(nivelClicado == 3){ 
2385    let params = '' 
2386 
2387    document.querySelectorAll("#filtro-temas-nivel-3 a.subtema-ativo") 
2388    .forEach(a => { 
2389      const friendlyUrl = urlTemasStorage.get(parseInt(a.getAttribute('data-tema'))) 
2390      params = (params ? params + ',' : '') + friendlyUrl 
2391    }) 
2392 
2393    atualizaUrlBrowser(params,nivelClicado); 
2394	} else { 
2395    atualizaUrlBrowser(friendlyUrlTema,nivelClicado); 
2396  } 
2397     
2398} 
2399 
2400let isAcessoDireto = false 
2401//verifica se usuario acessou direto pelas urls dos temas e carrega os temas para dar sequencia 
2402async function verificaAcessoDiretoELoadTema(){ 
2403  isAcessoDireto = true 
2404  urlTemaNv1 = $("#friendlyTemaNv1").text().trim(); 
2405  urlTemaNv2 = $("#friendlyTemaNv2").text().trim(); 
2406  urlTemaNv3 = $("#friendlyTemaNv3").text().trim(); 
2407 
2408  const urlParamsTemaNv3 = new URLSearchParams(window.location.search); 
2409  urlParamTemaNv3 = urlParamsTemaNv3.get('q'); 
2410 
2411  carregaTemas() 
2412 
2413  let nivel1CategoryId 
2414  let nivel2CategoryId 
2415  let nivel3CategoryId 
2416 
2417  if(urlTemaNv1) {     
2418    getSubtemas(urlTemaNv1) 
2419    .done(categories => { 
2420      nivel1CategoryId = categories[0].categoryId 
2421      clickTema(nivel1CategoryId) 
2422    }) 
2423  } 
2424 
2425  if(urlTemaNv2){ 
2426    getSubtemas(urlTemaNv2, nivel1CategoryId) 
2427    .done(categories => { 
2428      nivel2CategoryId = categories[0].categoryId 
2429      clickTema(nivel2CategoryId) 
2430    }) 
2431  } 
2432 
2433  if(urlParamTemaNv3) { 
2434    const params = urlParamTemaNv3.split(',') 
2435 
2436    for (let index = 0; index < params.length; index++) { 
2437      const url = params[index]; 
2438 
2439      const categories = await getSubtemas(url, nivel2CategoryId) 
2440       
2441      await clickTema(categories[0].categoryId) 
2442    } 
2443  } 
2444 
2445  isAcessoDireto = false 
2446} 
2447 
2448function getFriendlyUrlUnidade() { 
2449  return $("#friendlyUnidade").text().trim() 
2450} 
2451 
2452/* Prefixa a URL do curso com a unidade atual, pro card novo (PortalView.Card) */ 
2453function hrefResolverUnidade(curso) { 
2454  var cursoUrl = curso.url || ''; 
2455  return (friendlyUrlUnidade && friendlyUrlUnidade.length > 1) 
2456      ? HOST + '/' + friendlyUrlUnidade + '/' + cursoUrl 
2457      : HOST + '/' + cursoUrl; 
2458} 
2459 
2460/* Prepara a montagem inicial da página */ 
2461async function init() { 
2462  var tipoCursoText = $('#tipoCursoText').text().trim(); 
2463 
2464  if(tipoCursoText == "Livre"){ 
2465      tipoCursoNomeBreadCrumb = "Cursos Livres"; 
2466      tipoCursoNome = "Livre"; 
2467      cookieName = "ck-cursos-livre";  
2468      cardVerTodosTipoCursoClass = "livre" 
2469   
2470  }else if(tipoCursoText == "Técnico"){ 
2471      tipoCursoNomeBreadCrumb = "Cursos Técnicos"; 
2472      tipoCursoNome = "Técnico"; 
2473      cookieName = "ck-cursos-tecnico"; 
2474      cardVerTodosTipoCursoClass = "tecnico" 
2475   
2476  }else if(tipoCursoText == "Extensão"){ 
2477      tipoCursoNomeBreadCrumb = "Extensão Universitária"; 
2478      tipoCursoNome = "Extensão"; 
2479      cookieName = "ck-cursos-extensao"; 
2480      cardVerTodosTipoCursoClass = "extensao" 
2481  } 
2482 
2483  montaBreadCrumb() 
2484 
2485  friendlyUrlUnidade = getFriendlyUrlUnidade() 
2486   
2487  const categories = await getSubtemas(friendlyUrlUnidade) 
2488  categoryIdUnidade = categories[0].categoryId 
2489 
2490	urlTipoCurso = getUrlTipoCurso(); 
2491	 
2492	groupId = Liferay.ThemeDisplay.getScopeGroupId(); 
2493	 
2494	$('#tema-atual h2').text(""); 
2495  $('#tema-atual').hide(); 
2496	 
2497	todosText = $('#tema-atual h2').text(); 
2498	 
2499		//Preenche o id do tipo de curso e a modalidade 
2500		var url = urlSearchTipoCurso 
2501		    .replace('{groupId}', groupId) 
2502		    .replace('{tipoCursoNome}', tipoCursoNome); 
2503		     
2504		$.ajax({ 
2505		    url : url, 
2506		    type : 'get', 
2507        async: false 
2508		}).done(function(categoryIdTipoCursoResponse) { 
2509		     
2510		    categoryIdTipoCurso = categoryIdTipoCursoResponse; 
2511		     
2512		}); 
2513 
2514	carregarCategorias() 
2515  verificaFiltroInscricaoBolsaEToggle() 
2516	verificaAcessoDiretoELoadTema() 
2517  visualizarMais() 
2518  hideVisualizarMais() 
2519 
2520  if(isMobile) { 
2521    visualizarMenos() 
2522    showVisualizarMais() 
2523  } 
2524 
2525} 
2526 
2527function verificaFiltroInscricaoBolsaEToggle() { 
2528  const urlParams = new URLSearchParams(window.location.search) 
2529  $('#chkInscricao').prop("checked", urlParams.get('inscricao') == 'true') 
2530  $('#chkInscricao').prop("checked") ? filtrarInscricoesAbertas = 1 : filtrarInscricoesAbertas = 0 
2531  $('#chkInscricao').change(ev => selectFilter('inscricao', $('#chkInscricao')) ) 
2532   
2533  if($('#chkBolsa').length) { 
2534    $('#chkBolsa').prop("checked", urlParams.get('bolsa') == 'true') 
2535    $('#chkBolsa').prop("checked") ? filtrarBolsaEstudo = 1 : filtrarBolsaEstudo = 0 
2536    $('#chkBolsa').change(ev => selectFilter('bolsa', $('#chkBolsa')) )     
2537  } 
2538} 
2539 
2540function carregarCategorias() { 
2541	if(!categorias.length) { 
2542		const searchParams = new URLSearchParams({ 
2543			companyId: themeDisplay.getCompanyId(), 
2544			groupIds: themeDisplay.getScopeGroupId(), 
2545			parentCategoryIds: 0, 
2546			vocabularyIds: document.querySelector('#ssp-vocabulary-id-tema-mercadologico').value 
2547		}) 
2548 
2549		$.ajax({ 
2550			url : '/o/senac-category-services/categories?' + searchParams.toString(), 
2551			method : 'get', 
2552			async: false 
2553		}) 
2554		.done(data => categorias = data) 
2555		.fail(err => console.error(err)) 
2556	} 
2557} 
2558 
2559function selectFilter(paramkey, el) { 
2560  setUrlParam(paramkey, el.prop("checked"))   
2561} 
2562 
2563function setUrlParam(key, value) { 
2564  const url = new URL(window.location.href) 
2565  if(value) 
2566   	url.searchParams.set(key, value); 
2567  else 
2568	url.searchParams.set(key, false) 
2569  window.history.pushState({}, '', decodeURIComponent(url.toString())) 
2570} 
2571	 
2572$(document).on("click", '.ssp-btn__visualizar-mais-content', toggleVisualizarMais) 
2573 
2574function visualizarMenos() { 
2575  const itensTema = $('#temas').children(); 
2576  const itensExibidos = 6; 
2577 
2578  if(isMobile) 
2579    itensTema.slice(itensExibidos).hide(); 
2580 
2581  $('#visualizar-mais').text('Visualizar mais'); 
2582  $('#visualizar-mais').parent().find('i').removeClass('fa-chevron-up'); 
2583  $('#visualizar-mais').parent().find('i').addClass('fa-chevron-down'); 
2584} 
2585 
2586function visualizarMais() { 
2587  const itensTema = $('#temas').children(); 
2588  const itensExibidos = 6; 
2589 
2590  if(isMobile) 
2591    itensTema.slice(itensExibidos).show(); 
2592     
2593  $('#visualizar-mais').text('Visualizar menos'); 
2594  $('#visualizar-mais').parent().find('i').removeClass('fa-chevron-down'); 
2595  $('#visualizar-mais').parent().find('i').addClass('fa-chevron-up'); 
2596} 
2597 
2598function toggleVisualizarMais(){   
2599  if( $('#visualizar-mais').text() === "Visualizar mais" ) 
2600    visualizarMais()					 
2601  else 
2602    visualizarMenos()   
2603} 
2604 
2605function showVisualizarMais() { 
2606  $('.ssp-btn__visualizar-mais-content').show() 
2607} 
2608 
2609function hideVisualizarMais() { 
2610  $('.ssp-btn__visualizar-mais-content').hide() 
2611} 
2612 
2613/* Carrega os subtemas ou cursos ao clicar no tema */ 
2614let lastClicked 
2615$(".container").on( 
2616		"click", 
2617		".tema", 
2618		function() { 
2619      const categoriaId = $(this).data('tema'); 
2620      const isEqualTema = lastClicked == categoriaId 
2621      lastClicked = categoriaId 
2622 
2623      const isTodos = this.classList.contains('todos') 
2624       
2625      activeCategoryLevel = $(this).data('nvl'); 
2626      limit = 2; 
2627			offset = 0;			 
2628			limitTodosCursos = 16; 
2629			offsetTodosCursos = 0; 
2630 
2631      $('#filtro-temas-nivel-2').empty() 
2632			$('#filtro-temas-nivel-3').empty() 
2633 
2634      hideVisualizarMais() 
2635      $('.tema').removeClass('ativo'); 
2636      $('.tema').removeClass('tema-ativo') 
2637      $('.ssp-section-tema__container-menu-item').show() 
2638 
2639      document.querySelector('.ssp-divider').classList.add('d-none') 
2640 
2641      document.querySelector('[data-section="title"]').classList.remove('selected') 
2642 
2643      if(isTodos){ 
2644        document.querySelector('[data-section="title"]').innerHTML = 'Qual a sua área de interesse?' 
2645        document.querySelector('.ssp-divider').classList.remove('d-none') 
2646 
2647        showVisualizarMais() 
2648				atualizaUrlBrowser(0,0); 
2649				$('.todos').addClass('ativo'); 
2650 
2651        if(isMobile) { 
2652          visualizarMenos() 
2653          showVisualizarMais() 
2654        } 
2655      } else { 
2656        document.querySelector('[data-section="title"]').innerHTML = 'Você selecionou:' 
2657        $('.ssp-section-tema__container-menu-item').hide() 
2658        $('.ssp-section-tema__container-menu-item').has(this).show() 
2659 
2660        if(isEqualTema) { 
2661          removeFiltersLevel1() 
2662          return 
2663        } else 
2664          $(this).addClass('tema-ativo') 
2665 
2666        $.ajax( 
2667						{ 
2668							url : '/o/senac-content-services/category/' 
2669									+ $(this).data('tema'), 
2670							type : 'get' 
2671						}).done(function(category) { 
2672	 
2673					activeCategory = JSON.parse(category); 
2674					 
2675					cleanElements(); 
2676 
2677					displayCursosPorTema(); 
2678					 
2679					displaySubTemasLista(); 
2680 
2681          buscaFriendlyUrlTemaEAtualizaBrowser(categoriaId,1); 
2682				}); 
2683				         
2684        if(!this.classList.contains('todos')) { 
2685					hideOthersLevel1(this) 
2686				} 
2687      } 
2688		} 
2689); 
2690 
2691/* Quando clica em Ver Todos cursos de um tema */ 
2692function verTodosCursos(){ 
2693	 
2694	//Scrool top 
2695	$('html, body').animate({ 
2696        scrollTop: $("#temas").offset().top 
2697    }, -1000); 
2698	 
2699	 
2700	var tema = $(this).data('tema'); 
2701	activeCategoryLevel = $(this).data('nvl'); 
2702	 
2703	if(activeCategoryLevel == 1) 
2704		buscaFriendlyUrlTemaEAtualizaBrowser(tema,activeCategoryLevel); 
2705 
2706	// Verifica o elemento, adiciona a classe ativo e remove dos seus primos 
2707	$('.todos').removeClass('ativo'); 
2708	 
2709	limit = 2; 
2710	offset = 0; 
2711 
2712	$.ajax({ 
2713		url : '/o/senac-content-services/category/'+ tema, 
2714		type : 'get' 
2715	}).done(function(category) { 
2716 
2717		activeCategory = JSON.parse(category); 
2718		 
2719		switch(activeCategoryLevel){ 
2720			case 1: 
2721				$('.tema').removeClass('tema-ativo'); 
2722				$('.tema[data-tema="'+activeCategory.categoryId+'"]').not('.slick-cloned').each(function(){ 
2723					if(!$(this).parent().hasClass('slick-cloned')){	 
2724						var botaoTemaVerTodos = $(this); 
2725						botaoTemaVerTodos.trigger('click'); 
2726					} 
2727				}); 
2728				 
2729				break; 
2730			case 2: 
2731					 
2732				var botaoTemaVerTodosNv2 = $('.subtema[data-tema="'+activeCategory.categoryId+'"]'); 
2733				botaoTemaVerTodosNv2.trigger('click'); 
2734				 
2735				break; 
2736			case 3: 
2737				var botaoTemaVerTodosNv3 = $('.subtema[data-tema="'+activeCategory.categoryId+'"]'); 
2738				botaoTemaVerTodosNv3.trigger('click'); 
2739				 
2740				break; 
2741		} 
2742			 
2743		 
2744	}); 
2745} 
2746	 
2747function defaultSubtema(el, temaIds) {   
2748  limit = 2; 
2749  offset = 0; 
2750  limitTodosCursos = 16; 
2751  offsetTodosCursos = 0; 
2752   
2753  $('#cursos-por-subtema-container').find('#curso-sem-slick').empty(); 
2754 
2755  activeCategoryLevel = $(el).data('nvl'); 
2756 
2757  if(!acessoDireto) 
2758    buscaFriendlyUrlTemaEAtualizaBrowser($(el).data('tema'),activeCategoryLevel); 
2759     
2760  cleanElements(); 
2761     
2762  const categories = [] 
2763  temaIds.forEach(id => { 
2764    $.ajax({ 
2765      url : '/o/senac-content-services/category/' + id, 
2766      type : 'get', 
2767      async: false 
2768    }) 
2769    .done((category) => { 
2770      activeCategory = JSON.parse(category) 
2771      categories.push(activeCategory) 
2772    }) 
2773  }); 
2774 
2775  displayCursosPorTema(categories) 
2776} 
2777 
2778// evento de click nos subtemas 
2779$("#filtro-temas-nivel-2") 
2780.on("click", ".subtema", function(ev, trigger) { 
2781   
2782  $(this).siblings('.todos').removeClass("subtema-ativo") 
2783 
2784  if(this.classList.contains('todos') || (this.classList.contains('subtema-ativo') && !trigger)) { 
2785    removeFiltersLevel2() 
2786    return 
2787  } else { 
2788    hideOthersLevel2(this) 
2789    this.classList.add('subtema-ativo') 
2790  } 
2791 
2792  defaultSubtema(this, [$(this).data('tema')]) 
2793}) 
2794 
2795$("#filtro-temas-nivel-3") 
2796.on("click", ".subtema", function(ev) {   
2797   
2798  $(this).siblings('.todos').removeClass("subtema-ativo") 
2799 
2800  if(this.classList.contains('todos')) { 
2801    removeFiltersLevel3() 
2802    return 
2803  } 
2804   
2805  const isActived = this.classList.contains('subtema-ativo') 
2806  if(isActived) 
2807    this.classList.remove('subtema-ativo') 
2808  else 
2809    this.classList.add('subtema-ativo') 
2810   
2811 
2812  const anyActive = !!document.querySelector("#filtro-temas-nivel-3 a.subtema-ativo") 
2813  if(!anyActive) 
2814    removeFiltersLevel3() 
2815 
2816  const temaIds = [] 
2817  document.querySelectorAll("#filtro-temas-nivel-3 a.subtema-ativo:not(.todos)") 
2818  .forEach(a => temaIds.push(a.getAttribute('data-tema'))) 
2819 
2820  defaultSubtema(this, temaIds) 
2821}) 
2822 
2823/* Click no botao todos */ 
2824$(".container").on("click", ".todos:not(.subtema.todos)", function() { 
2825	 
2826	atualizaUrlBrowser(0); 
2827	 
2828	activeCategory = 'all'; 
2829	activeCategoryLevel = $(this).data('nvl'); 
2830	offset = 0; 
2831 
2832	/* Limpa dados de subtemas que possam ter sido criados na navegação */ 
2833	cleanElements(); 
2834 
2835  $('#tema-atual').show() 
2836	$('#tema-atual h2').text(todosText); 
2837	 
2838	// Esconde a div com subtemas 
2839	$('#filtro-temas-nivel-2').empty(); 
2840	$('#filtro-temas-nivel-2').addClass('d-none'); 
2841 
2842	displayCursosPorTema(); 
2843 
2844}); 
2845 
2846/* Limpa a tela para exibição de novos cursos */ 
2847function cleanElements() { 
2848 
2849	$('#subtemas-lista').empty(); 
2850		 
2851	$('#cursos-por-categoria-container .cursos-por-categoria').remove(); 
2852	$('#subtema-atual').empty(); 
2853	$('#cursos-por-subtema-container #subsubtemas-lista').empty(); 
2854	$('#cursos-por-subtema-container .ssp-new-card-course').remove(); 
2855	 
2856	$('#cursos-por-categoria-container').removeClass('d-none'); 
2857	$('#cursos-por-subtema-container').addClass('d-none'); 
2858} 
2859 
2860/* 
2861 * Armazena a navegação em cookies, se habilitado 
2862 */ 
2863$(document).on("click", ".ck-curso", function() { 
2864	 
2865	//Verifica se os alternadores estao selecionados e manipula o link do curso de acordo a eles. 
2866	urlFinal = new URL(window.location.origin + $(this).attr('href')); 
2867	let filtroInscricaoBolsa = false; 
2868	 
2869    if($("#inscricao-aberta input").is(":checked")){ 
2870      urlFinal.searchParams.set("inscricao", true); 
2871      filtroInscricaoBolsa = true; 
2872    }  
2873    if($("#bolsas-estudo input").is(":checked")){ 
2874      urlFinal.searchParams.set("bolsa", true); 
2875      filtroInscricaoBolsa = true; 
2876    }  
2877    $(this).attr('href', urlFinal.pathname + (filtroInscricaoBolsa ? "?"+urlFinal.searchParams : "")) 
2878	 
2879 
2880	//Verifica se o cookie está habilitado 
2881    if(getCookie('portalSenacCookie') != null){ 
2882    	 
2883		var articleId = $(this).data('ck'); 
2884		manageCookieArray(cookieName, articleId); 
2885		manageCookieArray('ck-cursos', articleId); 
2886    } 
2887 
2888}); 
2889 
2890/* 
2891 * Exibe os cursos por tema, dependendo do nivel 
2892 */ 
2893function displayCursosPorTema(categories) {   
2894	hideMensagemSemCurso(); 
2895 
2896	// Verifica o nivel 
2897	switch (activeCategoryLevel) { 
2898 
2899	case 0: // exibe todos 
2900    $('#tema-atual').hide() 
2901		limit = 2; 
2902 
2903		$.each(temas.slice(offset, limit + offset), function(k, t) { 
2904			 
2905			if($('#cursos-por-categoria-'+t.categoryId).length == 0){ 
2906				var template = $('#cursos-por-categoria-template').clone(); 
2907				template.prop('id', 'cursos-por-categoria-'+t.categoryId); 
2908				template.removeClass('d-none'); 
2909				$('#cursos-por-categoria-container').append(template); 
2910			} 
2911			 
2912			$.ajax( 
2913					{ 
2914						url : '/o/senac-content-services/category/' 
2915								+ t.categoryId, 
2916						type : 'get', 
2917            async: false 
2918					}).done(function(category) { 
2919						 
2920						var dadosCategoria = JSON.parse(category); 
2921						 
2922						//monta as divs para cada tcategoria 
2923						var templatePorCategoria = $('#cursos-por-categoria-'+dadosCategoria.categoryId); 
2924						templatePorCategoria.find('.tema-nome').text(dadosCategoria.name); 
2925						templatePorCategoria.find('.ver-todos-cursos-link').attr('data-nvl', 1); 
2926						templatePorCategoria.find('.ver-todos-cursos-link').attr('data-tema', dadosCategoria.categoryId); 
2927						templatePorCategoria.removeClass('d-none'); 
2928 
2929						cursosPorCategoriaModelo1(dadosCategoria); 
2930 
2931			}); 
2932		}); 
2933		 
2934		// Esconde botao carregar mais, se  necessário 
2935		 
2936		$('.section-carregar-mais').remove(); 
2937		 
2938		if (temas.length > limit + offset) 
2939			$('#cursos-por-categoria-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
2940			 
2941		break; 
2942 
2943	case 1: 
2944		limit = 2; 
2945 
2946		$('#tema-atual h2').text("O que você quer aprender nessa área?"); 
2947    $('#tema-atual').show() 
2948		 
2949		// Exibe os cursos dos subtemas do tema clicado percorrendo a lista de 
2950		// subtemas do tema clicado 
2951		if(subtemasStorage.get(activeCategory.categoryId) && subtemasStorage.get(activeCategory.categoryId).length > 0){ 
2952			 
2953			$.each(subtemasStorage.get(activeCategory.categoryId).slice(offset, 
2954					limit + offset), function(k, t) { 
2955				 
2956				if($('#cursos-por-categoria-'+t.categoryId).length == 0){ 
2957					var template = $('#cursos-por-categoria-template').clone(); 
2958					template.prop('id', 'cursos-por-categoria-'+t.categoryId); 
2959	 
2960					template.removeClass('d-none'); 
2961					 
2962					$('#cursos-por-categoria-container').append(template); 
2963				} 
2964				 
2965				$.ajax( 
2966						{ 
2967							url : '/o/senac-content-services/category/' 
2968									+ t.categoryId, 
2969							type : 'get', 
2970            async: false 
2971						}).done(function(category) { 
2972							 
2973							var dadosCategoria = JSON.parse(category); 
2974							 
2975							//monta as divs para cada tcategoria 
2976							var templatePorCategoria = $('#cursos-por-categoria-'+dadosCategoria.categoryId); 
2977							templatePorCategoria.find('.tema-nome').text(dadosCategoria.name); 
2978							templatePorCategoria.find('.ver-todos-cursos-link').attr('data-nvl', 2); 
2979							templatePorCategoria.find('.ver-todos-cursos-link').attr('data-tema', dadosCategoria.categoryId); 
2980							templatePorCategoria.removeClass('d-none'); 
2981 
2982							cursosPorCategoriaModelo1(dadosCategoria); 
2983	 
2984				}); 
2985			}); 
2986			 
2987			// Esconde botao carregar mais, se  necessário 
2988			$('.section-carregar-mais').remove(); 
2989			 
2990			if (subtemasStorage.get(activeCategory.categoryId).length > limit + offset) 
2991				$('#cursos-por-categoria-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
2992			 
2993		}else{ 
2994			//Se nao tiver subtema, exibe o modelo 2 
2995			cursosPorCategoriaModelo2(); 
2996		} 
2997 
2998		break; 
2999 
3000	case 2: // exibe cursos do nivel 2 
3001		limitTodosCursos = 16; 
3002		cursosPorCategoriaModelo2(); 
3003		break; 
3004		 
3005	case 3: 
3006    // subtemas de nivel 3 nao devem ter limite 
3007    limitTodosCursos = ($('#filtro-temas-nivel-3 .subtema-ativo:not(.todos)').length) ? -1 : 16; 
3008		cursosPorCategoriaModelo3(categories); 
3009		break; 
3010	} 
3011   
3012} 
3013 
3014/* 
3015 * Faz a exibição dos cursos quando se carrega a tela ou clica em 'Todos' 
3016 */ 
3017async function cursosPorCategoriaModelo1(category) { 
3018 
3019	activeModeloExibicao = 1; 
3020	categoryWithoutCourse = [] 
3021	hideMensagemSemCurso() 
3022 
3023	function limparCategoria() { 
3024		$('#cursos-por-categoria-'+category.categoryId).html(''); 
3025 
3026		//essa classe tirar todo o padding da div, escondendo ela 
3027		$('#cursos-por-categoria-'+category.categoryId).removeClass('ssp-section'); 
3028 
3029		if(isMobile){ 
3030			var $element = document.getElementById('cursos-por-categoria-container'); 
3031			var _elementPos = $element.offsetTop + 100; 
3032			var _scrollDown = _elementPos + (filtrarInscricoesAbertas == 1 || filtrarBolsaEstudo == 1 ? 300 : 1); 
3033			window.scrollTo(window.scrollX || window.pageXOffset, _scrollDown);//carrega os cursos 
3034			setTimeout(()=> window.scrollTo(window.scrollX || window.pageXOffset, _elementPos), 500);//mostra o primeiro 
3035 
3036		}else{ 
3037			var _scrollDown = (window.scrollY || window.pageYOffset) + (filtrarInscricoesAbertas == 1 || filtrarBolsaEstudo == 1 ? 20 : 1); 
3038			window.scrollTo(window.scrollX || window.pageXOffset, _scrollDown); 
3039		} 
3040	} 
3041 
3042	try { 
3043 
3044		if(typeof CursoService !== 'object') throw new Error('Missing CursoService from script js-portal-services'); 
3045 
3046		loading('#cursos-por-categoria-'+category.categoryId+' .slider-curso'); 
3047 
3048		const cursosPorCategoria = await CursoService.buscaCursos({ 
3049			area : [category.categoryId], 
3050			tipoCurso : [categoryIdTipoCurso], 
3051			unidade : [categoryIdUnidade], 
3052			turmasCompra : filtrarInscricoesAbertas == 1, 
3053			turmasBolsa : filtrarBolsaEstudo == 1, 
3054			start : 0, 
3055			end : limitCursos 
3056		}); 
3057 
3058		var totalCursos = cursosPorCategoria.total; 
3059 
3060		//Se nao retornou cursos, deve esconder a div da categoria 
3061		if(totalCursos == 0){ 
3062			limparCategoria(); 
3063			updateMensagemSemCurso(); 
3064			return; 
3065		} 
3066 
3067		if(!$('#cursos-por-categoria-'+category.categoryId).hasClass('ssp-section')) 
3068			$('#cursos-por-categoria-'+category.categoryId).addClass('ssp-section'); 
3069 
3070		var template = $('#cursos-por-categoria-'+category.categoryId); 
3071 
3072		template.find('.slider-curso').empty(); 
3073 
3074		//if(!isMobile) template.find('.slider-curso').addClass('slick-area--md-bleed slider-container'); 
3075 
3076		const cursosListId = 'lista-cursos-' + category.categoryId; 
3077		const $swiperCursosList = await PortalView.Card.createCardsCursosList( 
3078			cursosPorCategoria.cursos, cursosListId, 'horizontal', 
3079			{ cardsLimit : limitCursos, hideGeolocation : true, hrefResolver : hrefResolverUnidade } 
3080		); 
3081 
3082		const $cardVerTodos = $swiperCursosList.querySelector('.card-ver-todos-cursos-link'); 
3083		if($cardVerTodos) { 
3084			$cardVerTodos.setAttribute('data-nvl', (activeCategoryLevel + 1)); 
3085			$cardVerTodos.setAttribute('data-tema', category.categoryId); 
3086		} 
3087 
3088		template.find('.slider-curso').append($swiperCursosList); 
3089 
3090		PortalView.Card.initSwiperCursos('#' + $swiperCursosList.id); 
3091 
3092		updateMensagemSemCurso(); 
3093 
3094	} catch(err) { 
3095		console.error(err); 
3096		limparCategoria(); 
3097	} finally { 
3098		enableScroll(true); 
3099	} 
3100} 
3101 
3102/* 
3103 * Faz a exibição dos cursos quando se clica em temas nivel 2 
3104 */ 
3105function cursosPorCategoriaModelo2() { 
3106	 
3107	activeModeloExibicao = 2; 
3108  categoryWithoutCourse = [] 
3109  hideMensagemSemCurso() 
3110 
3111  $('#tema-atual').hide() 
3112	$("#tema-atual h2").html(''); 
3113	 
3114	// Busca os filhos (3 nivel) 
3115	$.ajax({ 
3116		url : '/o/senac-unidade-services/subtemasPorTipoCursoETemaEUnidade/'+ groupId+ '/'+ activeCategory.categoryId+ '/'+ tipoCursoNome+'/'+categoryIdUnidade, 
3117		type : 'get', 
3118		data : {} 
3119		}).done(function(subtemas) { 
3120			 
3121			enableScroll(true); 
3122 
3123			subtemas = JSON.parse(subtemas); 
3124			 
3125      let subsubtemaLista = '' ;  
3126       
3127			if(subtemas.length > 0) { 
3128				subsubtemaLista = '<h3 class="ssp-title-filtrar-mais">Filtrar mais:</h3>'; 
3129        const btnTodos = '<a href="#a" '  
3130        + ' class="subtema btn-nivel-3 subtema-ativo todos" ' 
3131				+ '" data-nvl="2" >' 
3132				+ 'Todos' 
3133				+ '</a>' 
3134       
3135        subsubtemaLista += btnTodos 
3136      } 
3137 
3138			$.each(subtemas, function(k, v) { 
3139				subsubtemaLista += '<a href="#a" class="subtema btn-nivel-3" data-tema="' 
3140						+ v.categoryId 
3141						+ '" data-nvl="3" >' 
3142						+ v.name 
3143						+ '</a>'; 
3144			}); 
3145 
3146      const containerSubTemaLista = document.createElement('div') 
3147      containerSubTemaLista.classList.add('row') 
3148      containerSubTemaLista.innerHTML = subsubtemaLista 
3149			$('#filtro-temas-nivel-3').html(containerSubTemaLista.outerHTML); 
3150			 
3151			if(subtemas.length > 0) $('#filtro-temas-nivel-3').removeClass('d-none'); 
3152 
3153			cursosPorCategoriaModelo3(); 
3154 
3155	}) 
3156	 
3157} 
3158 
3159async function getCursosByCategory(category) { 
3160  if(activeCategory == 'all') 
3161    return [] 
3162 
3163  return await CursoService.buscaCursos({ 
3164    area : [category.categoryId], 
3165    tipoCurso : [categoryIdTipoCurso], 
3166    unidade : [categoryIdUnidade], 
3167    turmasCompra : filtrarInscricoesAbertas == 1, 
3168    turmasBolsa : filtrarBolsaEstudo == 1, 
3169    start : offsetTodosCursos, 
3170    end : limitTodosCursos + offsetTodosCursos 
3171  }); 
3172} 
3173/* 
3174 * Faz a exibição dos cursos quando se clica em temas nivel 3 
3175 */ 
3176async function cursosPorCategoriaModelo3(categories) {   
3177	activeModeloExibicao = 3; 
3178  categoryWithoutCourse = [] 
3179  hideMensagemSemCurso() 
3180 
3181	//Se já estiver carregando não deixa juntar várias chamadas 
3182	if($('#loading-todos-cursos').length > 0) return; 
3183	 
3184	//Loading 
3185	$('#cursos-por-categoria-container').append('<div id="loading-todos-cursos" style="width:100%; text-align:center">'+ 
3186	'<div class="ssp-loader-content">'+ 
3187	'<div class="ssp-loader"></div>'+ 
3188	'<p class="ssp-loader-text">Carregando...</p>'+ 
3189	'</div>'+ 
3190	'</div>'); 
3191  $("#tema-atual").hide() 
3192	$("#tema-atual h2").html(''); 
3193	   
3194  categories = categories && categories.length ? categories : [activeCategory] 
3195   
3196  const cursosPorSubtema = [] 
3197  var totalCursos = 0; 
3198  var templateContainer = $('#cursos-por-subtema-container'); 
3199  if(offsetTodosCursos == 0) templateContainer.find('#curso-sem-slick').empty(); 
3200 
3201  try { 
3202 
3203    for (let index = 0; index < categories.length; index++) { 
3204      const category = categories[index]; 
3205 
3206      const cursosEncontrados = await getCursosByCategory(category) 
3207 
3208      if(!cursosEncontrados || !cursosEncontrados.cursos || !cursosEncontrados.cursos.length) 
3209        categoryWithoutCourse.push(category) 
3210 
3211      totalCursos += cursosEncontrados.total || 0; 
3212 
3213      (cursosEncontrados.cursos || []).forEach(cEncontrado => { 
3214        if(!cursosPorSubtema.filter(c => c.articleId == cEncontrado.articleId).length) 
3215            cursosPorSubtema.push(cEncontrado) 
3216      }) 
3217    } 
3218 
3219    $('.ssp-loader-content').parent().remove(); 
3220 
3221    if(!cursosPorSubtema.length) { 
3222      updateMensagemSemCurso() 
3223      return 
3224    } 
3225 
3226    const $cards = await PortalView.Card.buildCardsCurso(cursosPorSubtema, { 
3227      hideGeolocation : true, 
3228      hrefResolver : hrefResolverUnidade 
3229    }); 
3230 
3231    $cards.forEach(function($card) { 
3232      templateContainer.find('#curso-sem-slick').append($card); 
3233    }); 
3234 
3235    templateContainer.removeClass('d-none'); 
3236 
3237    var totalCursosExibicao = $('#curso-sem-slick .ssp-new-card-course').length; 
3238 
3239    // Esconde botao carregar mais, se  necessário 
3240    $('.section-carregar-mais').remove(); 
3241 
3242    if (totalCursosExibicao < totalCursos) 
3243      $('#cursos-por-subtema-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
3244 
3245    updateMensagemSemCurso(); 
3246 
3247  } catch(err) { 
3248    console.error(err); 
3249    $('.ssp-loader-content').parent().remove(); 
3250    updateMensagemSemCurso(); 
3251  } finally { 
3252    enableScroll(true) 
3253  } 
3254} 
3255 
3256function montaTextoTipoCursoParaCard(curso){ 
3257	 
3258	var tipoCursoNomeFinal = curso.tipoCursoNome + " ¿ " + curso.formatos[0].name;	                 			  
3259 
3260	if(curso.tipoCursoNome == "Livre") 
3261		tipoCursoNomeFinal = "Livre"; 
3262		//tipoCursoNomeFinal = "Curso " + curso.tipoCursoNome + " ¿ " + curso.formatos[0].name; 
3263	 
3264	return tipoCursoNomeFinal; 
3265} 
3266 
3267//ao final de todos os ajax, se não houver curso na pag por causa dos filtros, exibimos mensagem de nenhum curso 
3268$(document).ajaxStop(function () { 
3269  $(".card-curso-nivel-2").each(function () { 
3270    if($(this).children().length == 0) 
3271      $(this).remove() 
3272  }); 
3273});	 
3274 
3275function hideMensagemSemCurso() { 
3276	const $msg = $("#filtroSemCurso"); 
3277	if(!$msg.hasClass('d-none')) $msg.addClass('d-none'); 
3278} 
3279function updateMensagemSemCurso() { 
3280	 
3281	if($(".ssp-new-card-course").not('.cursos-recentes-card').not('.d-none').length > 0 || $('#curso-sem-slick .ssp-new-card-course').length > 0){ 
3282		hideMensagemSemCurso(); 
3283		return; 
3284  	} 
3285 
3286	let htmlSemCurso = '' 
3287	 
3288	switch (getCurrentLevel()) { 
3289	case 1: 
3290	case 2: 
3291		htmlSemCurso = getTextoSemCurso(filtrarBolsaEstudo,filtrarInscricoesAbertas,activeCategory.name) 
3292		$(".ssp-bolsa-formulario__card-aviso-texto").html(htmlSemCurso); 
3293		break; 
3294 
3295	case 3: 
3296		categoryWithoutCourse 
3297		.forEach(category => { 
3298		const el = document.querySelector('[data-tema="' + category.categoryId + '"]') 
3299		if(el) { 
3300			const temaName = el.text 
3301			htmlSemCurso += getTextoSemCurso(filtrarBolsaEstudo, filtrarInscricoesAbertas, temaName) 
3302		} 
3303		}) 
3304		if(!htmlSemCurso) 
3305		htmlSemCurso = getTextoSemCurso(filtrarBolsaEstudo,filtrarInscricoesAbertas,activeCategory.name) 
3306 
3307		$(".ssp-bolsa-formulario__card-aviso-texto").html(htmlSemCurso); 
3308		break; 
3309 
3310	default: 
3311		break; 
3312	} 
3313	 
3314	if(htmlSemCurso){ 
3315		$("#filtroSemCurso").removeClass("d-none"); 
3316	} 
3317} 
3318 
3319function getTextoSemCurso(filtroBolsa,filtroInsc,temaNome){ 
3320	 
3321	temaNome = typeof temaNome === "undefined" ? '' : 'de '+temaNome; 
3322	 
3323	if(filtroBolsa && filtroInsc) 
3324		return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> disponíveis para compra e com bolsas de estudo.<br>Selecione outras áreas para consultar bolsas ou <a href='https://www.sp.senac.br/bolsas-de-estudo'>confira bolsas disponíveis em diferentes cursos.</a></p>"; 
3325	else if(filtroBolsa) 
3326		return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> com bolsas de estudo.<br>Selecione outras áreas para consultar bolsas ou <a href='https://www.sp.senac.br/bolsas-de-estudo'>confira bolsas disponíveis em diferentes cursos.</a></p>";	 
3327	else if(filtroInsc) 
3328		return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> disponíveis para compra."; 
3329 
3330  return '' 
3331} 
3332 
3333/* 
3334 * Monta a lista de temas de curso livre no header da página 
3335 */ 
3336 
3337function carregaTemas() { 
3338 
3339	$ 
3340			.ajax( 
3341					{ 
3342						url : '/o/senac-unidade-services/temasPorTipoCursoEUnidade/'+groupId+'/'+tipoCursoNome+'/'+categoryIdUnidade, 
3343						type : 'get', 
3344            async: false 
3345					}) 
3346			.done( 
3347					function(temasLista) { 
3348            if(typeof temasLista != 'object') 
3349						  temasLista = JSON.parse(temasLista); 
3350 
3351						var temasObj = $('#temas'); 
3352 
3353						$ 
3354								.each( 
3355										temasLista, 
3356										function(k, tema) { 
3357											const icon = (categorias.filter(cat => cat.categoryId == tema.categoryId)[0] || {properties: {}}).properties.icon 
3358											temasObj 
3359													.append('<div class="ssp-section-tema__container-menu-item mega-menu"><a href="#a" class="tema" data-nvl="1" data-tema="' 
3360															+ tema.categoryId 
3361															+ '">' 
3362															+ '<i class="' + icon + '"></i>' 
3363															+ tema.name 
3364															+ '</a></div>'); 
3365 
3366											// Armazena os subtemas deste tema 
3367											$ 
3368													.ajax( 
3369															{ 
3370																url : '/o/senac-unidade-services/subtemasPorTipoCursoETemaEUnidade/'+ groupId+ '/'+ tema.categoryId+ '/'+ tipoCursoNome+'/'+categoryIdUnidade, 
3371																type : 'get', 
3372																data : {}, 
3373                                async: false 
3374															}) 
3375													.done( 
3376															function(subtemas) { 
3377																subtemasStorage 
3378																		.set( 
3379																				tema.categoryId, 
3380																				JSON 
3381																						.parse(subtemas)); 
3382 
3383															}); 
3384										}); 
3385 
3386						temas = temasLista; 
3387										 
3388						displayCursosPorTema(); 
3389 
3390						$('.todos').addClass('ativo'); 
3391  
3392					}).fail(function(jqXHR, textStatus, msg) { 
3393				// alert(msg); 
3394			}); 
3395} 
3396 
3397/* 
3398 * Exibe a lista de subtemas no mouse over do tema 
3399 */ 
3400function displaySubTemasLista(categoryId) { 
3401	$('#filtro-temas-nivel-2').empty(); 
3402	$('#filtro-temas-nivel-2').removeClass('d-none'); 
3403	 
3404  const btnTodos = $('<a href="#a" '  
3405        + ' class="subtema btn-nivel-3 subtema-ativo todos" ' 
3406				+ '" data-nvl="2" >' 
3407				+ 'Todos' 
3408				+ '</a>') 
3409 
3410  $('#filtro-temas-nivel-2').append(btnTodos); 
3411 
3412  if(!subtemasStorage.get(activeCategory.categoryId) || !subtemasStorage.get(activeCategory.categoryId).length) 
3413    $('#filtro-temas-nivel-2 .subtema-ativo.todos').hide() 
3414         
3415	$.each(subtemasStorage.get(activeCategory.categoryId), function(k, t) { 
3416		$('#filtro-temas-nivel-2').append('<a href="#a" class="subtema btn-nivel-3" data-tema="' 
3417				+ t.categoryId 
3418				+ '" data-nvl="2" >' 
3419				+ t.name 
3420				+ '</a>'); 
3421	}); 
3422} 
3423 
3424//Carregar mais 
3425$(window).scroll(function() { 
3426	 
3427	var element = document.querySelector('#carregar-mais'); 
3428	 
3429	if(element != null && !carregandoMais){ 
3430		var position = element.getBoundingClientRect(); 
3431	 
3432		// carregar maios 
3433		if(position.top >= 0 && position.bottom <= window.innerHeight) { 
3434			// enableScroll(false); 
3435			var qtCardsSubTema = $('#cursos-por-subtema-container .ssp-new-card-course').not('.d-none').length; 
3436			if(qtCardsSubTema > 0){ 
3437				offsetTodosCursos = qtCardsSubTema; 
3438				$('.section-carregar-mais').remove(); 
3439			}else{ 
3440				offset = $('.cursos-por-categoria').not('.d-none').length; 
3441			} 
3442 
3443      const urlParamsTemaNv3 = new URLSearchParams(window.location.search); 
3444      urlParamTemaNv3 = urlParamsTemaNv3.get('q'); 
3445 
3446      if(!urlParamTemaNv3) 
3447			  displayCursosPorTema();			 
3448		} 
3449	} 
3450	 
3451}); 
3452 
3453function enableScroll(enable) { 
3454    if(enable === false) document.body.classList.add("stop-scrolling") 
3455    else document.body.classList.remove("stop-scrolling"); 
3456    carregandoMais = !enable; 
3457} 
3458 
3459function hideOthersLevel1(elementShow){ 
3460  document.querySelectorAll('#temas .ssp-section-tema__container-menu-item a') 
3461  .forEach(a => a != elementShow ? a.classList.add('d-none') : undefined) 
3462} 
3463 
3464function hideOthersLevel2(elementShow){ 
3465	document.querySelectorAll('#filtro-temas-nivel-2 a') 
3466	.forEach(a => a != elementShow ? a.classList.add('d-none') : undefined) 
3467} 
3468 
3469function hideOthersLevel3(elementShow){ 
3470	document.querySelectorAll('#filtro-temas-nivel-3 a') 
3471	.forEach(a => a != elementShow ? a.classList.add('d-none') : undefined) 
3472} 
3473 
3474function showAllLevel1(){ 
3475  document.querySelectorAll('#temas .ssp-section-tema__container-menu-item a') 
3476  .forEach(btn => { 
3477    btn.classList.remove('d-none') 
3478    btn.classList.remove('ativo') 
3479    btn.classList.remove('tema-ativo') 
3480  }) 
3481} 
3482 
3483function showAllLevel2(){ 
3484  document.querySelectorAll('#filtro-temas-nivel-2 a') 
3485  .forEach(btn => { 
3486    btn.classList.remove('d-none') 
3487    btn.classList.remove('subtema-ativo') 
3488  }) 
3489} 
3490 
3491function showAllLevel3(){ 
3492  document.querySelectorAll('#filtro-temas-nivel-3 a') 
3493  .forEach(btn => { 
3494    btn.classList.remove('d-none') 
3495    btn.classList.remove('subtema-ativo') 
3496  }) 
3497} 
3498 
3499function removeFiltersLevel1() { 
3500  showAllLevel1() 
3501 
3502  const btnActived = document.querySelector('#temas .ssp-section-tema__container-menu-item .todos') 
3503  btnActived.click() 
3504} 
3505 
3506function removeFiltersLevel2() { 
3507  const btnActived = document.querySelector('#temas .tema-ativo') 
3508  btnActived.click() 
3509 
3510  new Promise(() => btnActived.click()) 
3511} 
3512 
3513function removeFiltersLevel3() { 
3514  const btnActivedNivel2 = document.querySelector('#filtro-temas-nivel-2 .subtema-ativo:not(.todos)') 
3515  const temaNivel2 = btnActivedNivel2.getAttribute('data-tema') 
3516 
3517  removeFiltersLevel2() 
3518 
3519  const intervalNível2 = setInterval(() => { 
3520    const btn = document.querySelector('[data-tema="' + temaNivel2 + '"]') 
3521 
3522    if(btn) { 
3523      btn.click() 
3524      $('.ssp-loader-content').parent().remove(); 
3525      clearInterval(intervalNível2) 
3526    } 
3527  }, 200); 
3528} 
3529 
3530function clickTema(categoryId) { 
3531  return new Promise(resolve => { 
3532    const interval = setInterval(() => { 
3533      const el = document.querySelector('[data-tema="' + categoryId + '"]') 
3534   
3535      if(el) { 
3536        el.click() 
3537        clearInterval(interval) 
3538        resolve() 
3539      } 
3540    }, 200); 
3541  }) 
3542} 
3543 
3544function getSubtemas(categoryFriendlyUrl, parentCategoryId) { 
3545  return $.ajax({ 
3546    url : '/o/senac-unidade-services/categoriaPorFriendlyURL/'+categoryFriendlyUrl+"/"+(parentCategoryId || 0), 
3547    type : 'get', 
3548    dataType: 'json', 
3549    async: false 
3550  }) 
3551} 
3552 
3553function getCategoriesIdNivel3Actived() { 
3554  const categories = [] 
3555 
3556  document.querySelectorAll("#filtro-temas-nivel-3 a.subtema-ativo") 
3557  .forEach(a => categories.push(parseInt(a.getAttribute('data-tema')))) 
3558 
3559  return categories 
3560} 
3561 
3562function getCurrentLevel() { 
3563  let level = 1 
3564   
3565  if(document.querySelector('#temas .tema-ativo')) 
3566    level = 1 
3567 
3568  if(document.querySelector('#filtro-temas-nivel-2 .subtema-ativo')) 
3569    level = 2 
3570   
3571  if(document.querySelector('#filtro-temas-nivel-3 .subtema-ativo')) 
3572    level = 3 
3573 
3574  return level 
3575} 
3576 
3577 
3578</script>