Si è verificato un errore nell'elaborarazione del modello.
The following has evaluated to null or missing:
==> response.data.docs.getJSONObject(0)  [in template "3572636#3572671#4212428" at line 21, column 24]

----
Tip: If the failing expression is known to be 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 doc = response.data.docs.getJ...  [in template "3572636#3572671#4212428" at line 21, column 9]
----
1<#import "_TEMPLATE_CONTEXT_/3572636/3574130/23609/3793037" as d40> 
2 
3<#setting url_escaping_charset="UTF-8"> 
4 
5<#assign 
6    PUTIL = objectUtil("com.liferay.portal.kernel.util.PortalUtil") 
7    uuid = themeDisplay.getURLCurrent()?keep_after("-/c/n/")?keep_after_last("_") 
8    langId = locale?keep_before("_") 
9    contentType = "event" 
10    vueActions = "" 
11    doc = "" 
12    lat = "0" 
13    lng = "0" 
14    hasCoords = false 
15/> 
16 
17<#if uuid?has_content> 
18    <#assign response = d40.fetchData("https://guestapp.d40.it/v1/search/apt-trento/${contentType}/?uuid=${uuid}")> 
19     
20    <#if !response.error && response.data.docs?has_content> 
21        <#assign doc = response.data.docs.getJSONObject(0)> 
22         
23        ${request.session.removeAttribute("circularCategories")} 
24        ${request.session.setAttribute("circularCategories", doc.details.assetCategoryIds)} 
25    </#if> 
26</#if> 
27 
28<#if doc?has_content> 
29    <#if doc.details?? && doc.details.name[langId]?has_content> 
30        ${PUTIL.setPageTitle(doc.details.name[langId], request)} 
31    </#if> 
32     
33    <#assign vueActions = "getFavorites();"> 
34     
35    <#if doc.details.location.geoCoords.lat?has_content && doc.details.location.geoCoords.lon?has_content> 
36        <#assign 
37            hasCoords = true 
38            lat = doc.details.location.geoCoords.lat 
39            lng = doc.details.location.geoCoords.lon 
40            vueActions = "getFavorites();buildMap(${lat}, ${lng})" 
41        /> 
42    </#if> 
43</#if> 
44 
45<style> 
46    .swiper-button-next:after{ 
47        content: ""; 
48
49    .swiper-button-prev:after{ 
50        content: ""; 
51
52    .bg-darkgray{ 
53        background-color: #e5e5e5 !important; 
54
55    .min-h-12{ 
56        min-height: 3rem; 
57
58    .-ml-5{ 
59        margin-left: -5%; 
60
61</style> 
62 
63<div v-scope id="${d40.portletNamespace}" @vue:mounted="${vueActions}" v-cloak> 
64    <#if doc?has_content> 
65        <#if themeDisplay.getLayout().getAncestors()?has_content> 
66            <section id="breadcrumb" class="z-15 mt-25"> 
67                <div class="container"> 
68                    <ol class="breadcrumb flex lg:justify-center"> 
69                        <li class="pl-1 text-sm mr-2 relative">${d40.getLabel("sei_in")}:</li> 
70                         
71                        <li class="breadcrumb-item"> 
72                            <a href="/" class="breadcrumb-link" title="Home"> 
73                                <span class="breadcrumb-text-truncate text-dark underline">Home</span> 
74                            </a> 
75                        </li> 
76                         
77                        <#list themeDisplay.getLayout().getAncestors()?reverse as ancestor> 
78                            <li class="breadcrumb-item"> 
79                                <a href="${ancestor.getFriendlyURL()}" class="breadcrumb-link" title="${d40.escape(ancestor.getHTMLTitle(locale))}"> 
80                                    <span class="breadcrumb-text-truncate text-dark underline"> 
81                                        ${d40.escape(ancestor.getHTMLTitle(locale))} 
82                                    </span> 
83                                </a> 
84                            </li> 
85                        </#list> 
86                         
87                        <li class="breadcrumb-item active"> 
88                            <span class="breadcrumb-text-truncate text-dark"> 
89                                ${doc.details.name[langId]} 
90                            </span> 
91                        </li> 
92                    </ol> 
93                </div> 
94            </section> 
95        </#if> 
96         
97        <section class="relative mt-20"> 
98            <div class="container"> 
99                <div class="row"> 
100                    <div class="col-12 col-lg-7"> 
101                        <div class="card-row flex-col lg:flex-row mb-10"> 
102                            <div class="autofit-col autofit-col-expand order-2 lg:order-1"> 
103                                <div class="autofit-section"> 
104                                    <p class="text-dark font-semibold font-heading text-3xl lg:text-4xl uppercase"> 
105                                        ${doc.details.name[langId]} 
106                                    </p> 
107                                </div> 
108                            </div> 
109                            <div class="autofit-col justify-start order-1 lg:order-2 mb-3 lg:mb-0"> 
110                                <div class="autofit-section"> 
111                                    <div class="flex space-x-4"> 
112                                        <button type="button" v-if="isFavorite('${doc.uuid}')" @click="removeFavorite($event, '${doc.uuid}')" class="btn btn-link px-2"> 
113                                            <i class="fas fa-heart text-dark fa-2x"></i> 
114                                        </button> 
115                                        <button type="button" v-else @click="setFavorite($event, {id: '${doc.uuid}', contentJSON: {title: '${doc.details.name[langId]?js_string}', previewDescription: '', description: '', geoRef: '', previewPicture: '${d40.getDTNPreview(doc)}', viewUrl: '${d40.getDTNUrl(doc.details.name[langId], doc.uuid, contentType)}'}})" class="btn btn-link px-2"> 
116                                            <i class="fal fa-heart text-dark fa-2x"></i> 
117                                        </button> 
118                                         
119                                        <button type="button" @click="share('${doc.details.name[langId]}', '')" class="btn btn-link px-2"> 
120                                            <i class="fas fa-share-alt text-dark fa-2x"></i> 
121                                        </button> 
122                                    </div> 
123                                </div> 
124                            </div> 
125                        </div> 
126                         
127                        <#if doc.details.description[langId]?has_content> 
128                            <div class="underline-grow text-dark font-light lg:text-lg leading-loose"> 
129                                ${doc.details.description[langId]} 
130                            </div> 
131                        </#if> 
132                         
133                        <#if doc.timetables.timeDescription[langId]?has_content> 
134                            <div class="text-dark text-lg font-light mb-5 mt-10"> 
135                                ${doc.timetables.timeDescription[langId]?keep_before("<br><p><b>")} 
136                            </div> 
137                        </#if> 
138                         
139                        <#if doc.details.howToArrive?has_content && doc.details.howToArrive[langId]?has_content> 
140                            <div class="text-dark text-lg font-light mb-5 mt-10"> 
141                                <b>${d40.getLabel("come_arrivare")}:</b> 
142                                ${doc.details.howToArrive[langId]} 
143                            </div> 
144                        </#if> 
145                         
146                        <#-- <#if d40.isDev> --> 
147                        <#if doc.booking?has_content> 
148                            <#if doc.booking.bookable?has_content && doc.booking.bookable> 
149                                <#if doc.booking.standartPrices?has_content> 
150                                    <#attempt> 
151                                        <div class="text-dark text-lg font-light mb-5 mt-10"> 
152                                            <#list doc.booking.standartPrices.iterator() as single_price > 
153                                                <#if single_price[langId]?has_content> 
154                                                 
155                                                    <#if single_price?index == 0> 
156                                                        <p class="mt-3"><b>${d40.getLabel("costo_biglietto")}:</b></p> 
157                                                        <ul style="padding-left:0;list-style: none;"> 
158                                                    </#if> 
159                                                 
160                                                    <li> 
161                                                        • ${single_price[langId]} 
162                                                    </li> 
163                                                </#if> 
164                                            </#list> 
165                                            </ul> 
166                                        </div> 
167                                    <#recover> 
168                                        <div style="display:none !important;"></div> 
169                                    </#attempt> 
170                                </#if> 
171                            </#if> 
172                        </#if> 
173                        <#-- </#if> --> 
174 
175                    </div> 
176                     
177                    <div class="xl:absolute col-12 col-lg-5 xl:max-w-xl lg:right-0"> 
178                        <div class="bg-light"> 
179                            <div class="card-body px-5 pt-5 lg:px-10 lg:pt-10 pb-0"> 
180                                <p class="text-dark font-bold uppercase text-lg mb-0"> 
181                                    ${d40.getLabel("informazioni_contatti")} 
182                                </p> 
183                                <#if doc.details.townLabel != "{}"> 
184                                    <p class="text-dark text-lg mb-0"> 
185                                        ${d40.getLabel("localita")}: <span class="text-capitalize">${doc.details.townLabel[langId]}</span> 
186                                    </p> 
187                                </#if> 
188                                <#if doc.details.location.address.fulltext?? && doc.details.location.address.fulltext?has_content> 
189                                    <p class="text-dark text-lg mb-0"> 
190                                        ${doc.details.location.address.fulltext} 
191                                    </p> 
192                                </#if> 
193                                <#if doc.timetables.timeInfos?has_content> 
194                                    <p class="text-dark font-bold text-lg mb-0 mt-3"> 
195                                        ${d40.getLabel("date_evento")} 
196                                    </p> 
197                                </#if> 
198                            </div> 
199                             
200                            <#if doc.timetables.timeInfos?has_content> 
201                                <div class="flex min-h-12"> 
202                                    <details class="bg-darkgray w-full lg:w-105% right-0 -ml-5"> 
203                                        <summary class="btn btn-link text-dark no-underline my-1 ml-12"> 
204                                            <i class="fal fa-calendar-alt"></i> 
205                                             
206                                            <#attempt> 
207                                                <#assign day_count = 0> 
208                                                 
209                                                <#list doc.timetables.timeInfos.getJSONObject(0).openingDays.iterator()?keys as single_day > 
210                                                    <#assign day_count += 1> 
211                                                </#list> 
212                                                 
213                                                <div style="display:none !important;"> 
214                                                    ${jsonFactoryUtil.looseSerialize(day_count)} 
215                                                </div> 
216                                            <#recover> 
217                                                <#assign test = doc.timetables.timeInfos.getJSONObject(0).openingDays /> 
218                                                <div style="display:none !important;"> 
219 
220                                                </div> 
221                                            </#attempt> 
222                                             
223                                             
224                                            <#assign  
225                                                split_fdf = doc.timetables.timeInfos.getJSONObject(0).dateFrom?split('-')  
226                                                split_fdt = doc.timetables.timeInfos.getJSONObject(0).dateTo?split('-') 
227                                                fdf = split_fdf[2]+"."+split_fdf[1]+"."+split_fdf[0] 
228                                                fdt = split_fdt[2]+"."+split_fdt[1]+"."+split_fdt[0] 
229                                                ftf = doc.timetables.timeInfos.getJSONObject(0).timeFrom 
230                                                ftt = doc.timetables.timeInfos.getJSONObject(0).timeTo 
231                                            />    
232                                             
233                                            <#if fdf == fdt> 
234                                                ${fdf} 
235                                            <#else> 
236                                                ${d40.getLabel("dal")} ${fdf} ${d40.getLabel("al")} ${fdt} 
237                                            </#if> 
238                                             
239                                            <i class="fal fa-chevron-down fa-lg ml-5"></i> 
240                                        </summary> 
241                                         
242                                        <#if doc.timetables.timeDescription[langId]?has_content> 
243                                            <div class="card-body px-5 lg:px-15"> 
244                                                <div class="text-dark"> 
245                                                    ${doc.timetables.timeDescription[langId]?keep_after('<br>')?keep_before("<br><p><b>")} 
246                                                </div> 
247                                            </div> 
248                                        </#if> 
249                                         
250                                        <#-- <#if d40.isDev> --> 
251                                        <#if doc.booking?has_content> 
252                                            <#if doc.booking.bookable?has_content && doc.booking.bookable> 
253                                                <#if doc.booking.standartPrices?has_content> 
254                                                    <#attempt> 
255                                                        <div class="card-body px-5 lg:px-15"> 
256                                                            <#list doc.booking.standartPrices.iterator() as single_price > 
257                                                                <#if single_price[langId]?has_content> 
258                                                                 
259                                                                    <#if single_price?index == 0> 
260                                                                        <p class="mt-3"><b>${d40.getLabel("costo_biglietto")}:</b></p> 
261                                                                        <ul style="padding-left:0;list-style: none;"> 
262                                                                    </#if> 
263                                                                 
264                                                                    <li> 
265                                                                        • ${single_price[langId]} 
266                                                                    </li> 
267                                                                </#if> 
268                                                            </#list> 
269                                                            </ul> 
270                                                        </div> 
271                                                    <#recover> 
272                                                        <div style="display:none !important;"></div> 
273                                                    </#attempt> 
274                                                </#if> 
275                                            </#if> 
276                                        </#if> 
277                                        <#-- </#if> --> 
278                                         
279                                        <div class="card-body px-5 lg:px-10" style="display:none"> 
280                                            <ul> 
281                                                <#list doc.timetables.timeInfos.iterator() as datetime> 
282                                                    <li class="text-dark mb-1"> 
283 
284                                                        <#assign  
285                                                            split_df = datetime.dateFrom?split('-')  
286                                                            split_dt = datetime.dateTo?split('-') 
287                                                            df = split_df[2]+"."+split_df[1]+"."+split_df[0] 
288                                                            dt = split_dt[2]+"."+split_dt[1]+"."+split_dt[0] 
289                                                            tf = datetime.timeFrom 
290                                                            tt = datetime.timeTo 
291                                                        />    
292                                                         
293                                                        <#if df == dt> 
294                                                            ${d40.getLabel("il")} ${df} - ${tf} - ${tt} 
295                                                        <#else> 
296                                                            ${d40.getLabel("dal")} ${df} ${d40.getLabel("al")} ${dt} - ${tf} - ${tt} 
297                                                        </#if> 
298                                                    </li> 
299                                                </#list> 
300                                            </ul> 
301                                        </div> 
302                                    </details> 
303                                </div> 
304                            </#if> 
305                             
306                            <div class="card-body px-5 lg:px-10"> 
307                                <#if doc.contacts.getJSONObject(0).address.fulltext?? && doc.contacts.getJSONObject(0).address.fulltext?has_content> 
308                                    <p class="text-dark font-bold uppercase text-lg mb-0"> 
309                                        ${d40.getLabel("organizzazione")} 
310                                    </p> 
311                                </#if> 
312 
313                                <#if doc.contacts.getJSONObject(0).supplierName?? && doc.contacts.getJSONObject(0).supplierName?has_content> 
314                                    <p class="text-dark text-lg mb-1 font-bold"> 
315                                        ${doc.contacts.getJSONObject(0).supplierName} 
316                                    </p> 
317                                </#if> 
318                             
319                                <#if doc.contacts.getJSONObject(0).address.fulltext?? && doc.contacts.getJSONObject(0).address.fulltext?has_content> 
320                                    <p class="text-dark text-lg mb-1"> 
321                                        ${doc.contacts.getJSONObject(0).address.fulltext} 
322                                    </p> 
323                                </#if> 
324                                 
325                                <#if doc.contacts.getJSONObject(0).telephone?? && doc.contacts.getJSONObject(0).telephone?has_content> 
326                                    <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone> 
327                                        <#if phone?? && phone?has_content> 
328                                            <a href="tel:${phone}" class="block no-underline text-dark text-lg space-x-2 mb-0"> 
329                                                <#assign clear_phone = phone?replace('+39', '')/> 
330                                                <#if clear_phone?starts_with("0461")> 
331                                                    <#assign display_phone = clear_phone?replace('0461', '0461 ')/> 
332                                                <#else> 
333                                                    <#attempt> 
334                                                        <#assign  
335                                                            pre_chunk = clear_phone[0..2] 
336                                                            display_phone = pre_chunk+" "+clear_phone[3..] 
337                                                        /> 
338                                                    <#recover> 
339                                                    </#attempt> 
340                                                </#if> 
341     
342                                                <#if display_phone?? && display_phone?has_content> 
343                                                    <i class="far fa-phone text-dark"></i> 
344                                                    <u>${display_phone}</u> 
345                                                </#if> 
346                                            </a> 
347                                        </#if> 
348                                    </#list> 
349                                </#if> 
350                                <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content> 
351                                    <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="block no-underline text-dark text-lg space-x-2 mb-0"> 
352                                        <i class="far fa-envelope text-dark"></i> 
353                                        <u>${doc.contacts.getJSONObject(0).mail}</u> 
354                                    </a> 
355                                </#if> 
356                                <#if doc.contacts.getJSONObject(0).websiteUrl[langId]?? && doc.contacts.getJSONObject(0).websiteUrl[langId]?has_content> 
357                                    <a href="${doc.contacts.getJSONObject(0).websiteUrl[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank"> 
358                                        <i class="far fa-external-link text-dark"></i> 
359                                        <u>${d40.getLabel("sito_web")}</u> 
360                                    </a> 
361                                </#if> 
362                                 
363                                <#if doc.contacts.getJSONObject(0).socialRefs.facebook?? && doc.contacts.getJSONObject(0).socialRefs.facebook?has_content> 
364                                    <a href="${doc.contacts.getJSONObject(0).socialRefs.facebook[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank"> 
365                                        <i class="fab fa-facebook-square text-dark"></i> 
366                                        <u>facebook</u> 
367                                    </a> 
368                                </#if> 
369                                 
370                                <#if doc.contacts.getJSONObject(0).socialRefs.twitter?? && doc.contacts.getJSONObject(0).socialRefs.twitter?has_content> 
371                                    <a href="${doc.contacts.getJSONObject(0).socialRefs.twitter[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank"> 
372                                        <i class="fab fa-twitter-square text-dark"></i> 
373                                        <u>twitter</u> 
374                                    </a> 
375                                </#if> 
376                                 
377                                <#if doc.contacts.getJSONObject(0).socialRefs.instagram?? && doc.contacts.getJSONObject(0).socialRefs.instagram?has_content> 
378                                    <a href="${doc.contacts.getJSONObject(0).socialRefs.instagram[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank"> 
379                                        <i class="fab fa-instagram-square text-dark"></i> 
380                                        <u>instagram</u> 
381                                    </a> 
382                                </#if> 
383                                 
384                                <a href="/richiesta-informazioni" class="btn bg-green text-white font-bold uppercase px-4 py-2 rounded-0 mt-10"> 
385                                    ${d40.getLabel("richiedi_info")} 
386                                </a> 
387                            </div> 
388                            <#if hasCoords> 
389                                <div class="relative flex h-70"> 
390                                    <div class="absolute w-full lg:w-105% h-full right-0"> 
391                                        <div id="suggesto-map" class="monochrome-map size-full border-0"></div> 
392                                    </div> 
393                                </div> 
394                             
395                                <div class="card-body p-5 lg:px-10"> 
396                                    <a href="https://www.google.com/maps/@${lat},${lng},14z" class="d-block no-underline space-x-5" target="_blank"> 
397                                        <span class="font-bold text-dark uppercase"> 
398                                            ${d40.getLabel("indicazioni_stradali")} 
399                                        </span> 
400                                        <img src="${d40.icons_folder}/arrow_circle-dark.svg" class="w-20" /> 
401                                    </a> 
402                                </div> 
403                            </#if> 
404                        </div> 
405                    </div> 
406                </div> 
407            </div> 
408        </section> 
409         
410        <#if doc.details.images?has_content> 
411            <#assign usePreview = false> 
412             
413            <section id="gallery" class="relative overflow-x-hidden mt-20 lg:mt-40"> 
414                <div class="container"> 
415                    <p class="text-dark uppercase text-lg lg:text-3xl mb-7"> 
416                        ${d40.getLabel("galleria_immagini")} 
417                    </p> 
418                     
419                    <div class="swiper-container"> 
420                        <div class="swiper-wrapper"> 
421                            <#if doc.details.cover != "[]"> 
422                                <#assign usePreview = true> 
423                                 
424                                <#list doc.details.cover.iterator() as pic> 
425                                    <div class="swiper-slide"> 
426                                        <a href="javascript:void(0);" class="card shadow-none border-0 bg-transparent no-underline" data-toggle="modal" data-target="#lightbox-modal" data-slider="${pic?index}" data-senna-off="true"> 
427                                            <div class="relative"> 
428                                                <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" /> 
429                                            </div> 
430                                        </a> 
431                                    </div> 
432                                     
433                                    <#break> 
434                                </#list> 
435                            </#if> 
436                             
437                            <#list doc.details.images.iterator() as pic> 
438                                <#if usePreview> 
439                                    <#assign counter = pic?counter> 
440                                <#else> 
441                                    <#assign counter = pic?index> 
442                                </#if> 
443                                 
444                                <div class="swiper-slide"> 
445                                    <a href="javascript:void(0);" class="card shadow-none border-0 bg-transparent no-underline" data-toggle="modal" data-target="#lightbox-modal" data-slider="${counter}" data-senna-off="true"> 
446                                        <div class="relative"> 
447                                            <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload rounded-custom size-full fit-cover" alt="" /> 
448                                        </div> 
449                                    </a> 
450                                </div> 
451                            </#list> 
452                        </div> 
453                    </div> 
454                </div> 
455                <div class="btn-square absolute btn-prev bg-white left-0"> 
456                    <span class="sr-only">${d40.getLabel("precedente")}</span> 
457                    <i class="fas fa-chevron-left text-dark w-6 h-6"></i> 
458                </div> 
459                <div class="btn-square absolute btn-next bg-white right-0"> 
460                    <span class="sr-only">${d40.getLabel("successivo")}</span> 
461                    <i class="fas fa-chevron-right text-dark w-6 h-6"></i> 
462                </div> 
463            </section> 
464             
465            <div id="lightbox-modal" tabindex="-1" role="dialog" class="modal fade"> 
466                <div class="modal-dialog modal-full-screen inset-0 border-0 shadow-none"> 
467                    <div class="modal-content bg-transparent"> 
468                        <div class="modal-body overflow-hidden"> 
469                            <div class="absolute top-0 right-0 z-5"> 
470                                <button type="button" data-dismiss="modal" class="btn btn-monospaced btn-secondary m-3"> 
471                                    <span class="sr-only">${d40.getLabel("chiudi")}</span> 
472                                    <i class="fal fa-times fa-lg"></i> 
473                                </button> 
474                            </div> 
475                             
476                            <#-- lightbox --> 
477            				<div id="lightbox-swiper" class="swiper-container h-75 my-auto"> 
478            				    <div class="swiper-button-prev w-12 h-12"> 
479                                    <span class="sticker sticker-circle bg-green size-full"> 
480                                        <span class="sticker-overlay"> 
481                                            <i class="fas fa-chevron-left fa-2x text-white"></i> 
482                                        </span> 
483                                    </span> 
484                                </div> 
485                                 
486                                <div class="swiper-button-next w-12 h-12"> 
487                                    <span class="sticker sticker-circle bg-green size-full"> 
488                                        <span class="sticker-overlay"> 
489                                            <i class="fas fa-chevron-right fa-2x text-white"></i> 
490                                        </span> 
491                                    </span> 
492                                </div> 
493                                 
494                                <div class="swiper-wrapper h-full"> 
495                                    <#if doc.details.cover != "[]"> 
496                                        <#list doc.details.cover.iterator() as pic> 
497                                            <div class="swiper-slide h-full"> 
498                                                <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt=""> 
499                                            </div> 
500                                            <#break> 
501                                        </#list> 
502                                    </#if> 
503                                     
504                                    <#list doc.details.images.iterator() as pic> 
505                                        <div class="swiper-slide h-full"> 
506                                            <img data-src="${d40.getKitPrefix(pic[langId], 'n-full_hd')}" loading="lazy" class="lazyload flex h-full object-contain mx-auto" alt=""> 
507                                        </div> 
508                                    </#list> 
509                                </div> 
510                            </div> 
511                             
512                            <#-- thumbnails --> 
513            				<div id="thumbnail-swiper" class="swiper-container" thumbsSlider=""> 
514                                <div class="swiper-wrapper"> 
515                                    <#if doc.details.cover != "[]"> 
516                                        <#list doc.details.cover.iterator() as pic> 
517                                            <div class="swiper-slide"> 
518                                                <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt=""> 
519                                            </div> 
520                                            <#break> 
521                                        </#list> 
522                                    </#if> 
523                                     
524                                    <#list doc.details.images.iterator() as pic> 
525                                        <div class="swiper-slide"> 
526                                            <img data-src="${d40.getKitPrefix(pic[langId], 'n-preview_h')}" loading="lazy" class="lazyload object-cover cursor-pointer size-full" alt=""> 
527                                        </div> 
528                                    </#list> 
529                                </div> 
530                            </div> 
531                        </div> 
532                    </div> 
533                </div> 
534            </div> 
535        </#if> 
536         
537        <#-- SEZIONE NON USATA 
538        <section class="mt-20"> 
539            <div class="container"> 
540                <div class="bg-light max-w-xl p-5 lg:p-10"> 
541                    <div class="card-row space-x-5"> 
542                        <div class="autofit-col"> 
543                            <div class="autofit-section"> 
544                                <i class="fas fa-download text-dark w-7 h-7"></i> 
545                            </div> 
546                        </div> 
547                        <div class="autofit-col autofit-col-expand"> 
548                            <div class="autofit-section"> 
549                                <p class="text-dark font-bold text-lg lg:text-xl uppercase mb-0"> Programma completo </p> 
550                            </div> 
551                        </div> 
552                    </div> 
553                </div> 
554                 
555                <div class="row mt-10 lg:mt-20"> 
556                    <div class="col-12 col-lg-8"> 
557                        <div class="space-y-10"> 
558                            <p class="text-dark uppercase text-lg lg:text-3xl"> 
559                                ${d40.getLabel("dettagli")} 
560                            </p> 
561                            <div class="space-y-5"> 
562                                <div class="row"> 
563                                    <div class="col-12 col-md-3 col-lg-2"> 
564                                        <p class="text-dark font-bold uppercase">Data</p> 
565                                    </div> 
566                                    <div class="col-12 col-md-9 col-lg-10"> 
567                                        <div class="text-dark font-light text-lg"> 
568                                            Dettagli 
569                                        </div> 
570                                    </div> 
571                                </div> 
572                            </div> 
573                        </div> 
574                    </div> 
575                </div> 
576            </div> 
577        </section> 
578        --> 
579         
580        <#-- <section class="mt-20"> 
581            <div class="container"> 
582                <div class="bg-light"> 
583                    <div class="space-y-10 p-5 lg:p-10"> 
584                        <p class="text-dark uppercase text-lg lg:text-3xl mb-0"> 
585                            ${d40.getLabel("organizzazione")} 
586                        </p> 
587                        <div class="space-y-2"> 
588                            <#if doc.contacts.getJSONObject(0).address.fulltext?? && doc.contacts.getJSONObject(0).address.fulltext?has_content> 
589                                <p class="text-dark mb-0"> 
590                                    ${doc.contacts.getJSONObject(0).address.fulltext} 
591                                </p> 
592                            </#if> 
593                             
594                            <#if doc.contacts.getJSONObject(0).mail?? && doc.contacts.getJSONObject(0).mail?has_content> 
595                                <a href="mailto:${doc.contacts.getJSONObject(0).mail}" class="d-block text-dark underline"> 
596                                    ${doc.contacts.getJSONObject(0).mail} 
597                                </a> 
598                            </#if> 
599                             
600                            <#if doc.contacts.getJSONObject(0).telephone?? && doc.contacts.getJSONObject(0).telephone?has_content> 
601                                <#list doc.contacts.getJSONObject(0).telephone.iterator() as phone> 
602                                    <p class="text-dark mb-0"> 
603                                        <span class="font-bold">${d40.getLabel("telefono")}:</span> 
604                                        ${phone} 
605                                    </p> 
606                                </#list> 
607                            </#if> 
608                             
609                            <#if doc.contacts.getJSONObject(0).socialRefs.facebook?? && doc.contacts.getJSONObject(0).socialRefs.facebook?has_content> 
610                                <a href="${doc.contacts.getJSONObject(0).socialRefs.facebook[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank"> 
611                                    <i class="fab fa-facebook-square text-dark"></i> 
612                                    <u>facebook</u> 
613                                </a> 
614                            </#if> 
615                             
616                            <#if doc.contacts.getJSONObject(0).socialRefs.twitter?? && doc.contacts.getJSONObject(0).socialRefs.twitter?has_content> 
617                                <a href="${doc.contacts.getJSONObject(0).socialRefs.twitter[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank"> 
618                                    <i class="fab fa-twitter-square text-dark"></i> 
619                                    <u>twitter</u> 
620                                </a> 
621                            </#if> 
622                             
623                            <#if doc.contacts.getJSONObject(0).socialRefs.instagram?? && doc.contacts.getJSONObject(0).socialRefs.instagram?has_content> 
624                                <a href="${doc.contacts.getJSONObject(0).socialRefs.instagram[langId]}" class="block no-underline text-dark text-lg space-x-2 mb-0" target="_blank"> 
625                                    <i class="fab fa-instagram-square text-dark"></i> 
626                                    <u>instagram</u> 
627                                </a> 
628                            </#if> 
629                        </div> 
630                    </div> 
631                </div> 
632            </div> 
633        </section> --> 
634         
635        <#-- SEZIONE NON USATA 
636        <section class="mt-10"> 
637            <div class="container"> 
638                <p class="text-dark uppercase text-lg lg:text-3xl mb-7"> Info sezione </p> 
639                <p class="text-dark text-lg font-light mb-0"> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p> 
640            </div> 
641        </section> 
642        --> 
643    <#else> 
644        <div class="text-center mt-35"> 
645            <p class="text-dark"> 
646                ${d40.getLabel("errore_caricamento_contenuto")} 
647            </p> 
648        </div> 
649    </#if> 
650</div> 
651 
652<script type="module"> 
653    import { createApp } from "https://cdnjs.cloudflare.com/ajax/libs/petite-vue/0.4.1/petite-vue.es.min.js"; 
654 
655    createApp({ 
656        isMobile: window.innerWidth < 768, 
657        favorites: [], 
658        getFavorites() { 
659            if(localStorage.getItem("favorites") !== null) { 
660    			this.favorites = JSON.parse(localStorage.getItem("favorites")); 
661
662        }, 
663        setFavorite(e, item) { 
664            e.preventDefault(); 
665    		this.getFavorites(); 
666     
667    		var newFavorite = { 
668    			id: item.id, 
669        			contentJSON: { 
670    				title: item.contentJSON.title, 
671    				previewDescription: item.contentJSON.previewDescription, 
672    				description: item.contentJSON.description, 
673    				geoRef: item.contentJSON.geoRef, 
674    				previewPicture: item.contentJSON.previewPicture, 
675    				viewUrl: item.contentJSON.viewUrl, 
676    				type: "lfr", 
677
678    		}; 
679     
680    		this.favorites.push(newFavorite); 
681    		this.saveFavorites(); 
682    	}, 
683    	removeFavorite(e, itemId) { 
684    	    e.preventDefault(); 
685    		this.favorites = this.favorites.filter((obj) => obj.id !== itemId); 
686    		this.saveFavorites(); 
687    	}, 
688    	saveFavorites() { 
689    		localStorage.setItem("favorites", JSON.stringify(this.favorites)); 
690    	}, 
691    	isFavorite(itemId) { 
692    		if (this.favorites.some((e) => e.id == itemId)) { 
693    			return true; 
694
695     
696    		return false; 
697    	}, 
698    	buildMap(lat, lng) { 
699            var map = new SuggestoMap("suggesto-map"), 
700                location = [parseFloat(lat), parseFloat(lng)]; 
701             
702            var svgIcon = L.divIcon({ 
703                html: ` 
704                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 44.537 64.343"> 
705                        <path d="M32.952,68c-4.491-5.935-9.221-11.692-12.837-18.251-3.4-6.175-5.892-12.453-4.094-19.725,2.422-9.787,12.253-17.363,22.112-16.878,11.322.558,20.189,8.638,21.649,19.385.8,5.867-1.25,10.892-3.84,15.837A105.38,105.38,0,0,1,43.958,65.889c-.687.844-1.309,1.739-1.96,2.611-.953,1.06-1.971,2.068-2.841,3.191-.965,1.245-1.729,1.629-2.844.1A50.506,50.506,0,0,0,32.952,68m4.722-46.328A14.156,14.156,0,0,0,23.76,35.59c-.168,7.053,6.542,13.748,13.813,13.783A14.234,14.234,0,0,0,51.46,35.693,14.138,14.138,0,0,0,37.674,21.676" transform="translate(-15.419 -13.129)" fill="#5098c6"/> 
706                        <path d="M31.941,63.206A50.288,50.288,0,0,1,35.3,67c1.116,1.526,1.878,1.142,2.844-.1.87-1.123,1.889-2.132,2.841-3.191a8.579,8.579,0,0,1,5.414,2.22c1.659,1.642,1.586,3.631-.455,4.627a21.209,21.209,0,0,1-16.871.723c-1.611-.565-3.293-1.51-3.092-3.645.19-2.018,1.855-2.718,3.511-3.342.833-.315,1.791-.363,2.447-1.079" transform="translate(-14.408 -8.331)" fill="#222"/> 
707                        <path d="M36.946,20.929A14.137,14.137,0,0,1,50.732,34.944,14.236,14.236,0,0,1,36.844,48.626c-7.27-.036-13.98-6.732-13.813-13.783A14.157,14.157,0,0,1,36.946,20.929m-.023,5.445a8.4,8.4,0,1,0,8.394,8.22,8.5,8.5,0,0,0-8.394-8.22" transform="translate(-14.69 -12.381)" fill="#fdfcf9"/> 
708                        <path d="M36.45,25.9a8.4,8.4,0,0,1,.077,16.809A8.405,8.405,0,1,1,36.45,25.9" transform="translate(-14.218 -11.905)" fill="#222"/> 
709                    </svg>`, 
710                className: "", 
711                iconSize: [44.537, 64.343], 
712                iconAnchor: [22.287, 64.343], 
713            }); 
714                 
715            var mapData = { 
716                tilelayer: "osm", 
717                gestureHandling: true, 
718                fitBounds: false, 
719                mapcenter: location, 
720                zoom: 15, 
721                markersFilter: "*", 
722                markers: [], 
723                layers: [] 
724            }; 
725                 
726            map.sm.createMap(mapData); 
727             
728            L.circleMarker(location, { 
729                radius: 0, 
730                color: "#000", 
731                fillOpacity: 0, 
732                weight: 0 
733            }).addTo(map.sm.lmap); 
734             
735            L.marker(location, { 
736                icon: svgIcon 
737            }).addTo(map.sm.lmap); 
738        }, 
739        share(title, desc, mode = "legacy") { 
740            if (this.isMobile) { 
741                var shareData = { 
742                    title: title, 
743                    text: desc, 
744                    url: window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D") 
745                }; 
746 
747                try { 
748                    navigator.share(shareData); 
749                } catch (err) { 
750                    console.error("Error sharing: " + err); 
751 
752                    if (mode == "legacy") { 
753                        this.legacyShare(); 
754                    } else if (mode == "social") { 
755                        this.socialShare(title, desc); 
756
757
758            } else { 
759                if (mode == "legacy") { 
760                    this.legacyShare(); 
761                } else if (mode == "social") { 
762                    this.socialShare(title, desc); 
763
764
765        }, 
766        legacyShare() { 
767            var clip = document.createElement("input"), 
768                toCopy = window.location.href.replaceAll("{", "%7B").replaceAll("}", "%7D"); 
769 
770            document.body.appendChild(clip); 
771            clip.value = toCopy; 
772            clip.select(); 
773            clip.setSelectionRange(0, 999999); 
774 
775            navigator.clipboard.writeText(clip.value); 
776            document.body.removeChild(clip); 
777 
778            alert("Link copiato"); 
779        }, 
780        socialShare(title, desc, image = "") { 
781            var link = "#", 
782                winHeight = 450, 
783                winWidth = 600, 
784                winTop = window.screen.height / 2 - winHeight / 2, 
785                winLeft = window.screen.width / 2 - winWidth / 2, 
786                params = "scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=" + winWidth + ",height=" + winHeight + ",left=" + winLeft + ",top=" + winTop; 
787 
788            link = "http://www.facebook.com/sharer.php?s=100&p[title]=" + encodeURIComponent(title) + "&p[summary]=" + encodeURIComponent(desc) + "&p[url]=" + window.location.href + "&p[images][0]=" + image; 
789 
790            window.open(link, "Facebook", params); 
791
792    }).mount("#${d40.portletNamespace}"); 
793</script> 
794 
795<#if doc?has_content> 
796    <script> 
797        document.addEventListener("DOMContentLoaded", function(){ 
798            if(${(doc.details.images?has_content)?c}){ 
799                new Swiper("#gallery .swiper-container", { 
800                    slidesPerView: 1, 
801                    spaceBetween: 50, 
802                    centerSlides: true, 
803                    centerInsufficientSlides: true, 
804                    breakpoints: { 
805                        768: { 
806                            slidesPerView: 2, 
807                            spaceBetween: 25 
808                        }, 
809                        992: { 
810                            slidesPerView: 3, 
811                            spaceBetween: 25 
812
813                    }, 
814                    navigation: { 
815                        prevEl: "#gallery .btn-prev", 
816                        nextEl: "#gallery .btn-next" 
817
818                }); 
819                 
820                var thumbnails = new Swiper("#thumbnail-swiper", { 
821                    spaceBetween: 10, 
822                    slidesPerView: 2, 
823                    centerInsufficientSlides: true, 
824                    freeMode: true, 
825                    watchSlidesVisibility: true, 
826                    watchSlidesProgress: true, 
827        			breakpoints: { 
828        				768: { 
829        					slidesPerView: 3 
830        				}, 
831        				992: { 
832        					slidesPerView: 4 
833        				}, 
834        				1200: { 
835        					slidesPerView: 5 
836
837        			}, 
838                }); 
839                 
840                var lightbox = new Swiper("#lightbox-swiper", { 
841        		    spaceBetween: 10, 
842                    autoHeight: true, 
843                    observer: true, 
844                    observeSlideChildren: true, 
845                    keyboard: { 
846                        enabled: true 
847                    }, 
848                    navigation: { 
849                        nextEl: ".swiper-button-next", 
850                        prevEl: ".swiper-button-prev" 
851                    }, 
852                    thumbs: { 
853                        swiper: thumbnails 
854
855                }); 
856                 
857                $("#lightbox-modal").on("shown.bs.modal", function(e){ 
858                    lightbox.update(); 
859                    thumbnails.update(); 
860                    lightbox.slideTo($(e.relatedTarget).data("slider")); 
861                    lightbox.update(); 
862                }); 
863                 
864                $("#lightbox-modal .swiper-wrapper").on("click", function(e){ 
865                    if($(e.target).attr("class").includes("swiper-slide")){ 
866                        $("#lightbox-modal").modal("hide"); 
867
868                }); 
869
870        }); 
871    </script> 
872</#if>