@tindtechnologies/universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
2 lines (1 loc) • 2.08 kB
JavaScript
import"./chunk-L67DAW3A.js";var o=function(l,a,n,r){return new(n||(n=Promise))(function(i,e){function u(t){try{f(r.next(t))}catch(s){e(s)}}function c(t){try{f(r.throw(t))}catch(s){e(s)}}function f(t){t.done?i(t.value):new n(function(s){s(t.value)}).then(u,c)}f((r=r.apply(l,a||[])).next())})},h=function(l,a){var n={label:0,sent:function(){if(e[0]&1)throw e[1];return e[1]},trys:[],ops:[]},r,i,e,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(t){return function(s){return f([t,s])}}function f(t){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(e=t[0]&2?i.return:t[0]?i.throw||((e=i.return)&&e.call(i),0):i.next)&&!(e=e.call(i,t[1])).done)return e;switch(i=0,e&&(t=[t[0]&2,e.value]),t[0]){case 0:case 1:e=t;break;case 4:return n.label++,{value:t[1],done:!1};case 5:n.label++,i=t[1],t=[0];continue;case 7:t=n.ops.pop(),n.trys.pop();continue;default:if(e=n.trys,!(e=e.length>0&&e[e.length-1])&&(t[0]===6||t[0]===2)){n=0;continue}if(t[0]===3&&(!e||t[1]>e[0]&&t[1]<e[3])){n.label=t[1];break}if(t[0]===6&&n.label<e[1]){n.label=e[1],e=t;break}if(e&&n.label<e[2]){n.label=e[2],n.ops.push(t);break}e[2]&&n.ops.pop(),n.trys.pop();continue}t=a.call(l,n)}catch(s){t=[6,s],i=0}finally{r=e=0}if(t[0]&5)throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}},v=void 0,y=function(){var l=document,a=!1;l.addEventListener("backbutton",function(){if(!a){var n=[],r=new CustomEvent("ionBackButton",{bubbles:!1,detail:{register:function(u,c){n.push({priority:u,handler:c})}}});if(l.dispatchEvent(r),n.length>0){var i=Number.MIN_SAFE_INTEGER,e;n.forEach(function(u){var c=u.priority,f=u.handler;c>=i&&(i=c,e=f)}),a=!0,b(e).then(function(){return a=!1})}}})},b=function(l){return o(v,void 0,void 0,function(){var a,n;return h(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),l?(a=l(),a==null?[3,2]:[4,a]):[3,2];case 1:r.sent(),r.label=2;case 2:return[3,4];case 3:return n=r.sent(),console.error(n),[3,4];case 4:return[2]}})})};export{y as startHardwareBackButton};