@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.3 kB
JavaScript
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[9041],{884:(e,t,n)=>{n.d(t,{a:()=>i,b:()=>l,c:()=>c,d:()=>h,e:()=>f,f:()=>r,h:()=>o,i:()=>d,n:()=>u,p:()=>s,r:()=>a});var i=function(e){return"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(e):"function"==typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e)},o=function(e){return!!e.shadowRoot&&!!e.attachShadow},r=function(e){var t=e.closest("ion-item");return t?t.querySelector("ion-label"):null},a=function(e,t,n,i,r){if(e||o(t)){var a=t.querySelector("input.aux-input");a||((a=t.ownerDocument.createElement("input")).type="hidden",a.classList.add("aux-input"),t.appendChild(a)),a.disabled=r,a.name=n,a.value=i||""}},c=function(e,t,n){return Math.max(e,Math.min(t,n))},l=function(e,t){if(!e){var n="ASSERT: "+t;throw console.error(n),new Error(n)}},u=function(e){return e.timeStamp||Date.now()},s=function(e){if(e){var t=e.changedTouches;if(t&&t.length>0){var n=t[0];return{x:n.clientX,y:n.clientY}}if(void 0!==e.pageX)return{x:e.pageX,y:e.pageY}}return{x:0,y:0}},d=function(e){var t="rtl"===document.dir;switch(e){case"start":return t;case"end":return!t;default:throw new Error('"'+e+'" is not a valid value for [side]. Use "start" or "end" instead.')}},h=function(e,t){var n=e._original||e;return{_original:e,emit:f(n.emit.bind(n),t)}},f=function(e,t){var n;return void 0===t&&(t=0),function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];clearTimeout(n),n=setTimeout.apply(void 0,[e,t].concat(i))}}},9041:(e,t,n)=>{n.r(t),n.d(t,{ion_radio:()=>u,ion_radio_group:()=>d});var i=n(5873),o=n(884),r=n(636),a=n(1867),c=function(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function c(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(a,c)}l((i=i.apply(e,t||[])).next())}))},l=function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}},u=function(){function e(e){var t=this;(0,i.r)(this,e),this.inputId="ion-rb-"+s++,this.name=this.inputId,this.disabled=!1,this.checked=!1,this.onFocus=function(){t.ionFocus.emit()},this.onBlur=function(){t.ionBlur.emit()},this.onClick=function(){t.checked?t.ionDeselect.emit():t.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 e.prototype.colorChanged=function(){this.emitStyle()},e.prototype.checkedChanged=function(e){e&&this.ionSelect.emit({checked:!0,value:this.value}),this.emitStyle()},e.prototype.disabledChanged=function(){this.emitStyle()},e.prototype.componentWillLoad=function(){void 0===this.value&&(this.value=this.inputId),this.emitStyle()},e.prototype.emitStyle=function(){this.ionStyle.emit({"radio-checked":this.checked,"interactive-disabled":this.disabled})},e.prototype.render=function(){var e,t=this,n=t.inputId,a=t.disabled,c=t.checked,l=t.color,u=t.el,s=(0,i.f)(this),d=n+"-lbl",h=(0,o.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,r.c)(l)),(e={},e[s]=!0,e["in-item"]=(0,r.h)("ion-item",u),e.interactive=!0,e["radio-checked"]=c,e["radio-disabled"]=a,e))},(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(e.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"watchers",{get:function(){return{color:["colorChanged"],checked:["checkedChanged"],disabled:["disabledChanged"]}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"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:var(--ion-color-step-400,#999);--color-checked:var(--ion-color-primary,#3880ff);--border-width:2px;--border-style:solid;width:20px;height:20px}:host(.ion-color) .radio-inner{background:var(--ion-color-base)}:host(.ion-color.radio-checked) .radio-icon{border-color:var(--ion-color-base)}.radio-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:50%;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--color)}.radio-inner{border-radius:50%;width:calc(50% + var(--border-width));height:calc(50% + var(--border-width));-webkit-transform:scale3d(0,0,0);transform:scale3d(0,0,0);-webkit-transition:-webkit-transform .28s cubic-bezier(.4,0,.2,1);transition:-webkit-transform .28s cubic-bezier(.4,0,.2,1);transition:transform .28s cubic-bezier(.4,0,.2,1);transition:transform .28s cubic-bezier(.4,0,.2,1),-webkit-transform .28s cubic-bezier(.4,0,.2,1);background:var(--color-checked)}:host(.radio-checked) .radio-icon{border-color:var(--color-checked)}:host(.radio-checked) .radio-inner{-webkit-transform:scaleX(1);transform:scaleX(1)}:host(.radio-disabled){opacity:.3}:host(.ion-focused) .radio-icon:after{border-radius:50%;left:-12px;top:-12px;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:-12px}:host(.in-item){margin-left:0;margin-right:0;margin-top:9px;margin-bottom:9px;display:block;position:static}:host(.in-item[slot=start]){margin-left:4px;margin-right:36px;margin-top:11px;margin-bottom:10px}@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:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px}}'},enumerable:!0,configurable:!0}),e}(),s=0,d=function(){function e(e){var t=this;(0,i.r)(this,e),this.inputId="ion-rg-"+h++,this.labelId=this.inputId+"-lbl",this.allowEmptySelection=!1,this.name=this.inputId,this.onSelect=function(e){var n=e.target;n&&(t.value=n.value)},this.onDeselect=function(e){var n=e.target;n&&(n.checked=!1,t.value=void 0)},this.ionChange=(0,i.c)(this,"ionChange",7)}return e.prototype.valueChanged=function(e){this.updateRadios(),this.ionChange.emit({value:e})},e.prototype.connectedCallback=function(){return c(this,void 0,void 0,(function(){var e,t,n,i,o=this;return l(this,(function(r){switch(r.label){case 0:return e=this.el,(t=e.querySelector("ion-list-header")||e.querySelector("ion-item-divider"))&&(n=t.querySelector("ion-label"))&&(this.labelId=n.id=this.name+"-lbl"),void 0!==this.value||void 0===(i=(0,a.f)(e,"ion-radio"))?[3,2]:[4,i.componentOnReady()];case 1:r.sent(),void 0===this.value&&(this.value=i.value),r.label=2;case 2:return this.mutationO=(0,a.w)(e,"ion-radio",(function(e){void 0!==e?e.componentOnReady().then((function(){o.value=e.value})):o.updateRadios()})),this.updateRadios(),[2]}}))}))},e.prototype.disconnectedCallback=function(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0)},e.prototype.updateRadios=function(){return c(this,void 0,void 0,(function(){var e,t,n,i,o,r;return l(this,(function(a){switch(a.label){case 0:return[4,this.getRadios()];case 1:for(e=a.sent(),t=this.value,n=!1,i=0,o=e;i<o.length;i++)r=o[i],n||r.value!==t?r.checked=!1:(n=!0,r.checked=!0);return n||(this.value=void 0),[2]}}))}))},e.prototype.getRadios=function(){return Promise.all(Array.from(this.el.querySelectorAll("ion-radio")).map((function(e){return e.componentOnReady()})))},e.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(e.prototype,"el",{get:function(){return(0,i.d)(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:!0,configurable:!0}),e}(),h=0},636:(e,t,n)=>{n.d(t,{c:()=>o,g:()=>r,h:()=>i,o:()=>c});var i=function(e,t){return null!==t.closest(e)},o=function(e){var t;return"string"==typeof e&&e.length>0?((t={"ion-color":!0})["ion-color-"+e]=!0,t):void 0},r=function(e){var t={};return function(e){return void 0!==e?(Array.isArray(e)?e:e.split(" ")).filter((function(e){return null!=e})).map((function(e){return e.trim()})).filter((function(e){return""!==e})):[]}(e).forEach((function(e){return t[e]=!0})),t},a=/^[a-z][a-z0-9+\-.]*:/,c=function(e,t,n){return i=void 0,o=void 0,c=function(){var i;return function(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function c(r){return function(c){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,c])}}}(this,(function(o){return null!=e&&"#"!==e[0]&&!a.test(e)&&(i=document.querySelector("ion-router"))?(null!=t&&t.preventDefault(),[2,i.push(e,n)]):[2,!1]}))},new((r=void 0)||(r=Promise))((function(e,t){function n(e){try{l(c.next(e))}catch(e){t(e)}}function a(e){try{l(c.throw(e))}catch(e){t(e)}}function l(t){t.done?e(t.value):new r((function(e){e(t.value)})).then(n,a)}l((c=c.apply(i,o||[])).next())}));var i,o,r,c}},1867:(e,t,n)=>{n.d(t,{f:()=>r,w:()=>i});var i=function(e,t,n){var i=new MutationObserver((function(e){n(o(e,t))}));return i.observe(e,{childList:!0,subtree:!0}),i},o=function(e,t){var n;return e.forEach((function(e){for(var i=0;i<e.addedNodes.length;i++)n=r(e.addedNodes[i],t)||n})),n},r=function(e,t){if(1===e.nodeType)return(e.tagName===t.toUpperCase()?[e]:Array.from(e.querySelectorAll(t))).find((function(e){return!0===e.checked}))}}}]);