swiper_angular.mjs 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313
  1. import * as i0 from '@angular/core';
  2. import { Directive, Input, EventEmitter, PLATFORM_ID, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Output, ViewChild, ContentChildren, HostBinding, NgModule } from '@angular/core';
  3. import * as i1 from '@angular/common';
  4. import { isPlatformBrowser, CommonModule } from '@angular/common';
  5. import Swiper from 'swiper';
  6. import { Subject, of } from 'rxjs';
  7. function isObject(o) {
  8. return (typeof o === 'object' &&
  9. o !== null &&
  10. o.constructor &&
  11. Object.prototype.toString.call(o).slice(8, -1) === 'Object');
  12. }
  13. function isEnabled(val) {
  14. return typeof val !== 'undefined' && typeof val !== 'boolean' && val.enabled === true;
  15. }
  16. function isShowEl(val, obj, el) {
  17. return ((coerceBooleanProperty(val) === true && obj && !obj.el) ||
  18. !(typeof obj !== 'boolean' &&
  19. obj.el !== (el === null || el === void 0 ? void 0 : el.nativeElement) &&
  20. (typeof obj.el === 'string' || typeof obj.el === 'object')));
  21. }
  22. function extend(target, src) {
  23. const noExtend = ['__proto__', 'constructor', 'prototype'];
  24. Object.keys(src)
  25. .filter((key) => noExtend.indexOf(key) < 0)
  26. .forEach((key) => {
  27. if (typeof target[key] === 'undefined') {
  28. target[key] = src[key];
  29. return;
  30. }
  31. if (target[key] && !src[key]) {
  32. return;
  33. }
  34. if (isObject(src[key]) && isObject(target[key]) && Object.keys(src[key]).length > 0) {
  35. if (src[key].__swiper__)
  36. target[key] = src[key];
  37. else
  38. extend(target[key], src[key]);
  39. }
  40. else {
  41. target[key] = src[key];
  42. }
  43. });
  44. }
  45. function coerceBooleanProperty(value) {
  46. return value != null && `${value}` !== 'false';
  47. }
  48. const ignoreNgOnChanges = ['pagination', 'navigation', 'scrollbar', 'virtual'];
  49. function setProperty(val, obj = {}) {
  50. if (isObject(val)) {
  51. return val;
  52. }
  53. if (coerceBooleanProperty(val) === true) {
  54. return obj;
  55. }
  56. return false;
  57. }
  58. /* underscore in name -> watch for changes */
  59. const paramsList = [
  60. 'init',
  61. 'enabled',
  62. '_direction',
  63. 'touchEventsTarget',
  64. 'initialSlide',
  65. '_speed',
  66. 'cssMode',
  67. 'updateOnWindowResize',
  68. 'resizeObserver',
  69. 'nested',
  70. 'focusableElements',
  71. '_width',
  72. '_height',
  73. 'preventInteractionOnTransition',
  74. 'userAgent',
  75. 'url',
  76. '_edgeSwipeDetection',
  77. '_edgeSwipeThreshold',
  78. '_freeMode',
  79. '_autoHeight',
  80. 'setWrapperSize',
  81. 'virtualTranslate',
  82. '_effect',
  83. 'breakpoints',
  84. '_spaceBetween',
  85. '_slidesPerView',
  86. 'maxBackfaceHiddenSlides',
  87. '_grid',
  88. '_slidesPerGroup',
  89. '_slidesPerGroupSkip',
  90. '_centeredSlides',
  91. '_centeredSlidesBounds',
  92. '_slidesOffsetBefore',
  93. '_slidesOffsetAfter',
  94. 'normalizeSlideIndex',
  95. '_centerInsufficientSlides',
  96. '_watchOverflow',
  97. 'roundLengths',
  98. 'touchRatio',
  99. 'touchAngle',
  100. 'simulateTouch',
  101. '_shortSwipes',
  102. '_longSwipes',
  103. 'longSwipesRatio',
  104. 'longSwipesMs',
  105. '_followFinger',
  106. 'allowTouchMove',
  107. '_threshold',
  108. 'touchMoveStopPropagation',
  109. 'touchStartPreventDefault',
  110. 'touchStartForcePreventDefault',
  111. 'touchReleaseOnEdges',
  112. 'uniqueNavElements',
  113. '_resistance',
  114. '_resistanceRatio',
  115. '_watchSlidesProgress',
  116. '_grabCursor',
  117. 'preventClicks',
  118. 'preventClicksPropagation',
  119. '_slideToClickedSlide',
  120. '_preloadImages',
  121. 'updateOnImagesReady',
  122. '_loop',
  123. '_loopAdditionalSlides',
  124. '_loopedSlides',
  125. '_loopFillGroupWithBlank',
  126. 'loopPreventsSlide',
  127. '_rewind',
  128. '_allowSlidePrev',
  129. '_allowSlideNext',
  130. '_swipeHandler',
  131. '_noSwiping',
  132. 'noSwipingClass',
  133. 'noSwipingSelector',
  134. 'passiveListeners',
  135. 'containerModifierClass',
  136. 'slideClass',
  137. 'slideBlankClass',
  138. 'slideActiveClass',
  139. 'slideDuplicateActiveClass',
  140. 'slideVisibleClass',
  141. 'slideDuplicateClass',
  142. 'slideNextClass',
  143. 'slideDuplicateNextClass',
  144. 'slidePrevClass',
  145. 'slideDuplicatePrevClass',
  146. 'wrapperClass',
  147. 'runCallbacksOnInit',
  148. 'observer',
  149. 'observeParents',
  150. 'observeSlideChildren',
  151. // modules
  152. 'a11y',
  153. 'autoplay',
  154. '_controller',
  155. 'coverflowEffect',
  156. 'cubeEffect',
  157. 'fadeEffect',
  158. 'flipEffect',
  159. 'creativeEffect',
  160. 'cardsEffect',
  161. 'hashNavigation',
  162. 'history',
  163. 'keyboard',
  164. 'lazy',
  165. 'mousewheel',
  166. '_navigation',
  167. '_pagination',
  168. 'parallax',
  169. '_scrollbar',
  170. '_thumbs',
  171. 'virtual',
  172. 'zoom',
  173. 'on',
  174. ];
  175. const allowedParams = paramsList.map((key) => key.replace(/_/, ''));
  176. function getParams(obj = {}) {
  177. const params = {
  178. on: {},
  179. };
  180. // const events = {};
  181. const passedParams = {};
  182. extend(params, Swiper.defaults);
  183. extend(params, Swiper.extendedDefaults);
  184. params._emitClasses = true;
  185. params.init = false;
  186. const rest = {};
  187. const allowedParams = paramsList.map((key) => key.replace(/_/, ''));
  188. Object.keys(obj).forEach((key) => {
  189. const _key = key.replace(/^_/, '');
  190. if (allowedParams.indexOf(_key) >= 0) {
  191. if (isObject(obj[key])) {
  192. params[_key] = {};
  193. passedParams[_key] = {};
  194. extend(params[_key], obj[key]);
  195. extend(passedParams[_key], obj[key]);
  196. }
  197. else {
  198. params[_key] = obj[key];
  199. passedParams[_key] = obj[key];
  200. }
  201. }
  202. // else if (key.search(/on[A-Z]/) === 0 && typeof obj[key] === 'function') {
  203. // events[`${_key[2].toLowerCase()}${key.substr(3)}`] = obj[key];
  204. // }
  205. else {
  206. rest[_key] = obj[key];
  207. }
  208. });
  209. ['navigation', 'pagination', 'scrollbar'].forEach((key) => {
  210. if (params[key] === true)
  211. params[key] = {};
  212. if (params[key] === false)
  213. delete params[key];
  214. });
  215. return { params, passedParams, rest };
  216. }
  217. class SwiperSlideDirective {
  218. constructor(template) {
  219. this.template = template;
  220. this.class = '';
  221. this.autoplayDelay = null;
  222. this.slideData = {
  223. isActive: false,
  224. isPrev: false,
  225. isNext: false,
  226. isVisible: false,
  227. isDuplicate: false,
  228. };
  229. }
  230. set zoom(val) {
  231. this._zoom = coerceBooleanProperty(val);
  232. }
  233. get zoom() {
  234. return this._zoom;
  235. }
  236. get classNames() {
  237. return this._classNames;
  238. }
  239. set classNames(val) {
  240. if (this._classNames === val) {
  241. return;
  242. }
  243. this._classNames = val;
  244. this.slideData = {
  245. isActive: this._hasClass(['swiper-slide-active', 'swiper-slide-duplicate-active']),
  246. isVisible: this._hasClass(['swiper-slide-visible']),
  247. isDuplicate: this._hasClass(['swiper-slide-duplicate']),
  248. isPrev: this._hasClass(['swiper-slide-prev', 'swiper-slide-duplicate-prev']),
  249. isNext: this._hasClass(['swiper-slide-next', 'swiper-slide-duplicate-next']),
  250. };
  251. }
  252. _hasClass(classNames) {
  253. return classNames.some((className) => this._classNames.indexOf(className) >= 0);
  254. }
  255. }
  256. SwiperSlideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SwiperSlideDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
  257. SwiperSlideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: SwiperSlideDirective, selector: "ng-template[swiperSlide]", inputs: { virtualIndex: "virtualIndex", class: "class", autoplayDelay: ["data-swiper-autoplay", "autoplayDelay"], zoom: "zoom" }, ngImport: i0 });
  258. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SwiperSlideDirective, decorators: [{
  259. type: Directive,
  260. args: [{
  261. selector: 'ng-template[swiperSlide]',
  262. }]
  263. }], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { virtualIndex: [{
  264. type: Input
  265. }], class: [{
  266. type: Input
  267. }], autoplayDelay: [{
  268. type: Input,
  269. args: ['data-swiper-autoplay']
  270. }], zoom: [{
  271. type: Input
  272. }] } });
  273. class SwiperComponent {
  274. constructor(_ngZone, elementRef, _changeDetectorRef, _platformId) {
  275. this._ngZone = _ngZone;
  276. this.elementRef = elementRef;
  277. this._changeDetectorRef = _changeDetectorRef;
  278. this._platformId = _platformId;
  279. this.slideClass = 'swiper-slide';
  280. this.wrapperClass = 'swiper-wrapper';
  281. this.showNavigation = true;
  282. this.showPagination = true;
  283. this.showScrollbar = true;
  284. this.s__beforeBreakpoint = new EventEmitter();
  285. this.s__containerClasses = new EventEmitter();
  286. this.s__slideClass = new EventEmitter();
  287. this.s__swiper = new EventEmitter();
  288. this.s_activeIndexChange = new EventEmitter();
  289. this.s_afterInit = new EventEmitter();
  290. this.s_autoplay = new EventEmitter();
  291. this.s_autoplayStart = new EventEmitter();
  292. this.s_autoplayStop = new EventEmitter();
  293. this.s_autoplayPause = new EventEmitter();
  294. this.s_autoplayResume = new EventEmitter();
  295. this.s_beforeDestroy = new EventEmitter();
  296. this.s_beforeInit = new EventEmitter();
  297. this.s_beforeLoopFix = new EventEmitter();
  298. this.s_beforeResize = new EventEmitter();
  299. this.s_beforeSlideChangeStart = new EventEmitter();
  300. this.s_beforeTransitionStart = new EventEmitter();
  301. this.s_breakpoint = new EventEmitter();
  302. this.s_changeDirection = new EventEmitter();
  303. this.s_click = new EventEmitter();
  304. this.s_doubleTap = new EventEmitter();
  305. this.s_doubleClick = new EventEmitter();
  306. this.s_destroy = new EventEmitter();
  307. this.s_fromEdge = new EventEmitter();
  308. this.s_hashChange = new EventEmitter();
  309. this.s_hashSet = new EventEmitter();
  310. this.s_imagesReady = new EventEmitter();
  311. this.s_init = new EventEmitter();
  312. this.s_keyPress = new EventEmitter();
  313. this.s_lazyImageLoad = new EventEmitter();
  314. this.s_lazyImageReady = new EventEmitter();
  315. this.s_loopFix = new EventEmitter();
  316. this.s_momentumBounce = new EventEmitter();
  317. this.s_navigationHide = new EventEmitter();
  318. this.s_navigationShow = new EventEmitter();
  319. this.s_observerUpdate = new EventEmitter();
  320. this.s_orientationchange = new EventEmitter();
  321. this.s_paginationHide = new EventEmitter();
  322. this.s_paginationRender = new EventEmitter();
  323. this.s_paginationShow = new EventEmitter();
  324. this.s_paginationUpdate = new EventEmitter();
  325. this.s_progress = new EventEmitter();
  326. this.s_reachBeginning = new EventEmitter();
  327. this.s_reachEnd = new EventEmitter();
  328. this.s_realIndexChange = new EventEmitter();
  329. this.s_resize = new EventEmitter();
  330. this.s_scroll = new EventEmitter();
  331. this.s_scrollbarDragEnd = new EventEmitter();
  332. this.s_scrollbarDragMove = new EventEmitter();
  333. this.s_scrollbarDragStart = new EventEmitter();
  334. this.s_setTransition = new EventEmitter();
  335. this.s_setTranslate = new EventEmitter();
  336. this.s_slideChange = new EventEmitter();
  337. this.s_slideChangeTransitionEnd = new EventEmitter();
  338. this.s_slideChangeTransitionStart = new EventEmitter();
  339. this.s_slideNextTransitionEnd = new EventEmitter();
  340. this.s_slideNextTransitionStart = new EventEmitter();
  341. this.s_slidePrevTransitionEnd = new EventEmitter();
  342. this.s_slidePrevTransitionStart = new EventEmitter();
  343. this.s_slideResetTransitionStart = new EventEmitter();
  344. this.s_slideResetTransitionEnd = new EventEmitter();
  345. this.s_sliderMove = new EventEmitter();
  346. this.s_sliderFirstMove = new EventEmitter();
  347. this.s_slidesLengthChange = new EventEmitter();
  348. this.s_slidesGridLengthChange = new EventEmitter();
  349. this.s_snapGridLengthChange = new EventEmitter();
  350. this.s_snapIndexChange = new EventEmitter();
  351. this.s_tap = new EventEmitter();
  352. this.s_toEdge = new EventEmitter();
  353. this.s_touchEnd = new EventEmitter();
  354. this.s_touchMove = new EventEmitter();
  355. this.s_touchMoveOpposite = new EventEmitter();
  356. this.s_touchStart = new EventEmitter();
  357. this.s_transitionEnd = new EventEmitter();
  358. this.s_transitionStart = new EventEmitter();
  359. this.s_update = new EventEmitter();
  360. this.s_zoomChange = new EventEmitter();
  361. this.s_swiper = new EventEmitter();
  362. this.s_lock = new EventEmitter();
  363. this.s_unlock = new EventEmitter();
  364. this._activeSlides = new Subject();
  365. this.containerClasses = 'swiper';
  366. this.slidesChanges = (val) => {
  367. this.slides = val.map((slide, index) => {
  368. slide.slideIndex = index;
  369. slide.classNames = this.slideClass || '';
  370. return slide;
  371. });
  372. if (this.loop && !this.loopedSlides) {
  373. this.calcLoopedSlides();
  374. }
  375. if (!this.virtual) {
  376. if (this.loopedSlides) {
  377. this.prependSlides = of(this.slides.slice(this.slides.length - this.loopedSlides));
  378. this.appendSlides = of(this.slides.slice(0, this.loopedSlides));
  379. }
  380. }
  381. else if (this.swiperRef && this.swiperRef.virtual) {
  382. this._ngZone.runOutsideAngular(() => {
  383. this.swiperRef.virtual.slides = this.slides;
  384. this.swiperRef.virtual.update(true);
  385. });
  386. }
  387. this._changeDetectorRef.detectChanges();
  388. };
  389. this.style = null;
  390. this.updateVirtualSlides = (virtualData) => {
  391. // TODO: type virtualData
  392. if (!this.swiperRef ||
  393. (this.currentVirtualData &&
  394. this.currentVirtualData.from === virtualData.from &&
  395. this.currentVirtualData.to === virtualData.to &&
  396. this.currentVirtualData.offset === virtualData.offset)) {
  397. return;
  398. }
  399. this.style = this.swiperRef.isHorizontal()
  400. ? {
  401. [this.swiperRef.rtlTranslate ? 'right' : 'left']: `${virtualData.offset}px`,
  402. }
  403. : {
  404. top: `${virtualData.offset}px`,
  405. };
  406. this.currentVirtualData = virtualData;
  407. this._activeSlides.next(virtualData.slides);
  408. this._ngZone.run(() => {
  409. this._changeDetectorRef.detectChanges();
  410. });
  411. this._ngZone.runOutsideAngular(() => {
  412. this.swiperRef.updateSlides();
  413. this.swiperRef.updateProgress();
  414. this.swiperRef.updateSlidesClasses();
  415. if (isEnabled(this.swiperRef.params.lazy)) {
  416. this.swiperRef.lazy.load();
  417. }
  418. this.swiperRef.virtual.update(true);
  419. });
  420. return;
  421. };
  422. }
  423. set navigation(val) {
  424. var _a, _b, _c;
  425. const currentNext = typeof this._navigation !== 'boolean' && this._navigation !== ''
  426. ? (_a = this._navigation) === null || _a === void 0 ? void 0 : _a.nextEl
  427. : null;
  428. const currentPrev = typeof this._navigation !== 'boolean' && this._navigation !== ''
  429. ? (_b = this._navigation) === null || _b === void 0 ? void 0 : _b.prevEl
  430. : null;
  431. this._navigation = setProperty(val, {
  432. nextEl: currentNext || null,
  433. prevEl: currentPrev || null,
  434. });
  435. this.showNavigation = !(coerceBooleanProperty(val) !== true ||
  436. (this._navigation &&
  437. typeof this._navigation !== 'boolean' &&
  438. this._navigation.prevEl !== ((_c = this._prevElRef) === null || _c === void 0 ? void 0 : _c.nativeElement) &&
  439. (this._navigation.prevEl !== null || this._navigation.nextEl !== null) &&
  440. (typeof this._navigation.nextEl === 'string' ||
  441. typeof this._navigation.prevEl === 'string' ||
  442. typeof this._navigation.nextEl === 'object' ||
  443. typeof this._navigation.prevEl === 'object')));
  444. }
  445. get navigation() {
  446. return this._navigation;
  447. }
  448. set pagination(val) {
  449. var _a;
  450. const current = typeof this._pagination !== 'boolean' && this._pagination !== ''
  451. ? (_a = this._pagination) === null || _a === void 0 ? void 0 : _a.el
  452. : null;
  453. this._pagination = setProperty(val, {
  454. el: current || null,
  455. });
  456. this.showPagination = isShowEl(val, this._pagination, this._paginationElRef);
  457. }
  458. get pagination() {
  459. return this._pagination;
  460. }
  461. set scrollbar(val) {
  462. var _a;
  463. const current = typeof this._scrollbar !== 'boolean' && this._scrollbar !== '' ? (_a = this._scrollbar) === null || _a === void 0 ? void 0 : _a.el : null;
  464. this._scrollbar = setProperty(val, {
  465. el: current || null,
  466. });
  467. this.showScrollbar = isShowEl(val, this._scrollbar, this._scrollbarElRef);
  468. }
  469. get scrollbar() {
  470. return this._scrollbar;
  471. }
  472. set virtual(val) {
  473. this._virtual = setProperty(val);
  474. }
  475. get virtual() {
  476. return this._virtual;
  477. }
  478. set config(val) {
  479. this.updateSwiper(val);
  480. const { params } = getParams(val);
  481. Object.assign(this, params);
  482. }
  483. set prevElRef(el) {
  484. this._prevElRef = el;
  485. this._setElement(el, this.navigation, 'navigation', 'prevEl');
  486. }
  487. set nextElRef(el) {
  488. this._nextElRef = el;
  489. this._setElement(el, this.navigation, 'navigation', 'nextEl');
  490. }
  491. set scrollbarElRef(el) {
  492. this._scrollbarElRef = el;
  493. this._setElement(el, this.scrollbar, 'scrollbar');
  494. }
  495. set paginationElRef(el) {
  496. this._paginationElRef = el;
  497. this._setElement(el, this.pagination, 'pagination');
  498. }
  499. get activeSlides() {
  500. if (this.virtual) {
  501. return this._activeSlides;
  502. }
  503. return of(this.slides);
  504. }
  505. get zoomContainerClass() {
  506. return this.zoom && typeof this.zoom !== 'boolean'
  507. ? this.zoom.containerClass
  508. : 'swiper-zoom-container';
  509. }
  510. _setElement(el, ref, update, key = 'el') {
  511. if (!ref || !el)
  512. return;
  513. if (el.nativeElement) {
  514. if (ref[key] === el.nativeElement) {
  515. return;
  516. }
  517. ref[key] = el.nativeElement;
  518. }
  519. const updateObj = {};
  520. updateObj[update] = true;
  521. this.updateInitSwiper(updateObj);
  522. }
  523. ngOnInit() {
  524. const { params } = getParams(this);
  525. Object.assign(this, params);
  526. }
  527. ngAfterViewInit() {
  528. this.childrenSlidesInit();
  529. this.initSwiper();
  530. this._changeDetectorRef.detectChanges();
  531. setTimeout(() => {
  532. this.s_swiper.emit(this.swiperRef);
  533. });
  534. }
  535. childrenSlidesInit() {
  536. this.slidesChanges(this.slidesEl);
  537. this.slidesEl.changes.subscribe(this.slidesChanges);
  538. }
  539. get isSwiperActive() {
  540. return this.swiperRef && !this.swiperRef.destroyed;
  541. }
  542. initSwiper() {
  543. const { params: swiperParams, passedParams } = getParams(this);
  544. Object.assign(this, swiperParams);
  545. this._ngZone.runOutsideAngular(() => {
  546. swiperParams.init = false;
  547. if (!swiperParams.virtual) {
  548. swiperParams.observer = true;
  549. }
  550. swiperParams.onAny = (eventName, ...args) => {
  551. const emitter = this[('s_' + eventName)];
  552. if (emitter) {
  553. emitter.emit([...args]);
  554. }
  555. };
  556. const _slideClasses = (_, updated) => {
  557. updated.forEach(({ slideEl, classNames }, index) => {
  558. const dataIndex = slideEl.getAttribute('data-swiper-slide-index');
  559. const slideIndex = dataIndex ? parseInt(dataIndex) : index;
  560. if (this.virtual) {
  561. const virtualSlide = this.slides.find((item) => {
  562. return item.virtualIndex && item.virtualIndex === slideIndex;
  563. });
  564. if (virtualSlide) {
  565. virtualSlide.classNames = classNames;
  566. return;
  567. }
  568. }
  569. if (this.slides[slideIndex]) {
  570. this.slides[slideIndex].classNames = classNames;
  571. }
  572. });
  573. this._changeDetectorRef.detectChanges();
  574. };
  575. const _containerClasses = (_, classes) => {
  576. setTimeout(() => {
  577. this.containerClasses = classes;
  578. });
  579. };
  580. Object.assign(swiperParams.on, {
  581. _containerClasses,
  582. _slideClasses,
  583. });
  584. const swiperRef = new Swiper(swiperParams);
  585. swiperRef.loopCreate = () => { };
  586. swiperRef.loopDestroy = () => { };
  587. if (swiperParams.loop) {
  588. swiperRef.loopedSlides = this.loopedSlides;
  589. }
  590. const isVirtualEnabled = isEnabled(swiperRef.params.virtual);
  591. if (swiperRef.virtual && isVirtualEnabled) {
  592. swiperRef.virtual.slides = this.slides;
  593. const extendWith = {
  594. cache: false,
  595. slides: this.slides,
  596. renderExternal: this.updateVirtualSlides,
  597. renderExternalUpdate: false,
  598. };
  599. extend(swiperRef.params.virtual, extendWith);
  600. extend(swiperRef.originalParams.virtual, extendWith);
  601. }
  602. if (isPlatformBrowser(this._platformId)) {
  603. this.swiperRef = swiperRef.init(this.elementRef.nativeElement);
  604. const isVirtualEnabled = isEnabled(this.swiperRef.params.virtual);
  605. if (this.swiperRef.virtual && isVirtualEnabled) {
  606. this.swiperRef.virtual.update(true);
  607. }
  608. this._changeDetectorRef.detectChanges();
  609. }
  610. });
  611. }
  612. ngOnChanges(changedParams) {
  613. this.updateSwiper(changedParams);
  614. this._changeDetectorRef.detectChanges();
  615. }
  616. updateInitSwiper(changedParams) {
  617. if (!(changedParams && this.swiperRef && !this.swiperRef.destroyed)) {
  618. return;
  619. }
  620. this._ngZone.runOutsideAngular(() => {
  621. const { params: currentParams, pagination, navigation, scrollbar, virtual, thumbs, } = this.swiperRef;
  622. if (changedParams.pagination) {
  623. if (this.pagination &&
  624. typeof this.pagination !== 'boolean' &&
  625. this.pagination.el &&
  626. pagination &&
  627. !pagination.el) {
  628. this.updateParameter('pagination', this.pagination);
  629. pagination.init();
  630. pagination.render();
  631. pagination.update();
  632. }
  633. else {
  634. pagination.destroy();
  635. pagination.el = null;
  636. }
  637. }
  638. if (changedParams.scrollbar) {
  639. if (this.scrollbar &&
  640. typeof this.scrollbar !== 'boolean' &&
  641. this.scrollbar.el &&
  642. scrollbar &&
  643. !scrollbar.el) {
  644. this.updateParameter('scrollbar', this.scrollbar);
  645. scrollbar.init();
  646. scrollbar.updateSize();
  647. scrollbar.setTranslate();
  648. }
  649. else {
  650. scrollbar.destroy();
  651. scrollbar.el = null;
  652. }
  653. }
  654. if (changedParams.navigation) {
  655. if (this.navigation &&
  656. typeof this.navigation !== 'boolean' &&
  657. this.navigation.prevEl &&
  658. this.navigation.nextEl &&
  659. navigation &&
  660. !navigation.prevEl &&
  661. !navigation.nextEl) {
  662. this.updateParameter('navigation', this.navigation);
  663. navigation.init();
  664. navigation.update();
  665. }
  666. else if (navigation.prevEl && navigation.nextEl) {
  667. navigation.destroy();
  668. navigation.nextEl = null;
  669. navigation.prevEl = null;
  670. }
  671. }
  672. if (changedParams.thumbs && this.thumbs && this.thumbs.swiper) {
  673. this.updateParameter('thumbs', this.thumbs);
  674. const initialized = thumbs.init();
  675. if (initialized)
  676. thumbs.update(true);
  677. }
  678. if (changedParams.controller && this.controller && this.controller.control) {
  679. this.swiperRef.controller.control = this.controller.control;
  680. }
  681. this.swiperRef.update();
  682. });
  683. }
  684. updateSwiper(changedParams) {
  685. this._ngZone.runOutsideAngular(() => {
  686. var _a, _b;
  687. if (changedParams.config) {
  688. return;
  689. }
  690. if (!(changedParams && this.swiperRef && !this.swiperRef.destroyed)) {
  691. return;
  692. }
  693. for (const key in changedParams) {
  694. if (ignoreNgOnChanges.indexOf(key) >= 0) {
  695. continue;
  696. }
  697. const newValue = (_b = (_a = changedParams[key]) === null || _a === void 0 ? void 0 : _a.currentValue) !== null && _b !== void 0 ? _b : changedParams[key];
  698. this.updateParameter(key, newValue);
  699. }
  700. if (changedParams.allowSlideNext) {
  701. this.swiperRef.allowSlideNext = this.allowSlideNext;
  702. }
  703. if (changedParams.allowSlidePrev) {
  704. this.swiperRef.allowSlidePrev = this.allowSlidePrev;
  705. }
  706. if (changedParams.direction) {
  707. this.swiperRef.changeDirection(this.direction, false);
  708. }
  709. if (changedParams.breakpoints) {
  710. if (this.loop && !this.loopedSlides) {
  711. this.calcLoopedSlides();
  712. }
  713. this.swiperRef.currentBreakpoint = null;
  714. this.swiperRef.setBreakpoint();
  715. }
  716. if (changedParams.thumbs || changedParams.controller) {
  717. this.updateInitSwiper(changedParams);
  718. }
  719. this.swiperRef.update();
  720. });
  721. }
  722. calcLoopedSlides() {
  723. if (!this.loop) {
  724. return false;
  725. }
  726. let slidesPerViewParams = this.slidesPerView;
  727. if (this.breakpoints) {
  728. const breakpoint = Swiper.prototype.getBreakpoint(this.breakpoints);
  729. const breakpointOnlyParams = breakpoint in this.breakpoints ? this.breakpoints[breakpoint] : undefined;
  730. if (breakpointOnlyParams && breakpointOnlyParams.slidesPerView) {
  731. slidesPerViewParams = breakpointOnlyParams.slidesPerView;
  732. }
  733. }
  734. if (slidesPerViewParams === 'auto') {
  735. this.loopedSlides = this.slides.length;
  736. return this.slides.length;
  737. }
  738. let loopedSlides = this.loopedSlides || slidesPerViewParams;
  739. if (!loopedSlides) {
  740. // ?
  741. return false;
  742. }
  743. if (this.loopAdditionalSlides) {
  744. loopedSlides += this.loopAdditionalSlides;
  745. }
  746. if (loopedSlides > this.slides.length) {
  747. loopedSlides = this.slides.length;
  748. }
  749. this.loopedSlides = loopedSlides;
  750. return true;
  751. }
  752. updateParameter(key, value) {
  753. if (!(this.swiperRef && !this.swiperRef.destroyed)) {
  754. return;
  755. }
  756. const _key = key.replace(/^_/, '');
  757. const isCurrentParamObj = isObject(this.swiperRef.params[_key]);
  758. if (_key === 'enabled') {
  759. if (value === true) {
  760. this.swiperRef.enable();
  761. }
  762. else if (value === false) {
  763. this.swiperRef.disable();
  764. }
  765. return;
  766. }
  767. if (isCurrentParamObj && isObject(value)) {
  768. extend(this.swiperRef.params[_key], value);
  769. }
  770. else {
  771. this.swiperRef.params[_key] = value;
  772. }
  773. }
  774. ngOnDestroy() {
  775. this._ngZone.runOutsideAngular(() => {
  776. var _a;
  777. (_a = this.swiperRef) === null || _a === void 0 ? void 0 : _a.destroy(true, false);
  778. });
  779. }
  780. }
  781. SwiperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SwiperComponent, deps: [{ token: i0.NgZone }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
  782. SwiperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: SwiperComponent, selector: "swiper, [swiper]", inputs: { enabled: "enabled", on: "on", direction: "direction", touchEventsTarget: "touchEventsTarget", initialSlide: "initialSlide", speed: "speed", cssMode: "cssMode", updateOnWindowResize: "updateOnWindowResize", resizeObserver: "resizeObserver", nested: "nested", focusableElements: "focusableElements", width: "width", height: "height", preventInteractionOnTransition: "preventInteractionOnTransition", userAgent: "userAgent", url: "url", edgeSwipeDetection: "edgeSwipeDetection", edgeSwipeThreshold: "edgeSwipeThreshold", freeMode: "freeMode", autoHeight: "autoHeight", setWrapperSize: "setWrapperSize", virtualTranslate: "virtualTranslate", effect: "effect", breakpoints: "breakpoints", spaceBetween: "spaceBetween", slidesPerView: "slidesPerView", maxBackfaceHiddenSlides: "maxBackfaceHiddenSlides", grid: "grid", slidesPerGroup: "slidesPerGroup", slidesPerGroupSkip: "slidesPerGroupSkip", centeredSlides: "centeredSlides", centeredSlidesBounds: "centeredSlidesBounds", slidesOffsetBefore: "slidesOffsetBefore", slidesOffsetAfter: "slidesOffsetAfter", normalizeSlideIndex: "normalizeSlideIndex", centerInsufficientSlides: "centerInsufficientSlides", watchOverflow: "watchOverflow", roundLengths: "roundLengths", touchRatio: "touchRatio", touchAngle: "touchAngle", simulateTouch: "simulateTouch", shortSwipes: "shortSwipes", longSwipes: "longSwipes", longSwipesRatio: "longSwipesRatio", longSwipesMs: "longSwipesMs", followFinger: "followFinger", allowTouchMove: "allowTouchMove", threshold: "threshold", touchMoveStopPropagation: "touchMoveStopPropagation", touchStartPreventDefault: "touchStartPreventDefault", touchStartForcePreventDefault: "touchStartForcePreventDefault", touchReleaseOnEdges: "touchReleaseOnEdges", uniqueNavElements: "uniqueNavElements", resistance: "resistance", resistanceRatio: "resistanceRatio", watchSlidesProgress: "watchSlidesProgress", grabCursor: "grabCursor", preventClicks: "preventClicks", preventClicksPropagation: "preventClicksPropagation", slideToClickedSlide: "slideToClickedSlide", preloadImages: "preloadImages", updateOnImagesReady: "updateOnImagesReady", loop: "loop", loopAdditionalSlides: "loopAdditionalSlides", loopedSlides: "loopedSlides", loopFillGroupWithBlank: "loopFillGroupWithBlank", loopPreventsSlide: "loopPreventsSlide", rewind: "rewind", allowSlidePrev: "allowSlidePrev", allowSlideNext: "allowSlideNext", swipeHandler: "swipeHandler", noSwiping: "noSwiping", noSwipingClass: "noSwipingClass", noSwipingSelector: "noSwipingSelector", passiveListeners: "passiveListeners", containerModifierClass: "containerModifierClass", slideClass: "slideClass", slideBlankClass: "slideBlankClass", slideActiveClass: "slideActiveClass", slideDuplicateActiveClass: "slideDuplicateActiveClass", slideVisibleClass: "slideVisibleClass", slideDuplicateClass: "slideDuplicateClass", slideNextClass: "slideNextClass", slideDuplicateNextClass: "slideDuplicateNextClass", slidePrevClass: "slidePrevClass", slideDuplicatePrevClass: "slideDuplicatePrevClass", wrapperClass: "wrapperClass", runCallbacksOnInit: "runCallbacksOnInit", observeParents: "observeParents", observeSlideChildren: "observeSlideChildren", a11y: "a11y", autoplay: "autoplay", controller: "controller", coverflowEffect: "coverflowEffect", cubeEffect: "cubeEffect", fadeEffect: "fadeEffect", flipEffect: "flipEffect", creativeEffect: "creativeEffect", cardsEffect: "cardsEffect", hashNavigation: "hashNavigation", history: "history", keyboard: "keyboard", lazy: "lazy", mousewheel: "mousewheel", parallax: "parallax", thumbs: "thumbs", zoom: "zoom", class: "class", id: "id", navigation: "navigation", pagination: "pagination", scrollbar: "scrollbar", virtual: "virtual", config: "config" }, outputs: { s__beforeBreakpoint: "_beforeBreakpoint", s__containerClasses: "_containerClasses", s__slideClass: "_slideClass", s__swiper: "_swiper", s_activeIndexChange: "activeIndexChange", s_afterInit: "afterInit", s_autoplay: "autoplay", s_autoplayStart: "autoplayStart", s_autoplayStop: "autoplayStop", s_autoplayPause: "autoplayPause", s_autoplayResume: "autoplayResume", s_beforeDestroy: "beforeDestroy", s_beforeInit: "beforeInit", s_beforeLoopFix: "beforeLoopFix", s_beforeResize: "beforeResize", s_beforeSlideChangeStart: "beforeSlideChangeStart", s_beforeTransitionStart: "beforeTransitionStart", s_breakpoint: "breakpoint", s_changeDirection: "changeDirection", s_click: "click", s_doubleTap: "doubleTap", s_doubleClick: "doubleClick", s_destroy: "destroy", s_fromEdge: "fromEdge", s_hashChange: "hashChange", s_hashSet: "hashSet", s_imagesReady: "imagesReady", s_init: "init", s_keyPress: "keyPress", s_lazyImageLoad: "lazyImageLoad", s_lazyImageReady: "lazyImageReady", s_loopFix: "loopFix", s_momentumBounce: "momentumBounce", s_navigationHide: "navigationHide", s_navigationShow: "navigationShow", s_observerUpdate: "observerUpdate", s_orientationchange: "orientationchange", s_paginationHide: "paginationHide", s_paginationRender: "paginationRender", s_paginationShow: "paginationShow", s_paginationUpdate: "paginationUpdate", s_progress: "progress", s_reachBeginning: "reachBeginning", s_reachEnd: "reachEnd", s_realIndexChange: "realIndexChange", s_resize: "resize", s_scroll: "scroll", s_scrollbarDragEnd: "scrollbarDragEnd", s_scrollbarDragMove: "scrollbarDragMove", s_scrollbarDragStart: "scrollbarDragStart", s_setTransition: "setTransition", s_setTranslate: "setTranslate", s_slideChange: "slideChange", s_slideChangeTransitionEnd: "slideChangeTransitionEnd", s_slideChangeTransitionStart: "slideChangeTransitionStart", s_slideNextTransitionEnd: "slideNextTransitionEnd", s_slideNextTransitionStart: "slideNextTransitionStart", s_slidePrevTransitionEnd: "slidePrevTransitionEnd", s_slidePrevTransitionStart: "slidePrevTransitionStart", s_slideResetTransitionStart: "slideResetTransitionStart", s_slideResetTransitionEnd: "slideResetTransitionEnd", s_sliderMove: "sliderMove", s_sliderFirstMove: "sliderFirstMove", s_slidesLengthChange: "slidesLengthChange", s_slidesGridLengthChange: "slidesGridLengthChange", s_snapGridLengthChange: "snapGridLengthChange", s_snapIndexChange: "snapIndexChange", s_tap: "tap", s_toEdge: "toEdge", s_touchEnd: "touchEnd", s_touchMove: "touchMove", s_touchMoveOpposite: "touchMoveOpposite", s_touchStart: "touchStart", s_transitionEnd: "transitionEnd", s_transitionStart: "transitionStart", s_update: "update", s_zoomChange: "zoomChange", s_swiper: "swiper", s_lock: "lock", s_unlock: "unlock" }, host: { properties: { "class": "this.containerClasses" } }, queries: [{ propertyName: "slidesEl", predicate: SwiperSlideDirective }], viewQueries: [{ propertyName: "prevElRef", first: true, predicate: ["prevElRef"], descendants: true }, { propertyName: "nextElRef", first: true, predicate: ["nextElRef"], descendants: true }, { propertyName: "scrollbarElRef", first: true, predicate: ["scrollbarElRef"], descendants: true }, { propertyName: "paginationElRef", first: true, predicate: ["paginationElRef"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-content select=\"[slot=container-start]\"></ng-content>\n<ng-container *ngIf=\"navigation && showNavigation\">\n <div class=\"swiper-button-prev\" #prevElRef></div>\n <div class=\"swiper-button-next\" #nextElRef></div>\n</ng-container>\n<div *ngIf=\"scrollbar && showScrollbar\" class=\"swiper-scrollbar\" #scrollbarElRef></div>\n<div *ngIf=\"pagination && showPagination\" class=\"swiper-pagination\" #paginationElRef></div>\n<div [ngClass]=\"wrapperClass\" [attr.id]=\"id\">\n <ng-content select=\"[slot=wrapper-start]\"></ng-content>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: prependSlides,\n key: 'prepend'\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: activeSlides,\n key: ''\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: appendSlides,\n key: 'append'\n }\n \"\n ></ng-template>\n <ng-content select=\"[slot=wrapper-end]\"></ng-content>\n</div>\n<ng-content select=\"[slot=container-end]\"></ng-content>\n\n<ng-template #slidesTemplate let-loopSlides=\"loopSlides\" let-slideKey=\"key\">\n <div\n *ngFor=\"let slide of loopSlides | async\"\n [ngClass]=\"\n (slide.class ? slide.class + ' ' : '') +\n slideClass +\n (slideKey !== '' ? ' ' + slideDuplicateClass : '')\n \"\n [attr.data-swiper-slide-index]=\"slide.virtualIndex ? slide.virtualIndex : slide.slideIndex\"\n [attr.data-swiper-autoplay]=\"slide.autoplayDelay\"\n [style]=\"style\"\n [ngSwitch]=\"slide.zoom\"\n >\n <div *ngSwitchCase=\"true\" [ngClass]=\"zoomContainerClass\">\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </div>\n <ng-container *ngSwitchDefault>\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </ng-container>\n </div>\n</ng-template>\n", styles: ["swiper{display:block}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }], pipes: { "async": i1.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  783. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SwiperComponent, decorators: [{
  784. type: Component,
  785. args: [{ selector: 'swiper, [swiper]', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [
  786. `
  787. swiper {
  788. display: block;
  789. }
  790. `,
  791. ], template: "<ng-content select=\"[slot=container-start]\"></ng-content>\n<ng-container *ngIf=\"navigation && showNavigation\">\n <div class=\"swiper-button-prev\" #prevElRef></div>\n <div class=\"swiper-button-next\" #nextElRef></div>\n</ng-container>\n<div *ngIf=\"scrollbar && showScrollbar\" class=\"swiper-scrollbar\" #scrollbarElRef></div>\n<div *ngIf=\"pagination && showPagination\" class=\"swiper-pagination\" #paginationElRef></div>\n<div [ngClass]=\"wrapperClass\" [attr.id]=\"id\">\n <ng-content select=\"[slot=wrapper-start]\"></ng-content>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: prependSlides,\n key: 'prepend'\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: activeSlides,\n key: ''\n }\n \"\n ></ng-template>\n <ng-template\n *ngTemplateOutlet=\"\n slidesTemplate;\n context: {\n loopSlides: appendSlides,\n key: 'append'\n }\n \"\n ></ng-template>\n <ng-content select=\"[slot=wrapper-end]\"></ng-content>\n</div>\n<ng-content select=\"[slot=container-end]\"></ng-content>\n\n<ng-template #slidesTemplate let-loopSlides=\"loopSlides\" let-slideKey=\"key\">\n <div\n *ngFor=\"let slide of loopSlides | async\"\n [ngClass]=\"\n (slide.class ? slide.class + ' ' : '') +\n slideClass +\n (slideKey !== '' ? ' ' + slideDuplicateClass : '')\n \"\n [attr.data-swiper-slide-index]=\"slide.virtualIndex ? slide.virtualIndex : slide.slideIndex\"\n [attr.data-swiper-autoplay]=\"slide.autoplayDelay\"\n [style]=\"style\"\n [ngSwitch]=\"slide.zoom\"\n >\n <div *ngSwitchCase=\"true\" [ngClass]=\"zoomContainerClass\">\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </div>\n <ng-container *ngSwitchDefault>\n <ng-template\n [ngTemplateOutlet]=\"slide.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: slide.slideData\n }\"\n ></ng-template>\n </ng-container>\n </div>\n</ng-template>\n" }]
  792. }], ctorParameters: function () {
  793. return [{ type: i0.NgZone }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: Object, decorators: [{
  794. type: Inject,
  795. args: [PLATFORM_ID]
  796. }] }];
  797. }, propDecorators: { enabled: [{
  798. type: Input
  799. }], on: [{
  800. type: Input
  801. }], direction: [{
  802. type: Input
  803. }], touchEventsTarget: [{
  804. type: Input
  805. }], initialSlide: [{
  806. type: Input
  807. }], speed: [{
  808. type: Input
  809. }], cssMode: [{
  810. type: Input
  811. }], updateOnWindowResize: [{
  812. type: Input
  813. }], resizeObserver: [{
  814. type: Input
  815. }], nested: [{
  816. type: Input
  817. }], focusableElements: [{
  818. type: Input
  819. }], width: [{
  820. type: Input
  821. }], height: [{
  822. type: Input
  823. }], preventInteractionOnTransition: [{
  824. type: Input
  825. }], userAgent: [{
  826. type: Input
  827. }], url: [{
  828. type: Input
  829. }], edgeSwipeDetection: [{
  830. type: Input
  831. }], edgeSwipeThreshold: [{
  832. type: Input
  833. }], freeMode: [{
  834. type: Input
  835. }], autoHeight: [{
  836. type: Input
  837. }], setWrapperSize: [{
  838. type: Input
  839. }], virtualTranslate: [{
  840. type: Input
  841. }], effect: [{
  842. type: Input
  843. }], breakpoints: [{
  844. type: Input
  845. }], spaceBetween: [{
  846. type: Input
  847. }], slidesPerView: [{
  848. type: Input
  849. }], maxBackfaceHiddenSlides: [{
  850. type: Input
  851. }], grid: [{
  852. type: Input
  853. }], slidesPerGroup: [{
  854. type: Input
  855. }], slidesPerGroupSkip: [{
  856. type: Input
  857. }], centeredSlides: [{
  858. type: Input
  859. }], centeredSlidesBounds: [{
  860. type: Input
  861. }], slidesOffsetBefore: [{
  862. type: Input
  863. }], slidesOffsetAfter: [{
  864. type: Input
  865. }], normalizeSlideIndex: [{
  866. type: Input
  867. }], centerInsufficientSlides: [{
  868. type: Input
  869. }], watchOverflow: [{
  870. type: Input
  871. }], roundLengths: [{
  872. type: Input
  873. }], touchRatio: [{
  874. type: Input
  875. }], touchAngle: [{
  876. type: Input
  877. }], simulateTouch: [{
  878. type: Input
  879. }], shortSwipes: [{
  880. type: Input
  881. }], longSwipes: [{
  882. type: Input
  883. }], longSwipesRatio: [{
  884. type: Input
  885. }], longSwipesMs: [{
  886. type: Input
  887. }], followFinger: [{
  888. type: Input
  889. }], allowTouchMove: [{
  890. type: Input
  891. }], threshold: [{
  892. type: Input
  893. }], touchMoveStopPropagation: [{
  894. type: Input
  895. }], touchStartPreventDefault: [{
  896. type: Input
  897. }], touchStartForcePreventDefault: [{
  898. type: Input
  899. }], touchReleaseOnEdges: [{
  900. type: Input
  901. }], uniqueNavElements: [{
  902. type: Input
  903. }], resistance: [{
  904. type: Input
  905. }], resistanceRatio: [{
  906. type: Input
  907. }], watchSlidesProgress: [{
  908. type: Input
  909. }], grabCursor: [{
  910. type: Input
  911. }], preventClicks: [{
  912. type: Input
  913. }], preventClicksPropagation: [{
  914. type: Input
  915. }], slideToClickedSlide: [{
  916. type: Input
  917. }], preloadImages: [{
  918. type: Input
  919. }], updateOnImagesReady: [{
  920. type: Input
  921. }], loop: [{
  922. type: Input
  923. }], loopAdditionalSlides: [{
  924. type: Input
  925. }], loopedSlides: [{
  926. type: Input
  927. }], loopFillGroupWithBlank: [{
  928. type: Input
  929. }], loopPreventsSlide: [{
  930. type: Input
  931. }], rewind: [{
  932. type: Input
  933. }], allowSlidePrev: [{
  934. type: Input
  935. }], allowSlideNext: [{
  936. type: Input
  937. }], swipeHandler: [{
  938. type: Input
  939. }], noSwiping: [{
  940. type: Input
  941. }], noSwipingClass: [{
  942. type: Input
  943. }], noSwipingSelector: [{
  944. type: Input
  945. }], passiveListeners: [{
  946. type: Input
  947. }], containerModifierClass: [{
  948. type: Input
  949. }], slideClass: [{
  950. type: Input
  951. }], slideBlankClass: [{
  952. type: Input
  953. }], slideActiveClass: [{
  954. type: Input
  955. }], slideDuplicateActiveClass: [{
  956. type: Input
  957. }], slideVisibleClass: [{
  958. type: Input
  959. }], slideDuplicateClass: [{
  960. type: Input
  961. }], slideNextClass: [{
  962. type: Input
  963. }], slideDuplicateNextClass: [{
  964. type: Input
  965. }], slidePrevClass: [{
  966. type: Input
  967. }], slideDuplicatePrevClass: [{
  968. type: Input
  969. }], wrapperClass: [{
  970. type: Input
  971. }], runCallbacksOnInit: [{
  972. type: Input
  973. }], observeParents: [{
  974. type: Input
  975. }], observeSlideChildren: [{
  976. type: Input
  977. }], a11y: [{
  978. type: Input
  979. }], autoplay: [{
  980. type: Input
  981. }], controller: [{
  982. type: Input
  983. }], coverflowEffect: [{
  984. type: Input
  985. }], cubeEffect: [{
  986. type: Input
  987. }], fadeEffect: [{
  988. type: Input
  989. }], flipEffect: [{
  990. type: Input
  991. }], creativeEffect: [{
  992. type: Input
  993. }], cardsEffect: [{
  994. type: Input
  995. }], hashNavigation: [{
  996. type: Input
  997. }], history: [{
  998. type: Input
  999. }], keyboard: [{
  1000. type: Input
  1001. }], lazy: [{
  1002. type: Input
  1003. }], mousewheel: [{
  1004. type: Input
  1005. }], parallax: [{
  1006. type: Input
  1007. }], thumbs: [{
  1008. type: Input
  1009. }], zoom: [{
  1010. type: Input
  1011. }], class: [{
  1012. type: Input
  1013. }], id: [{
  1014. type: Input
  1015. }], navigation: [{
  1016. type: Input
  1017. }], pagination: [{
  1018. type: Input
  1019. }], scrollbar: [{
  1020. type: Input
  1021. }], virtual: [{
  1022. type: Input
  1023. }], config: [{
  1024. type: Input
  1025. }], s__beforeBreakpoint: [{
  1026. type: Output,
  1027. args: ['_beforeBreakpoint']
  1028. }], s__containerClasses: [{
  1029. type: Output,
  1030. args: ['_containerClasses']
  1031. }], s__slideClass: [{
  1032. type: Output,
  1033. args: ['_slideClass']
  1034. }], s__swiper: [{
  1035. type: Output,
  1036. args: ['_swiper']
  1037. }], s_activeIndexChange: [{
  1038. type: Output,
  1039. args: ['activeIndexChange']
  1040. }], s_afterInit: [{
  1041. type: Output,
  1042. args: ['afterInit']
  1043. }], s_autoplay: [{
  1044. type: Output,
  1045. args: ['autoplay']
  1046. }], s_autoplayStart: [{
  1047. type: Output,
  1048. args: ['autoplayStart']
  1049. }], s_autoplayStop: [{
  1050. type: Output,
  1051. args: ['autoplayStop']
  1052. }], s_autoplayPause: [{
  1053. type: Output,
  1054. args: ['autoplayPause']
  1055. }], s_autoplayResume: [{
  1056. type: Output,
  1057. args: ['autoplayResume']
  1058. }], s_beforeDestroy: [{
  1059. type: Output,
  1060. args: ['beforeDestroy']
  1061. }], s_beforeInit: [{
  1062. type: Output,
  1063. args: ['beforeInit']
  1064. }], s_beforeLoopFix: [{
  1065. type: Output,
  1066. args: ['beforeLoopFix']
  1067. }], s_beforeResize: [{
  1068. type: Output,
  1069. args: ['beforeResize']
  1070. }], s_beforeSlideChangeStart: [{
  1071. type: Output,
  1072. args: ['beforeSlideChangeStart']
  1073. }], s_beforeTransitionStart: [{
  1074. type: Output,
  1075. args: ['beforeTransitionStart']
  1076. }], s_breakpoint: [{
  1077. type: Output,
  1078. args: ['breakpoint']
  1079. }], s_changeDirection: [{
  1080. type: Output,
  1081. args: ['changeDirection']
  1082. }], s_click: [{
  1083. type: Output,
  1084. args: ['click']
  1085. }], s_doubleTap: [{
  1086. type: Output,
  1087. args: ['doubleTap']
  1088. }], s_doubleClick: [{
  1089. type: Output,
  1090. args: ['doubleClick']
  1091. }], s_destroy: [{
  1092. type: Output,
  1093. args: ['destroy']
  1094. }], s_fromEdge: [{
  1095. type: Output,
  1096. args: ['fromEdge']
  1097. }], s_hashChange: [{
  1098. type: Output,
  1099. args: ['hashChange']
  1100. }], s_hashSet: [{
  1101. type: Output,
  1102. args: ['hashSet']
  1103. }], s_imagesReady: [{
  1104. type: Output,
  1105. args: ['imagesReady']
  1106. }], s_init: [{
  1107. type: Output,
  1108. args: ['init']
  1109. }], s_keyPress: [{
  1110. type: Output,
  1111. args: ['keyPress']
  1112. }], s_lazyImageLoad: [{
  1113. type: Output,
  1114. args: ['lazyImageLoad']
  1115. }], s_lazyImageReady: [{
  1116. type: Output,
  1117. args: ['lazyImageReady']
  1118. }], s_loopFix: [{
  1119. type: Output,
  1120. args: ['loopFix']
  1121. }], s_momentumBounce: [{
  1122. type: Output,
  1123. args: ['momentumBounce']
  1124. }], s_navigationHide: [{
  1125. type: Output,
  1126. args: ['navigationHide']
  1127. }], s_navigationShow: [{
  1128. type: Output,
  1129. args: ['navigationShow']
  1130. }], s_observerUpdate: [{
  1131. type: Output,
  1132. args: ['observerUpdate']
  1133. }], s_orientationchange: [{
  1134. type: Output,
  1135. args: ['orientationchange']
  1136. }], s_paginationHide: [{
  1137. type: Output,
  1138. args: ['paginationHide']
  1139. }], s_paginationRender: [{
  1140. type: Output,
  1141. args: ['paginationRender']
  1142. }], s_paginationShow: [{
  1143. type: Output,
  1144. args: ['paginationShow']
  1145. }], s_paginationUpdate: [{
  1146. type: Output,
  1147. args: ['paginationUpdate']
  1148. }], s_progress: [{
  1149. type: Output,
  1150. args: ['progress']
  1151. }], s_reachBeginning: [{
  1152. type: Output,
  1153. args: ['reachBeginning']
  1154. }], s_reachEnd: [{
  1155. type: Output,
  1156. args: ['reachEnd']
  1157. }], s_realIndexChange: [{
  1158. type: Output,
  1159. args: ['realIndexChange']
  1160. }], s_resize: [{
  1161. type: Output,
  1162. args: ['resize']
  1163. }], s_scroll: [{
  1164. type: Output,
  1165. args: ['scroll']
  1166. }], s_scrollbarDragEnd: [{
  1167. type: Output,
  1168. args: ['scrollbarDragEnd']
  1169. }], s_scrollbarDragMove: [{
  1170. type: Output,
  1171. args: ['scrollbarDragMove']
  1172. }], s_scrollbarDragStart: [{
  1173. type: Output,
  1174. args: ['scrollbarDragStart']
  1175. }], s_setTransition: [{
  1176. type: Output,
  1177. args: ['setTransition']
  1178. }], s_setTranslate: [{
  1179. type: Output,
  1180. args: ['setTranslate']
  1181. }], s_slideChange: [{
  1182. type: Output,
  1183. args: ['slideChange']
  1184. }], s_slideChangeTransitionEnd: [{
  1185. type: Output,
  1186. args: ['slideChangeTransitionEnd']
  1187. }], s_slideChangeTransitionStart: [{
  1188. type: Output,
  1189. args: ['slideChangeTransitionStart']
  1190. }], s_slideNextTransitionEnd: [{
  1191. type: Output,
  1192. args: ['slideNextTransitionEnd']
  1193. }], s_slideNextTransitionStart: [{
  1194. type: Output,
  1195. args: ['slideNextTransitionStart']
  1196. }], s_slidePrevTransitionEnd: [{
  1197. type: Output,
  1198. args: ['slidePrevTransitionEnd']
  1199. }], s_slidePrevTransitionStart: [{
  1200. type: Output,
  1201. args: ['slidePrevTransitionStart']
  1202. }], s_slideResetTransitionStart: [{
  1203. type: Output,
  1204. args: ['slideResetTransitionStart']
  1205. }], s_slideResetTransitionEnd: [{
  1206. type: Output,
  1207. args: ['slideResetTransitionEnd']
  1208. }], s_sliderMove: [{
  1209. type: Output,
  1210. args: ['sliderMove']
  1211. }], s_sliderFirstMove: [{
  1212. type: Output,
  1213. args: ['sliderFirstMove']
  1214. }], s_slidesLengthChange: [{
  1215. type: Output,
  1216. args: ['slidesLengthChange']
  1217. }], s_slidesGridLengthChange: [{
  1218. type: Output,
  1219. args: ['slidesGridLengthChange']
  1220. }], s_snapGridLengthChange: [{
  1221. type: Output,
  1222. args: ['snapGridLengthChange']
  1223. }], s_snapIndexChange: [{
  1224. type: Output,
  1225. args: ['snapIndexChange']
  1226. }], s_tap: [{
  1227. type: Output,
  1228. args: ['tap']
  1229. }], s_toEdge: [{
  1230. type: Output,
  1231. args: ['toEdge']
  1232. }], s_touchEnd: [{
  1233. type: Output,
  1234. args: ['touchEnd']
  1235. }], s_touchMove: [{
  1236. type: Output,
  1237. args: ['touchMove']
  1238. }], s_touchMoveOpposite: [{
  1239. type: Output,
  1240. args: ['touchMoveOpposite']
  1241. }], s_touchStart: [{
  1242. type: Output,
  1243. args: ['touchStart']
  1244. }], s_transitionEnd: [{
  1245. type: Output,
  1246. args: ['transitionEnd']
  1247. }], s_transitionStart: [{
  1248. type: Output,
  1249. args: ['transitionStart']
  1250. }], s_update: [{
  1251. type: Output,
  1252. args: ['update']
  1253. }], s_zoomChange: [{
  1254. type: Output,
  1255. args: ['zoomChange']
  1256. }], s_swiper: [{
  1257. type: Output,
  1258. args: ['swiper']
  1259. }], s_lock: [{
  1260. type: Output,
  1261. args: ['lock']
  1262. }], s_unlock: [{
  1263. type: Output,
  1264. args: ['unlock']
  1265. }], prevElRef: [{
  1266. type: ViewChild,
  1267. args: ['prevElRef', { static: false }]
  1268. }], nextElRef: [{
  1269. type: ViewChild,
  1270. args: ['nextElRef', { static: false }]
  1271. }], scrollbarElRef: [{
  1272. type: ViewChild,
  1273. args: ['scrollbarElRef', { static: false }]
  1274. }], paginationElRef: [{
  1275. type: ViewChild,
  1276. args: ['paginationElRef', { static: false }]
  1277. }], slidesEl: [{
  1278. type: ContentChildren,
  1279. args: [SwiperSlideDirective, { descendants: false, emitDistinctChangesOnly: true }]
  1280. }], containerClasses: [{
  1281. type: HostBinding,
  1282. args: ['class']
  1283. }] } });
  1284. class SwiperModule {
  1285. }
  1286. SwiperModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SwiperModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
  1287. SwiperModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SwiperModule, declarations: [SwiperComponent, SwiperSlideDirective], imports: [CommonModule], exports: [SwiperComponent, SwiperSlideDirective] });
  1288. SwiperModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SwiperModule, imports: [[CommonModule]] });
  1289. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: SwiperModule, decorators: [{
  1290. type: NgModule,
  1291. args: [{
  1292. declarations: [SwiperComponent, SwiperSlideDirective],
  1293. exports: [SwiperComponent, SwiperSlideDirective],
  1294. imports: [CommonModule],
  1295. }]
  1296. }] });
  1297. /*
  1298. * Public API Surface of angular
  1299. */
  1300. /**
  1301. * Generated bundle index. Do not edit.
  1302. */
  1303. export { SwiperComponent, SwiperModule, SwiperSlideDirective };
  1304. //# sourceMappingURL=swiper_angular.mjs.map