@tindtechnologies/universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
1 lines • 12.1 kB
JavaScript
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[9043],{884(t,e,n){n.d(e,{a:()=>i,b:()=>l,c:()=>c,d:()=>h,e:()=>f,f:()=>o,h:()=>r,i:()=>d,n:()=>u,p:()=>s,r:()=>a});var i=function(t){return"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(t):"function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t)},r=function(t){return!!t.shadowRoot&&!!t.attachShadow},o=function(t){var e=t.closest("ion-item");return e?e.querySelector("ion-label"):null},a=function(t,e,n,i,o){if(t||r(e)){var a=e.querySelector("input.aux-input");a||((a=e.ownerDocument.createElement("input")).type="hidden",a.classList.add("aux-input"),e.appendChild(a)),a.disabled=o,a.name=n,a.value=i||""}},c=function(t,e,n){return Math.max(t,Math.min(e,n))},l=function(t,e){if(!t){var n="ASSERT: "+e;throw console.error(n),new Error(n)}},u=function(t){return t.timeStamp||Date.now()},s=function(t){if(t){var e=t.changedTouches;if(e&&e.length>0){var n=e[0];return{x:n.clientX,y:n.clientY}}if(void 0!==t.pageX)return{x:t.pageX,y:t.pageY}}return{x:0,y:0}},d=function(t){var e="rtl"===document.dir;switch(t){case"start":return e;case"end":return!e;default:throw new Error('"'+t+'" is not a valid value for [side]. Use "start" or "end" instead.')}},h=function(t,e){var n=t._original||t;return{_original:t,emit:f(n.emit.bind(n),e)}},f=function(t,e){var n;return void 0===e&&(e=0),function(){for(var i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];clearTimeout(n),n=setTimeout.apply(void 0,[t,e].concat(i))}}},9043(t,e,n){n.r(e),n.d(e,{ion_radio:()=>u,ion_radio_group:()=>d});var i=n(5873),r=n(884),o=n(636),a=n(1867),c=function(t,e,n,i){return new(n||(n=Promise))((function(r,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function c(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){t.done?r(t.value):new n((function(e){e(t.value)})).then(a,c)}l((i=i.apply(t,e||[])).next())}))},l=function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}},u=function(){function t(t){var e=this;(0,i.r)(this,t),this.inputId="ion-rb-"+s++,this.name=this.inputId,this.disabled=!1,this.checked=!1,this.onFocus=function(){e.ionFocus.emit()},this.onBlur=function(){e.ionBlur.emit()},this.onClick=function(){e.checked?e.ionDeselect.emit():e.checked=!0},this.ionStyle=(0,i.c)(this,"ionStyle",7),this.ionSelect=(0,i.c)(this,"ionSelect",7),this.ionDeselect=(0,i.c)(this,"ionDeselect",7),this.ionFocus=(0,i.c)(this,"ionFocus",7),this.ionBlur=(0,i.c)(this,"ionBlur",7)}return t.prototype.colorChanged=function(){this.emitStyle()},t.prototype.checkedChanged=function(t){t&&this.ionSelect.emit({checked:!0,value:this.value}),this.emitStyle()},t.prototype.disabledChanged=function(){this.emitStyle()},t.prototype.componentWillLoad=function(){void 0===this.value&&(this.value=this.inputId),this.emitStyle()},t.prototype.emitStyle=function(){this.ionStyle.emit({"radio-checked":this.checked,"interactive-disabled":this.disabled})},t.prototype.render=function(){var t,e=this,n=e.inputId,a=e.disabled,c=e.checked,l=e.color,u=e.el,s=(0,i.f)(this),d=n+"-lbl",h=(0,r.f)(u);return h&&(h.id=d),(0,i.h)(i.H,{onClick:this.onClick,role:"radio","aria-disabled":a?"true":null,"aria-checked":""+c,"aria-labelledby":d,class:Object.assign(Object.assign({},(0,o.c)(l)),(t={},t[s]=!0,t["in-item"]=(0,o.h)("ion-item",u),t.interactive=!0,t["radio-checked"]=c,t["radio-disabled"]=a,t))},(0,i.h)("div",{class:"radio-icon"},(0,i.h)("div",{class:"radio-inner"})),(0,i.h)("button",{type:"button",onFocus:this.onFocus,onBlur:this.onBlur,disabled:a}))},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{color:["colorChanged"],checked:["checkedChanged"],disabled:["disabledChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"style",{get:function(){return':host{display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}:host(.radio-disabled){pointer-events:none}.radio-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;contain:layout size style}.radio-icon,button{width:100%;height:100%}button{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}:host-context([dir=rtl]) button,[dir=rtl] button{left:unset;right:unset;right:0}button::-moz-focus-inner{border:0}.radio-icon,.radio-inner{-webkit-box-sizing:border-box;box-sizing:border-box}:host{--color-checked:var(--ion-color-primary,#3880ff);width:15px;height:24px}:host(.ion-color.radio-checked) .radio-inner{border-color:var(--ion-color-base)}.item-radio.item-ios ion-label{margin-left:0}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.item-radio.item-ios ion-label{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}.radio-inner{width:33%;height:50%}:host(.radio-checked) .radio-inner{-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--color-checked)}:host(.radio-disabled){opacity:.3}:host(.ion-focused) .radio-icon:after{border-radius:50%;left:-9px;top:-8px;display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint,#4c8dff);content:"";opacity:.2}:host-context([dir=rtl]).ion-focused .radio-icon:after,:host-context([dir=rtl]):host(.ion-focused) .radio-icon:after{left:unset;right:unset;right:-9px}:host(.in-item){margin-left:8px;margin-right:11px;margin-top:8px;margin-bottom:8px;display:block;position:static}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host(.in-item){margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:11px;margin-inline-end:11px}}:host(.in-item[slot=start]){margin-left:3px;margin-right:21px;margin-top:8px;margin-bottom:8px}@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){:host(.in-item[slot=start]){margin-left:unset;margin-right:unset;-webkit-margin-start:3px;margin-inline-start:3px;-webkit-margin-end:21px;margin-inline-end:21px}}'},enumerable:!0,configurable:!0}),t}(),s=0,d=function(){function t(t){var e=this;(0,i.r)(this,t),this.inputId="ion-rg-"+h++,this.labelId=this.inputId+"-lbl",this.allowEmptySelection=!1,this.name=this.inputId,this.onSelect=function(t){var n=t.target;n&&(e.value=n.value)},this.onDeselect=function(t){var n=t.target;n&&(n.checked=!1,e.value=void 0)},this.ionChange=(0,i.c)(this,"ionChange",7)}return t.prototype.valueChanged=function(t){this.updateRadios(),this.ionChange.emit({value:t})},t.prototype.connectedCallback=function(){return c(this,void 0,void 0,(function(){var t,e,n,i,r=this;return l(this,(function(o){switch(o.label){case 0:return t=this.el,(e=t.querySelector("ion-list-header")||t.querySelector("ion-item-divider"))&&(n=e.querySelector("ion-label"))&&(this.labelId=n.id=this.name+"-lbl"),void 0!==this.value||void 0===(i=(0,a.f)(t,"ion-radio"))?[3,2]:[4,i.componentOnReady()];case 1:o.sent(),void 0===this.value&&(this.value=i.value),o.label=2;case 2:return this.mutationO=(0,a.w)(t,"ion-radio",(function(t){void 0!==t?t.componentOnReady().then((function(){r.value=t.value})):r.updateRadios()})),this.updateRadios(),[2]}}))}))},t.prototype.disconnectedCallback=function(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0)},t.prototype.updateRadios=function(){return c(this,void 0,void 0,(function(){var t,e,n,i,r,o;return l(this,(function(a){switch(a.label){case 0:return[4,this.getRadios()];case 1:for(t=a.sent(),e=this.value,n=!1,i=0,r=t;i<r.length;i++)o=r[i],n||o.value!==e?o.checked=!1:(n=!0,o.checked=!0);return n||(this.value=void 0),[2]}}))}))},t.prototype.getRadios=function(){return Promise.all(Array.from(this.el.querySelectorAll("ion-radio")).map((function(t){return t.componentOnReady()})))},t.prototype.render=function(){return(0,i.h)(i.H,{role:"radiogroup","aria-labelledby":this.labelId,onIonSelect:this.onSelect,onIonDeselect:this.allowEmptySelection?this.onDeselect:void 0,class:(0,i.f)(this)})},Object.defineProperty(t.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:!0,configurable:!0}),t}(),h=0},636(t,e,n){n.d(e,{c:()=>r,g:()=>o,h:()=>i,o:()=>c});var i=function(t,e){return null!==e.closest(t)},r=function(t){var e;return"string"==typeof t&&t.length>0?((e={"ion-color":!0})["ion-color-"+t]=!0,e):void 0},o=function(t){var e={};return function(t){return void 0!==t?(Array.isArray(t)?t:t.split(" ")).filter((function(t){return null!=t})).map((function(t){return t.trim()})).filter((function(t){return""!==t})):[]}(t).forEach((function(t){return e[t]=!0})),e},a=/^[a-z][a-z0-9+\-.]*:/,c=function(t,e,n){return i=void 0,r=void 0,c=function(){var i;return function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}}(this,(function(r){return null!=t&&"#"!==t[0]&&!a.test(t)&&(i=document.querySelector("ion-router"))?(null!=e&&e.preventDefault(),[2,i.push(t,n)]):[2,!1]}))},new((o=void 0)||(o=Promise))((function(t,e){function n(t){try{l(c.next(t))}catch(t){e(t)}}function a(t){try{l(c.throw(t))}catch(t){e(t)}}function l(e){e.done?t(e.value):new o((function(t){t(e.value)})).then(n,a)}l((c=c.apply(i,r||[])).next())}));var i,r,o,c}},1867(t,e,n){n.d(e,{f:()=>o,w:()=>i});var i=function(t,e,n){var i=new MutationObserver((function(t){n(r(t,e))}));return i.observe(t,{childList:!0,subtree:!0}),i},r=function(t,e){var n;return t.forEach((function(t){for(var i=0;i<t.addedNodes.length;i++)n=o(t.addedNodes[i],e)||n})),n},o=function(t,e){if(1===t.nodeType)return(t.tagName===e.toUpperCase()?[t]:Array.from(t.querySelectorAll(e))).find((function(t){return!0===t.checked}))}}}]);