PageSourceSearch

https://bars.su/bitrix/cache/js/s1/main_adaptive/page_97f69e7cdaaa…a25fbc8ab94eadb82b9a4_v1.js?176424308488951

js bars.su collected 2026-09-26 16:34:59 UTC 88,951 bytes, 1,565 lines download raw bytes

1
2; /* Start:"a:4:{s:4:"full";s:69:"/bitrix/templates/main_adaptive/scripts/lists/news.js?172794262448434";s:6:"source";s:53:"/bitrix/templates/main_adaptive/scripts/lists/news.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3/*
4 Классы dom:
5	.-list-items блок dom, в который будут положены list items
6	.-list-loader лоадер, который будет показан во время обновления 
7 */
8function CList(opts){
9
10	/*** defaults ***/
11	var self = {
12		pcode: 'CList', // имя класса
13		opts: {
14			props: [], // массив свойств
15			area: '.-list-container', // блок dom, в котором производится работа
16			loader: '.-list-loader', // это или селектор jquery, или объект, типа delayedLoader
17			grdeg: '.-list-noscript-version', // селектор блока, который показывается при gracefull degradation, когда либо js отключен, либо список, либо doInitialUpdate == true
18			responser: null,
19			
20			doInitialUpdate: true, // если true, то апдейт произойдёт при первой же загрузке
21			matchDomain: false, // проверяет соответствие домена указанному. если домены не совпадают, дальнейшая работа скрипта прекращается
22			scrollTopOnResort: true, // если true, список будет прокручиваться к верху при каждом обновлении сортировки
23			scrollTopOnUpd: true, // если true, список будет прокручиваться к верху при каждом обновлении свойств
24			ignoreDuplCalls: false, // если true и свойства пощёлкали и не изменили - перезагрузки не будет
25			
26			lazyOutput: false, // отображение новых элементов при прокрутке страницы вниз (альтернатива постраничной навигации)
27			loAsk: 2, // количество подгрузок, после которых автоподгрузка осуществляется только по нажатию кнопки "more..."
28			
29			addItemsByOne: true, // добавлять в список элементы по одному, или сразу пачкой. ставь true, если привязываешь к элементам ещё какую-то функцониональность. ставь false, если элементы тяжёлые
30			wrapPages: false, // 
31
32			// кнопка вверх-вниз
33			upDistFromBottom: 300, // расстояние от низа экрана до кнопок "наверх" и "обратно"
34			upDistFromCenter: 520, // расстояние от центра сайта до кнопок "наверх" и "обратно"
35			upMinShowScrollTop: 500, // сколько должно проскроллится вниз, чтобы кнопка "наверх" появилась
36			downHideScrollTop: 100, // сколько должно проскроллится вниз, чтобы кнопка "обратно" скрылась
37
38			navOpts: {}, // опции постраничного навигатора
39
40			whenListContainerClear: function(){ // когда производится очистка от старых элементов при обновлении списка
41				this.ctrls.list.css('height', this.ctrls.list.height()).empty();
42			},
43			whenHtmlWrap: function(html){return html}, // вызывается перед вставкой блока в список. может применяться для модификации html		
44			whenListContainerFilled: function(){ // когда добавлена первая пачка элементов
45				this.ctrls.list.css('height','auto');
46			},
47			
48			onReset: function(){}, // вызывается, когда происходит сброс значений списка
49			onSortSwitch: function(){}, // вызывается при смене направления сортировки
50			onBeforeRefresh: function(){}, // вызывается перед началом изменения списка
51			onAfterRefresh: function(){}, // вызывается после изменения списка
52			onLazyGoesOff: function(){}, // вызывается, когда происходит переключение с lazy-режима в ручной режим
53			onPage: function(p){}, // вызывается, когда загружается страница p
54			onPagerPage: function(p){}, // вызывается, когда щёлкнули по странице в навигаторе
55			
56			debTimeout: 200, // таймаут дебонса реакции на изменения свойств
57		},
58		vars: {
59			entId: Math.ceil(Math.random()*1000),
60			sort: {
61				by: typeof(opts.sortBy) == 'string' ? opts.sortBy : false,
62				order: typeof(opts.sortOrder) == 'string' ? opts.sortOrder : false
63			},
64			
65			// lazy load
66			lazyManual: false, // включен ручной метод подгрузки контента (с кнопки "загрузить ещё")
67			lazyAllowed: false, // флаг, который не дает сработать следующему событию lazyload, пока не отработало предыдущее
68			
69			// other
70			prevFields: {}, // кеш значений свойств. позволяет не производить никаких действий, если значение свойств не поменялось
71			jumpPos: -1, // координата для кнопки "наверх" и "обратно"
72			lazyTimes: 0 // количество подгрузок, которые уже были с момента последней очистки списка
73		},
74		ctrls: {}, // ссылки на контролы
75		tmpls: {} // ссылки на шаблоны
76	};
77	if(typeof opts == 'object')
78		$.extend(self.opts, opts);
79
80	/*** public ***/
81	/* methods */
82	// добавляет новые свойства в список существуюших
83	self.addProps = function(props){
84		$.each(props, function(i, item){
85			item.vars.parent = self;
86			sv.props[item.opts.code] = item;
87		});
88	}
89	// сброс списка
90	self.reset = function(){
91		so.onReset.call(self);
92		
93		sv.nav.page(1);
94		sc.lazyLoadMore.hide();
95
96		$.each(sv.props, function(i, prop){
97			prop.reset();
98		});
99		self.update();
100	}
101	// немедленное обновление списка
102	self.updateImmediate = function(){
103	
104		var props = {};
105		var value = '';
106		$.each(sv.props, function(i, prop){	
107			if((value = prop.value()).toString().length > 0)
108				props[i] = value;
109		});
110		
111		sv.nav.page(1);
112		sc.lazyLoadMore.hide();
113
114		var fields = $.extend({}, {props:props,nav:sv.nav.getFlds()});
115
116		if(typeof(sv.sort.by) !== false)
117			fields['sort'] = sv.sort;
118
119		if(so.ignoreDuplCalls && $.equalObj(sv.prevFields, fields)) return;
120		sv.prevFields = $.extend({}, fields);
121			
122		so.onBeforeRefresh.call(self);
123		sc.loader.show();
124
125		sv.lazyManual = sv.lazyAllowed = false;
126
127		so.responser.perform(fields);
128	}
129	// обновление списка
130	self.update = $.debounce(self.updateImmediate, self.opts.debTimeout);
131	self.firstUpdate = function(){
132		// здесь решается судьба seo-контента: показывать или нет
133		//self._showSC();
134		self.update();
135		sv.lazyAllowed = true;
136	}
137	// производит скролл окна к координате y со скоростью speed
138	self.scrollOnTop = function(y, speed){
139		$("html, body").animate({scrollTop:y}, typeof speed == 'undefined' ? 1 : speed);
140	}
141	self.nothingFound = function(){
142		so.whenListContainerClear.call(self);
143		so.whenListContainerFilled.call(self);
144	}
145	// инициализация вывода страниц
146	self.beginPaging = function(){
147
148		// очистка списка
149		self.clear();
150		
151		if(so.scrollTopOnUpd) self.scrollOnTop();
152
153		self.page(sv.nav.page(), function(){
154			so.whenListContainerFilled.call(self);
155			sv.nav.reInit({
156				pages: so.responser.pageCount()
157			});			
158			self.mooreBrains(); // начинаем бесконечный вывод
159		});
160
161	}
162
163	// этот метод добавляет в список элементы из массива html
164	self.appendHTML = function(html, items){
165
166		if(so.addItemsByOne){
167
168			var addTo = so.wrapPages ? $('<div>').appendTo(sc.list) : sc.list;
169			var aItems = new JQSet();
170			for(k in html){
171
172				// так мы избежим возможной ошибки unrecognized expression
173				var item = $('<div>').html(so.whenHtmlWrap.apply(this, [html[k].dom])).children().data('list-item', html[k].item);
174
175				addTo.append(item);
176				aItems.__addItem(item);
177			}
178
179		}else{
180
181			// пока не реализовал, да и вряд ли понадобится
182			//block.get(0).innerHTML = so.whenHtmlWrap.apply(this, [html]);
183
184		}
185		console.log(aItems)
186		sc.loader.hide();
187		so.onAfterRefresh.apply(self, [aItems]);
188
189		return aItems;
190	}
191
192	// эта функция не успокоится, пока не произойдёт одна из двух вещей: 1) закончатся страницы для вывода, 2) исчерпается лимит на показы lazy
193	self.mooreBrains = function(){
194
195		if(so.lazyOutput){
196			if(self._needLoadMore())
197				self.page(false, self.mooreBrains);
198		}
199	}
200
201	// загрузить страницу с номером p и выполнить произвольный колбэк cb. если номер не передан, то загрузка следующей по счёту страницы
202	self.page = function(p, cb){
203		sc.loader.show();
204		sc.lazyLoadMore.hide();
205		sv.lazyAllowed = false;
206		sv.lazyTimes++;
207
208		so.onPage.apply(self, [p]);
209
210		if(typeof p == 'undefined' || p === false) sv.nav.forward(); // увеличиваем страницу на 1
211
212		so.responser.page(sv.nav.page()/*текущая страница*/, function(){
213			sc.loader.hide();
214			sv.lazyAllowed = true;
215			
216			if(typeof cb == 'function') cb();
217		});
218	}
219
220	self.clear = function(){
221		sv.lazyTimes = 0; // сбрасываем счётчик показов
222		sv.lazyManual = false; // отключаем ручную подгрузку, если она была включена
223		so.whenListContainerClear.call(self); // очищаем список
224	}
225	
226	/*** private ***/
227	/* methods */
228	self._showSC = function(){
229		if(so.grdeg) sc.grdegLock.remove();
230	}
231	self._needLoadMore = function(){
232
233		if(sv.lazyAllowed && so.responser.morePages() && !sv.lazyManual){ // опция lazyLoad включена, можно ещё что-то подгрузить, ручной режим не включен
234		
235			if(so.loAsk > 0 && sv.lazyTimes > so.loAsk){ /*so.responser.pagesShown()*/
236
237				if(!sv.lazyManual) so.onLazyGoesOff.call(self);
238
239				sv.lazyManual = true;
240				sc.lazyLoadMore.show();
241				return false;
242			}
243		
244			// ВНЕЗАПНО слетел метод $(window).height(), хз чё такое
245			var wHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
246
247			return wHeight + $(document).scrollTop() >= sc.list.offset().top + +sc.list.height();
248		}
249		return false;
250	}
251	
252    /*** init ***/
253	var so = self.opts;
254	var sv = self.vars;
255	var sc = self.ctrls;
256	var d = $(document);
257	
258	// if(so.matchDomain){
259	// 	var found = false;
260	// 	for(k in so.matchDomain)
261	// 		if(so.matchDomain[k] == window.location.host){
262	// 			found = true;
263	// 			break;
264	// 		}
265
266	// 	if(!found){
267	// 		console.error('Domain name doesnt match. Should be one of '+so.matchDomain);
268	// 		return;
269	// 	}
270	// }
271	
272	// базовые контролы
273	if((sc.area = $(so.area)).length != 1) return;
274	sc.list = $('.-list-items', sc.area);
275	sc.loader = typeof so.loader == 'object' ? so.loader : $(so.loader, sc.area);
276
277	// временно скрываем seo-контент. потом его можно будет снова показать, если что-то пойдёт не так...
278	if(so.grdeg.length > 0){
279		document.write('<style id="grdeg_'+sv.entId+'">'+so.grdeg+'{display: none}</style>');
280		sc.grdegLock = $('#grdeg_'+sv.entId);
281	}		
282	
283	// регистрируем свойства
284	sv.props = {};
285	self.addProps(so.props);
286
287	// регистрируем ответчик
288	so.responser.init(self);
289	
290	// сортировка
291	sc.sortBtns = sc.area.find('.-list-sort').bind('click.'+self.pcode, function(){
292		var $this = $(this);
293		var sortOrder = $this.attr('data-list-sort-order'); // направление сортировки может быть жёстко задано для этой кнопки, а может переключаться
294		
295		sv.sort.by = $this.attr('-list-sort-by');
296		sv.sort.order = typeof(sortOrder) == 'undefined' ? (sv.sort.order == 'asc' ? 'desc' : 'asc' ) : sortOrder;
297		
298		so.onSortSwitch.apply(self, [sv.sort.order, $this]);
299		//if(so.scrollTopOnResort) self.scrollOnTop();
300		
301		self.update();
302	}).each(function(){ // сортировка по умолчанию
303		var $this = $(this);
304		if($this.attr('data-list-sort-by') == self.options.defaultSortBy)
305			self.options.onSortSwitch.apply(self, [self._sort.order, $this]);
306	});
307	// сброс
308	$(so.resetButton).bind('click.'+self.pcode, self.reset);
309	sc.lazyLoadMore = $('.-list-lazy-load-more', sc.area).hide().click(function(){
310		if(sv.lazyAllowed){
311
312			self.page(false, function(){
313				if(so.responser.morePages())
314					sc.lazyLoadMore.show();
315			});
316
317		}
318	});
319	
320	// навигация
321	sv.nav = new CListNav($.extend({
322		area: sc.area,
323		showAll: false,
324		page: so.page,
325		num: so.navNum,
326		lop: so.lop,
327		parent: self
328	}, so.navOpts));
329
330	// lazy load
331	if(so.lazyOutput){
332		
333		var onLazy = function(){
334			if(self._needLoadMore())
335				self.page();
336		}
337		
338		d.scroll($.throttle(onLazy, 500));
339		$(window).resize($.throttle(onLazy, 300));
340	}	
341
342	// кнопки "вверх" и "обратно"
343	if((sc.back = $('.-list-ud-up', sc.area).click(function(){
344		sv.jumpPos = d.scrollTop();
345		self.scrollOnTop(0, 1);
346		sc.back.hide();
347	}).hide()).length){
348
349		sc.down = $('.-list-ud-down', sc.area).click(function(){
350			if(sv.jumpPos > 0){
351				self.scrollOnTop(sv.jumpPos, 1);
352				sv.jumpPos = -1;
353				$(this).hide();
354			}
355		}).hide();
356		sc.btnUD = $('.-list-up-down', sc.area);
357	
358		var adjustBtn = function(){
359			
360			var w = $(window);
361			var btnH = sc.back.height();
362
363			sc.btnUD.css({
364				'top': w.height() - so.upDistFromBottom - btnH, 
365				'left': Math.ceil(w.width() / 2) - so.upDistFromCenter
366			});
367
368			sc.back['fade'+(d.scrollTop() >= so.upMinShowScrollTop ? 'In' : 'Out')](200);
369
370			if(d.scrollTop() >= so.downHideScrollTop){
371				sv.jumpPos = -1;
372				sc.down.fadeOut();
373			}else if(sv.jumpPos > 0)
374				sc.down.show();
375
376		};
377		d.scroll($.throttle(adjustBtn, 500));
378		$(window).resize($.throttle(adjustBtn, 300));
379		adjustBtn();
380	}
381	
382	/*** finally ***/
383	$(function(){
384		if(so.doInitialUpdate) 
385			self.firstUpdate();
386		else
387			sv.lazyAllowed = true;
388	});
389
390return self;}
391
392function CListNav(opts){
393
394	/*** defaults ***/
395	var s = this;
396	$.extend(s, {
397		//pcode: 'CListNav', // имя класса
398		opts: {
399			area: false,
400			whenSelect: function(){
401				if('addClass' in this) this.addClass('active');
402			},
403			whenDeSelect: function(){
404				if('removeClass' in this) this.removeClass('active');
405			},
406			whenGlow: function(){
407
408				if('addClass' in this) this.addClass('glowing');
409			},
410			whenFade: function(){
411				if('removeClass' in this) this.removeClass('glowing');
412			},
413			whenAfterInit: function(){
414				this.ctrls.area.show();
415			}
416		}, // опции по умолчанию
417		vars: {
418			page: +opts.page > 1 ? +opts.page : 1, // последняя загруженная страница
419			num: +opts.num > 0 ? +opts.num : 1, // номер навигатора (для ajax)
420			lop: opts.lop || 10, // количество элементов на странице
421			showAll: false, // показывать все или постранично (true пока не реализовано)
422			pageCount: 0, // текущее число страниц
423			requester: opts.parent, // ссылка на объект CList
424			glowing: false, // светящийся (отображённый) диапазон
425			selected: false, // текущая нажатая кнопка
426			prevSelected: false
427		}, // значимые переменные
428		ctrls: {
429			items: new JQSet() // все текущие кнопочки
430		}, // ссылки на контролы
431		tmpls: {} // ссылки на шаблоны
432	});
433	if(typeof opts == 'object')
434		$.extend(s.opts, opts);
435
436	/*** public ***/
437	/* methods */
438	// перерисовывает навигатор
439	s.reInit = function(params){
440		sv.pageCount = +params.pages;
441
442		// страниц вряд ли будет много, поэтому тут можем позволить себе вставку в dom в цикле
443		sc.area.empty().hide();
444		sc.items = new JQSet();
445
446		// кнопка назад
447		$('<div>').html(st.pageBwd).children().appendTo(sc.area).click(function(){
448
449			if(sv.selected == 1) return false;
450
451			sv.page = sv.selected - 1;
452
453			// гасим все подсвеченные
454			s._fadeGlowing();
455
456			// делаем кнопку нажатой
457			s._selectUp(sv.page);
458
459			s._page(sv.page);
460
461		});
462
463		console.log(sv.pageCount)
464		if (sv.pageCount > 17) {
465			$('.new-pagenav').addClass('w100')
466			$('.pagination-list.-list-pagenav').addClass('flex-list')
467		}
468		for(var i = 1; i <= sv.pageCount; i++)
469			(function(i){
470
471				var item = $('<div>').html(st.pageItem.replace('#PAGE#', i)).children().appendTo(sc.area).click(function(){
472					if(sv.selected == i) return;
473
474					var obj = $(this);
475
476					sv.selected = i; // записываем номер последней нажатой страницы
477					sv.page = i; // текущая страница
478
479					// гасим все подсвеченные
480					s._fadeGlowing();
481
482					// делаем кнопку нажатой
483					s._selectUp(i);
484
485					s._page(i);
486				});
487
488				sc.items.__addItem(item);
489			})(i);
490
491		// кнопка вперёд
492		$('<div>').html(st.pageFwd).children().appendTo(sc.area).click(function(){
493
494			if(sv.selected == sv.pageCount) return false;
495
496			sv.page = sv.selected + 1;
497
498			// гасим все подсвеченные
499			s._fadeGlowing();
500
501			// делаем кнопку нажатой
502			s._selectUp(sv.page);
503
504			s._page(sv.page);
505
506		});
507
508		// текущую кнопку надо подсветить и сделать активной
509		sv.glowing = [];
510		s._selectUp(sv.page);
511		s._glowUp(sv.page);
512
513		so.whenAfterInit.call(s);
514	}
515	// получает поля навигатора для запроса
516	s.getFlds = function(){
517		return {
518			showAll: sv.showAll,
519			page: sv.page,
520			navNum: sv.num,
521			lop: sv.lop
522		};
523	}
524	// просто сохраняет номер текущей страницы (или выдаёт его)
525	s.page = function(p){
526
527		if(typeof p == 'undefined') return sv.page;
528
529		p = parseInt(p);
530		if(p < 1) p =1;
531		if(sv.pageCount > 0 && p > sv.pageCount) p = sv.pageCount;
532
533		sv.page = p;
534
535		// подсвечиваем текущий элемент
536		s._glowUp(p);		
537	}
538	// показывает следующую страницу
539	s.forward = function(){
540		if(sv.page == sv.pageCount) return false;
541
542		sv.page++;
543		s.page(sv.page);
544
545		return true;
546	}
547	// показывает предыдущую страницу
548	s.backward = function(){
549		if(sv.page == 1) return false;
550
551		sv.page--;
552		s.page(sv.page);
553
554		return true;
555	}
556	s.parent = function(obj){
557		sv.requester = obj;
558	}
559	/*** private ***/
560	/* methods */
561
562	s._fadeGlowing = function(){
563		for(var k = 0; k < sv.glowing.length; k++)
564			so.whenFade.call(sc.items.eq(sv.glowing[k] - 1));
565
566		sv.glowing = [];
567	}
568	s._glowUp = function(page){
569
570		if(sv.glowing !== false){
571			sv.glowing.push(page);
572			so.whenGlow.call(sc.items.eq(page - 1));
573		}
574	}
575	s._selectUp = function(page){
576
577		if(sv.prevSelected !== false)
578			so.whenDeSelect.call(sc.items.eq(sv.prevSelected - 1));
579
580		sv.prevSelected = page;
581		sv.selected = page;
582
583		so.whenSelect.call(sc.items.eq(page - 1));
584	}
585	s._page = function(i){
586		if(sv.requester){
587
588			if(typeof i == 'undefined') i = sv.page;
589
590			sv.requester.opts.onPagerPage.apply(sv.requester, [i]);
591			sv.requester.clear();
592			sv.requester.page(i, function(){
593
594				sv.requester.opts.whenListContainerFilled.call(sv.requester);
595				sv.requester.mooreBrains(); // до победы
596
597			});
598		}
599
600		// подсвечиваем текущий элемент
601		s._glowUp(i);		
602	}
603
604    /*** init ***/
605	var so = s.opts;
606	var sv = s.vars;
607	var sc = s.ctrls;
608	var st = s.tmpls;
609
610	sc.area = $('.-list-pagenav', $(so.area));
611	st.pageItem = $('script[type="text/html"].-list-pn-item-template', sc.area).html();
612	st.pageFwd = $('script[type="text/html"].-list-pn-forward', sc.area).html();
613	st.pageBwd = $('script[type="text/html"].-list-pn-backward', sc.area).html();
614
615	sv.lastPressedPage = sv.page;
616
617	/*** finally ***/
618	
619	return s;
620}
621
622function CListAjax(opts){
623
624	/*** defaults ***/
625	var self = {
626		pcode: 'CListAjax', // имя класса
627		opts: {
628			items: [],
629			URL: '', // url, по которому идёт запрос
630			dataType: 'json', // может быть ещё html (но пока не реализован)
631			tag: false, // дополнительный флажок, который отправляется в ajax запросе. по нему можно отследить, что именно от этого компонента отправлен данный запрос. полезно при наличии нескольких ajax-компонентов на странице
632
633			whenItemProcess: function(item){return '<div></div>'}, // когда элемент перегоняется из json в html. должна возвращать строку или объект jquery
634			
635			onInitialize: function(){}, // когда происходит инициализация скрипта
636			onAfterRefresh: function(){}, // вызвается после изменения списка
637			onBeforeRefresh: function(){} // вызывается перед изменением списка
638		},
639		vars: {
640			fldCache: {},
641			itemsCount: 0,
642			ajaxId: false // id текущего ajax-вызова
643		},
644		ctrls: {}, // ссылки на контролы
645		tmpls: {} // ссылки на шаблоны
646	};
647	if(typeof opts == 'object')
648		$.extend(self.opts, opts);
649	
650	/*** public ***/
651	/* methods */
652	// инициализирует ответчик (системный метод)
653	self.init = function(req){
654		sv.requester = req;
655
656		sc.nothingFound = req.ctrls.area.find('.-list-nothing-found');
657		sc.tryAgain = req.ctrls.area.find('.-list-try-again');
658	}
659	// выполнить обновление списка
660	self.perform = function(fields){
661
662		sc.nothingFound.hide();
663		sc.tryAgain.hide();
664		
665		sv.fldCache = fields;
666		so.onBeforeRefresh.call(self);
667		sv.requester.beginPaging();
668	}
669	// сколько страниц уже было показано
670	self.pagesShown = function(){
671		return sv.fldCache.nav.page;
672	}
673	// выводит страницу с номером page
674	self.page = function(page, cb){
675
676		if(sv.fldCache.nav.showAll){
677			// при таком раскладе больше одной страницы не удастся вывести
678				// НЕ РЕАЛИЗОВАНО:
679				// если в постраничной навигации включено "show all", то мы получаем как бы одну большую страницу...
680				// тогда окно должно быть от 0 до sv.itemsCount
681				// и тогда вывод надо делать через eachAsync()
682				console.error('Вывод сразу всей портянки не реализован');
683			
684		}else{
685			if(sv.suppressLO) return;
686			sv.fldCache.nav.page = page;
687
688			var aItems = [];
689			var buf = [];
690			var ids = [];
691			self._perform(sv.fldCache, function(res){
692
693				self._procAdditInfo(res['ADDIT_INFO']);
694				delete(res['ADDIT_INFO']);
695
696				for(k in res){
697					res[k].HTML.__ID = k;
698
699					buf.push({
700						id: k,
701						item: res[k],
702						dom: so.whenItemProcess.apply(self, [res[k], k])
703					});
704				}
705
706				if(buf.length == 0){
707					sc.nothingFound.show();
708				}
709				var aItems = sv.requester.appendHTML(buf);
710
711				if(typeof cb == 'function') cb();
712				so.onAfterRefresh.apply(self, [aItems]);
713			});
714		}
715	}
716	// возвращает количество страниц (возможно использовать только после хотя бы одного вызова .perform())
717	self.pageCount = function(){
718		if(typeof sv.fldCache.nav == 'undefined') return -1;
719		return sv.fldCache.nav.showAll ? 1 : Math.ceil(sv.itemsCount / sv.fldCache.nav.lop);
720	}
721	// возвращает true, если ещё не все страницы показаны
722	self.morePages = function(){
723		return sv.fldCache.nav.page < self.pageCount();
724	}
725	
726	/*** private ***/
727	/* methods */
728	self._procAdditInfo = function(ai){
729		if(typeof ai == 'undefined') return;
730		sv.itemsCount = +ai['ITEMS_COUNT'];
731	}
732	// перегоняем поля запроса из общего вида в специфический, для аякса
733	self._refineReq = function(reqest){
734		var req = $.extend({}, reqest);
735
736		if(req.nav.showAll)
737			req['SHOWALL_'+req.nav.navNum] = 'Y';
738		else
739			req['PAGEN_'+req.nav.navNum] = req.nav.page;
740
741		delete(req.nav);
742
743		if(req.sort.by == false || req.sort.order == false)
744			delete(req.sort);
745
746		if(so.tag)
747			req.ajaxTag = so.tag;
748
749		return req;
750	}
751	self._perform = function(fields, callback){
752
753		sv.requester.ctrls.loader.show();
754
755		if(sv.ajaxId !== false && sv.ajaxId.readyState < 4)
756			sv.ajaxId.abort();
757
758		sv.ajaxId = $.ajax({
759			url: so.URL,
760			type: 'post',
761			data: self._refineReq(fields),
762			dataType: so.dataType,
763			success: function(result){
764				sv.requester.ctrls.loader.hide();
765
766				if(typeof callback == 'function')
767					callback(result);
768			},
769			error: function(xhr, msg, exp){
770
771				if(msg == 'abort') return;
772
773				sv.requester.ctrls.loader.hide();
774
775				console.error('Ajax call failed: '+msg+' '+exp);
776				sc.tryAgain.show();
777			}
778		});
779	}
780	
781    /*** init ***/
782	var so = self.opts;
783	var sv = self.vars;
784	var sc = self.ctrls;
785	
786	so.onInitialize.call(self);
787	
788	/*** finally ***/
789	
790return self;}
791
792function CListClientSide(opts){
793
794	/*** defaults ***/
795	var self = {
796		pcode: 'CListClientSide', // имя класса
797		opts: {
798			items: [],
799			fetchURL: '', // позволяет брать список элементов на json по указанному урлу. это для того, чтобы не ждать загрузки гигантского списка
800			tag: false, // дополнительный флажок, который отправляется в ajax запросе. по нему можно отследить, что именно от этого компонента отправлен данный запрос. полезно при наличии нескольких ajax-компонентов на странице
801
802			whenItemProcess: function(item){return '<div></div>'}, // когда элемент перегоняется из json в html. должна возвращать строку или объект jquery
803			
804			onInitialize: function(){}, // когда происходит инициализация скрипта
805			onItemsRemove: function(){ // когда удаляются элементы
806				//sv.requester.ctrls.list.children().css('visibility', 'hidden');
807			},
808			onAfterRefresh: function(){}, // вызвается после изменения списка
809			onBeforeRefresh: function(){} // вызывается перед изменением списка
810		},
811		vars: {
812			items: [],			
813			processed: false, // весь список обработан (html для каждого элемента сгенерирован)
814			itemIndex: [],
815			fltrTimer: {ID:-1},
816			promiseUpd: false,
817			navCache: {lop:10}
818		},
819		ctrls: {}, // ссылки на контролы
820		tmpls: {} // ссылки на шаблоны
821	};
822	if(typeof opts == 'object')
823		$.extend(self.opts, opts);
824	
825	/*** public ***/
826	/* methods */
827	// добавляет элементы в список. при этом, список автоматически обновляется
828	self.addItems = function(items){
829		self._addItems(items);
830		sv.requester.update();
831	}
832	// инициализирует ответчик (системный метод)
833	self.init = function(req){
834		sv.requester = req;
835		if(so.fetchURL.length > 0){ // ещё ничего не загружено
836			sv.promiseUpd = req.opts.doInitialUpdate; // апдейтнуть после получения элементов по ajax
837			req.opts.doInitialUpdate = false;
838		}
839		sc.nothingFound = req.ctrls.area.find('.-list-nothing-found');
840		sc.tryAgain = req.ctrls.area.find('.-list-try-again');
841	}
842	// выполнить обновление списка
843	self.perform = function(fields){	
844		if(sv.processed) // если все items перегнаны из json в html, то просто выполнить фильтрацию
845			self._perform(fields);
846		else // иначе, перегнать, а потом фильтровать.
847			self._process(function(){
848				self._perform(fields);
849			});
850	}	
851	// вывод следующей страницы
852	/*
853	self.nextPage = function(cb){
854		return self.page(sv.outputIndex++, cb);
855	}
856	*/
857	// сколько страниц уже было показано
858	self.pagesShown = function(){
859		return sv.outputIndex;
860	}
861	// выводит страницу с номером page
862	self.page = function(page, cb){
863
864		if(sv.navCache.showAll){
865			if(page == 0){ // при таком раскладе больше одной страницы не удастся вывести
866				// НЕ РЕАЛИЗОВАНО:
867				// если в постраничной навигации включено "show all", то мы получаем как бы одну большую страницу...
868				// тогда окно должно быть от 0 до длины всего массива sv.itemIndex
869				// и тогда вывод надо делать через eachAsync()
870				console.error('Вывод сразу всей портянки не реализован');
871			}
872		}else{
873			// в случае, когда страница ограничена:
874			var winFrom = page*sv.navCache.lop;
875			var winTo = (page+1)*sv.navCache.lop - 1;
876
877			//console.dir(winFrom+' => '+winTo);
878			
879			if(sv.suppressLO || winFrom >= sv.itemIndex.length) return;
880			
881			var buf = [];
882			var i = 0;
883			for(var k = winFrom; k <= winTo; k++){
884			
885				if(i >= sv.navCache.lop || k >= sv.itemIndex.length)
886					break;
887			
888				buf.push({
889					dom:sv.items[sv.itemIndex[k].id].dom,
890					id: sv.itemIndex[k].id,
891					item: sv.items[sv.itemIndex[k].id]
892				});
893
894				i++;
895			}
896			var aItems = sv.requester.appendHTML(buf);
897			if(typeof cb == 'function') cb();
898			so.onAfterRefresh.apply(self, [aItems]);
899		}
900	}
901	// возвращает количество страниц (возможно использовать только после хотя бы одного вызова .perform())
902	self.pageCount = function(){
903		return sv.navCache.showAll ? 1 : Math.ceil(sv.itemIndex.length / 
903sv.navCache.lop);
904	}
905	// возвращает true, если ещё не все страницы показаны
906	self.morePages = function(){
907		return sv.outputIndex < self.pageCount();
908	}
909	
910	/*** private ***/
911	/* methods */
912	self._addItems = function(items){
913		$.each(items, function(i, item){
914			item.ID = +i;
915			sv.items.push(item);
916		});
917		sv.processed = false; // теперь не все обработаны
918	}
919
920	self._process = function(whenDone){
921	
922		$.eachAsync(sv.items, function(i, item){
923			if(typeof(item.dom) != 'undefined') return; // этот элемент уже обработан
924			item.HTML.__ID = item.ID;
925
926			sv.items[item.ID].dom = so.whenItemProcess.apply(self, [item, item.ID]);
927		},
928		function(){
929			sv.processed = true;
930			whenDone();
931		});
932
933	}
934
935	self._perform = function(fields){
936
937		sc.nothingFound.hide();
938		sc.tryAgain.hide();
939		
940		sv.navCache = fields.nav;
941		sv.outputIndex = 1; // вывод блоков с начала
942		
943		clearTimeout(sv.fltrTimer.ID); // остановим всё предыдущее, если ещё работает
944		so.onBeforeRefresh.call(self);
945			
946		sv.itemIndex = []; // отфильтрованные элементы (подмножество sv.items)
947		var shown = 0;
948		var useSort = typeof(fields.sort) != 'undefined' && fields.sort.by;
949		
950		// порядок обработки: фильтрация, сортировка, постраничная навигация
951		sv.fltrTimer = $.eachAsync(sv.items, function(bug, item){
952			if(self._filter(fields.props, item)){
953				sv.itemIndex.push(useSort ? {id: item.ID, val: item.PROPS[fields.sort.by]} : {id: item.ID});
954				shown++;
955			}
956		}, function(){ // done
957		
958			if(shown == 0){
959				sv.requester.ctrls.loader.hide(); // местный лоадер типа
960				sv.requester.nothingFound();
961				sc.nothingFound.show();
962			}else{
963				if(useSort) sv.itemIndex.sort(fields.sort.order == 'asc' ? self._sortAsc : self._sortDesc);		
964				sv.requester.beginPaging();
965			}
966		});
967	}
968	
969	self._filter = function(props, item){
970	
971		// если свойств вообще нет, то просто true
972		if(props.length == 0) return true;
973	
974		// действует логика "хотя бы одно совпадение", т.е. OR
975		for(k in props)
976			if(props.hasOwnProperty(k)){
977				// отсутсвущему\пустому свойству автоматически удовлетворяет
978				if(typeof(item.PROPS[k]) == 'undefined' || item.PROPS[k].toString().length == 0)
979					continue;
980					
981				if(!sv.requester.vars.props[k].match(item.PROPS[k]))
982					return false;
983			}
984		
985		return true;
986	}	
987	
988    /*** init ***/
989	var so = self.opts;
990	var sv = self.vars;
991	var sc = self.ctrls;
992	
993	self._addItems(so.items);
994	so.onInitialize.call(self);
995
996	if(so.fetchURL.length > 0)
997		$(function(){
998			sv.requester.ctrls.loader.show();
999			var flds = {};
1000			if(so.tag)
1001				flds['ajaxTag'] = so.tag;
1002			$.ajax({
1003				url: so.fetchURL,
1004				type: "POST",
1005				dataType: "json",
1006				data: flds,
1007				success: function(result){
1008					self._addItems(result);
1009					if(sv.promiseUpd)
1010						sv.requester.firstUpdate();
1011				},
1012				error: function(xhr, msg, exp){
1013					console.error('Ajax call failed: '+msg+' '+exp);
1014					sc.tryAgain.show();
1015				},
1016				complete: function(){
1017					sv.requester.ctrls.loader.hide();
1018				}
1019			});
1020		});	
1021	
1022	/*** finally ***/
1023	
1024return self;}
1025
1026function JQSet(){
1027	this.context = null;
1028	this.length = 0;
1029	this.selector = '';
1030	this.__addItem = function(item){
1031		this[this.length++] = item.get(0);
1032	}
1033}
1034JQSet.prototype = jQuery.fn;
1035
1036$.fn.smoothLoad = function(todo){
1037
1038	/*** plugin parameters ***/
1039	var self = {pcode: 'smoothLoad',options:{
1040		loader: '.-sl-loader',
1041		onSuccess: function(){}
1042	}};
1043	
1044	/*** methods standard ***/
1045	self.init = function(options){
1046
1047		var common = {};
1048		var opts = $.extend(self.options, options);
1049		return this.each(function(){
1050		
1051			var $this = $(this);
1052			//if(typeof($this.data(self.pcode)) != 'undefined') return; // плагин уже инициализирован на этом элементе
1053			
1054			//////////////////////////////////////////////////////////
1055			///////////////
1056			
1057			// при каждом вызове плагина self будет ДРУГИМ объектом, поэтому к self никаких данных не привязываем, а вместо этого привязываем всё к data
1058			var data = {
1059				dom: $this,
1060				ctrls: { // хранимые контролы
1061					loader: typeof(opts.loader) == 'object' ? opts.loader : $(opts.loader)
1062				},
1063				vars: { // переменные величины
1064				},
1065				tmpls: {},
1066				sdata: common, // shared data, общая инфа для всех элементов в выбранном jquery объекте
1067				opts: $.extend({}, opts) // опции плагина на момент инициализации
1068			}
1069			
1070			// тут дальнейшая инициализация
1071			var img = $this.is('img') ? $this : $this.find('img');
1072			if(!img.get(0).complete){
1073				img.css({opacity: 0}); //hide();
1074				
1075				data.ctrls.loader.show();	
1076				
1077				//(function(img, loader){
1078					
1079					img.__timer = setInterval(function(){
1080						if(img.get(0).complete){
1081							clearInterval(img.__timer);
1082							img.css({opacity: 1}).hide().fadeIn(300);
1083							data.ctrls.loader.hide();
1084							data.opts.onSuccess.call(data, [img]);
1085						}
1086					}, 100);
1087					
1088				//})(img, loader);
1089			}else
1090				data.opts.onSuccess.call(data, [img]);
1091			
1092			///////////////
1093			//////////////////////////////////////////////////////////
1094			//$this.data(self.pcode, data);
1095		});
1096	}
1097	
1098	/*** methods public ***/
1099	
1100	/*** methods private ***/
1101	
1102	// разбор todo
1103	return self.init.apply(this, arguments);
1104	/*
1105    if(typeof(todo) == 'string' && todo[0] != '_' && typeof(self[todo]) == 'function') // todo это метод плагина, который вызываем
1106		return self[todo].apply(this, Array.prototype.slice.call(arguments, 1));
1107    else if(typeof(todo) === 'object' || typeof(todo) == 'undefined') // todo это опции, надо сделать init
1108		return self.init.apply(this, arguments);
1109	*/
1110}
1111
1112$.fn.floatPanel = function(todo){
1113
1114	/*** plugin parameters ***/
1115	var self = {pcode: 'floatPanel',opts:{
1116		tempBulkClass: '-temp-bulk', // класс, который назначается блоку, который замещает панель при скролле вниз
1117		defZIndex: 99, // z-index по умолчанию
1118		correct: 0 // небольшой поправочный коэффициент по высоте
1119	}};
1120	
1121	/*** methods standard ***/
1122	self.init = function(opts){
1123
1124		//var common = {};
1125		var opts = $.extend(self.opts, opts);
1126		return this.each(function(){
1127		
1128			var $this = $(this);
1129			if(typeof($this.data(self.pcode)) != 'undefined') return; // плагин уже инициализирован на этом элементе
1130
1131			//////////////////////////////////////////////////////////
1132			///////////////
1133			
1134			// при каждом вызове плагина self будет ДРУГИМ объектом, поэтому к self никаких данных не привязываем, а вместо этого привязываем всё к data
1135			var data = {
1136				dom: $this,
1137				ctrls: { // хранимые контролы
1138				},
1139				vars: { // переменные величины
1140					initOffset: $this.offset(),
1141					initPos: $this.css('position'),
1142					bulk: false,
1143					winWidth: $(window).width(),
1144					float: false
1145				},
1146				/*
1147				tmpls: {},
1148				sdata: common, // shared data, общая инфа для всех элементов в выбранном jquery объекте
1149				*/
1150				opts: $.extend({}, opts) // опции плагина на момент инициализации
1151			}
1152			
1153			// тут дальнейшая инициализация
1154
1155			// лучше было бы сделать потом ОДИН обработчик скролла, который будет следить за всеми панелями плагина			 
1156			$(window).scroll(function(){self._processPanel.call(data)});
1157			$(window).resize(function(){
1158				
1159				/*
1160				// эта корретировка пока не работает
1161				var newWidth = $(window).width();
1162				var oldWidth = data.vars.winWidth;
1163				if(newWidth != oldWidth && data.vars.float){
1164					$this.css({right: parseInt($this.css('right')) + (newWidth - oldWidth)});
1165				}
1166				*/	
1167
1168				self._processPanel.call(data);
1169			});
1170			self._processPanel.call(data);
1171
1172			///////////////
1173			//////////////////////////////////////////////////////////
1174			$this.data(self.pcode, data);
1175		});
1176	}
1177	
1178	/*** methods public ***/
1179
1180	/*** methods private ***/
1181	self._getRightOffset = function(obj){
1182		return $(window).width() - obj.offset().left - obj.width();
1183	}
1184	self._processPanel = function(){
1185		var posY = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
1186		var $this = this.dom;
1187
1188		if(posY > this.vars.initOffset.top + this.opts.correct){
1189			if(this.vars.bulk == false)
1190				this.vars.bulk = $('<div style="height: '+$this.height()+'px; position: '+this.vars.initPos+'" class="'+this.opts.tempBulkClass+'"></div>').insertBefore($this);
1191
1192			var rOffs = self._getRightOffset($this);
1193
1194			$this.css({position: 'fixed', top: 0, right: rOffs});
1195			this.vars.float = true;
1196		}else{
1197
1198			var bulk = $this.prev();
1199			if(this.vars.bulk != false){
1200				bulk.remove();
1201				this.vars.bulk = false;
1202			}
1203
1204			$this.css({position: this.vars.initPos, top: 'auto', left: 'auto', right: 'auto', 'z-index': this.opts.defZIndex});
1205			this.vars.float = false;
1206		}
1207		this.vars.winWidth = $(window).width();	
1208	}
1209	
1210	// разбор todo
1211    if(typeof(todo) == 'string' && todo[0] != '_' && typeof(self[todo]) == 'function') // todo это метод плагина, который вызываем
1212		return self[todo].apply(this, Array.prototype.slice.call(arguments, 1));
1213    else if(typeof(todo) === 'object' || typeof(todo) == 'undefined') // todo это опции, надо сделать init
1214		return self.init.apply(this, arguments);
1215}
1216
1217$.extend({
1218
1219	equalObj: function(obj1, obj2){
1220	
1221		var inclusion = function(obj1, obj2){
1222			for(k in obj1)
1223				if(obj1.hasOwnProperty(k))
1224					if(!(typeof obj1[k] == 'object' ? $.equalObj(obj1[k], obj2[k]) : obj1[k].toString() == obj2[k].toString())) return false;
1225
1226			return true;
1227		}
1228		
1229		return inclusion(obj1, obj2) && inclusion(obj2, obj1);
1230	},
1231
1232	eachAsync: function(set, callback, done, afterEach, blockLen, delay){
1233
1234		var slice = false;
1235		var length = 0;
1236		
1237		// если set это массив или объект $(), то волноваться не о чем. иначе - есть о чём (особенно если объект общего вида)
1238		if(typeof(set.length) != 'number'){
1239		
1240			slice = function(from, to){
1241				var chunk = {};
1242				var startCopying = false;
1243				// this === set
1244				$.each(this, function(i, item){
1245					if(i.toString() == from.toString())
1246						startCopying = true;
1247						
1248					if(startCopying)
1249						chunk[i] = item;
1250						
1251					if(i.toString() == to.toString())
1252						startCopying = false;
1253				});
1254				return chunk;
1255			}
1256		} else
1257			slice = set.slice;
1258		
1259		if(typeof(set.length) != 'number')
1260			$.each(set, function(){
1261				length++;
1262			});
1263		else
1264			length = set.length;
1265
1266		if(typeof(afterEach) != 'function')
1267			afterEach = function(){};
1268
1269		if(typeof(blockLen) != 'number')
1270			blockLen = 30;
1271			
1272		var times = Math.ceil(length / blockLen);
1273		var index = 0;
1274		var globalIndex = 0;
1275		var self = this;
1276		
1277		var handler = {};
1278		
1279		var iterator = function(){
1280			if(times == index){
1281				if(typeof(done) == 'function')
1282					done.call(set);
1283				return false;
1284			}
1285			return setTimeout(function(){
1286				index++;
1287				$.each(slice.apply(set, [(index-1)*blockLen, index*blockLen-1]), callback);
1288				afterEach.call(self);
1289				handler.ID = iterator();
1290			}, delay || 10);
1291		}
1292		handler.ID = iterator();
1293		return handler;
1294	}
1295	
1296});
1297
1298/*
1299Copyright Vassilis Petroulias [DRDigit]
1300
1301Licensed under the Apache License, Version 2.0 (the "License");
1302you may not use this file except in compliance with the License.
1303You may obtain a copy of the License at
1304
1305       http://www.apache.org/licenses/LICENSE-2.0
1306
1307Unless required by applicable law or agreed to in writing, software
1308distributed under the License is distributed on an "AS IS" BASIS,
1309WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1310See the License for the specific language governing permissions and
1311limitations under the License.
1312*/
1313var B64 = {
1314    alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
1314+/=',
1315    lookup: null,
1316    ie: /MSIE /.test(navigator.userAgent),
1317    ieo: /MSIE [67]/.test(navigator.userAgent),
1318    encode: function (s) {
1319        var buffer = B64.toUtf8(s),
1320            position = -1,
1321            len = buffer.length,
1322            nan1, nan2, enc = [, , , ];
1323        if (B64.ie) {
1324            var result = [];
1325            while (++position < len) {
1326                nan1 = buffer[position + 1], nan2 = buffer[position + 2];
1327                enc[0] = buffer[position] >> 2;
1328                enc[1] = ((buffer[position] & 3) << 4) | (buffer[++position] >> 4);
1329                if (isNaN(nan1)) enc[2] = enc[3] = 64;
1330                else {
1331                    enc[2] = ((buffer[position] & 15) << 2) | (buffer[++position] >> 6);
1332                    enc[3] = (isNaN(nan2)) ? 64 : buffer[position] & 63;
1333                }
1334                result.push(B64.alphabet[enc[0]], B64.alphabet[enc[1]], B64.alphabet[enc[2]], B64.alphabet[enc[3]]);
1335            }
1336            return result.join('');
1337        } else {
1338            result = '';
1339            while (++position < len) {
1340                nan1 = buffer[position + 1], nan2 = buffer[position + 2];
1341                enc[0] = buffer[position] >> 2;
1342                enc[1] = ((buffer[position] & 3) << 4) | (buffer[++position] >> 4);
1343                if (isNaN(nan1)) enc[2] = enc[3] = 64;
1344                else {
1345                    enc[2] = ((buffer[position] & 15) << 2) | (buffer[++position] >> 6);
1346                    enc[3] = (isNaN(nan2)) ? 64 : buffer[position] & 63;
1347                }
1348                result += B64.alphabet[enc[0]] + B64.alphabet[enc[1]] + B64.alphabet[enc[2]] + B64.alphabet[enc[3]];
1349            }
1350            return result;
1351        }
1352    },
1353    decode: function (s) {
1354        var buffer = B64.fromUtf8(s),
1355            position = 0,
1356            len = buffer.length;
1357        if (B64.ieo) {
1358            result = [];
1359            while (position < len) {
1360                if (buffer[position] < 128) result.push(String.fromCharCode(buffer[position++]));
1361                else if (buffer[position] > 191 && buffer[position] < 224) result.push(String.fromCharCode(((buffer[position++] & 31) << 6) | (buffer[position++] & 63)));
1362                else result.push(String.fromCharCode(((buffer[position++] & 15) << 12) | ((buffer[position++] & 63) << 6) | (buffer[position++] & 63)));
1363            }
1364            return result.join('');
1365        } else {
1366            result = '';
1367            while (position < len) {
1368                if (buffer[position] < 128) result += String.fromCharCode(buffer[position++]);
1369                else if (buffer[position] > 191 && buffer[position] < 224) result += String.fromCharCode(((buffer[position++] & 31) << 6) | (buffer[position++] & 63));
1370                else result += String.fromCharCode(((buffer[position++] & 15) << 12) | ((buffer[position++] & 63) << 6) | (buffer[position++] & 63));
1371            }
1372            return result;
1373        }
1374    },
1375    toUtf8: function (s) {
1376        var position = -1,
1377            len = s.length,
1378            chr, buffer = [];
1379        if (/^[\x00-\x7f]*$/.test(s)) while (++position < len)
1380        buffer.push(s.charCodeAt(position));
1381        else while (++position < len) {
1382            chr = s.charCodeAt(position);
1383            if (chr < 128) buffer.push(chr);
1384            else if (chr < 2048) buffer.push((chr >> 6) | 192, (chr & 63) | 128);
1385            else buffer.push((chr >> 12) | 224, ((chr >> 6) & 63) | 128, (chr & 63) | 128);
1386        }
1387        return buffer;
1388    },
1389    fromUtf8: function (s) {
1390        var position = -1,
1391            len, buffer = [],
1392            enc = [, , , ];
1393        if (!B64.lookup) {
1394            len = B64.alphabet.length;
1395            B64.lookup = {};
1396            while (++position < len)
1397            B64.lookup[B64.alphabet[position]] = position;
1398            position = -1;
1399        }
1400        len = s.length;
1401        while (position < len) {
1402            enc[0] = B64.lookup[s.charAt(++position)];
1403            enc[1] = B64.lookup[s.charAt(++position)];
1404            buffer.push((enc[0] << 2) | (enc[1] >> 4));
1405            enc[2] = B64.lookup[s.charAt(++position)];
1406            if (enc[2] == 64) break;
1407            buffer.push(((enc[1] & 15) << 4) | (enc[2] >> 2));
1408            enc[3] = B64.lookup[s.charAt(++position)];
1409            if (enc[3] == 64) break;
1410            buffer.push(((enc[2] & 3) << 6) | enc[3]);
1411        }
1412        return buffer;
1413    }
1414};
1415/* End */
1416;
1417; /* Start:"a:4:{s:4:"full";s:73:"/bitrix/templates/main_adaptive/scripts/lib/handlebars.js?149846604037752";s:6:"source";s:57:"/bitrix/templates/main_adaptive/scripts/lib/handlebars.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
1418var Handlebars={};
1419(function(e,p){e.VERSION="1.0.0-rc.4";e.COMPILER_REVISION=3;e.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:">= 1.0.0-rc.4"};e.helpers={};e.partials={};var q=Object.prototype.toString;e.registerHelper=function(a,b,c){if("[object Object]"===q.call(a)){if(c||b)throw new e.Exception("Arg not supported with multiple helpers");e.Utils.extend(this.helpers,a)}
1419else c&&(b.not=c),this.helpers[a]=b};e.registerPartial=function(a,b){"[object Object]"===q.call(a)?e.Utils.extend(this.partials,a):this.partials[a]=
1420b};e.registerHelper("helperMissing",function(a){if(2===arguments.length)return p;throw Error("Could not find property '"+a+"'");});e.registerHelper("blockHelperMissing",function(a,b){var c=b.inverse||function(){},d=b.fn,j=q.call(a);"[object Function]"===j&&(a=a.call(this));return!0===a?d(this):!1===a||null==a?c(this):"[object Array]"===j?0<a.length?e.helpers.each(a,b):c(this):d(a)});e.K=function(){};e.createFrame=Object.create||function(a){e.K.prototype=a;a=new e.K;e.K.prototype=null;return a};e.logger=
1421{DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,methodMap:{"0":"debug",1:"info",2:"warn",3:"error"},log:function(a,b){if(e.logger.level<=a){var c=e.logger.methodMap[a];"undefined"!==typeof console&&console[c]&&console[c].call(console,b)}}};e.log=function(a,b){e.logger.log(a,b)};e.registerHelper("each",function(a,b){var c=b.fn,d=b.inverse,j=0,f="",h;b.data&&(h=e.createFrame(b.data));if(a&&"object"===typeof a)if(a instanceof Array)for(var g=a.length;j<g;j++)h&&(h.index=j),f+=c(a[j],{data:h});else for(g in a)a.hasOwnProperty(g)&&
1422(h&&(h.key=g),f+=c(a[g],{data:h}),j++);0===j&&(f=d(this));return f});e.registerHelper("if",function(a,b){"[object Function]"===q.call(a)&&(a=a.call(this));return!a||e.Utils.isEmpty(a)?b.inverse(this):b.fn(this)});e.registerHelper("unless",function(a,b){return e.helpers["if"].call(this,a,{fn:b.inverse,inverse:b.fn})});e.registerHelper("with",function(a,b){if(!e.Utils.isEmpty(a))return b.fn(a)});e.registerHelper("log",function(a,b){var c=b.data&&null!=b.data.level?parseInt(b.data.level,10):1;e.log(c,
1423a)});var m;m=function(){this.yy={}};var v={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,simpleInverse:6,statements:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,inMustache:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,OPEN_PARTIAL:24,partialName:25,params:26,hash:27,DATA:28,param:29,STRING:30,INTEGER:31,BOOLEAN:32,hashSegments:33,hashSegment:34,ID:35,EQUALS:36,PARTIAL_NAME:37,
1424pathSegments:38,SEP:39,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"DATA",30:"STRING",31:"INTEGER",32:"BOOLEAN",35:"ID",36:"EQUALS",37:"PARTIAL_NAME",39:"SEP"},productions_:[0,[3,2],[4,2],[4,3],[4,2],[4,1],[4,1],[4,0],[7,1],[7,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[6,2],[17,3],[17,2],[17,2],[17,1],[17,1],[26,
14252],[26,1],[29,1],[29,1],[29,1],[29,1],[29,1],[27,1],[33,2],[33,1],[34,3],[34,3],[34,3],[34,3],[34,3],[25,1],[21,1],[38,3],[38,1]],performAction:function(a,b,c,d,e,f){a=f.length-1;switch(e){case 1:return f[a-1];case 2:this.$=new d.ProgramNode([],f[a]);break;case 3:this.$=new d.ProgramNode(f[a-2],f[a]);break;case 4:this.$=new d.ProgramNode(f[a-1],[]);break;case 5:this.$=new d.ProgramNode(f[a]);break;case 6:this.$=new d.ProgramNode([],[]);break;case 7:this.$=new d.ProgramNode([]);break;case 8:this.$=
1426[f[a]];break;case 9:f[a-1].push(f[a]);this.$=f[a-1];break;case 10:this.$=new d.BlockNode(f[a-2],f[a-1].inverse,f[a-1],f[a]);break;case 11:this.$=new d.BlockNode(f[a-2],f[a-1],f[a-1].inverse,f[a]);break;case 12:this.$=f[a];break;case 13:this.$=f[a];break;case 14:this.$=new d.ContentNode(f[a]);break;case 15:this.$=new d.CommentNode(f[a]);break;case 16:this.$=new d.MustacheNode(f[a-1][0],f[a-1][1]);break;case 17:this.$=new d.MustacheNode(f[a-1][0],f[a-1][1]);break;case 18:this.$=f[a-1];break;case 19:this.$=
1427new d.MustacheNode(f[a-1][0],f[a-1][1]);break;case 20:this.$=new d.MustacheNode(f[a-1][0],f[a-1][1],!0);break;case 21:this.$=new d.PartialNode(f[a-1]);break;case 22:this.$=new d.PartialNode(f[a-2],f[a-1]);break;case 24:this.$=[[f[a-2]].concat(f[a-1]),f[a]];break;case 25:this.$=[[f[a-1]].concat(f[a]),null];break;case 26:this.$=[[f[a-1]],f[a]];break;case 27:this.$=[[f[a]],null];break;case 28:this.$=[[new d.DataNode(f[a])],null];break;case 29:f[a-1].push(f[a]);this.$=f[a-1];break;case 30:this.$=[f[a]];
1428break;case 31:this.$=f[a];break;case 32:this.$=new d.StringNode(f[a]);break;case 33:this.$=new d.IntegerNode(f[a]);break;case 34:this.$=new d.BooleanNode(f[a]);break;case 35:this.$=new d.DataNode(f[a]);break;case 36:this.$=new d.HashNode(f[a]);break;case 37:f[a-1].push(f[a]);this.$=f[a-1];break;case 38:this.$=[f[a]];break;case 39:this.$=[f[a-2],f[a]];break;case 40:this.$=[f[a-2],new d.StringNode(f[a])];break;case 41:this.$=[f[a-2],new d.IntegerNode(f[a])];break;case 42:this.$=[f[a-2],new d.BooleanNode(f[a])];
1429break;case 43:this.$=[f[a-2],new d.DataNode(f[a])];break;case 44:this.$=new d.PartialNameNode(f[a]);break;case 45:this.$=new d.IdNode(f[a]);break;case 46:f[a-2].push(f[a]);this.$=f[a-2];break;case 47:this.$=[f[a]]}},table:[{3:1,4:2,5:[2,7],6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],22:[1,14],23:[1,15],24:[1,16]},{1:[3]},{5:[1,17]},{5:[2,6],7:18,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,6],22
1429:[1,14],23:[1,15],24:[1,16]},{5:[2,5],6:20,8:21,9:7,
143011:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,5],22:[1,14],23:[1,15],24:[1,16]},{17:23,18:[1,22],21:24,28:[1,25],35:[1,27],38:26},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{4:28,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],24:[1,16]},{4:29,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],24:[1,16]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],
143119:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{17:30,21:24,28:[1,25],35:[1,27],38:26},{17:31,21:24,28:[1,25],35:[1,27],38:26},{17:32,21:24,28:[1,25],35:[1,27],38:26},{25:33,37:[1,34]},{1:[2,1]},{5:[2,2],8:21,9:7,11:8,12:9,13:10,
143214:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,2],22:[1,14],23:[1,15],24:[1,16]},{17:23,21:24,28:[1,25],35:[1,27],38:26},{5:[2,4],7:35,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,4],22:[1,14],23:[1,15],24:[1,16]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,23],14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],24:[2,23]},{18:[1,36]},{18:[2,27],21:41,26:37,27:38,28:[1,45],29:39,30:[1,42],31:[1,43],32:[1,44],33:40,
143334:46,35:[1,47],38:26},{18:[2,28]},{18:[2,45],28:[2,45],30:[2,45],31:[2,45],32:[2,45],35:[2,45],39:[1,48]},{18:[2,47],28:[2,47],30:[2,47],31:[2,47],32:[2,47],35:[2,47],39:[2,47]},{10:49,20:[1,50]},{10:51,20:[1,50]},{18:[1,52]},{18:[1,53]},{18:[1,54]},{18:[1,55],21:56,35:[1,27],38:26},{18:[2,44],35:[2,44]},{5:[2,3],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,3],22:[1,14],23:[1,15],24:[1,16]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},
1434{18:[2,25],21:41,27:57,28:[1,45],29:58,30:[1,42],31:[1,43],32:[1,44],33:40,34:46,35:[1,47],38:26},{18:[2,26]},{18:[2,30],28:[2,30],30:[2,30],31:[2,30],32:[2,30],35:[2,30]},{18:[2,36],34:59,35:[1,60]},{18:[2,31],28:[2,31],30:[2,31],31:[2,31],32:[2,31],35:[2,31]},{18:[2,32],28:[2,32],30:[2,32],31:[2,32],32:[2,32],35:[2,32]},{18:[2,33],28:[2,33],30:[2,33],31:[2,33],32:[2,33],35:[2,33]},{18:[2,34],28:[2,34],30:[2,34],31:[2,34],32:[2,34],35:[2,34]},{18:[2,35],28:[2,35],30:[2,35],31:[2,35],32:[2,35],35:[2,
143535]},{18:[2,38],35:[2,38]},{18:[2,47],28:[2,47],30:[2,47],31:[2,47],32:[2,47],35:[2,47],36:[1,61],39:[2,47]},{35:[1,62]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{21:63,35:[1,27],38:26},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,
143620],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],24:[2,21]},{18:[1,64]},{18:[2,24]},{18:[2,29],28:[2,29],30:[2,29],31:[2,29],32:[2,29],35:[2,29]},{18:[2,37],35:[2,37]},{36:[1,61]},{21:65,28:[1,69],30:[1,66],31:[1,67],32:[1,68],35:[1,27],38:26},{18:[2,46],28:[2,46],30:[2,46],31:[2,46],32:[2,46],35:[2,46],39:[2,46]},{18:[1,70]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],
143722:[2,22],23:[2,22],24:[2,22]},{18:[2,39],35:[2,39]},{18:[2,40],35:[2,40]},{18:[2,41],35:[2,41]},{18:[2,42],35:[2,42]},{18:[2,43],35:[2,43]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]}],defaultActions:{17:[2,1],25:[2,28],38:[2,26],57:[2,24]},parseError:function(a){throw Error(a);},parse:function(a){var b=[0],c=[null],d=[],e=this.table,f="",h=0,g=0,m=0;this.lexer.setInput(a);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;this.yy.parser=this;"undefined"==
1438typeof this.lexer.yylloc&&(this.lexer.yylloc={});a=this.lexer.yylloc;d.push(a);var s=this.lexer.options&&this.lexer.options.ranges;"function"===typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var k,p,r,l,u={},q,n;;){r=b[b.length-1];if(this.defaultActions[r])l=this.defaultActions[r];else{if(null===k||"undefined"==typeof k)k=void 0,k=this.lexer.lex()||1,"number"!==typeof k&&(k=this.symbols_[k]||k);
1438l=e[r]&&e[r][k]}if("undefined"===typeof l||!l.length||!l[0]){var t="";if(!m){n=[];
1439for(q in e[r])this.terminals_[q]&&2<q&&n.push("'"+this.terminals_[q]+"'");t=this.lexer.showPosition?"Parse error on line "+(h+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+n.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(h+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'");this.parseError(t,{text:this.lexer.match,token:this.terminals_[k]||k,line:this.lexer.yylineno,loc:a,expected:n})}}if(l[0]instanceof Array&&1<l.length)throw Error("Parse Error: multiple actions possible at state: "+
1440r+", token: "+k);switch(l[0]){case 1:b.push(k);c.push(this.lexer.yytext);d.push(this.lexer.yylloc);b.push(l[1]);k=null;p?(k=p,p=null):(g=this.lexer.yyleng,f=this.lexer.yytext,h=this.lexer.yylineno,a=this.lexer.yylloc,0<m&&m--);break;case 2:n=this.productions_[l[1]][1];u.$=c[c.length-n];u._$={first_line:d[d.length-(n||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(n||1)].first_column,last_column:d[d.length-1].last_column};s&&(u._$.range=[d[d.length-(n||1)].range[0],d[d.length-
14411].range[1]]);r=this.performAction.call(u,f,g,h,this.yy,l[1],c,d);if("undefined"!==typeof r)return r;n&&(b=b.slice(0,-2*n),c=c.slice(0,-1*n),d=d.slice(0,-1*n));b.push(this.productions_[l[1]][0]);c.push(u.$);d.push(u._$);l=e[b[b.length-2]][b[b.length-1]];b.push(l);break;case 3:return!0}}return!0},lexer:{EOF:1,parseError:function(a,b){if(this.yy.parser)this.yy.parser.parseError(a,b);else throw Error(a);},setInput:function(a){this._input=a;this._more=this._less=this.done=!1;this.yylineno=this.yyleng=
14420;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};this.options.ranges&&(this.yylloc.range=[0,0]);this.offset=0;return this},input:function(){var a=this._input[0];this.yytext+=a;this.yyleng++;this.offset++;this.match+=a;this.matched+=a;a.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++;this.options.ranges&&this.yylloc.range[1]++;this._input=this._input.slice(1);return a},
1443unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-b-1);this.offset-=b;a=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);c.length-1&&(this.yylineno-=c.length-1);var d=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===
1444a.length?this.yylloc.first_column:0)+a[a.length-c.length].length-c[0].length:this.yylloc.first_column-b};this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-b]);return this},more:function(){this._more=!0;return this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(20<a.length?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;20>a.length&&(a+=this._input.substr(0,
144520-a.length));return(a.substr(0,20)+(20<a.length?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c;this._more||(this.match=this.yytext="");for(var d=this._currentRules(),e=0;e<d.length;e++)if((b=this._input.match(this.rules[d[e]]))&&(!a||b[0].length>a[0].length))if(a=b,c=e,!this.options.flex)break;if(a){if(b=a[0].match(/(?:\r\n?|\n).*/g))this.yylineno+=
1446b.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:b?b[b.length-1].length-b[b.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+a[0].length};this.yytext+=a[0];this.match+=a[0];this.matches=a;this.yyleng=this.yytext.length;this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]);this._more=!1;this._input=this._input.slice(a[0].length);this.matched+=a[0];a=this.performAction.call(this,this.yy,
1447this,d[c],this.conditionStack[this.conditionStack.length-1]);this.done&&this._input&&(this.done=!1);if(a)return a}else return""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!==typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-
14481]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)},options:{},performAction:function(a,b,c){switch(c){case 0:return b.yytext="\\",14;case 1:"\\"!==b.yytext.slice(-1)&&this.begin("mu");"\\"===b.yytext.slice(-1)&&(b.yytext=b.yytext.substr(0,b.yyleng-1),this.begin("emu"));if(b.yytext)return 14;break;case 2:return 14;case 3:return"\\"!==b.yytext.slice(-1)&&this.popState(),"\\"===b.yytext.slice(-1)&&(b.yytext=b.yytext.substr(0,
1449b.yyleng-1)),14;case 4:return b.yytext=b.yytext.substr(0,b.yyleng-4),this.popState(),15;case 5:return this.begin("par"),24;case 6:return 16;case 7:return 20;case 8:return 19;case 9:return 19;case 10:return 23;case 11:return 23;case 12:this.popState();this.begin("com");break;case 13:return b.yytext=b.yytext.substr(3,b.yyleng-5),this.popState(),15;case 14:return 22;case 15:return 36;case 16:return 35;case 17:return 35;case 18:return 39;case 20:return this.popState(),18;case 21:return this.popState(),
145018;case 22:return b.yytext=b.yytext.substr(1,b.yyleng-2).replace(/\\"/g,'"'),30;case 23:return b.yytext=b.yytext.substr(1,b.yyleng-2).replace(/\\'/g,"'"),30;case 24:return b.yytext=b.yytext.substr(1),28;case 25:return 32;case 26:return 32;case 27:return 31;case 28:return 35;case 29:return b.yytext=b.yytext.substr(1,b.yyleng-2),35;case 30:return"INVALID";case 32:return this.popState(),37;case 33:return 5}},rules:[/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,
1451/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@[a-zA-Z]+)/,/^(?:true(?=[}
1451\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$:\-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:\s+)/,/^(?:[a-zA-Z0-9_$\-\/]+)/,/^(?:$)/],
1452conditions:{mu:{rules:[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,33],inclusive:!1},emu:{rules:[3],inclusive:!1},com:{rules:[4],inclusive:!1},par:{rules:[31,32],inclusive:!1},INITIAL:{rules:[0,1,2,33],inclusive:!0}}}};m.prototype=v;v.Parser=m;m=new m;e.Parser=m;e.parse=function(a){if(a.constructor===e.AST.ProgramNode)return a;e.Parser.yy=e.AST;return e.Parser.parse(a)};e.AST={};e.AST.ProgramNode=function(a,b){this.type="program";this.statements=a;b&&(this.inverse=new e.AST.ProgramNode(b))};
1453e.AST.MustacheNode=function(a,b,c){this.type="mustache";this.escaped=!c;this.hash=b;c=this.id=a[0];a=this.params=a.slice(1);this.isHelper=(this.eligibleHelper=c.isSimple)&&(a.length||b)};e.AST.PartialNode=function(a,b){this.type="partial";this.partialName=a;this.context=b};e.AST.BlockNode=function(a,b,c,d){var j=a.id;if(j.original!==d.original)throw new e.Exception(j.original+" doesn't match "+d.original);this.type="block";this.mustache=a;this.program=b;if((this.inverse=c)&&!this.program)this.isInverse=
1454!0};e.AST.ContentNode=function(a){this.type="content";this.string=a};e.AST.HashNode=function(a){this.type="hash";this.pairs=a};e.AST.IdNode=function(a){this.type="ID";this.original=a.join(".");for(var b=[],c=0,d=0,j=a.length;d<j;d++){var f=a[d];if(".."===f||"."===f||"this"===f){if(0<b.length)throw new e.Exception("Invalid path: "+this.original);".."===f?c++:this.isScoped=!0}else b.push(f)}this.parts=b;this.string=b.join(".");this.depth=c;this.isSimple=1===a.length&&!this.isScoped&&0===c;this.stringModeValue=
1455this.string};e.AST.PartialNameNode=function(a){this.type="PARTIAL_NAME";this.name=a};e.AST.DataNode=function(a){this.type="DATA";this.id=a};e.AST.StringNode=function(a){this.type="STRING";this.stringModeValue=this.string=a};e.AST.IntegerNode=function(a){this.type="INTEGER";this.integer=a;this.stringModeValue=Number(a)};e.AST.BooleanNode=function(a){this.type="BOOLEAN";this.bool=a;this.stringModeValue="true"===a};e.AST.CommentNode=function(a){this.type="comment";this.comment=a};var x="description fileName lineNumber message name number stack".split(" ");
1456e.Exception=function(a){for(var b=Error.prototype.constructor.apply(this,arguments),c=0;c<x.length;c++)this[x[c]]=b[x[c]]};e.Exception.prototype=Error();e.SafeString=function(a){this.string=a};e.SafeString.prototype.toString=function(){return this.string.toString()};var A={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},B=/[&<>"'`]/g,C=/[&<>"'`]/,D=function(a){return A[a]||"&amp;"};e.Utils={extend:function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},escapeExpression:function(a){if(a instanceof
1457e.SafeString)return a.toString();if(null==a||!1===a)return"";a=a.toString();return!C.test(a)?a:a.replace(B,D)},isEmpty:function(a){return!a&&0!==a?!0:"[object Array]"===q.call(a)&&0===a.length?!0:!1}};var w=e.Compiler=function(){},s=e.JavaScriptCompiler=function(){};w.prototype={compiler:w,disassemble:function(){for(var a=this.opcodes,b,c=[],d,e,f=0,h=a.length;f<h;f++)if(b=a[f],"DECLARE"===b.opcode)c.push("DECLARE "+b.name+"="+b.value);else{d=[];for(var g=0;g<b.args.length;g++)e=b.args[g],"string"===
1458typeof e&&(e='"'+e.replace("\n","\\n")+'"'),d.push(e);c.push(b.opcode+" "+d.join(" "))}return c.join("\n")},equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;c<b;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||d.args.length!==e.args.length)return!1;for(var f=0;f<d.args.length;f++)if(d.args[f]!==e.args[f])return!1}b=this.children.length;if(a.children.length!==b)return!1;for(c=0;c<b;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},
1459guid:0,compile:function(a,b){this.children=[];this.depths={list:[]};this.options=b;var c=this.options.knownHelpers;this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0};if(c)for(var d in c)this.options.knownHelpers[d]=c[d];return this.program(a)},accept:function(a){return this[a.type](a)},program:function(a){a=a.statements;var b;this.opcodes=[];for(var c=0,d=a.length;c<d;c++)b=a[c],this[b.type](b);this.isSimple=1===d;this.depths.list=this.depths.list.sort(function(a,
1460b){return a-b});return this},compileProgram:function(a){a=(new this.compiler).compile(a,this.options);var b=this.guid++,c;this.usePartial=this.usePartial||a.usePartial;this.children[b]=a;for(var d=0,e=a.depths.list.length;d<e;d++)c=a.depths.list[d],2>c||this.addDepth(c-1);return b},block:function(a){var b=a.mustache,c=a.program;a=a.inverse;c&&(c=this.compileProgram(c));a&&(a=this.compileProgram(a));var d=this.classifyMustache(b);"helper"===d?this.helperMustache(b,c,a):"simple"===d?(this.simpleMustache(b),
1461this.opcode("pushProgram",c),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousMustache(b,c,a),this.opcode("pushProgram",c),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue"));this.opcode("append")},hash:function(a){a=a.pairs;var b,c;this.opcode("pushHash");for(var d=0,e=a.length;d<e;d++)b=a[d],c=b[1],this.options.stringParams?(c.depth&&this.addDepth(c.depth),this.opcode("getContext",c.depth||0),this.opcode("pushStringParam",
1462c.stringModeValue,c.type)):this.accept(c),this.opcode("assignToHash",b[0]);this.opcode("popHash")},partial:function(a){var b=a.partialName;this.usePartial=!0;a.context?this.ID(a.context):this.opcode("push","depth0");this.opcode("invokePartial",b.name);this.opcode("append")},content:function(a){this.opcode("appendContent",a.string)},mustache:function(a){var b=this.options,c=this.classifyMustache(a);"simple"===c?this.simpleMustache(a):"helper"===c?this.helperMustache(a):this.ambiguousMustache(a);a.escaped&&
1463!b.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousMustache:function(a,b,c){a=a.id;var d=a.parts[0],e=null!=b||null!=c;this.opcode("getContext",a.depth);this.opcode("pushProgram",b);this.opcode("pushProgram",c);this.opcode("invokeAmbiguous",d,e)},simpleMustache:function(a){a=a.id;"DATA"===a.type?this.DATA(a):a.parts.length?this.ID(a):(this.addDepth(a.depth),this.opcode("getContext",a.depth),this.opcode("pushContext"));this.opcode("resolvePossibleLambda")},helperMustache:function(a,
1464b,c){b=this.setupFullMustacheParams(a,b,c);a=a.id.parts[0];if(this.options.knownHelpers[a])this.opcode("invokeKnownHelper",b.length,a);else{if(this.options.knownHelpersOnly)throw Error("You specified knownHelpersOnly, but used the unknown helper "+a);this.opcode("invokeHelper",b.length,a)}},ID:function(a){this.addDepth(a.depth);this.opcode("getContext",a.depth);a.parts[0]?this.opcode("lookupOnContext",a.parts[0]):this.opcode("pushContext");for(var b=1,c=a.parts.length;b<c;b++)this.opcode("lookup",
1465a.parts[b])},DATA:function(a){this.options.data=!0;this.opcode("lookupData",a.id)},STRING:function(a){this.opcode("pushString",a.string)},INTEGER:function(a){this.opcode("pushLiteral",a.integer)},BOOLEAN:function(a){this.opcode("pushLiteral",a.bool)},comment:function(){},opcode:function(a){this.opcodes.push({opcode:a,args:[].slice.call(arguments,1
1465)})},declare:function(a,b){this.opcodes.push({opcode:"DECLARE",name:a,value:b})},addDepth:function(a){if(isNaN(a))throw Error("EWOT");0!==a&&!this.depths[a]&&
1466(this.depths[a]=!0,this.depths.list.push(a))},classifyMustache:function(a){var b=a.isHelper,c=a.eligibleHelper,d=this.options;c&&!b&&(d.knownHelpers[a.id.parts[0]]?b=!0:d.knownHelpersOnly&&(c=!1));return b?"helper":c?"ambiguous":"simple"},pushParams:function(a){for(var b=a.length,c;b--;)if(c=a[b],this.options.stringParams)c.depth&&this.addDepth(c.depth),this.opcode("getContext",c.depth||0),this.opcode("pushStringParam",c.stringModeValue,c.type);else this[c.type](c)},setupMustacheParams:function(a){var b=
1467a.params;this.pushParams(b);a.hash?this.hash(a.hash):this.opcode("emptyHash");return b},setupFullMustacheParams:function(a,b,c){var d=a.params;this.pushParams(d);this.opcode("pushProgram",b);this.opcode("pushProgram",c);a.hash?this.hash(a.hash):this.opcode("emptyHash");return d}};var t=function(a){this.value=a};s.prototype={nameLookup:function(a,b){return/^[0-9]+$/.test(b)?a+"["+b+"]":s.isValidJavaScriptVariableName(b)?a+"."+b:a+"['"+b+"']"},appendToBuffer:function(a){return this.environment.isSimple?
1468"return "+a+";":{appendToBuffer:!0,content:a,toString:function(){return"buffer += "+a+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(a,b,c,d){this.environment=a;this.options=b||{};e.log(e.logger.DEBUG,this.environment.disassemble()+"\n\n");this.name=this.environment.name;this.isChild=!!c;this.context=c||{programs:[],environments:[],aliases:{}};this.preamble();this.stackSlot=0;this.stackVars=[];this.registers={list:[]};this.compileStack=[];
1469this.inlineStack=[];this.compileChildren(a,b);a=a.opcodes;this.i=0;for(y=a.length;this.i<y;this.i++)b=a[this.i],"DECLARE"===b.opcode?this[b.name]=b.value:this[b.opcode].apply(this,b.args);return this.createFunctionContext(d)},nextOpcode:function(){return this.environment.opcodes[this.i+1]},eat:function(){this.i+=1},preamble:function(){var a=[];if(this.isChild)a.push("");else{var b=this.namespace,c="helpers = helpers || "+b+".helpers;";this.environment.usePartial&&(c=c+" partials = partials || "+b+
1470".partials;");this.options.data&&(c+=" data = data || {};");a.push(c)}this.environment.isSimple?a.push(""):a.push(", buffer = "+this.initializeBuffer());this.lastContext=0;this.source=a},createFunctionContext:function(a){var b=this.stackVars.concat(this.registers.list);0<b.length&&(this.source[1]=this.source[1]+", "+b.join(", "));if(!this.isChild)for(var c in this.context.aliases)this.source[1]=this.source[1]+", "+c+"="+this.context.aliases[c];this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+
1471";");this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n");this.environment.isSimple||this.source.push("return buffer;");b=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];c=0;for(var d=this.environment.depths.list.length;c<d;c++)b.push("depth"+this.environment.depths.list[c]);c=this.mergeSource();this.isChild||(d=e.COMPILER_REVISION,c="this.compilerInfo = ["+d+",'"+e.REVISION_CHANGES[d]+"'];\n"+c);if(a)return b.push(c),Function.apply(this,b);
1472a="function "+(this.name||"")+"("+b.join(",")+") {\n  "+c+"}";e.log(e.logger.DEBUG,a+"\n\n");return a},mergeSource:function(){for(var a="",b,c=0,d=this.source.length;c<d;c++){var e=this.source[c];e.appendToBuffer?b=b?b+"\n    + "+e.content:e.content:(b&&(a+="buffer += "+b+";\n  ",b=p),a+=e+"\n  ")}return a},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a);this.replaceStack(function(b){a.splice(1,0,b);return"blockHelperMissing.call("+
1473a.join(", ")+")"})},ambiguousBlockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var a=["depth0"];this.setupParams(0,a);var b=this.topStack();a.splice(1,0,b);a[a.length-1]="options";this.source.push("if (!"+this.lastHelper+") { "+b+" = blockHelperMissing.call("+a.join(", ")+"); }")},appendContent:function(a){this.source.push(this.appendToBuffer(this.quotedString(a)))},append:function(){this.flushInline();var a=this.popStack();
1473this.source.push("if("+a+" || "+
1474a+" === 0) { "+this.appendToBuffer(a)+" }");this.environment.isSimple&&this.source.push("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression";this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(a){this.lastContext!==a&&(this.lastContext=a)},lookupOnContext:function(a){this.push(this.nameLookup("depth"+this.lastContext,a,"context"))},pushContext:function(){this.pushStackLiteral("depth"+
1475this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"';this.replaceStack(function(a){return"typeof "+a+" === functionType ? "+a+".apply(depth0) : "+a})},lookup:function(a){this.replaceStack(function(b){return b+" == null || "+b+" === false ? "+b+" : "+this.nameLookup(b,a,"context")})},lookupData:function(a){this.push(this.nameLookup("data",a,"data"))},pushStringParam:function(a,b){this.pushStackLiteral("depth"+this.lastContext);this.pushString(b);"string"===
1476typeof a?this.pushString(a):this.pushStackLiteral(a)},emptyHash:function(){this.pushStackLiteral("{}");this.options.stringParams&&(this.register("hashTypes","{}"),this.register("hashContexts","{}"))},pushHash:function(){this.hash={values:[],types:[],contexts:[]}},popHash:function(){var a=this.hash;this.hash=p;this.options.stringParams&&(this.register("hashContexts","{"+a.contexts.join(",")+"}"),this.register("hashTypes","{"+a.types.join(",")+"}"));this.push("{\n    "+a.values.join(",\n    ")+"\n  }")},
1477pushString:function(a){this.pushStackLiteral(this.quotedString(a))},push:function(a){this.inlineStack.push(a);return a},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},invokeHelper:function(a,b){this.context.aliases.helperMissing="helpers.helperMissing";var c=this.lastHelper=this.setupHelper(a,b,!0);this.push(c.name);this.replaceStack(function(a){return a+" ? "+a+".call("+c.callParams+") : helperMissing.call("+
1478c.helperMissingParams+")"})},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(c.name+".call("+c.callParams+")")},invokeAmbiguous:function(a,b){this.context.aliases.functionType='"function"';this.pushStackLiteral("{}");var c=this.setupHelper(0,a,b),d=this.lastHelper=this.nameLookup("helpers",a,"helper"),e=this.nameLookup("depth"+this.lastContext,a,"context"),f=this.nextStack();this.source.push("if ("+f+" = "+d+") { "+f+" = "+f+".call("+c.callParams+"); }");this.source.push("else { "+
1479f+" = "+e+"; "+f+" = typeof "+f+" === functionType ? "+f+".apply(depth0) : "+f+"; }")},invokePartial:function(a){a=[this.nameLookup("partials",a,"partial"),"'"+a+"'",this.popStack(),"helpers","partials"];this.options.data&&a.push("data");this.context.aliases.self="this";this.push("self.invokePartial("+a.join(", ")+")")},assignToHash:function(a){var b=this.popStack(),c,d;this.options.stringParams&&(d=this.popStack(),c=this.popStack());var e=this.hash;c&&e.contexts.push("'"+a+"': "+c);d&&e.types.push("'"+
1480a+"': "+d);e.values.push("'"+a+"': ("+b+")")},compiler:s,compileChildren:function(a,b){for(var c=a.children,d,e,f=0,h=c.length;f<h;f++){d=c[f];
1480e=new this.compiler;var g=this.matchExistingProgram(d);null==g?(this.context.programs.push(""),g=this.context.programs.length,d.index=g,d.name="program"+g,this.context.programs[g]=e.compile(d,b,this.context),this.context.environments[g]=d):(d.index=g,d.name="program"+g)}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;b<c;b++){var d=
1481this.context.environments[b];if(d&&d.equals(a))return b}},programExpression:function(a){this.context.aliases.self="this";if(null==a)return"self.noop";var b=this.environment.children[a];a=b.depths.list;for(var c=[b.index,b.name,"data"],d=0,e=a.length;d<e;d++)b=a[d],1===b?c.push("depth0"):c.push("depth"+(b-1));return(0===a.length?"self.program(":"self.programWithDepth(")+c.join(", ")+")"},register:function(a,b){this.useRegister(a);this.source.push(a+" = "+b+";")},useRegister:function(a){this.registers[a]||
1482(this.registers[a]=!0,this.registers.list.push(a))},pushStackLiteral:function(a){return this.push(new t(a))},pushStack:function(a){this.flushInline();var b=this.incrStack();a&&this.source.push(b+" = "+a+";");this.compileStack.push(b);return b},replaceStack:function(a){var b="",c=this.isInline(),d;c?(d=this.popStack(!0),d instanceof t?d=d.value:(b=this.stackSlot?this.topStackName():this.incrStack(),b="("+this.push(b)+" = "+d+"),",d=this.topStack())):d=this.topStack();a=a.call(this,d);c?((this.inlineStack.length||
1483this.compileStack.length)&&this.popStack(),this.push("("+b+a+")")):(/^stack/.test(d)||(d=this.nextStack()),this.source.push(d+" = ("+b+a+");"));return d},nextStack:function(){return this.pushStack()},incrStack:function(){this.stackSlot++;this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;if(a.length){this.inlineStack=[];for(var b=0,c=a.length;b<
1484c;b++){var d=a[b];d instanceof t?this.compileStack.push(d):this.pushStack(d)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof t)return c.value;b||this.stackSlot--;return c},topStack:function(a){var b=this.isInline()?this.inlineStack:this.compileStack,b=b[b.length-1];return!a&&b instanceof t?b.value:b},quotedString:function(a){return'"'+a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,
1485"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(a,b,c){var d=[];this.setupParams(a,d,c);a=this.nameLookup("helpers",b,"helper");return{params:d,name:a,callParams:["depth0"].concat(d).join(", "),helperMissingParams:c&&["depth0",this.quotedString(b)].concat(d).join(", ")}},setupParams:function(a,b,c){var d=[],e=[],f=[],h,g;d.push("hash:"+this.popStack());h=this.popStack();if((g=this.popStack())||h)g||(this.context.aliases.self="this",g=
1486"self.noop"),h||(this.context.aliases.self="this",h="self.noop"),d.push("inverse:"+h),d.push("fn:"+g);for(g=0;g<a;g++)h=this.popStack(),b.push(h),this.options.stringParams&&(f.push(this.popStack()),e.push(this.popStack()));this.options.stringParams&&(d.push("contexts:["+e.join(",")+"]"),d.push("types:["+f.join(",")+"]"),d.push("hashContexts:hashContexts"),d.push("hashTypes:hashTypes"));this.options.data&&d.push("data:data");d="{"+d.join(",")+"}";c?(this.register("options",d),b.push("options")):b.push(d);
1487return b.join(", ")}};m="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" ");for(var v=s.RESERVED_WORDS={},z=0,y=m.length;z<y;z++)v[m[z]]=!0;s.isValidJavaScriptVariableName=
1488function(a){return!s.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(a)?!0:!1};e.precompile=function(a,b){if(null==a||"string"!==typeof a&&a.constructor!==e.AST.ProgramNode)throw new e.Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{};"data"in b||(b.data=!0);var c=e.parse(a),c=(new w).compile(c,b);return(new s).compile(c,b)};e.compile=function(a,b){if(null==a||"string"!==typeof a&&a.constructor!==e.AST.ProgramNode)throw new e.Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+
1489a);b=b||{};"data"in b||(b.data=!0);var c;return function(d,j){if(!c){var f=e.parse(a),f=(new w).compile(f,b),f=(new s).compile(f,b,p,!0);c=e.template(f)}return c.call(this,d,j)}};e.VM={template:function(a){var b={escapeExpression:e.Utils.escapeExpression,invokePartial:e.VM.invokePartial,programs:[],program:function(a,b,j){var f=this.programs[a];j?f=e.VM.program(a,b,j):f||(f=this.programs[a]=e.VM.program(a,b));return f},programWithDepth:e.VM.programWithDepth,noop:e.VM.noop,compilerInfo:null};return function(c,
1490d){d=d||{};var j=a.call(b,e,c,d.helpers,d.partials,d.data),f=b.compilerInfo||[],h=f[0]||1,g=e.COMPILER_REVISION;if(h!==g){if(h<g)throw"Template was precompiled with an older version of Handlebars than the current runtime. Please update your prec
1490ompiler to a newer version ("+e.REVISION_CHANGES[g]+") or downgrade your runtime to an older version ("+e.REVISION_CHANGES[h]+").";throw"Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+
1491f[1]+").";}return j}},programWithDepth:function(a,b,c){var d=Array.prototype.slice.call(arguments,3),e=function(a,e){e=e||{};return b.apply(this,[a,e.data||c].concat(d))};e.program=a;e.depth=d.length;return e},program:function(a,b,c){var d=function(a,d){d=d||{};return b(a,d.data||c)};d.program=a;d.depth=0;return d},noop:function(){return""},invokePartial:function(a,b,c,d,j,f){d={helpers:d,partials:j,data:f};if(a===p)throw new e.Exception("The partial "+b+" could not be found");if(a instanceof Function)return a(c,
1492d);if(e.compile)return j[b]=e.compile(a,{data:f!==p}),j[b](c,d);throw new e.Exception("The partial "+b+" could not be compiled when running in runtime-only mode");}};e.template=e.VM.template})(Handlebars);
1493/* End */
1494;
1495; /* Start:"a:4:{s:4:"full";s:107:"/bitrix/templates/main_adaptive/components/bitrix/news/news/bitrix/news.list/grdeg/script.js?14984660391713";s:6:"source";s:92:"/bitrix/templates/main_adaptive/components/bitrix/news/news/bitrix/news.list/grdeg/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
1496function initNewsListModel(__opts){
1497
1498	new CList({
1499		matchDomain: window.allowedDomains,
1500		lazyOutput: true,
1501		lop: __opts.newsCount,
1502		navNum: __opts.navNum,
1503		loader: $('.-list-loader').delayedLoader(),
1504		navOpts: {
1505			whenAfterInit: function(){
1506				this.ctrls.area.show();
1507			}
1508		},
1509		responser: new CListAjax({
1510			URL: __opts.url,
1511			tag: __opts.tag,
1512			onInitialize: function(){
1513				this.tmpls.itemTemplate = Handlebars.compile($('.-list-items').find('script[type="text/html"]').html());
1514				Handlebars.registerHelper('preview_text', function(options) {
1515				  	return new Handlebars.SafeString(B64.decode(this.PREVIEW_TEXT));
1516				});
1517			},
1518			whenItemProcess: function(item, index){
1519				return this.tmpls.itemTemplate(item.HTML);
1520			}
1521		}),
1522		whenListContainerFilled: function(){}, // ничё не делать с контейнером
1523		whenListContainerClear: function(){ // просто очищаем список
1524
1525			var list = this.ctrls.list;
1526			list.empty();
1527
1528			if (typeof( $.data(list.get(0), 'masonry') ) != 'undefined') {
1529				list.masonry('destroy');
1530			}
1531
1532			list.masonry({
1533				columnWidth: "",
1534				itemSelector: ".news-item"
1535			});
1536		},
1537		onAfterRefresh: function(items){
1538
1539			this.ctrls.list.masonry('appended', items).masonry();
1540			
1541			this.ctrls.list.masonry('on', 'layoutComplete', function() {
1542				$.publish('lazyLoadRefresh');
1543			})
1544
1545			items.adminBorders({
1546				iblockType: __opts.iblockType,
1547				iblockId: __opts.iblockId,
1548				backURL: __opts.backUrl,
1549				sessid: __opts.sessId
1550			});
1551		},
1552		onLazyGoesOff: function(){
1553			this.ctrls.loader.opts.timeout = 1;
1554		},
1555		onPagerPage: function(){
1556			this.ctrls.loader.opts.timeout = 500;
1557		}
1558	});
1559
1560	$('.new-pagenav').appendTo('.breadcrumbs');
1561}
1562/* End */
1563;; /* /bitrix/templates/main_adaptive/scripts/lists/news.js?172794262448434*/
1564; /* /bitrix/templates/main_adaptive/scripts/lib/handlebars.js?149846604037752*/
1565; /* /bitrix/templates/main_adaptive/components/bitrix/news/news/bitrix/news.list/grdeg/script.js?14984660391713*/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.