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,QAC5B,GACD,GACD,EAEA,EAAM,OAAO,QAAQ,SAAU,EAAM,GAChC,GAAQ,EACP,GACH,KAEU,GAAQ,EAAM,UACzB,EAAM,QAAQ,QACd,EAAM,QAAU,KAElB,IAEA,EAAM,UAAY,SAAS,GAC1B,IAAI,EAAQ,KAAK,MAAM,QACX,UAAT,GAA8B,WAAT,EACpB,GAAsB,mBAAT,GACf,IAGD,KAAK,OAAO,EAEd,EAEA,EAAM,IAAI,WAAW,IAAM,EAAM,QAAU,MAC5C,EACD,CA1FA,sBAAsB,QAAU,CAAC,WAAY,QAAS,kBA4FtD,MAAM,WAAa,qBAEnB,QACE,OAAO,WAAY,IACnB,UAAU,eAAgB,uBAE5B,OAAO,QAAU","file":"/npm/@codemotion/angular-photoswipe@0.0.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@codemotion/angular-photoswipe@0.0.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const angular = require(`angular`);\nconst PhotoSwipe = require(`photoswipe`);\nconst PhotoSwipeUI_Default = require(`photoswipe/dist/photoswipe-ui-default.min`);\n\nngPhotoswipeDirective.$inject = [`$compile`, `$http`, `$templateCache`];\nfunction ngPhotoswipeDirective($compile, $http, $templateCache) {\n\treturn {\n\t\trestrict: 'AE',\n\t\treplace: true,\n\t\tscope: {\n\t\t\topen: '=',\n\t\t\toptions: '=',\n\t\t\tslides: '=',\n\t\t\tslideSelector: '@',\n\t\t\ttemplate: '@',\n\t\t\tonClose: '&'\n\t\t},\n\t\tlink: linkFn\n\t};\n\n\tfunction linkFn(scope, iElement){\n\t\tscope.template = scope.template || 'views/ng-photoswipe.html';\n\n\t\t$http\n\t\t\t.get(scope.template, { cache: $templateCache })\n\t\t\t.then(function(result) {\n\t\t\t\tvar template = angular.element(result.data);\n\t\t\t\tiElement.append($compile(template)(scope));\n\t\t\t});\n\n\t\tscope.start = function () {\n\t\t\tscope.open = true;\n\t\t\tstartGallery();\n\t\t};\n\n\t\tvar startGallery = function () {\n\t\t\tvar pswpElement = document.querySelectorAll('.pswp')[0];\n\n\t\t\tif (angular.isUndefined(scope.options.getThumbBoundsFn) &&\n\t\t\t\t\tangular.isDefined(scope.slideSelector)) {\n\n\t\t\t\tscope.options = angular.merge({}, {\n\n\t\t\t\t\tgetThumbBoundsFn: function(index) {\n\t\t\t\t\t\tvar thumbnail = document.querySelectorAll(scope.slideSelector)[index];\n\t\t\t\t\t\tvar pageYScroll = window.pageYOffset || document.documentElement.scrollTop;\n\t\t\t\t\t\tvar rect = thumbnail.getBoundingClientRect();\n\t\t\t\t\t\treturn {x:rect.left, y:rect.top + pageYScroll, w:rect.width};\n\t\t\t\t\t}\n\n\t\t\t\t}, scope.options);\n\t\t\t}\n\n\t\t\tscope.gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default || false, scope.slides, scope.options);\n\t\t\tscope.gallery.init();\n\t\t\tscope.item = scope.gallery.currItem;\n\n\t\t\tscope.gallery.listen('destroy', function () {\n\t\t\t\tscope.safeApply(function () {\n\t\t\t\t\t(scope.onClose || angular.noop)();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tscope.gallery.listen('afterChange', function () {\n\t\t\t\tscope.safeApply(function () {\n\t\t\t\t\tscope.item = scope.gallery.currItem;\n\t\t\t\t});\n\t\t\t});\n\t\t};\n\n\t\tscope.$watch('open', function (nVal, oVal) {\n\t\t\tif (nVal != oVal) {\n\t\t\t\tif (nVal) {\n\t\t\t\t\tstartGallery();\n\t\t\t\t}\n\t\t\t} else if (!nVal && scope.gallery) {\n\t\t\t\tscope.gallery.close();\n\t\t\t\tscope.gallery = null;\n\t\t\t}\n\t\t});\n\n\t\tscope.safeApply = function(fn) {\n\t\t\tvar phase = this.$root.$$phase; // TODO: Remove this bad practice\n\t\t\tif(phase == '$apply' || phase == '$digest') {\n\t\t\t\tif(fn && (typeof(fn) === 'function')) {\n\t\t\t\t\tfn();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.$apply(fn);\n\t\t\t}\n\t\t};\n\n\t\tscope.$on(`destroy`, () => scope.gallery = null);\n\t}\n}\n\nconst moduleName = 'angular-photoswipe';\n\nangular\n\t.module(moduleName, [])\n\t.directive('ngPhotoswipe', ngPhotoswipeDirective);\n\nmodule.exports = moduleName;"]}