@vivliostyle/print 2.11.1 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es6.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @vivliostyle/print v2.11.1
2
+ * @vivliostyle/print v2.13.0
3
3
  * Allows page-layouting using the vivliostyle for printing within a website without destroying the original layout
4
4
  *
5
5
  * @author Johannes Wilm
6
6
  * @license AGPL-3.0
7
7
  * @preserve
8
8
  */
9
- function t(o,a,s,u){if(o===a)return o?[[0,o]]:[];if(null!=s){var h=function(t,e,n){var i="number"==typeof n?{index:n,length:0}:n.oldRange,r="number"==typeof n?null:n.newRange,o=t.length,a=e.length;if(0===i.length&&(null===r||0===r.length)){var s=i.index,u=t.slice(0,s),h=t.slice(s),c=r?r.index:null,d=s+a-o;if((null===c||c===d)&&!(d<0||d>a)){var f=e.slice(0,d);if((v=e.slice(d))===h){var p=Math.min(s,d);if((E=u.slice(0,p))===(D=f.slice(0,p)))return l(E,u.slice(p),f.slice(p),h)}}if(null===c||c===s){var g=s,v=(f=e.slice(0,g),e.slice(g));if(f===u){var m=Math.min(o-g,a-g);if((C=h.slice(h.length-m))===(w=v.slice(v.length-m)))return l(u,h.slice(0,h.length-m),v.slice(0,v.length-m),C)}}}if(i.length>0&&r&&0===r.length){var E=t.slice(0,i.index),C=t.slice(i.index+i.length);if(!(a<(p=E.length)+(m=C.length))){var D=e.slice(0,p),w=e.slice(a-m);if(E===D&&C===w)return l(E,t.slice(p,o-m),e.slice(p,a-m),C)}}return null}(o,a,s);if(h)return h}var c=n(o,a),d=o.substring(0,c);c=i(o=o.substring(c),a=a.substring(c));var f=o.substring(o.length-c),p=function(r,o){var a;if(!r)return[[1,o]];if(!o)return[[-1,r]];var s=r.length>o.length?r:o,u=r.length>o.length?o:r,l=s.indexOf(u);if(-1!==l)return a=[[1,s.substring(0,l)],[0,u],[1,s.substring(l+u.length)]],r.length>o.length&&(a[0][0]=a[2][0]=-1),a;if(1===u.length)return[[-1,r],[1,o]];var h=function(t,e){var r=t.length>e.length?t:e,o=t.length>e.length?e:t;if(r.length<4||2*o.length<r.length)return null;function a(t,e,r){for(var o,a,s,u,l=t.substring(r,r+Math.floor(t.length/4)),h=-1,c="";-1!==(h=e.indexOf(l,h+1));){var d=n(t.substring(r),e.substring(h)),f=i(t.substring(0,r),e.substring(0,h));c.length<f+d&&(c=e.substring(h-f,h)+e.substring(h,h+d),o=t.substring(0,r-f),a=t.substring(r+d),s=e.substring(0,h-f),u=e.substring(h+d))}return 2*c.length>=t.length?[o,a,s,u,c]:null}var s,u,l,h,c,d=a(r,o,Math.ceil(r.length/4)),f=a(r,o,Math.ceil(r.length/2));if(!d&&!f)return null;s=f?d&&d[4].length>f[4].length?d:f:d;t.length>e.length?(u=s[0],l=s[1],h=s[2],c=s[3]):(h=s[0],c=s[1],u=s[2],l=s[3]);var p=s[4];return[u,l,h,c,p]}(r,o);if(h){var c=h[0],d=h[1],f=h[2],p=h[3],g=h[4],v=t(c,f),m=t(d,p);return v.concat([[0,g]],m)}return function(t,n){for(var i=t.length,r=n.length,o=Math.ceil((i+r)/2),a=o,s=2*o,u=new Array(s),l=new Array(s),h=0;h<s;h++)u[h]=-1,l[h]=-1;u[a+1]=0,l[a+1]=0;for(var c=i-r,d=c%2!=0,f=0,p=0,g=0,v=0,m=0;m<o;m++){for(var E=-m+f;E<=m-p;E+=2){for(var C=a+E,D=(S=E===-m||E!==m&&u[C-1]<u[C+1]?u[C+1]:u[C-1]+1)-E;S<i&&D<r&&t.charAt(S)===n.charAt(D);)S++,D++;if(u[C]=S,S>i)p+=2;else if(D>r)f+=2;else if(d){if((N=a+c-E)>=0&&N<s&&-1!==l[N])if(S>=(y=i-l[N]))return e(t,n,S,D)}}for(var w=-m+g;w<=m-v;w+=2){for(var y,N=a+w,b=(y=w===-m||w!==m&&l[N-1]<l[N+1]?l[N+1]:l[N-1]+1)-w;y<i&&b<r&&t.charAt(i-y-1)===n.charAt(r-b-1);)y++,b++;if(l[N]=y,y>i)v+=2;else if(b>r)g+=2;else if(!d){if((C=a+c-w)>=0&&C<s&&-1!==u[C]){var S;D=a+(S=u[C])-C;if(S>=(y=i-y))return e(t,n,S,D)}}}}return[[-1,t],[1,n]]}(r,o)}(o=o.substring(0,o.length-c),a=a.substring(0,a.length-c));return d&&p.unshift([0,d]),f&&p.push([0,f]),r(p,u),p}function e(e,n,i,r){var o=e.substring(0,i),a=n.substring(0,r),s=e.substring(i),u=n.substring(r),l=t(o,a),h=t(s,u);return l.concat(h)}function n(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var n=0,i=Math.min(t.length,e.length),r=i,a=0;n<r;)t.substring(a,r)==e.substring(a,r)?a=n=r:i=r,r=Math.floor((i-n)/2+n);return o(t.charCodeAt(r-1))&&r--,r}function i(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var n=0,i=Math.min(t.length,e.length),r=i,o=0;n<r;)t.substring(t.length-r,t.length-o)==e.substring(e.length-r,e.length-o)?o=n=r:i=r,r=Math.floor((i-n)/2+n);return a(t.charCodeAt(t.length-r))&&r--,r}function r(t,e){t.push([0,""]);for(var o,a=0,l=0,h=0,c="",d="";a<t.length;)if(a<t.length-1&&!t[a][1])t.splice(a,1);else switch(t[a][0]){case 1:h++,d+=t[a][1],a++;break;case-1:l++,c+=t[a][1],a++;break;case 0:var f=a-h-l-1;if(e){if(f>=0&&u(t[f][1])){var p=t[f][1].slice(-1);if(t[f][1]=t[f][1].slice(0,-1),c=p+c,d=p+d,!t[f][1]){t.splice(f,1),a--;var g=f-1;t[g]&&1===t[g][0]&&(h++,d=t[g][1]+d,g--),t[g]&&-1===t[g][0]&&(l++,c=t[g][1]+c,g--),f=g}}if(s(t[a][1])){p=t[a][1].charAt(0);t[a][1]=t[a][1].slice(1),c+=p,d+=p}}if(a<t.length-1&&!t[a][1]){t.splice(a,1);break}if(c.length>0||d.length>0){c.length>0&&d.length>0&&(0!==(o=n(d,c))&&(f>=0?t[f][1]+=d.substring(0,o):(t.splice(0,0,[0,d.substring(0,o)]),a++),d=d.substring(o),c=c.substring(o)),0!==(o=i(d,c))&&(t[a][1]=d.substring(d.length-o)+t[a][1],d=d.substring(0,d.length-o),c=c.substring(0,c.length-o)));var v=h+l;0===c.length&&0===d.length?(t.splice(a-v,v),a-=v):0===c.length?(t.splice(a-v,v,[1,d]),a=a-v+1):0===d.length?(t.splice(a-v,v,[-1,c]),a=a-v+1):(t.splice(a-v,v,[-1,c],[1,d]),a=a-v+2)}0!==a&&0===t[a-1][0]?(t[a-1][1]+=t[a][1],t.splice(a,1)):a++,h=0,l=0,c="",d=""}""===t[t.length-1][1]&&t.pop();var m=!1;for(a=1;a<t.length-1;)0===t[a-1][0]&&0===t[a+1][0]&&(t[a][1].substring(t[a][1].length-t[a-1][1].length)===t[a-1][1]?(t[a][1]=t[a-1][1]+t[a][1].substring(0,t[a][1].length-t[a-1][1].length),t[a+1][1]=t[a-1][1]+t[a+1][1],t.splice(a-1,1),m=!0):t[a][1].substring(0,t[a+1][1].length)==t[a+1][1]&&(t[a-1][1]+=t[a+1][1],t[a][1]=t[a][1].substring(t[a+1][1].length)+t[a+1][1],t.splice(a+1,1),m=!0)),a++;m&&r(t,e)}function o(t){return t>=55296&&t<=56319}function a(t){return t>=56320&&t<=57343}function s(t){return a(t.charCodeAt(0))}function u(t){return o(t.charCodeAt(t.length-1))}function l(t,e,n,i){return u(t)||s(i)?null:function(t){for(var e=[],n=0;n<t.length;n++)t[n][1].length>0&&e.push(t[n]);return e}([[0,t],[-1,e],[1,n],[0,i]])}function h(e,n,i){return t(e,n,i,!0)}h.INSERT=1,h.DELETE=-1,h.EQUAL=0;var c,d,f=h,p=(c=function(t,e){var n,i,r,o=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(f);function a(t){e.isDebug=t}function s(t){switch(t){case"ltr":return e.PageProgression.LTR;case"rtl":return e.PageProgression.RTL;default:throw new Error("unknown PageProgression: "+t)}}function u(t){var e=Array.from(t),n=null;return e[0]instanceof Error&&(n=e.shift()),{error:n,messages:e}}function l(t){var e=t.error,n=e&&(e.frameTrace||e.stack),i=[].concat(t.messages);return e&&(i.length>0&&(i=i.concat(["\n"])),i=i.concat([e.toString()]),n&&(i=i.concat(["\n"]).concat(n))),i}e.isDebug=!1,e.PageProgression=void 0,function(t){t.LTR="ltr",t.RTL="rtl"}(e.PageProgression||(e.PageProgression={})),e.PageSide=void 0,(n=e.PageSide||(e.PageSide={})).LEFT="left",n.RIGHT="right",e.ReadyState=void 0,(i=e.ReadyState||(e.ReadyState={})).LOADING="loading",i.INTERACTIVE="interactive",i.COMPLETE="complete",function(t){t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR"}(r||(r={}));var h,c=new(function(){function t(t){this.opt_console=void 0,this.listeners={},this.opt_console=t}var e=t.prototype;return e.consoleDebug=function(t){var e,n,i;this.opt_console?this.opt_console.debug?(e=this.opt_console).debug.apply(e,t):(n=this.opt_console).log.apply(n,t):(i=console).debug.apply(i,t)},e.consoleInfo=function(t){var e,n,i;this.opt_console?this.opt_console.info?(e=this.opt_console).info.apply(e,t):(n=this.opt_console).log.apply(n,t):(i=console).info.apply(i,t)},e.consoleWarn=function(t){var e,n,i;this.opt_console?this.opt_console.warn?(e=this.opt_console).warn.apply(e,t):(n=this.opt_console).log.apply(n,t):(i=console).warn.apply(i,t)},e.consoleError=function(t){var e,n,i;this.opt_console?this.opt_console.error?(e=this.opt_console).error.apply(e,t):(n=this.opt_console).log.apply(n,t):(i=console).error.apply(i,t)},e.triggerListeners=function(t,e){var n=this.listeners[t];n&&n.forEach((function(t){t(e)}))},e.addListener=function(t,e){var n=this.listeners[t];n||(n=this.listeners[t]=[]),n.push(e)},e.debug=function(){var t=u(arguments);this.consoleDebug(l(t)),this.triggerListeners(r.DEBUG,t)},e.info=function(){var t=u(arguments);this.consoleInfo(l(t)),this.triggerListeners(r.INFO,t)},e.warn=function(){var t=u(arguments);this.consoleWarn(l(t)),this.triggerListeners(r.WARN,t)},e.error=function(){var t=u(arguments);this.consoleError(l(t)),this.triggerListeners(r.ERROR,t)},t}());e.HOOKS=void 0,(h=e.HOOKS||(e.HOOKS={})).SIMPLE_PROPERTY="SIMPLE_PROPERTY",h.PREPROCESS_SINGLE_DOCUMENT="PREPROCESS_SINGLE_DOCUMENT",h.PREPROCESS_TEXT_CONTENT="PREPROCESS_TEXT_CONTENT",h.PREPROCESS_ELEMENT_STYLE="PREPROCESS_ELEMENT_STYLE",h.POLYFILLED_INHERITED_PROPS="POLYFILLED_INHERITED_PROPS",h.CONFIGURATION="CONFIGURATION",h.RESOLVE_TEXT_NODE_BREAKER="RESOLVE_TEXT_NODE_BREAKER",h.RESOLVE_FORMATTING_CONTEXT="RESOLVE_FORMATTING_CONTEXT",h.RESOLVE_LAYOUT_PROCESSOR="RESOLVE_LAYOUT_PROCESSOR",h.POST_LAYOUT_BLOCK="POST_LAYOUT_BLOCK";var d={};function p(t,n){if(e.HOOKS[t]){var i=d[t];i||(i=d[t]=[]),i.push(n)}else c.warn(new Error("Skipping unknown plugin hook '"+t+"'."))}function g(t,n){if(e.HOOKS[t]){var i=d[t];if(i){var r=i.indexOf(n);r>=0&&i.splice(r,1)}}else c.warn(new Error("Ignoring unknown plugin hook '"+t+"'."))}function v(t){return d[t]||[]}var m={registerHook:p,removeHook:g},E=function(){function t(t){this.performanceInstance=void 0,this.timestamps={},this.registerTiming=void 0,this.registerStartTiming=void 0,this.registerEndTiming=void 0,this.performanceInstance=t,this.registerTiming=C,this.registerStartTiming=this.registerStartTiming=C,this.registerEndTiming=this.registerEndTiming=C}var e=t.prototype;return e.forceRegisterStartTiming=function(t,e){D.call(this,t,"start",e)},e.forceRegisterEndTiming=function(t,e){D.call(this,t,"end",e)},e.printTimings=function(){var t=this.timestamps,e="";Object.keys(t).forEach((function(n){for(var i=t[n],r=i.length,o=0;o<r;o++){var a=i[o];e+=n,r>1&&(e+="("+o+")"),e+=" => start: "+a.start+", end: "+a.end+", duration: "+(a.end-a.start)+"\n"}})),c.info(e)},e.disable=function(){this.registerTiming=C,this.registerStartTiming=this.registerStartTiming=C,this.registerEndTiming=this.registerEndTiming=C},e.enable=function(){this.registerTiming=D,this.registerStartTiming=this.registerStartTiming=w,this.registerEndTiming=this.registerEndTiming=y},e.isEnabled=function(){return this.registerStartTiming===w},t}();function C(){}function D(t,e,n){n||(n=this.performanceInstance.now());var i,r=this.timestamps[t];r||(r=this.timestamps[t]=[]);for(var o=r.length-1;o>=0&&(!(i=r[o])||i[e]);o--)i=null;i||r.push(i={}),i[e]=n}function w(t,e){this.registerTiming(t,"start",e)}function y(t,e){this.registerTiming(t,"end",e)}var N={now:Date.now},b=new E(window&&window.performance||N);b.forceRegisterStartTiming("load_vivliostyle");var S={profiler:{registerStartTiming:b.registerStartTiming,registerEndTiming:b.registerEndTiming,printTimings:b.printTimings,disable:b.disable,enable:b.enable}};function A(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function T(t,e,n){return e&&A(t.prototype,e),n&&A(t,n),t}function x(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,F(t,e)}function I(t){return I=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},I(t)}function F(t,e){return F=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},F(t,e)}function P(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function R(t,e,n){return R=P()?Reflect.construct:function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&F(r,n.prototype),r},R.apply(null,arguments)}function L(t){var e="function"==typeof Map?new Map:void 0;return L=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return R(t,arguments,I(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),F(n,t)},L(t)}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function B(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return k(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var _=/^(?:[\t-\r -#%-\*,-\/:;\?@\[-\]_\{\}\xA0\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u0300-\u036F\u037E\u0387\u0483-\u0487\u055A-\u055F\u0589\u058A\u0591-\u05C7\u05F3\u05F4\u0609\u060A\u060C\u060D\u0610-\u061B\u061D-\u061F\u064B-\u065F\u066A-\u066D\u0670\u06D4\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0700-\u070D\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F7-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0830-\u083E\u0859-\u085B\u085E\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0965\u0970\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FD\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A76\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF0\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C77\u0C81\u0C84\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0DF4\u0E31\u0E34-\u0E3A\u0E47-\u0E4F\u0E5A\u0E5B\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u0FD0-\u0FD4\u0FD9\u0FDA\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u104A-\u104F\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u10FB\u135D-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1712-\u1714\u1732\u1733\u1735\u1736\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D6\u17D8-\u17DA\u17DD\u1800-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1944\u1945\u1A17\u1A18\u1A1B\u1A1E\u1A1F\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B5A-\u1B60\u1B6B-\u1B73\u1B7D\u1B7E\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1BFC-\u1BFF\u1C2C-\u1C33\u1C36\u1C37\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD0-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CEF-\u2CF1\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2D7F\u2DE0-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3000-\u3003\u3008-\u3011\u3014-\u301F\u302A-\u302D\u3030\u303D\u3099\u309A\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA66F\uA673-\uA67E\uA69E\uA69F\uA6F0-\uA6F7\uA802\uA806\uA80B\uA825\uA826\uA82C\uA874-\uA877\uA8C4\uA8C5\uA8CE\uA8CF\uA8E0-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF\uA926-\uA92F\uA947-\uA951\uA95F\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9C1-\uA9CD\uA9DE\uA9DF\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA5C-\uAA5F\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAADE\uAADF\uAAEC\uAAED\uAAF0\uAAF1\uAAF6\uABE5\uABE8\uABEB\uABED\uFB1E\uFD3E\uFD3F\uFE00-\uFE19\uFE20-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFEFF\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDDFD\uDEE0\uDF76-\uDF7A\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDE50-\uDE58\uDE7F\uDEE5\uDEE6\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD24-\uDD27\uDEAB-\uDEAD\uDF46-\uDF50\uDF55-\uDF59\uDF82-\uDF89]|\uD804[\uDC01\uDC38-\uDC4D\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9-\uDCBC\uDCBE-\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD40-\uDD43\uDD73-\uDD75\uDD80\uDD81\uDDB6-\uDDBE\uDDC5-\uDDCD\uDDCF\uDDDB\uDDDD-\uDDDF\uDE2F-\uDE31\uDE34\uDE36-\uDE3E\uDEA9\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDCC6\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF-\uDDD7\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F-\uDE43\uDE60-\uDE6C\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDEB9\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B\uDF3C-\uDF3E]|\uD806[\uDC2F-\uDC37\uDC39-\uDC3B\uDD3B\uDD3C\uDD3E\uDD43-\uDD46\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDDE2\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC41-\uDC45\uDC70\uDC71\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF0-\uDEF5\uDF30-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDF4F\uDF8F-\uDF92\uDFE2\uDFE4]|\uD82F[\uDC9D-\uDC9F]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE87-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD5E\uDD5F]|\uDB40[\uDD00-\uDDEF])*(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])(?:[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*(?:[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F])(?:[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*)*/,M={};function U(t){return JSON.parse(t)}function V(t){var e=t.match(/^([^#]*)/);return e?e[1]:t}var H=window.location.href;function z(t){H=t}var G,X=window.location.href;function W(t){X=t}function j(t,e){if(/^data:/i.test(e))return t||e;if(!e||t.match(/^\w{2,}:/))return t.toLowerCase().match("^javascript:")?"#":(t.match(/^\w{2,}:\/\/[^\/]+$/)&&(t+="/"),t);var n;if(e.match(/^\w{2,}:\/\/[^\/]+$/)&&(e+="/"),t.match(/^\/\//))return(n=e.match(/^(\w{2,}:)\/\//))?n[1]+t:t;if(t.match(/^\//))return(n=e.match(/^(\w{2,}:\/\/[^\/]+)\//))?n[1]+t:t;if(t.match(/^\.(\/|$)/)&&(t=t.substr(2)),e=function(t){var e=t.match(/^([^#?]*)/);return e?e[1]:t}(e),t.match(/^#/))return e+t;var i=e.lastIndexOf("/");if(i<0)return t;if(i<e.length-1&&e.lastIndexOf(".")<i){if(""==t)return e;i=(e+="/").length-1}var r=e.substr(0,i+1)+t,o="";for((n=r.match(/^([^?#]*)([?#].*)$/))&&(r=n[1],o=n[2]);!((i=r.indexOf("/../"))<=0);){var a=r.lastIndexOf("/",i-1);if(a<=0)break;r=r.substr(0,a)+r.substr(i+3)}return r.replace(/\/(\.\/)+/g,"/")+o}function K(t){var e;return(e=/^(https?:)\/\/github\.com\/([^/]+\/[^/]+)\/(blob\/|tree\/|raw\/)?(.*)$/.exec(t))?t=e[1]+"//raw.githubusercontent.com/"+e[2]+"/"+(e[3]?"":"master/")+e[4]:(e=/^(https?:)\/\/www\.aozora\.gr\.jp\/(cards\/[^/]+\/files\/[^/.]+\.html)$/.exec(t))?t=e[1]+"//raw.githubusercontent.com/aozorabunko/aozorabunko/master/"+e[2]:(e=/^(https?:)\/\/gist\.github\.com\/([^/]+\/\w+)(\/|$)(raw(\/|$))?(.*)$/.exec(t))?t=e[1]+"//gist.githubusercontent.com/"+e[2]+"/raw/"+e[6]:(e=/^(https?:)\/\/(?:[^/.]+\.)?jsbin\.com\/(?!(?:blog|help)\b)(\w+)((\/\d+)?).*$/.exec(t))&&(t=e[1]+"//output.jsbin.com/"+e[2]+e[3]+"/"),t}function Y(t){return null==t?t:t.toString()}!function(t){t.epub="http://www.idpf.org/2007/ops",t.EV="http://www.w3.org/2001/xml-events",t.MATHML="http://www.w3.org/1998/Math/MathML",t.XML="http://www.w3.org/XML/1998/namespace",t.XHTML="http://www.w3.org/1999/xhtml",t.XLINK="http://www.w3.org/1999/xlink",t.SHADOW="http://www.pyroxy.com/ns/shadow",t.SVG="http://www.w3.org/2000/svg",t.DC="http://purl.org/dc/elements/1.1/",t.NCX="http://www.daisy.org/z3986/2005/ncx/"}(G||(G={}));var q=function(){function t(){this.queue=[null]}var e=t.prototype;return e.length=function(){return this.queue.length-1},e.add=function(t){for(var e=this.queue.length;e>1;){var n=Math.floor(e/2),i=this.queue[n];if(i.compare(t)>0)return void(this.queue[e]=t);this.queue[e]=i,e=n}this.queue[1]=t},e.peek=function(){return this.queue[1]},e.remove=function(){var t=this.queue[1],e=this.queue.pop(),n=this.queue.length;if(n>1){for(var i=1;;){var r=2*i;if(r>=n)break;if(this.queue[r].compare(e)>0)r+1<n&&this.queue[r+1].compare(this.queue[r])>0&&r++;else{if(!(r+1<n&&this.queue[r+1].compare(e)>0))break;r++}this.queue[i]=this.queue[r],i=r}this.queue[i]=e}return t},t}(),Q=["","-webkit-","-moz-"],$={};function Z(t,e){return"string"==typeof document.documentElement.style[function(t,e){return t&&(e="-"+e,"moz"===(t=t.replace(/-/g,""))&&(t="Moz")),t+e.replace(/-[a-z]/g,(function(t){return t.substr(1).toUpperCase()}))}(t,e)]}function J(t){var e=$[t];if(e||null===e)return e;switch(t){case"behavior":return $[t]=null,null;case"text-combine-upright":if(Z("-webkit-","text-combine")&&!Z("","text-combine-upright"))return $[t]=["-webkit-text-combine"],["-webkit-text-combine"];break;case"filter":if(Z("-webkit-","filter"))return $[t]=["-webkit-filter"],["-webkit-filter"];break;case"clip-path":if(Z("-webkit-","clip-path"))return $[t]=["-webkit-clip-path","clip-path"];break;case"margin-inline-start":if(Z("-webkit-","margin-start"))return $[t]=["-webkit-margin-start"],["-webkit-margin-start"];break;case"margin-inline-end":if(Z("-webkit-","margin-end"))return $[t]=["-webkit-margin-end"],["-webkit-margin-end"];break;case"padding-inline-start":if(Z("-webkit-","padding-start"))return $[t]=["-webkit-padding-start"],["-webkit-padding-start"];break;case"padding-inline-end":if(Z("-webkit-","padding-end"))return $[t]=["-webkit-padding-end"],["-webkit-padding-end"]}for(var n,i=B(Q);!(n=i()).done;){var r=n.value;if(Z(r,t))return $[t]=[e=r+t],[e]}return c.warn("Property not supported by the browser: ",t),$[t]=null,null}function tt(t,e,n){try{var i=J(e);if(!i)return;var r=null==t?void 0:t.style;if(!r)return;i.forEach((function(t){switch(t){case"-webkit-text-combine":"all"===n&&(n="horizontal");break;case"text-combine-upright":"all"===n&&r.setProperty("text-indent","0")}r.setProperty(t,n)}))}catch(t){c.warn(t)}}function et(t,e,n){try{var i=$[e];return t.style.getPropertyValue(i?i[0]:e)}catch(t){}return n||""}function nt(t){var e=t.getAttributeNS(G.XML,"lang");return e||t.namespaceURI!=G.XHTML||(e=t.getAttribute("lang")),e}var it=function(){function t(){this.list=[]}var e=t.prototype;return e.append=function(t){return this.list.push(t),this},e.clear=function(){this.list=[]},e.toString=function(){var t=this.list.join("");return this.list=[t],t},t}();function rt(t){return"\\"+t.charCodeAt(0).toString(16)+" "}function ot(t){return t.replace(/[^-_a-zA-Z0-9\u0080-\uFFFF]/g,rt)}function at(t){return t.replace(/[\u0000-\u001F"\\]/g,rt)}function st(t){return t.replace(/[\s+&?=#\u007F-\uFFFF]+/g,encodeURIComponent)}function ut(t){return!!t.match(/^[a-zA-Z\u009E\u009F\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u024F\u037B-\u037D\u0386\u0388-\u0482\u048A-\u0527]$/)}function lt(t,e){return t.replace(/[^-a-zA-Z0-9_]/g,(function(t){return function(t,e){return(e="string"==typeof e?e:"\\u")+(65536|t.charCodeAt(0)).toString(16).substr(1)}(t,e)}))}function ht(t){return lt(t)}function ct(t,e){for(var n=0,i=t;;){if(0==n||e(n-1),i==t||e(i),n==i)return n;var r=n+i>>1;e(r)?i=r:n=r+1}}function dt(t,e){return t-e}function ft(t,e){for(var n,i={},r=B(t);!(n=r()).done;){var o=n.value,a=e(o);a&&!i[a]&&(i[a]=o)}return i}function pt(t,e){for(var n,i={},r=B(t);!(n=r()).done;){var o=n.value,a=e(o);a&&(i[a]?i[a].push(o):i[a]=[o])}return i}var gt=function(){function t(){this.listeners={}}var e=t.prototype;return e.dispatchEvent=function(t){var e=this.listeners[t.type];if(e){t.target=this,t.currentTarget=this;for(var n=0;n<e.length;n++)e[n](t)}},e.addEventListener=function(t,e,n){if(!n){var i=this.listeners[t];i?i.push(e):this.listeners[t]=[e]}},e.removeEventListener=function(t,e,n){if(!n){var i=this.listeners[t];if(i){var r=i.indexOf(e);r>=0&&i.splice(r,1)}}},t}(),vt=null,mt=null,Et=null,Ct=null;function Dt(t){if(1==t.nodeType){var e=t.getAttribute("id");if(e)return e}return null}function wt(t){return"^"+t}function yt(t){return t.replace(/[\[\]\(\),=;^]/g,wt)}function Nt(t){return t.substr(1)}function bt(t){return t?t.replace(/\^[\[\]\(\),=;^]/g,Nt):t}function St(t){var e=[];do{var n=t.match(/^(\^,|[^,])*/),i=bt(n[0]);if(!(t=t.substr(n[0].length+1))&&!e.length)return i;e.push(i)}while(t);return e}function At(t){for(var e={};t;){var n=t.match(/^;([^;=]+)=(([^;]|\^;)*)/);if(!n)return e;e[n[1]]=St(n[2]),t=t.substr(n[0].length)}return e}var Tt=function(){function t(){}var e=t.prototype;return e.appendTo=function(t){t.append("!")},e.applyTo=function(t){return!1},t}(),xt=function(){function t(t,e,n){this.index=void 0,this.id=void 0,this.sideBias=void 0,this.index=t,this.id=e,this.sideBias=n}var e=t.prototype;return e.appendTo=function(t){t.append("/"),t.append(this.index.toString()),(this.id||this.sideBias)&&(t.append("["),this.id&&t.append(this.id),this.sideBias&&(t.append(";s="),t.append(this.sideBias)),t.append("]"))},e.applyTo=function(t){if(1!=t.node.nodeType)throw new Error("E_CFI_NOT_ELEMENT");var e,n=t.node,i=n.children,r=i.length,o=Math.floor(this.index/2)-1;if(o<0||0==r)t.node=(e=n.firstChild)||n;else{if(e=i[Math.min(o,r-1)],1&this.index){var a=e.nextSibling;a&&1!=a.nodeType?e=a:t.after=!0}t.node=e}if(this.id&&(t.after||this.id!=Dt(t.node)))throw new Error("E_CFI_ID_MISMATCH");return t.sideBias=this.sideBias,!0},t}(),It=function(){function t(t,e,n,i){this.offset=void 0,this.textBefore=void 0,this.textAfter=void 0,this.sideBias=void 0,this.offset=t,this.textBefore=e,this.textAfter=n,this.sideBias=i}var e=t.prototype;return e.applyTo=function(t){if(this.offset>0&&!t.after){for(var e=this.offset,n=t.node;;){var i=n.nodeType;if(1==i)break;var r=n.nextSibling;if(3<=i&&i<=5){var o=n.textContent.length;if(e<=o)break;if(!r){e=o;break}e-=o}if(!r){e=0;break}n=r}t.node=n,t.offset=e}return t.sideBias=this.sideBias,!0},e.appendTo=function(t){t.append(":"),t.append(this.offset.toString()),(this.textBefore||this.textAfter||this.sideBias)&&(t.append("["),(this.textBefore||this.textAfter)&&(this.textBefore&&t.append(yt(this.textBefore)),t.append(","),this.textAfter&&t.append(yt(this.textAfter))),this.sideBias&&(t.append(";s="),t.append(this.sideBias)),t.append("]"))},t}(),Ft=function(){function t(){this.steps=null}var e=t.prototype;return e.fromString=function(t){var e=t.match(/^#?epubcfi\((.*)\)$/);if(!e)throw new Error("E_CFI_NOT_CFI");for(var n=decodeURIComponent(e[1]),i=0,r=[];;){var o=void 0;switch(n.charAt(i)){case"/":if(i++,!(e=n.substr(i).match(/^(0|[1-9][0-9]*)(\[(.*?)(;([^\]]|\^\])*)?\])?/)))throw new Error("E_CFI_NUMBER_EXPECTED");i+=e[0].length;var a=parseInt(e[1],10),s=e[3];o=At(e[4]),r.push(new xt(a,s,Y(o.s)));break;case":":if(i++,!(e=n.substr(i).match(/^(0|[1-9][0-9]*)(\[((([^\];,]|\^[\];,])*)(,(([^\];,]|\^[\];,])*))?)(;([^]]|\^\])*)?\])?/)))throw new Error("E_CFI_NUMBER_EXPECTED");i+=e[0].length;var u=parseInt(e[1],10),l=e[4];l&&(l=bt(l));var h=e[7];h&&(h=bt(h)),o=At(e[10]),r.push(new It(u,l,h,Y(o.s)));break;case"!":i++,r.push(new Tt);break;case"~":case"@":case"":return void(this.steps=r);default:throw new Error("E_CFI_PARSE_ERROR")}}},e.navigate=function(e){for(var n={node:e.documentElement,offset:0,after:!1,sideBias:null,ref:null},i=0;i<this.steps.length;i++)if(!this.steps[i].applyTo(n)){n.ref=new t,n.ref.steps=this.steps.slice(i+1);break}return n},e.trim=function(t,e){return t.replace(/\s+/g," ").match(e?/^[ -\uD7FF\uE000-\uFFFF]{0,8}/:/[ -\uD7FF\uE000-\uFFFF]{0,8}$/)[0].replace(/^\s/,"").replace(/\s$/,"")},e.prependPathFromNode=function(t,e,n,i){for(var r=[],o=t.parentNode,a="",s="";t;){switch(t.nodeType){case 3:case 4:case 5:var u=t.textContent,l=u.length;n?(e+=l,a||(a=u)):(e>l&&(e=l),n=!0,a=u.substr(0,e),s=u.substr(e)),t=t.previousSibling;continue;case 8:t=t.previousSibling;continue}break}for((e>0||a||s)&&(a=this.trim(a,!1),s=this.trim(s,!0),r.push(new It(e,a,s,i)),i=null);o&&o&&9!=o.nodeType;){for(var h=n?null:Dt(t),c=n?1:0;t;)1==t.nodeType&&(c+=2),t=t.previousSibling;r.push(new xt(c,h,i)),i=null,t=o,o=o.parentNode,n=!1}r.reverse(),this.steps?(r.push(new Tt),this.steps=r.concat(this.steps)):this.steps=r},e.toString=function(){if(!this.steps)return"";var t=new it;t.append("epubcfi(");for(var e=0;e<this.steps.length;e++)this.steps[e].appendTo(t);return t.append(")"),t.toString().replace(/%/g,"%25")},t}();function Pt(t){return{fontFamily:t.fontFamily,lineHeight:t.lineHeight,margin:t.margin,hyphenate:t.hyphenate,columnWidth:t.columnWidth,horizontal:t.horizontal,nightMode:t.nightMode,spreadView:t.spreadView,pageBorder:t.pageBorder,enabledMediaTypes:Object.assign({},t.enabledMediaTypes),defaultPaperSize:t.defaultPaperSize?Object.assign({},t.defaultPaperSize):void 0}}var Rt={fontFamily:"serif",lineHeight:1.25,margin:8,hyphenate:!1,columnWidth:25,horizontal:!1,nightMode:!1,spreadView:!1,pageBorder:1,enabledMediaTypes:{vivliostyle:!0,print:!0},defaultPaperSize:void 0},Lt={};function Ot(t,e,n,i){var r=Math.min((t-0)/n,(e-0)/i);return"matrix("+r+",0,0,"+r+",0,0)"}function kt(t){return'"'+at(""+t)+'"'}function Bt(t){return ot(""+t)}function _t(t,e){return t?ot(t)+"."+ot(e):ot(e)}var Mt=0,Ut=function(){function t(t,e){if(this.parent=void 0,this.resolver=void 0,this.scopeKey=void 0,this.children=[],this.zero=void 0,this.one=void 0,this._true=void 0,this._false=void 0,this.values={},this.funcs={},this.builtIns={},this.parent=t,this.resolver=e,this.scopeKey="S"+Mt++,this.zero=new ye(this,0),this.one=new ye(this,1),this._true=new ye(this,!0),this._false=new ye(this,!1),t&&t.children.push(this),!t){var n=this.builtIns;n.floor=Math.floor,n.ceil=Math.ceil,n.round=Math.round,n.sqrt=Math.sqrt,n.min=Math.min,n.max=Math.max,n.letterbox=Ot,n["css-string"]=kt,n["css-name"]=Bt,n.typeof=function(t){return typeof t},this.defineBuiltInName("page-width",(function(){return this.pageWidth()})),this.defineBuiltInName("page-height",(function(){return this.pageHeight()})),this.defineBuiltInName("pref-font-family",(function(){return this.pref.fontFamily})),this.defineBuiltInName("pref-night-mode",(function(){return this.pref.nightMode})),this.defineBuiltInName("pref-hyphenate",(function(){return this.pref.hyphenate})),this.defineBuiltInName("pref-margin",(function(){return this.pref.margin})),this.defineBuiltInName("pref-line-height",(function(){return this.pref.lineHeight})),this.defineBuiltInName("pref-column-width",(function(){return this.pref.columnWidth*this.fontSize})),this.defineBuiltInName("pref-horizontal",(function(){return this.pref.horizontal})),this.defineBuiltInName("pref-spread-view",(function(){return this.pref.spreadView})),this.defineBuiltInName("pub-title",(function(){return kt(this.pubTitle?this.pubTitle:"")})),this.defineBuiltInName("doc-title",(function(){return kt(this.docTitle?this.docTitle:"")}))}}var e=t.prototype;return e.defineBuiltInName=function(t,e){this.values[t]=new Ce(this,e,t)},e.defineName=function(t,e){this.values[t]=e},e.defineFunc=function(t,e){this.funcs[t]=e},e.defineBuiltIn=function(t,e){this.builtIns[t]=e},t}();function Vt(t){switch(t.toLowerCase()){case"vw":case"vh":case"vi":case"vb":case"vmin":case"vmax":case"pvw":case"pvh":case"pvi":case"pvb":case"pvmin":case"pvmax":return!0;default:return!1}}var Ht={px:1,in:96,pt:4/3,pc:16,cm:96/2.54,mm:96/25.4,q:96/2.54/40,em:16,rem:16,ex:8,dppx:1,dpi:1/96,dpcm:2.54/96};function zt(t){switch(t){case"q":case"rem":return!0;default:return!1}}var Gt=function(){function t(t,e,n,i){this.rootScope=void 0,this.viewportWidth=void 0,this.viewportHeight=void 0,this.actualPageWidth=null,this.pageWidth=void 0,this.actualPageHeight=null,this.pageHeight=void 0,this.initialFontSize=void 0,this.rootFontSize=null,this.isRelativeRootFontSize=null,this.fontSize=void 0,this.pref=void 0,this.scopes={},this.pageAreaWidth=null,this.pageAreaHeight=null,this.pageVertical=null,this.pubTitle=null,this.docTitle=null,this.rootScope=t,this.viewportWidth=e,this.viewportHeight=n,this.pageWidth=function(){return this.actualPageWidth?this.actualPageWidth:this.pref.spreadView?Math.floor(e/2)-this.pref.pageBorder:e},this.pageHeight=function(){return this.actualPageHeight?this.actualPageHeight:n},this.initialFontSize=i,this.fontSize=function(){return this.rootFontSize?this.rootFontSize:i},this.pref=Rt}var e=t.prototype;return e.getScopeContext=function(t){var e=this.scopes[t.scopeKey];return e||(this.scopes[t.scopeKey]=e={}),e},e.clearScope=function(t){this.scopes[t.scopeKey]={};for(var e=0;e<t.children.length;e++)this.clearScope(t.children[e])},e.queryUnitSize=function(t,e){if(Vt(t)){var n=this.pageWidth()/100,i=this.pageHeight()/100,r=null!=this.pageAreaWidth?this.pageAreaWidth/100:n,o=null!=this.pageAreaHeight?this.pageAreaHeight/100:i;switch(t){case"vw":return r;case"vh":return o;case"vi":return this.pageVertical?o:r;case"vb":return this.pageVertical?r:o;case"vmin":return r<o?r:o;case"vmax":return r>o?r:o;case"pvw":return n;case"pvh":return i;case"pvi":return this.pageVertical?i:n;case"pvb":return this.pageVertical?n:i;case"pvmin":return n<i?n:i;case"pvmax":return n>i?n:i}}return"em"==t||"rem"==t?e?this.initialFontSize:this.fontSize():"ex"==t?Ht.ex*(e?this.initialFontSize:this.fontSize())/Ht.em:Ht[t]},e.evalName=function(t,e){do{var n=t.values[e];if(n)return n;if(t.resolver&&(n=t.resolver.call(this,e,!1)))return n;t=t.parent}while(t);throw new Error("Name '"+e+"' is undefined")},e.evalCall=function(t,e,n,i){do{var r=t.funcs[e];if(r)return r;if(t.resolver&&(r=t.resolver.call(this,e,!0)))return r;var o=t.builtIns[e];if(o){if(i)return t.zero;for(var a=Array(n.length),s=0;s<n.length;s++)a[s]=n[s].evaluate(this);return new ye(t,o.apply(this,a))}t=t.parent}while(t);throw new Error("Function '"+e+"' is undefined")},e.evalMediaName=function(t,e){var n="all"===t||!!this.pref.enabledMediaTypes[t];return e?!n:n},e.evalMediaTest=function(t,e){var n="",i=t.match(/^(min|max)-(.*)$/);i&&(n=i[1],t=i[2]);var r=null,o=null;switch(t){case"width":case"height":case"device-width":case"device-height":case"color":e&&(r=e.evaluate(this))}switch(t){case"width":o=this.pageWidth();break;case"height":o=this.pageHeight();break;case"device-width":o=window.screen.availWidth;break;case"device-height":o=window.screen.availHeight;break;case"color":o=window.screen.pixelDepth}if(null!=o&&null!=r)switch(n){case"min":return o>=r;case"max":return o<=r;default:return o==r}else if(null!=o&&null==e)return 0!==o;return!1},e.evalSupportsTest=function(t,e,n){return!1},e.queryVal=function(t,e){var n=this.scopes[t.scopeKey];return n?n[e]:void 0},e.storeVal=function(t,e,n){this.getScopeContext(t)[e]=n},t}(),Xt=function(){function t(t){this.scope=void 0,this.key=void 0,this.scope=t,this.scope=t,this.key="_"+Mt++}var e=t.prototype;return e.toString=function(){var t=new it;return this.appendTo(t,0),t.toString()},e.appendTo=function(t,e){throw new Error("F_ABSTRACT")},e.evaluateCore=function(t){throw new Error("F_ABSTRACT")},e.expand=function(t,e){return this},e.dependCore=function(t,e,n){return t===this},e.dependOuter=function(t,e,n){var i=n[this.key];if(null!=i)return i!==Lt&&i;n[this.key]=Lt;var r=this.dependCore(t,e,n);return n[this.key]=r,r},e.depend=function(t,e){return this.dependOuter(t,e,{})},e.evaluate=function(t){var e=t.queryVal(this.scope,this.key);return void 0!==e||(e=this.evaluateCore(t),t.storeVal(this.scope,this.key,e)),e},e.isMediaName=function(){return!1},t}(),Wt=function(t){function e(e,n){var i;return(i=t.call(this,e)||this).val=void 0,i.val=n,i}x(e,t);var n=e.prototype;return n.getOp=function(){throw new Error("F_ABSTRACT")},n.evalPrefix=function(t){throw new Error("F_ABSTRACT")},n.evaluateCore=function(t){var e=this.val.evaluate(t);return this.evalPrefix(e)},n.dependCore=function(t,e,n){return t===this||this.val.dependOuter(t,e,n)},n.appendTo=function(t,e){10<e&&t.append("("),t.append(this.getOp()),this.val.appendTo(t,10),10<e&&t.append(")")},n.expand=function(t,e){var n=this.val.expand(t,e);return n===this.val?this:new this.constructor(this.scope,n)},e}(Xt),jt=function(t){function e(e,n,i){var r;return(r=t.call(this,e)||this).lhs=void 0,r.rhs=void 0,r.lhs=n,r.rhs=i,r}x(e,t);var n=e.prototype;return n.getPriority=function(){throw new Error("F_ABSTRACT")},n.getOp=function(){throw new Error("F_ABSTRACT")},n.evalInfix=function(t,e){throw new Error("F_ABSTRACT")},n.evaluateCore=function(t){var e=this.lhs.evaluate(t),n=this.rhs.evaluate(t);return this.evalInfix(e,n)},n.dependCore=function(t,e,n){return t===this||this.lhs.dependOuter(t,e,n)||this.rhs.dependOuter(t,e,n)},n.appendTo=function(t,e){var n=this.getPriority();n<=e&&t.append("("),this.lhs.appendTo(t,n),t.append(this.getOp()),this.rhs.appendTo(t,n),n<=e&&t.append(")")},n.expand=function(t,e){var n=this.lhs.expand(t,e),i=this.rhs.expand(t,e);return n===this.lhs&&i===this.rhs?this:new this.constructor(this.scope,n,i)},e}(Xt),Kt=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return x(e,t),e.prototype.getPriority=function(){return 1},e}(jt),Yt=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return x(e,t),e.prototype.getPriority=function(){return 2},e}(jt),qt=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return x(e,t),e.prototype.getPriority=function(){return 3},e}(jt),Qt=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return x(e,t),e.prototype.getPriority=function(){return 4},e}(jt),$t=function(t){function e(e,n){return t.call(this,e,n)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"!"},n.evalPrefix=function(t){return!t},e}(Wt),Zt=function(t){function e(e,n){return t.call(this,e,n)||this}return x(e,t),e.prototype.getOp=function(){return"not "},e}($t),Jt=function(t){function e(e,n){return t.call(this,e,n)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"-"},n.evalPrefix=function(t){return-t},e}(Wt),te=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"&&"},n.evaluateCore=function(t){return this.lhs.evaluate(t)&&this.rhs.evaluate(t)},e}(Kt),ee=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return x(e,t),e.prototype.getOp=function(){return" and "},e}(te),ne=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"||"},n.evaluateCore=function(t){return this.lhs.evaluate(t)||this.rhs.evaluate(t)},e}(Kt),ie=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return x(e,t),e.prototype.getOp=function(){return", "},e}(ne),re=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}return x(e,t),e.prototype.getOp=function(){return" or "},e}(ne),oe=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"<"},n.evalInfix=function(t,e){return t<e},e}(Yt),ae=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"<="},n.evalInfix=function(t,e){return t<=e},e}(Yt),se=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return">"},n.evalInfix=function(t,e){return t>e},e}(Yt),ue=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return">="},n.evalInfix=function(t,e){return t>=e},e}(Yt),le=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"=="},n.evalInfix=function(t,e){return t==e},e}(Yt),he=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"!="},n.evalInfix=function(t,e){return t!=e},e}(Yt),ce=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"+"},n.evalInfix=function(t,e){return t+e},e}(qt),de=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return" - "},n.evalInfix=function(t,e){return t-e},e}(qt),fe=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"*"},n.evalInfix=function(t,e){return t*e},e}(Qt),pe=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"/"},n.evalInfix=function(t,e){return t/e},e}(Qt),ge=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.getOp=function(){return"%"},n.evalInfix=function(t,e){return t%e},e}(Qt),ve=function(t){function e(e,n,i){var r;return(r=t.call(this,e)||this).num=void 0,r.unit=void 0,r.num=n,r.unit=i.toLowerCase(),r}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append(this.num.toString()),t.append(ot(this.unit))},n.evaluateCore=function(t){return this.num*t.queryUnitSize(this.unit,!1)},e}(Xt),me=function(t){function e(e,n){var i;return(i=t.call(this,e)||this).qualifiedName=void 0,i.qualifiedName=n,i}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append(this.qualifiedName)},n.evaluateCore=function(t){return t.evalName(this.scope,this.qualifiedName).evaluate(t)},n.dependCore=function(t,e,n){return t===this||e.evalName(this.scope,this.qualifiedName).dependOuter(t,e,n)},e}(Xt),Ee=function(t){function e(e,n,i){var r;return(r=t.call(this,e)||this).not=void 0,r.name=void 0,r.not=n,r.name=i,r}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){this.not&&t.append("not "),t.append(ot(this.name))},n.evaluateCore=function(t){return t.evalMediaName(this.name,this.not)},n.isMediaName=function(){return!0},e}(Xt),Ce=function(t){function e(e,n,i){var r;return(r=t.call(this,e)||this).fn=void 0,r.str=void 0,r.fn=n,r.str=i,r}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append(this.str)},n.evaluateCore=function(t){return this.fn.call(t)},e}(Xt),De=function(t){function e(e,n,i){var r;return(r=t.call(this,e)||this).qualifiedName=void 0,r.params=void 0,r.qualifiedName=n,r.params=i,r}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append(this.qualifiedName),function(t,e){t.append("(");for(var n=0;n<e.length;n++)n&&t.append(","),e[n].appendTo(t,0);t.append(")")}(t,this.params)},n.evaluateCore=function(t){return t.evalCall(this.scope,this.qualifiedName,this.params,!1).expand(t,this.params).evaluate(t)},n.dependCore=function(t,e,n){if(t===this)return!0;for(var i=0;i<this.params.length;i++)if(this.params[i].dependOuter(t,e,n))return!0;return e.evalCall(this.scope,this.qualifiedName,this.params,!0).dependOuter(t,e,n)},n.expand=function(t,n){var i=function(t,e,n){for(var i=e,r=0;r<e.length;r++){var o=e[r].expand(t,n);if(e!==i)i[r]=o;else if(o!==e[r]){i=Array(e.length);for(var a=0;a<r;a++)i[a]=e[a];i[r]=o}}return i}(t,this.params,n);return i===this.params?this:new e(this.scope,this.qualifiedName,i)},e}(Xt),we=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e)||this).cond=void 0,o.ifTrue=void 0,o.ifFalse=void 0,o.cond=n,o.ifTrue=i,o.ifFalse=r,o}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){e>0&&t.append("("),this.cond.appendTo(t,0),t.append("?"),this.ifTrue.appendTo(t,0),t.append(":"),this.ifFalse.appendTo(t,0),e>0&&t.append(")")},n.evaluateCore=function(t){return this.cond.evaluate(t)?this.ifTrue.evaluate(t):this.ifFalse.evaluate(t)},n.dependCore=function(t,e,n){return t===this||this.cond.dependOuter(t,e,n)||this.ifTrue.dependOuter(t,e,n)||this.ifFalse.dependOuter(t,e,n)},n.expand=function(t,n){var i=this.cond.expand(t,n),r=this.ifTrue.expand(t,n),o=this.ifFalse.expand(t,n);return i===this.cond&&r===this.ifTrue&&o===this.ifFalse?this:new e(this.scope,i,r,o)},e}(Xt),ye=function(t){function e(e,n){var i;return(i=t.call(this,e)||this).val=void 0,i.val=n,i}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){switch(typeof this.val){case"number":case"boolean":t.append(this.val.toString());break;case"string":t.append('"'),t.append(at(this.val)),t.append('"');break;default:throw new Error("F_UNEXPECTED_STATE")}},n.evaluateCore=function(t){return this.val},e}(Xt),Ne=function(t){function e(e,n,i){var r;return(r=t.call(this,e)||this).name=void 0,r.value=void 0,r.name=n,r.value=i,r}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append("("),t.append(at(this.name.name)),t.append(":"),this.value.appendTo(t,0),t.append(")")},n.evaluateCore=function(t){return t.evalMediaTest(this.name.name,this.value)},n.dependCore=function(t,e,n){return t===this||this.value.dependOuter(t,e,n)},n.expand=function(t,n){var i=this.value.expand(t,n);return i===this.value?this:new e(this.scope,this.name,i)},e}(Xt),be=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e)||this).name=void 0,o.value=void 0,o.isFunc=void 0,o.name=n,o.value=i,o.isFunc=r,o}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){this.isFunc&&t.append(this.name),t.append("("),!this.isFunc&&this.name&&(t.append(this.name),t.append(":")),t.append(this.value),t.append(")")},n.evaluateCore=function(t){return t.evalSupportsTest(this.name,this.value,this.isFunc)},e}(Xt),Se=function(t){function e(e,n){var i;return(i=t.call(this,e)||this).index=void 0,i.index=n,i}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append("$"),t.append(this.index.toString())},n.expand=function(t,e){var n=e[this.index];if(!n)throw new Error("Parameter missing: "+this.index);return n},e}(Xt);function Ae(t,e,n){return e===t._false||e===t.zero||n==t._false||n==t.zero?t._false:e===t._true||e===t.one?n:n===t._true||n===t.one?e:new te(t,e,n)}function Te(t,e,n){return e===t.zero?n:n===t.zero?e:new ce(t,e,n)}function xe(t,e,n){return e===t.zero?new Jt(t,n):n===t.zero?e:new de(t,e,n)}function Ie(t,e,n){return e===t.zero||n===t.zero?t.zero:e===t.one?n:n===t.one?e:new fe(t,e,n)}function Fe(t,e,n){return e===t.zero?t.zero:n===t.one?e:new pe(t,e,n)}var Pe=function(){function t(){}var e=t.prototype;return e.visitValues=function(t){for(var e=0;e<t.length;e++)t[e].visit(this)},e.visitEmpty=function(t){throw new Error("E_CSS_EMPTY_NOT_ALLOWED")},e.visitSlash=function(t){throw new Error("E_CSS_SLASH_NOT_ALLOWED")},e.visitStr=function(t){throw new Error("E_CSS_STR_NOT_ALLOWED")},e.visitIdent=function(t){throw new Error("E_CSS_IDENT_NOT_ALLOWED")},e.visitNumeric=function(t){throw new Error("E_CSS_NUMERIC_NOT_ALLOWED")},e.visitNum=function(t){throw new Error("E_CSS_NUM_NOT_ALLOWED")},e.visitInt=function(t){return this.visitNum(t)},e.visitColor=function(t){throw new Error("E_CSS_COLOR_NOT_ALLOWED")},e.visitURL=function(t){throw new Error("E_CSS_URL_NOT_ALLOWED")},e.visitURange=function(t){throw new Error("E_CSS_URANGE_NOT_ALLOWED")},e.visitSpaceList=function(t){throw new Error("E_CSS_LIST_NOT_ALLOWED")},e.visitCommaList=function(t){throw new Error("E_CSS_COMMA_NOT_ALLOWED")},e.visitFunc=function(t){throw new Error("E_CSS_FUNC_NOT_ALLOWED")},e.visitExpr=function(t){throw new Error("E_CSS_EXPR_NOT_ALLOWED")},t}(),Re=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.visitValues=function(t){for(var e=null,n=0;n<t.length;n++){var i=t[n],r=i.visit(this);if(e)e[n]=r;else if(i!==r){e=new Array(t.length);for(var o=0;o<n;o++)e[o]=t[o];e[n]=r}}return e||t},n.visitStr=function(t){return t},n.visitIdent=function(t){return t},n.visitSlash=function(t){return t},n.visitNumeric=function(t){return t},n.visitNum=function(t){return t},n.visitInt=function(t){return t},n.visitColor=function(t){return t},n.visitURL=function(t){return t},n.visitURange=function(t){return t},n.visitSpaceList=function(t){var e=this.visitValues(t.values);return e===t.values?t:new qe(e)},n.visitCommaList=function(t){var e=this.visitValues(t.values);return e===t.values?t:new Qe(e)},n.visitFunc=function(t){var e=this.visitValues(t.values);return e===t.values?t:new $e(t.name,e)},n.visitExpr=function(t){return t},e}(Pe),Le=function(){function t(){}var e=t.prototype;return e.toString=function(){var t=new it;return this.appendTo(t,!0),t.toString()},e.stringValue=function(){var t=new it;return this.appendTo(t,!1),t.toString()},e.toExpr=function(t,e){throw new Error("F_ABSTRACT")},e.appendTo=function(t,e){t.append("[error]")},e.isExpr=function(){return!1},e.isNumeric=function(){return!1},e.isNum=function(){return!1},e.isIdent=function(){return!1},e.isSpaceList=function(){return!1},e.visit=function(t){throw new Error("F_ABSTRACT")},t}(),Oe=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.toExpr=function(t,e){return new ye(t,"")},n.appendTo=function(t,e){},n.visit=function(t){return t.visitEmpty(this)},T(e,null,[{key:"instance",get:function(){return this.empty||(this.empty=new e),this.empty}}]),e}(Le);Oe.empty=void 0;var ke=Oe.instance,Be=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.toExpr=function(t,e){return new ye(t,"/")},n.appendTo=function(t,e){t.append("/")},n.visit=function(t){return t.visitSlash(this)},T(e,null,[{key:"instance",get:function(){return this.slash||(this.slash=new e),this.slash}}]),e}(Le);Be.slash=void 0;var _e=Be.instance,Me=function(t){function e(e){var n;return(n=t.call(this)||this).str=void 0,n.str=e,n}x(e,t);var n=e.prototype;return n.toExpr=function(t,e){return new ye(t,this.str)},n.appendTo=function(t,e){e?(t.append('"'),t.append(at(this.str)),t.append('"')):t.append(this.str)},n.visit=function(t){return t.visitStr(this)},e}(Le),Ue={},Ve=function(t){function e(e){var n;if((n=t.call(this)||this).name=void 0,n.name=e,Ue[e])throw new Error("E_INVALID_CALL");return Ue[e]=O(n),n}x(e,t);var n=e.prototype;return n.toExpr=function(t,e){return new ye(t,this.name)},n.appendTo=function(t,e){t.append(e?ot(this.name):this.name)},n.visit=function(t){return t.visitIdent(this)},n.isIdent=function(){return!0},e}(Le);function He(t){var e=Ue[t];return e||(e=new Ve(t)),e}var ze=function(t){function e(e,n){var i;return(i=t.call(this)||this).num=void 0,i.unit=void 0,i.num=e,i.unit=n.toLowerCase(),i}x(e,t);var n=e.prototype;return n.toExpr=function(t,e){return 0==this.num?t.zero:e&&"%"==this.unit?100==this.num?e:new fe(t,e,new ye(t,this.num/100)):new ve(t,this.num,this.unit)},n.appendTo=function(t,e){t.append(this.num.toString()),t.append(this.unit)},n.visit=function(t){return t.visitNumeric(this)},n.isNumeric=function(){return!0},e}(Le),Ge=function(t){function e(e){var n;return(n=t.call(this)||this).num=void 0,n.num=e,n}x(e,t);var n=e.prototype;return n.toExpr=function(t,e){return 0==this.num?t.zero:1==this.num?t.one:new ye(t,this.num)},n.appendTo=function(t,e){t.append(this.num.toString())},n.visit=function(t){return t.visitNum(this)},n.isNum=function(){return!0},e}(Le),Xe=function(t){function e(e){return t.call(this,e)||this}return x(e,t),e.prototype.visit=function(t){return t.visitInt(this)},e}(Ge),We=function(t){function e(e){var n;return(n=t.call(this)||this).rgb=void 0,n.rgb=e,n}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append("#");var n=this.rgb.toString(16);t.append("000000".substr(n.length)),t.append(n)},n.visit=function(t){return t.visitColor(this)},e}(Le),je=function(t){function e(e){var n;return(n=t.call(this)||this).url=void 0,n.url=e,n}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append('url("'),t.append(at(this.url)),t.append('")')},n.visit=function(t){return t.visitURL(this)},e}(Le),Ke=function(t){function e(e){var n;return(n=t.call(this)||this).urangeText=void 0,n.urangeText=e,n}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append(this.urangeText)},n.visit=function(t){return t.visitURange(this)},e}(Le);function Ye(t,e,n,i){var r=e.length;if(r>0){e[0].appendTo(t,i);for(var o=1;o<r;o++)t.append(n),e[o].appendTo(t,i)}}var qe=function(t){function e(e){var n;return(n=t.call(this)||this).values=void 0,n.values=e,n}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){Ye(t,this.values," ",e)},n.visit=function(t){return t.visitSpaceList(this)},n.isSpaceList=function(){return!0},e}(Le),Qe=function(t){function e(e){var n;return(n=t.call(this)||this).values=void 0,n.values=e,n}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){Ye(t,this.values,",",e)},n.visit=function(t){return t.visitCommaList(this)},e}(Le),$e=function(t){function e(e,n){var i;return(i=t.call(this)||this).name=void 0,i.values=void 0,i.name=e,i.values=n,i}x(e,t);var n=e.prototype;return n.appendTo=function(t,e){t.append(ot(this.name)),t.append("("),Ye(t,this.values,",",e),t.append(")")},n.visit=function(t){return t.visitFunc(this)},e}(Le),Ze=function(t){function e(e){var n;return(n=t.call(this)||this).expr=void 0,n.expr=e,n}x(e,t);var n=e.prototype;return n.toExpr=function(){return this.expr},n.appendTo=function(t,e){t.append("-epubx-expr("),this.expr.appendTo(t,0),t.append(")")},n.visit=function(t){return t.visitExpr(this)},n.isExpr=function(){return!0},e}(Le);function Je(t,e){if(t){if(t.isNumeric()){var n=t;return e.queryUnitSize(n.unit,!1)*n.num}if(t.isNum())return t.num}return 0}function tn(t,e){return new ze(Je(t,e),"px")}var en={absolute:He("absolute"),all:He("all"),always:He("always"),anywhere:He("anywhere"),auto:He("auto"),avoid:He("avoid"),balance:He("balance"),balance_all:He("balance-all"),block:He("block"),block_end:He("block-end"),block_start:He("block-start"),both:He("both"),bottom:He("bottom"),border_box:He("border-box"),break_all:He("break-all"),break_word:He("break-word"),crop:He("crop"),cross:He("cross"),column:He("column"),exclusive:He("exclusive"),_false:He("false"),fixed:He("fixed"),flex:He("flex"),footnote:He("footnote"),footer:He("footer"),header:He("header"),hidden:He("hidden"),horizontal_tb:He("horizontal-tb"),inherit:He("inherit"),inline:He("inline"),inline_block:He("inline-block"),inline_end:He("inline-end"),inline_start:He("inline-start"),landscape:He("landscape"),left:He("left"),line:He("line"),list_item:He("list-item"),ltr:He("ltr"),manual:He("manual"),none:He("none"),normal:He("normal"),oeb_page_foot:He("oeb-page-foot"),oeb_page_head:He("oeb-page-head"),page:He("page"),relative:He("relative"),right:He("right"),same:He("same"),scale:He("scale"),snap_block:He("snap-block"),spread:He("spread"),_static:He("static"),rtl:He("rtl"),table:He("table"),table_caption:He("table-caption"),table_cell:He("table-cell"),table_footer_group:He("table-footer-group"),table_header_group:He("table-header-group"),table_row:He("table-row"),top:He("top"),transparent:He("transparent"),vertical_lr:He("vertical-lr"),vertical_rl:He("vertical-rl"),visible:He("visible"),_true:He("true")},nn=new ze(100,"%"),rn=new ze(100,"pvw"),on=new ze(100,"pvh"),an=new ze(0,"px"),sn=new Ke("U+0-10FFFF"),un={"font-size":1,color:2};function ln(t,e){return(un[t]||Number.MAX_VALUE)-(un[e]||Number.MAX_VALUE)}var hn=function(t,e,n,i){this.x1=void 0,this.y1=void 0,this.x2=void 0,this.y2=void 0,this.x1=t,this.y1=e,this.x2=n,this.y2=i},cn=function(t,e){this.x=void 0,this.y=void 0,this.x=t,this.y=e},dn=function(t,e,n,i){this.left=void 0,this.top=void 0,this.right=void 0,this.bottom=void 0,this.left=t,this.top=e,this.right=n,this.bottom=i},fn=function(t,e,n,i){this.low=void 0,this.high=void 0,this.winding=void 0,this.shapeId=void 0,this.low=t,this.high=e,this.winding=n,this.shapeId=i},pn=function(t,e,n,i){this.y1=void 0,this.y2=void 0,this.x1=void 0,this.x2=void 0,this.left=null,this.right=null,this.y1=t,this.y2=e,this.x1=n,this.x2=i};function gn(t,e){return t.low.y-e.low.y||t.low.x-e.low.x}var vn=function(){function t(t){this.points=void 0,this.points=t}var e=t.prototype;return e.addSegments=function(t,e){for(var n=this.points,i=n.length,r=n[i-1],o=0;o<i;o++){var a,s=n[o];a=r.y<s.y?new fn(r,s,1,e):new fn(s,r,-1,e),t.push(a),r=s}},e.withOffset=function(e,n){for(var i,r=[],o=B(this.points);!(i=o()).done;){var a=i.value;r.push(new cn(a.x+e,a.y+n))}return new t(r)},t}();function mn(t,e,n,i){for(var r=[],o=0;o<20;o++){var a=2*o*Math.PI/20;r.push(new cn(t+n*Math.sin(a),e+i*Math.cos(a)))}return new vn(r)}function En(t,e,n,i){return new vn([new cn(t,e),new cn(n,e),new cn(n,i),new cn(t,i)])}var Cn=function(t,e,n,i){this.x=void 0,this.winding=void 0,this.shapeId=void 0,this.lowOrHigh=void 0,this.x=t,this.winding=e,this.shapeId=n,this.lowOrHigh=i};function Dn(t,e){var n=t.low.x+(t.high.x-t.low.x)*(e-t.low.y)/(t.high.y-t.low.y);if(isNaN(n))throw new Error("Bad intersection");return n}function wn(t,e,n,i){var r,o,a,s;e.high.y<n&&c.warn("Error: inconsistent segment (1)"),e.low.y<=n?(r=Dn(e,n),o=e.winding):(r=e.low.x,o=0),e.high.y>=i?(a=Dn(e,i),s=e.winding):(a=e.high.x,s=0),r<a?(t.push(new Cn(r,o,e.shapeId,-1)),t.push(new Cn(a,s,e.shapeId,1))):(t.push(new Cn(a,s,e.shapeId,-1)),t.push(new Cn(r,o,e.shapeId,1)))}function yn(t,e,n){var i,r=e+n,o=Array(r),a=Array(r);for(i=0;i<=r;i++)o[i]=0,a[i]=0;for(var s=[],u=!1,l=t.length,h=0;h<l;h++){var c=t[h];o[c.shapeId]+=c.winding,a[c.shapeId]+=c.lowOrHigh;var d=!1;for(i=0;i<e;i++)if(o[i]&&!a[i]){d=!0;break}if(d)for(i=e;i<=r;i++)if(o[i]||a[i]){d=!1;break}u!=d&&(s.push(c.x),u=d)}return s}function Nn(t,e){return e?Math.floor(t/e)*e:t}function bn(t){return new hn(t.y1,-t.x2,t.y2,-t.x1)}function Sn(t){return new hn(-t.y2,t.x1,-t.y1,t.x2)}function An(t){return new vn(t.points.map((function(t){return function(t){return new cn(t.y,-t.x)}(t)})))}function Tn(t,e){for(var n=e.length-1,i=new pn(t.y2,t.y2,t.x1,t.x2);n>=0;){var r=i;((i=e[n]).y2-i.y1<1||i.x1==r.x1&&i.x2==r.x2)&&(r.y1=i.y1,e.splice(n,1),i=r),n--}}function xn(t,e){for(var n=0,i=t.length;n<i;){var r=Math.floor((n+i)/2);e>=t[r].y2?n=r+1:i=r}return n}function In(t,e){if(!t.length)return e;var n,i,r=e.y1;for(i=0;i<t.length&&!((n=t[i]).y2>e.y1&&n.x1-.1<=e.x1&&n.x2+.1>=e.x2);i++)r=Math.max(r,n.y2);for(var o=r;i<t.length&&!((n=t[i]).y1>=e.y2||n.x1-.1>e.x1||n.x2+.1<e.x2);i++)o=n.y2;return(o=i===t.length?e.y2:Math.min(o,e.y2))<=r?null:new hn(e.x1,r,e.x2,o)}function Fn(t,e){if(!t.length)return e;var n,i,r=e.y2;for(i=t.length-1;i>=0&&(n=t[i],!(i===t.length-1&&n.y2<e.y2))&&!(n.y1<e.y2&&n.x1-.1<=e.x1&&n.x2+.1>=e.x2);i--)r=Math.min(r,n.y1);for(var o=Math.min(r,n.y2);i>=0&&!((n=t[i]).y2<=e.y1||n.x1-.1>e.x1||n.x2+.1<e.x2);i--)o=n.y1;return r<=(o=Math.max(o,e.y1))?null:new hn(e.x1,o,e.x2,r)}var Pn=function(t){function e(){var e;return(e=t.call(this)||this).propSet={},e}x(e,t);var n=e.prototype;return n.visitIdent=function(t){return this.propSet[t.name]=!0,t},n.visitSpaceList=function(t){return this.visitValues(t.values),t},e}(Pe),Rn=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}return x(e,t),e.prototype.visitInt=function(t){return this.value=t.num,t},e}(Pe);function Ln(t,e){if(t){var n=new Rn(e);try{return t.visit(n),n.value}catch(t){c.warn(t,"toInt: ")}}return e}var On=function(t){function e(){var e;return(e=t.call(this)||this).collect=!1,e.coords=[],e.name=null,e}x(e,t);var n=e.prototype;return n.visitNumeric=function(t){return this.collect&&this.coords.push(t),null},n.visitNum=function(t){return this.collect&&0==t.num&&this.coords.push(new ze(0,"px")),null},n.visitSpaceList=function(t){return this.visitValues(t.values),null},n.visitFunc=function(t){return this.collect||(this.collect=!0,this.visitValues(t.values),this.collect=!1,this.name=t.name.toLowerCase()),null},n.getShape=function(t,e,n,i,r){var o=this;if(this.coords.length>0){var a=[];switch(this.coords.forEach((function(t,e){if("%"==t.unit){var s=e%2==0?n:i;3==e&&"circle"==o.name&&(s=Math.sqrt((n*n+i*i)/2)),a.push(t.num*s/100)}else a.push(t.num*r.queryUnitSize(t.unit,!1))})),this.name){case"polygon":if(a.length%2==0){for(var s=[],u=0;u<a.length;u+=2)s.push(new cn(t+a[u],e+a[u+1]));return new vn(s)}break;case"rectangle":if(4==a.length)return En(t+a[0],e+a[1],t+a[0]+a[2],e+a[1]+a[3]);break;case"ellipse":if(4==a.length)return mn(t+a[0],e+a[1],a[2],a[3]);break;case"circle":if(3==a.length)return mn(t+a[0],e+a[1],a[2],a[2])}}return null},e}(Pe);function kn(t,e,n,i,r,o){if(t){var a=new On;try{return t.visit(a),a.getShape(e,n,i,r,o)}catch(t){c.warn(t,"toShape:")}}return En(e,n,e+i,n+r)}var Bn=function(t){function e(e){var n;return(n=t.call(this)||this).reset=void 0,n.counters={},n.name=null,n.reset=e,n}x(e,t);var n=e.prototype;return n.visitIdent=function(t){return this.name=t.toString(),this.counters[this.name]=this.reset?0:(this.counters[this.name]||0)+1,t},n.visitInt=function(t){return this.name&&(this.counters[this.name]+=t.num-(this.reset?0:1)),t},n.visitSpaceList=function(t){return this.visitValues(t.values),t},e}(Pe);function _n(t,e){var n=new Bn(e);try{t.visit(n)}catch(t){c.warn(t,"toCounters:")}return n.counters}var Mn=function(t){function e(e,n){var i;return(i=t.call(this)||this).baseUrl=void 0,i.transformer=void 0,i.baseUrl=e,i.transformer=n,i}return x(e,t),e.prototype.visitURL=function(t){return new je(this.transformer.transformURL(t.url,this.baseUrl))},e}(Re);function Un(t){var e={};return Object.keys(t).forEach((function(n){e[n]=Array.from(t[n])})),e}var Vn,Hn=function(){function t(t,e){this.targetId=void 0,this.resolved=void 0,this.pageCounters=null,this.spineIndex=-1,this.pageIndex=-1,this.targetId=t,this.resolved=e}var e=t.prototype;return e.equals=function(t){return this===t||!!t&&this.targetId===t.targetId&&this.resolved===t.resolved&&this.spineIndex===t.spineIndex&&this.pageIndex===t.pageIndex},e.isResolved=function(){return this.resolved},e.resolve=function(){this.resolved=!0},e.unresolve=function(){this.resolved=!1},t}(),zn=function(){function t(t,e){this.counterStore=void 0,this.baseURL=void 0,this.counterStore=t,this.baseURL=e}var e=t.prototype;return e.countersOfId=function(t,e){t=this.counterStore.documentURLTransformer.transformFragment(t,this.baseURL),this.counterStore.countersById[t]=e},e.getExprContentListener=function(){return this.counterStore.getExprContentListener()},t}(),Gn=function(){function t(t,e,n,i){this.counterStore=void 0,this.baseURL=void 0,this.rootScope=void 0,this.pageScope=void 0,this.styler=null,this.namedStringValues={},this.counterStore=t,this.baseURL=e,this.rootScope=n,this.pageScope=i}var e=t.prototype;return e.setStyler=function(t){this.styler=t},e.getFragment=function(t){var e=t.match(/^[^#]*#(.*)$/);return e?e[1]:null},e.getTransformedId=function(t){var e=this.counterStore.documentURLTransformer.transformURL(j(t,this.baseURL),this.baseURL);return"#"===e.charAt(0)&&(e=e.substring(1)),e},e.getPageCounterVal=function(t,e){var n=this,i=new Ce(this.pageScope,(function(){return e(function(){var e=n.counterStore.currentPageCounters[t];return e&&e.length?e[e.length-1]:null}())}),"page-counter-"+t);return this.counterStore.registerPageCounterExpr(t,(function(t){return e(t[0])}),i),i},e.getPageCountersVal=function(t,e){var n=this,i=new Ce(this.pageScope,(function(){return e(n.counterStore.currentPageCounters[t]||[])}),"page-counters-"+t);return this.counterStore.registerPageCounterExpr(t,e,i),i},e.getTargetCounters=function(t,e,n){var i=this.counterStore.countersById[e];return!i&&n&&t&&(this.styler.styleUntilIdIsReached(t),i=this.counterStore.countersById[e]),i||null},e.getTargetPageCounters=function(t){return this.counterStore.currentPage.elementsById[t]?this.counterStore.currentPageCounters:this.counterStore.pageCountersById[t]||null},e.getTargetCounterVal=function(t,e,n){var i=this,r=this.getFragment(t),o=this.getTransformedId(t),a=this.getTargetCounters(r,o,!1);if(a&&a[e]){var s=a[e];return new ye(this.rootScope,n(s[s.length-1]||null))}return new Ce(this.pageScope,(function(){if(a=i.getTargetCounters(r,o,!0)){if(a[e]){var t=a[e];return n(t[t.length-1]||null)}var s=i.getTargetPageCounters(o);if(s){if(i.counterStore.resolveReference(o),s[e]){var u=s[e];return n(u[u.length-1]||null)}return n(0)}return i.counterStore.saveReferenceOfCurrentPage(o,!1),"??"}return i.counterStore.saveReferenceOfCurrentPage(o,!1),"??"}),"target-counter-"+e+"-of-"+t)},e.getTargetCountersVal=function(t,e,n){var i=this,r=this.getFragment(t),o=this.getTransformedId(t);return new Ce(this.pageScope,(function(){var t=i.getTargetPageCounters(o);if(t){i.counterStore.resolveReference(o);var a=t[e]||[],s=i.getTargetCounters(r,o,!0);return n(a.concat(s[e]||[]))}return i.counterStore.saveReferenceOfCurrentPage(o,!1),"??"}),"target-counters-"+e+"-of-"+t)},e.getNamedStringVal=function(t,e){var n=this;return new Ce(this.pageScope,(function(){var i=n.namedStringValues[t];if(!i)return"";for(var r=Object.keys(i).map((function(t){return parseInt(t,10)})).sort(dt),o=n.counterStore.currentPage,a=o.isBlankPage?o.offset-1:o.offset,s=o.isBlankPage?a:Math.max.apply(Math,[a].concat(Array.from(o.container.querySelectorAll("[data-adapt-eloff]")).map((function(t){return parseInt(t.getAttribute("data-adapt-eloff"),10)})))),u=-1,l=-1,h=-1,c=-1,d=0;d<r.length;d++){var f=r[d],p=d>0?r[d-1]:-1,g=d<r.length-1?r[d+1]:-1;if(f>s)break;if(f>=a){if(u<0&&(u=f,c=-1),l<0)if(f===a)l=f;else{p<u&&(l=p);var v=o.container.querySelector('[data-adapt-eloff="'+f+'"]');if(v){var m=o.container.querySelector('[data-adapt-eloff="'+a+'"]');if(m||(m=o.container.querySelector('[data-adapt-eloff="0"]')),m)for(var E=m;E;E=E.firstElementChild)if(E===v){l=f;break}}else l<0&&(l=f)}h=f}else(g>s||g<0)&&(u=l=h=c=f)}return i[{first:u,start:l,last:h,"first-except":c}[e]]||""}),"named-string-"+e+"-"+t)},e.setNamedString=function(t,e,n){(this.namedStringValues[t]||(this.namedStringValues[t]={}))[n.currentElementOffset]=e},t}(),Xn=function(){function t(t){this.documentURLTransformer=void 0,this.countersById={},this.pageCountersById={},this.currentPageCounters={},this.previousPageCounters={},this.currentPageCountersStack=[],this.pageIndicesById={},this.currentPage=null,this.newReferencesOfCurrentPage=[],this.referencesToSolve=[],this.referencesToSolveStack=[],this.unresolvedReferences={},this.resolvedReferences={},this.pagesCounterExprs=[],this.documentURLTransformer=t,this.currentPageCounters.page=[0]}var e=t.prototype;return e.createCounterListener=function(t){return new zn(this,t)},e.createCounterResolver=function(t,e,n){return new Gn(this,t,e,n)},e.setCurrentPage=function(t){this.currentPage=t},e.definePageCounter=function(t,e){this.currentPageCounters[t]?this.currentPageCounters[t].push(e):this.currentPageCounters[t]=[e]},e.forceSetPageCounter=function(t){var e=this.currentPageCounters.page;e&&e.length?e[e.length-1]=t:this.currentPageCounters.page=[t]},e.updatePageCounters=function(t,e){var n;this.previousPageCounters=Un(this.currentPageCounters);var i,r=t["counter-reset"];if(r){var o=r.evaluate(e);o&&(n=_n(o,!0))}if(n)for(var a in n)this.definePageCounter(a,n[a]);var s=t["counter-increment"];if(s){var u=s.evaluate(e);u&&(i=_n(u,!1))}for(var l in i?"page"in i||(i.page=1):(i={}).page=1,i){this.currentPageCounters[l]||this.definePageCounter(l,0);var h=this.currentPageCounters[l];h[h.length-1]+=i[l]}},e.pushPageCounters=function(t){this.currentPageCountersStack.push(this.currentPageCounters),this.currentPageCounters=Un(t)},e.popPageCounters=function(){this.currentPageCounters=this.currentPageCountersStack.pop()},e.resolveReference=function(t){var e=this.unresolvedReferences[t],n=this.resolvedReferences[t];n||(n=this.resolvedReferences[t]=[]);for(var i=!1,r=0;r<this.referencesToSolve.length;){var o=this.referencesToSolve[r];if(o.targetId===t){if(o.resolve(),this.referencesToSolve.splice(r,1),e){var a=e.indexOf(o);a>=0&&e.splice(a,1)}n.push(o),i=!0}else r++}i||this.saveReferenceOfCurrentPage(t,!0)},e.saveReferenceOfCurrentPage=function(t,e){if(!this.newReferencesOfCurrentPage.some((function(e){return e.targetId===t}))){var n=new Hn(t,e);this.newReferencesOfCurrentPage.push(n)}},e.finishPage=function(t,e){var n=this,i=Object.keys(this.currentPage.elementsById);if(i.length>0){var r=Un(this.currentPageCounters);i.forEach((function(i){n.pageCountersById[i]=r;var o=n.pageIndicesById[i];if(o&&o.pageIndex<e){var a=n.resolvedReferences[i];if(a){var s,u=n.unresolvedReferences[i];for(u||(u=n.unresolvedReferences[i]=[]);s=a.shift();)s.unresolve(),u.push(s)}}n.pageIndicesById[i]={spineIndex:t,pageIndex:e}}))}for(var o,a=this.previousPageCounters;o=this.newReferencesOfCurrentPage.shift();){o.pageCounters=a,o.spineIndex=t,o.pageIndex=e;var s=void 0;o.isResolved()?(s=this.resolvedReferences[o.targetId])||(s=this.resolvedReferences[o.targetId]=[]):(s=this.unresolvedReferences[o.targetId])||(s=this.unresolvedReferences[o.targetId]=[]),s.every((function(t){return!o.equals(t)}))&&s.push(o)}this.currentPage=null},e.getUnresolvedRefsToPage=function(t){var e=this,n=[];Object.keys(t.elementsById).forEach((function(t){var i=e.unresolvedReferences[t];i&&(n=n.concat(i))})),n.sort((function(t,e){return t.spineIndex-e.spineIndex||t.pageIndex-e.pageIndex}));var i=[],r=null;return n.forEach((function(t){r&&r.spineIndex===t.spineIndex&&r.pageIndex===t.pageIndex?r.refs.push(t):i.push(r={spineIndex:t.spineIndex,pageIndex:t.pageIndex,pageCounters:t.pageCounters,refs:[t]})})),i},e.pushReferencesToSolve=function(t){this.referencesToSolveStack.push(this.referencesToSolve),this.referencesToSolve=t},e.popReferencesToSolve=function(){this.referencesToSolve=this.referencesToSolveStack.pop()},e.registerPageCounterExpr=function(t,e,n){"pages"===t&&this.pagesCounterExprs.push({expr:n,format:e})},e.getExprContentListener=function(){return this.exprContentListener.bind(this)},e.exprContentListener=function(t,e,n){if(this.pagesCounterExprs.findIndex((function(e){return e.expr===t}))>=0){var i=n.createElement("span");return i.textContent=e,i.setAttribute(Wn,t.key),i}return null},e.finishLastPage=function(t){for(var e,n=this,i=t.root.querySelectorAll("["+Wn+"]"),r=this.currentPageCounters.page[0],o=function(){var t=e.value,i=t.getAttribute(Wn),o=n.pagesCounterExprs.findIndex((function(t){return t.expr.key===i}));t.textContent=n.pagesCounterExprs[o].format([r])},a=B(i);!(e=a()).done;)o()},e.createLayoutConstraint=function(t){return new jn(this,t)},t}(),Wn="data-vivliostyle-pages-counter",jn=function(){function t(t,e){this.counterStore=void 0,this.pageIndex=void 0,this.counterStore=t,this.pageIndex=e}return t.prototype.allowLayout=function(t){if(!t||t.after)return!0;var e=t.viewNode;if(!e||1!==e.nodeType)return!0;var n=e.getAttribute("id")||e.getAttribute("name");if(!n)return!0;if(!this.counterStore.resolvedReferences[n]&&!this.counterStore.unresolvedReferences[n])return!0;var i=this.counterStore.pageIndicesById[n];return!i||this.pageIndex>=i.pageIndex},t}();function Kn(t){if((t=t.substr(1)).match(/^[^0-9a-fA-F\n\r]$/))return t;var e=parseInt(t,16);return isNaN(e)?"":e<=65535?String.fromCharCode(e):e<=1114111?String.fromCharCode(55296|e>>10&1023,56320|1023&e):"�"}function Yn(t){return t.replace(/\\([0-9a-fA-F]{0,6}(\r\n|[ \n\r\t\f])?|[^0-9a-fA-F\n\r])/g,Kn)}!function(t){t[t.EOF=0]="EOF",t[t.IDENT=1]="IDENT",t[t.STR=2]="STR",t[t.NUMERIC=3]="NUMERIC",t[t.NUM=4]="NUM",t[t.INT=5]="INT",t[t.FUNC=6]="FUNC",t[t.HASH=7]="HASH",t[t.URL=8]="URL",t[t.CLASS=9]="CLASS",t[t.O_PAR=10]="O_PAR",t[t.C_PAR=11]="C_PAR",t[t.O_BRC=12]="O_BRC",t[t.C_BRC=13]="C_BRC",t[t.O_BRK=14]="O_BRK",t[t.C_BRK=15]="C_BRK",t[t.COMMA=16]="COMMA",t[t.SEMICOL=17]="SEMICOL",t[t.COLON=18]="COLON",t[t.SLASH=19]="SLASH",t[t.AT=20]="AT",t[t.PERCENT=21]="PERCENT",t[t.QMARK=22]="QMARK",t[t.PLUS=23]="PLUS",t[t.MINUS=24]="MINUS",t[t.BAR_BAR=25]="BAR_BAR",t[t.AMP_AMP=26]="AMP_AMP",t[t.URANGE=27]="URANGE",t[t.BANG=31]="BANG",t[t.DOLLAR=32]="DOLLAR",t[t.HAT=33]="HAT",t[t.BAR=34]="BAR",t[t.TILDE=35]="TILDE",t[t.STAR=36]="STAR",t[t.GT=37]="GT",t[t.LT=38]="LT",t[t.EQ=39]="EQ",t[t.BANG_EQ=41]="BANG_EQ",t[t.DOLLAR_EQ=42]="DOLLAR_EQ",t[t.HAT_EQ=43]="HAT_EQ",t[t.BAR_EQ=44]="BAR_EQ",t[t.TILDE_EQ=45]="TILDE_EQ",t[t.STAR_EQ=46]="STAR_EQ",t[t.GT_EQ=47]="GT_EQ",t[t.LT_EQ=48]="LT_EQ",t[t.EQ_EQ=49]="EQ_EQ",t[t.COL_COL=50]="COL_COL",t[t.INVALID=51]="INVALID",t[t.LAST=51]="LAST"}(Vn||(Vn={}));var qn,Qn=function(){this.type=void 0,this.precededBySpace=!1,this.num=0,this.text="",this.position=0,this.type=Vn.EOF};function $n(t,e){var n,i=Array(128);for(n=0;n<128;n++)i[n]=t;for(i.NaN=t==qn.END?qn.END:qn.INVALID,n=0;n<e.length;n+=2)i[e[n]]=e[n+1];return i}!function(t){t[t.SPACE=1]="SPACE",t[t.INT=2]="INT",t[t.IDENT=3]="IDENT",t[t.BANG=4]="BANG",t[t.HASH=6]="HASH",t[t.DOLLAR=7]="DOLLAR",t[t.PERCENT=8]="PERCENT",t[t.AMP=9]="AMP",t[t.O_PAR=10]="O_PAR",t[t.C_PAR=11]="C_PAR",t[t.STAR=12]="STAR",t[t.PLUS=13]="PLUS",t[t.COMMA=14]="COMMA",t[t.MINUS=15]="MINUS",t[t.DOT=16]="DOT",t[t.SLASH=17]="SLASH",t[t.COLON=18]="COLON",t[t.SEMICOL=19]="SEMICOL",t[t.LT=20]="LT",t[t.EQ=21]="EQ",t[t.GT=22]="GT",t[t.QMARK=23]="QMARK",t[t.AT=24]="AT",t[t.O_BRK=25]="O_BRK",t[t.C_BRK=26]="C_BRK",t[t.O_BRC=27]="O_BRC",t[t.C_BRC=28]="C_BRC",t[t.BSLASH=29]="BSLASH",t[t.HAT=30]="HAT",t[t.BAR=31]="BAR",t[t.TILDE=32]="TILDE",t[t.STR1=33]="STR1",t[t.STR2=34]="STR2",t[t.END=35]="END",t[t.EQTAIL=36]="EQTAIL",t[t.ENDINT=37]="ENDINT",t[t.ENDNUM=38]="ENDNUM",t[t.CONT=39]="CONT",t[t.UNIT=40]="UNIT",t[t.PCUNIT=41]="PCUNIT",t[t.NUMBER=42]="NUMBER",t[t.ENDIDNT=43]="ENDIDNT",t[t.IDNTESC=44]="IDNTESC",t[t.ENDIDES=45]="ENDIDES",t[t.ENDSTR=46]="ENDSTR",t[t.ENDESTR=47]="ENDESTR",t[t.STR1ESC=48]="STR1ESC",t[t.STR2ESC=49]="STR2ESC",t[t.BAR_BAR=50]="BAR_BAR",t[t.AMP_AMP=51]="AMP_AMP",t[t.FUNC=52]="FUNC",t[t.FUNCES=53]="FUNCES",t[t.COMMENT=54]="COMMENT",t[t.COMMST=55]="COMMST",t[t.ENDNOTK=56]="ENDNOTK",t[t.MINMIN=57]="MINMIN",t[t.TOINT=58]="TOINT",t[t.TONUM=59]="TONUM",t[t.TOIDENT=60]="TOIDENT",t[t.TOIDES=61]="TOIDES",t[t.KILL1=62]="KILL1",t[t.KILL2=63]="KILL2",t[t.URL=64]="URL",t[t.URL1=65]="URL1",t[t.URL2=66]="URL2",t[t.ENDURL=67]="ENDURL",t[t.TERMURL=68]="TERMURL",t[t.FINURL=69]="FINURL",t[t.LT_BG=70]="LT_BG",t[t.LT_BG_M=71]="LT_BG_M",t[t.INVALID=72]="INVALID",t[t.CHKPOSS=73]="CHKPOSS",t[t.CHKPOSN=74]="CHKPOSN",t[t.URLESC=75]="URLESC",t[t.IDESCH=76]="IDESCH",t[t.COL_COL=77]="COL_COL",t[t.TOCLASS=78]="TOCLASS",t[t.CHKSP=79]="CHKSP",t[t.EOF=80]="EOF"}(qn||(qn={}));var Zn=[qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.SPACE,qn.SPACE,qn.INVALID,qn.SPACE,qn.SPACE,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.SPACE,qn.BANG,qn.STR2,qn.HASH,qn.DOLLAR,qn.PERCENT,qn.AMP,qn.STR1,qn.O_PAR,qn.C_PAR,qn.STAR,qn.PLUS,qn.COMMA,qn.MINUS,qn.DOT,qn.SLASH,qn.INT,qn.INT,qn.INT,qn.INT,qn.INT,qn.INT,qn.INT,qn.INT,qn.INT,qn.INT,qn.COLON,qn.SEMICOL,qn.LT,qn.EQ,qn.GT,qn.QMARK,qn.AT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.O_BRK,qn.BSLASH,qn.C_BRK,qn.HAT,qn.IDENT,qn.INVALID,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.IDENT,qn.O_BRC,qn.BAR,qn.C_BRC,qn.TILDE,qn.INVALID];Zn.NaN=qn.EOF;var Jn=[qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.FUNC,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.CONT,qn.ENDIDNT,qn.ENDIDNT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.ENDIDNT,qn.IDNTESC,qn.ENDIDNT,qn.ENDIDNT,qn.CONT,qn.ENDIDNT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT,qn.ENDIDNT];Jn.NaN=qn.ENDIDNT;var ti=[qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.TOCLASS,qn.TONUM,qn.INVALID,qn.TONUM,qn.TONUM,qn.TONUM,qn.TONUM,qn.TONUM,qn.TONUM,qn.TONUM,qn.TONUM,qn.TONUM,qn.TONUM,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.INVALID,qn.TOIDES,qn.INVALID,qn.INVALID,qn.TOCLASS,qn.INVALID,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.TOCLASS,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID,qn.INVALID];Jn.NaN=qn.ENDIDNT;var ei=[qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.MINMIN,qn.TONUM,qn.END,qn.TOINT,qn.TOINT,qn.TOINT,qn.TOINT,qn.TOINT,qn.TOINT,qn.TOINT,qn.TOINT,qn.TOINT,qn.TOINT,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.END,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.END,qn.TOIDES,qn.END,qn.END,qn.TOIDENT,qn.END,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.TOIDENT,qn.END,qn.END,qn.END,qn.END,qn.END];ei.NaN=qn.END;var ni=[qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.CHKPOSS,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.CHKPOSS,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.FUNCES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.ENDIDES,qn.IDNTESC,qn.ENDIDES,qn.ENDIDES,qn.CONT,qn.ENDIDES,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES,qn.ENDIDES];ni.NaN=qn.ENDIDES;var ii=[qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.PCUNIT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.NUMBER,qn.ENDINT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.UNIT,qn.ENDINT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT,qn.ENDINT];ii.NaN=qn.ENDINT;var ri=[qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.PCUNIT,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.CONT,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.UNIT,qn.ENDNUM,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.UNIT,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM,qn.ENDNUM];ri.NaN=qn.ENDNUM;var oi,ai=$n(qn.END,[61,qn.EQTAIL]),si=$n(qn.END,[58,qn.COL_COL]),ui=$n(qn.END,[61,qn.EQTAIL,124,qn.BAR_BAR]),li=$n(qn.END,[38,qn.AMP_AMP]),hi=$n(qn.END,[42,qn.COMMENT]),ci=$n(qn.CONT,[42,qn.COMMST]),di=$n(qn.COMMENT,[42,qn.COMMST,47,qn.ENDNOTK]),fi=$n(qn.KILL1,[62,qn.ENDNOTK]),pi=$n(qn.END,[61,qn.EQTAIL,33,qn.LT_BG]),gi=$n(qn.KILL1,[45,qn.LT_BG_M]),vi=$n(qn.KILL2,[45,qn.ENDNOTK]),mi=$n(qn.IDESCH,[9,qn.INVALID,10,qn.INVALID,13,qn.INVALID,32,qn.INVALID]),Ei=$n(qn.CONT,[39,qn.ENDSTR,10,qn.INVALID,13,qn.INVALID,92,qn.STR1ESC]),Ci=$n(qn.CONT,[34,qn.ENDSTR,10,qn.INVALID,13,qn.INVALID,92,qn.STR2ESC]),Di=$n(qn.CONT,[39,qn.ENDESTR,10,qn.CHKPOSN,13,qn.CHKPOSN,92,qn.STR1ESC]),wi=$n(qn.CONT,[34,qn.ENDESTR,10,qn.CHKPOSN,13,qn.CHKPOSN,92,qn.STR2ESC]),yi=$n(qn.URL,[9,qn.CONT,32,qn.CONT,34,qn.URL2,39,qn.URL1,41,qn.INVALID,10,qn.CONT,13,qn.CONT]),Ni=$n(qn.CONT,[41,qn.ENDURL,9,qn.CHKSP,10,qn.CHKSP,13,qn.CHKSP,32,qn.CHKSP,92,qn.URLESC,40,qn.INVALID,91,qn.INVALID,93,qn.INVALID,123,qn.INVALID,125,qn.INVALID,NaN,qn.ENDURL]),bi=$n(qn.CONT,[39,qn.TERMURL,10,qn.CHKPOSN,13,qn.CHKPOSN,92,qn.URLESC,NaN,qn.ENDURL]),Si=$n(qn.CONT,[34,qn.TERMURL,10,qn.CHKPOSN,13,qn.CHKPOSN,92,qn.URLESC,NaN,qn.ENDURL]),Ai=$n(qn.INVALID,[9,qn.CONT,10,qn.CONT,13,qn.CONT,32,qn.CONT,41,qn.FINURL]),Ti=function(){function t(t,e){this.input=void 0,this.handler=void 0,this.indexMask=void 0,this.buffer=void 0,this.head=-1,this.tail=0,this.curr=0,this.position=0,this.input=t,this.handler=e,this.indexMask=15,this.buffer=Array(this.indexMask+1);for(var n=0;n<=this.indexMask;n++)this.buffer[n]=new Qn}var e=t.prototype;return e.token=function(){return this.tail==this.curr&&this.fillBuffer(),this.buffer[this.curr]},e.nthToken=function(t){return(this.tail-this.curr&this.indexMask)<=t&&this.fillBuffer(),this.buffer[this.curr+t&this.indexMask]},e.consume=function(){this.curr=this.curr+1&this.indexMask},e.mark=function(){if(this.head>=0)throw new Error("F_CSSTOK_BAD_CALL mark");this.head=this.curr},e.reset=function(){if(this.head<0)throw new Error("F_CSSTOK_BAD_CALL reset");this.curr=this.head,this.head=-1},e.unmark=function(){this.head=-1},e.hasMark=function(){return this.head>=0},e.reallocate=function(){for(var t=2*(this.indexMask+1)-1,e=Array(t+1),n=this.head,i=0;n!=this.tail;)e[i]=this.buffer[n],n==this.curr&&(this.curr=i),n=n+1&this.indexMask,i++;for(this.head=0,this.tail=i,this.indexMask=t,this.buffer=e;i<=t;)e[i++]=new Qn},e.error=function(t,e,n){this.handler&&this.handler.error(n,e)},e.fillBuffer=function(){var t=this.tail,e=this.head>=0?this.head:this.curr,n=this.indexMask;if(t>=e?e+=n:e--,e==t){if(this.head<0)throw new Error("F_CSSTOK_INTERNAL");this.reallocate(),t=this.tail,e=n=this.indexMask}for(var i=Zn,r=this.input,o=this.position,a=this.buffer,s=Vn.EOF,u=0,l="",h=0,c=!1,d=a[t],f=-9;;){var p=r.charCodeAt(o);switch(i[p]||i[65]){case qn.INVALID:s=Vn.INVALID,l=isNaN(p)?"E_CSS_UNEXPECTED_EOF":"E_CSS_UNEXPECTED_CHAR",i=Zn,o++;break;case qn.SPACE:o++,c=!0;continue;case qn.INT:u=o++,i=ii;continue;case qn.IDENT:s=Vn.IDENT,u=o++,i=Jn;continue;case qn.BANG:u=o++,s=Vn.BANG,i=ai;continue;case qn.STR1:s=Vn.STR,u=++o,i=Ei;continue;case qn.STR2:s=Vn.STR,u=++o,i=Ci;continue;case qn.HASH:u=++o,s=Vn.HASH,i=Jn;continue;case qn.DOLLAR:u=o++,s=Vn.DOLLAR,i=ai;continue;case qn.PERCENT:u=o++,s=Vn.PERCENT;break;case qn.AMP:u=o++,s=Vn.DOLLAR,i=li;continue;case qn.O_PAR:u=o++,s=Vn.O_PAR;break;case qn.C_PAR:u=o++,s=Vn.C_PAR;break;case qn.STAR:u=o++,s=Vn.STAR,i=ai;continue;case qn.PLUS:u=o++,s=Vn.PLUS;break;case qn.COMMA:u=o++,s=Vn.COMMA;break;case qn.MINUS:s=Vn.MINUS,u=o++,i=ei;continue;case qn.DOT:u=o++,i=ti;continue;case qn.TOCLASS:u=o++,s=Vn.CLASS,i=Jn;continue;case qn.SLASH:u=o++,s=Vn.SLASH,i=hi;continue;case qn.COLON:u=o++,s=Vn.COLON,i=si;continue;case qn.COL_COL:o++,s=Vn.COL_COL;break;case qn.SEMICOL:u=o++,s=Vn.SEMICOL;break;case qn.LT:u=o++,s=Vn.LT,i=pi;continue;case qn.EQ:u=o++,s=Vn.EQ,i=ai;continue;case qn.GT:u=o++,s=Vn.GT,i=ai;continue;case qn.QMARK:u=o++,s=Vn.QMARK;break;case qn.AT:u=++o,s=Vn.AT,i=Jn;continue;case qn.O_BRK:u=o++,s=Vn.O_BRK;break;case qn.C_BRK:u=o++,s=Vn.C_BRK;break;case qn.O_BRC:u=o++,s=Vn.O_BRC;break;case qn.C_BRC:u=o++,s=Vn.C_BRC;break;case qn.BSLASH:f=u=o++,s=Vn.IDENT,i=mi;continue;case qn.HAT:u=o++,s=Vn.HAT,i=ai;continue;case qn.BAR:u=o++,s=Vn.BAR,i=ui;continue;case qn.TILDE:u=o++,s=Vn.TILDE,i=ai;continue;case qn.END:break;case qn.EQTAIL:o++,s=s+Vn.BANG_EQ-Vn.BANG;break;case qn.ENDINT:s=Vn.INT,h=parseInt(r.substring(u,o),10);break;case qn.ENDNUM:s=Vn.NUM,h=parseFloat(r.substring(u,o));break;case qn.CONT:o++;continue;case qn.UNIT:s=Vn.NUMERIC,h=parseFloat(r.substring(u,o)),u=o++,i=Jn;continue;case qn.PCUNIT:s=Vn.NUMERIC,h=parseFloat(r.substring(u,o)),l="%",u=o++;break;case qn.NUMBER:o++,i=ri;continue;case qn.ENDIDNT:if(l=r.substring(u,o),s===Vn.URANGE&&63===p||s===Vn.IDENT&&"u"===l.toLowerCase()&&/^\+[?0-9a-fA-F]/.test(r.substr(o,2))&&/\bunicode-range\s*:\s*(u\+[-?0-9a-f]+\s*,\s*)*u$/i.test(r.substr(0,o))){s=Vn.URANGE,o++;continue}break;case qn.IDNTESC:f=o++,i=mi;continue;case qn.ENDIDES:l=Yn(r.substring(u,o));break;case qn.ENDSTR:l=r.substring(u,o),o++;break;case qn.ENDESTR:l=Yn(r.substring(u,o)),o++;break;case qn.STR1ESC:f=o,o+=2,i=Di;continue;case qn.STR2ESC:f=o,o+=2,i=wi;continue;case qn.BAR_BAR:o++,s=Vn.BAR_BAR;break;case qn.AMP_AMP:o++,s=Vn.AMP_AMP;break;case qn.FUNC:if(l=r.substring(u,o),s==Vn.IDENT){if(o++,"url"==l.toLowerCase()){i=yi;continue}s=Vn.FUNC}break;case qn.FUNCES:if(l=Yn(r.substring(u,o)),s==Vn.IDENT){if(o++,"url"==l.toLowerCase()){i=yi;continue}s=Vn.FUNC}break;case qn.COMMENT:i=ci,o++;continue;case qn.COMMST:i=di,o++;continue;case qn.ENDNOTK:i=Zn,o++;continue;case qn.MINMIN:i=fi,o++;continue;case qn.TOINT:s=Vn.INT,i=ii,o++;continue;case qn.TONUM:s=Vn.NUM,i=ri,o++;continue;case qn.TOIDENT:s=Vn.IDENT,i=Jn,o++;continue;case qn.TOIDES:s=Vn.IDENT,i=mi,f=o++;continue;case qn.KILL1:o--;break;case qn.KILL2:o-=2;break;case qn.URL:u=o++,i=Ni;continue;case qn.URL1:u=++o,i=bi;continue;case qn.URL2:u=++o,i=Si;continue;case qn.ENDURL:s=Vn.URL,l=Yn(r.substring(u,o)),o++;break;case qn.FINURL:o++;break;case qn.LT_BG:i=gi,o++;continue;case qn.LT_BG_M:i=vi,o++;continue;case qn.CHKSP:if(o-f<8&&r.substring(f+1,o+1).match(/^[0-9a-fA-F]{0,6}(\r\n|[\n\r])|[ \t]$/)){o++;continue}case qn.TERMURL:s=Vn.URL,l=Yn(r.substring(u,o)),o++,i=Ai;continue;case qn.CHKPOSN:if(++o-f<9&&r.substring(f+1,o).match(/^[0-9a-fA-F]{0,6}(\r\n|[\n\r])$/))continue;s=Vn.INVALID,l="E_CSS_UNEXPECTED_NEWLINE",i=Zn;break;case qn.CHKPOSS:if(o-f<9&&r.substring(f+1,o+1).match(/^[0-9a-fA-F]{0,6}[ \t]$/)){o++;continue}l=Yn(r.substring(u,o));break;case qn.URLESC:f=o++;continue;case qn.IDESCH:o++,i=ni;continue;default:if(i!==Zn){s=Vn.INVALID,l="E_CSS_UNEXPECTED_STATE";break}u=o,s=Vn.EOF}if(d.type=s,d.precededBySpace=c,d.num=h,d.text=l,d.position=u,++t>=e)break;i=Zn,c=!1,d=a[t&n]}this.position=o,this.tail=t&n},t}(),xi=null,Ii=null;function Fi(){return xi}function Pi(t){if(!xi)throw new Error("E_TASK_NO_CONTEXT");xi.name||(xi.name=t);var e=xi,n=new Vi(e,e.top,t);return e.top=n,n.state=oi.ACTIVE,n}function Ri(t){return new Mi(t)}function Li(t,e,n){var i=Pi(t);i.handler=n;try{e(i)}catch(t){i.task.raise(t,i)}return i.result()}!function(t){t[t.INIT=0]="INIT",t[t.ACTIVE=1]="ACTIVE",t[t.FINISHED=2]="FINISHED",t[t.DEAD=3]="DEAD"}(oi||(oi={}));var Oi=function(){function t(){}var e=t.prototype;return e.currentTime=function(){return(new Date).valueOf()},e.setTimeout=function(t){function e(e,n){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){return setTimeout(t,e)})),e.clearTimeout=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){clearTimeout(t)})),t}(),ki=function(){function t(t){this.timer=void 0,this.timeout=1,this.slice=25,this.sliceOverTime=0,this.queue=void 0,this.wakeupTime=null,this.timeoutToken=null,this.inTimeSlice=!1,this.order=0,this.timer=t,this.queue=new q,Ii||(Ii=this)}var e=t.prototype;return e.setSlice=function(t){this.slice=t},e.setTimeout=function(t){this.timeout=t},e.isTimeSliceOver=function(){return this.timer.currentTime()>=this.sliceOverTime},e.arm=function(){var t=this;if(!this.inTimeSlice){var e=this.queue.peek().scheduledTime,n=this.timer.currentTime();if(null!=this.timeoutToken){if(n+this.timeout>this.wakeupTime)return;this.timer.clearTimeout(this.timeoutToken)}var i=e-n;i<=this.timeout&&(i=this.timeout),this.wakeupTime=n+i,this.timeoutToken=this.timer.setTimeout((function(){t.timeoutToken=null,t.doTimeSlice()}),i)}},e.schedule=function(t,e){var n=t,i=this.timer.currentTime();n.order=this.order++,n.scheduledTime=i+(e||0),this.queue.add(n),this.arm()},e.doTimeSlice=function(){null!=this.timeoutToken&&(this.timer.clearTimeout(this.timeoutToken),this.timeoutToken=null),this.inTimeSlice=!0;try{var t=this.timer.currentTime();for(this.sliceOverTime=t+this.slice;this.queue.length();){var e=this.queue.peek();if(e.scheduledTime>t)break;if(this.queue.remove(),e.canceled||e.resumeInternal(),(t=this.timer.currentTime())>=this.sliceOverTime)break}}catch(t){c.error(t)}this.inTimeSlice=!1,this.queue.length()&&this.arm()},e.run=function(t,e){var n=new _i(this,e||"");n.top=new Vi(n,null,"bootstrap"),n.top.state=oi.ACTIVE,n.top.then((function(){var e=function(){n.running=!1;for(var t,e=B(n.callbacks);!(t=e()).done;){var i=t.value;try{i()}catch(t){c.error(t)}}};try{t().then((function(t){n.result=t,e()}))}catch(t){n.raise(t),e()}}));var i=xi;return xi=n,this.schedule(n.top.suspend("bootstrap")),xi=i,n},t}(),Bi=function(){function t(t){this.task=void 0,this.scheduledTime=0,this.order=0,this.result=null,this.canceled=!1,this.task=t}var e=t.prototype;return e.compare=function(t){return t.scheduledTime-this.scheduledTime||t.order-this.order},e.getTask=function(){return this.task},e.schedule=function(t,e){this.result=t,this.task.scheduler.schedule(this,e)},e.resumeInternal=function(){var t=this.task;if(this.task=null,t&&t.continuation==this){t.continuation=null;var e=xi;return xi=t,t.top.finish(this.result),xi=e,!0}return!1},e.cancel=function(){this.canceled=!0},t}(),_i=function(){function t(t,e){this.scheduler=void 0,this.name=void 0,this.callbacks=[],this.exception=null,this.running=!0,this.result=null,this.waitTarget=null,this.top=null,this.continuation=null,this.scheduler=t,this.name=e}var e=t.prototype;return e.getName=function(){return this.name},e.interrupt=function(t){if(this.raise(t||new Error("E_TASK_INTERRUPT")),this!==xi&&this.continuation){this.continuation.cancel();var e=new Bi(this);this.waitTarget="interrupt",this.continuation=e,this.scheduler.schedule(e)}},e.getScheduler=function(){return this.scheduler},e.isRunning=function(){return this.running},e.whenDone=function(t){this.callbacks.push(t)},e.join=function(){var t=this,e=Pi("Task.join");if(this.running){var n=e.suspend(this);this.whenDone((function(){n.schedule(t.result)}))}else e.finish(this.result);return e.result()},e.unwind=function(){for(;this.top&&!this.top.handler;)this.top=this.top.parent;if(this.top&&this.top.handler&&this.exception){var t=this.exception;this.exception=null,this.top.handler(this.top,t)}else this.exception&&c.error(this.exception,"Unhandled exception in task",this.name)},e.raise=function(t,e){if(this.fillStack(t),e){for(var n=this.top;n&&n!=e;)n=n.parent;n==e&&(this.top=n)}this.exception=t,this.unwind()},e.fillStack=function(t){var e=t.frameTrace;if(!e){e=t.stack?t.stack+"\n\t---- async ---\n":"";for(var n=this.top;n;n=n.parent)e+="\t",e+=n.getName(),e+="\n";t.frameTrace=e}},t}(),Mi=function(){function t(t){this.value=void 0,this.value=t}var e=t.prototype;return e.then=function(t){t(this.value)},e.thenAsync=function(t){return t(this.value)},e.thenReturn=function(e){return new t(e)},e.thenFinish=function(t){t.finish(this.value)},e.isPending=function(){return!1},e.get=function(){return this.value},t}(),Ui=function(){function t(t){this.frame=void 0,this.frame=t}var e=t.prototype;return e.then=function(t){this.frame.then(t)},e.thenAsync=function(t){if(this.isPending()){var e=new Vi(this.frame.task,this.frame.parent,"AsyncResult.thenAsync");return e.state=oi.ACTIVE,this.frame.parent=e,this.frame.then((function(n){t(n).then((function(t){e.finish(t)}))})),e.result()}return t(this.frame.res)},e.thenReturn=function(t){return this.isPending()?this.thenAsync((function(){return new Mi(t)})):new Mi(t)},e.thenFinish=function(t){this.isPending()?this.then((function(e){t.finish(e)})):t.finish(this.frame.res)},e.isPending=function(){return this.frame.state==oi.ACTIVE},e.get=function(){if(this.isPending())throw new Error("Result is pending");return this.frame.res},t}(),Vi=function(){function t(t,e,n){this.task=void 0,this.parent=void 0,this.name=void 0,this.res=null,this.state=void 0,this.callback=null,this.handler=null,this.task=t,this.parent=e,this.name=n,this.state=oi.INIT}var e=t.prototype;return e.checkEnvironment=function(){if(!xi)throw new Error("F_TASK_NO_CONTEXT");if(this!==xi.top)throw new Error("F_TASK_NOT_TOP_FRAME")},e.result=function(){return new Ui(this)},e.finish=function(t){this.checkEnvironment(),xi&&!xi.exception&&(this.res=t),this.state=oi.FINISHED;var e=this.parent;if(xi&&(xi.top=e),this.callback){try{this.callback(t)}catch(t){this.task.raise(t,e)}this.state=oi.DEAD}},e.getTask=function(){return this.task},e.getName=function(){return this.name},e.getScheduler=function(){return this.task.scheduler},e.then=function(t){switch(this.state){case oi.ACTIVE:if(this.callback)throw new Error("F_TASK_FRAME_ALREADY_HAS_CALLBACK");this.callback=t;break;case oi.FINISHED:var e=this.task,n=this.parent;try{t(this.res),this.state=oi.DEAD}catch(t){this.state=oi.DEAD,e.raise(t,n)}break;case oi.DEAD:throw new Error("F_TASK_DEAD_FRAME");default:throw new Error("F_TASK_UNEXPECTED_FRAME_STATE "+this.state)}},e.timeSlice=function(){var t=Pi("Frame.timeSlice");return t.getScheduler().isTimeSliceOver()?(c.debug("-- time slice --"),t.suspend().schedule(!0)):t.finish(!0),t.result()},e.sleep=function(t){var e=Pi("Frame.sleep");return e.suspend().schedule(!0,t),e.result()},e.loop=function(t){var e=Pi("Frame.loop");return function n(i){try{for(;i;){var r=t();if(r.isPending())return void r.then(n);r.then((function(t){i=t}))}e.finish(!0)}catch(t){e.task.raise(t,e)}}(!0),e.result()},e.loopWithFrame=function(t){var e=xi;if(!e)throw new Error("E_TASK_NO_CONTEXT");return this.loop((function(){var n;do{var i=new Hi(e,e.top);e.top=i,i.state=oi.ACTIVE,t(i),n=i.result()}while(!n.isPending()&&n.get());return n}))},e.suspend=function(t){if(this.checkEnvironment(),this.task.continuation)throw new Error("E_TASK_ALREADY_SUSPENDED");var e=new Bi(this.task);return this.task.continuation=e,xi=null,this.task.waitTarget=t||null,e},t}(),Hi=function(t){function e(e,n){return t.call(this,e,n,"loop")||this}x(e,t);var n=e.prototype;return n.continueLoop=function(){this.finish(!0)},n.breakLoop=function(){this.finish(!1)},e}(Vi),zi=function(){function t(t,e){this.fetch=void 0,this.name=void 0,this.arrived=!1,this.resource=null,this.task=null,this.piggybacks=[],this.fetch=t,this.name=e}var e=t.prototype;return e.start=function(){var t=this;this.task||(this.task=Fi().getScheduler().run((function(){var e=Pi("Fetcher.run");return t.fetch().then((function(n){var i=t.piggybacks;if(t.arrived=!0,t.resource=n,t.task=null,t.piggybacks=[],i)for(var r=0;r<i.length;r++)try{i[r](n)}catch(t){c.error(t,"Error:")}e.finish(n)})),e.result()}),this.name))},e.piggyback=function(t){this.arrived?t(this.resource):this.piggybacks.push(t)},e.get=function(){return this.arrived?Ri(this.resource):(this.start(),this.task.join())},e.hasArrived=function(){return this.arrived},t}(),Gi=function(t){if(0==t.length)return Ri(!0);if(1==t.length)return t[0].get().thenReturn(!0);var e=Pi("waitForFetches"),n=0;return e.loop((function(){for(;n<t.length;){var e=t[n++];if(!e.hasArrived())return e.get().thenReturn(!0)}return Ri(!1)})).then((function(){e.finish(!0)})),e.result()};function Xi(t,e){var n=null,i=null;"img"==t.localName&&(n=t.getAttribute("width"),i=t.getAttribute("height"));var r=new zi((function(){var r=Pi("loadImage"),o=r.suspend(t),a=!1,s=function(e){a||(a=!0,"img"==t.localName&&(n||t.removeAttribute("width"),i||t.removeAttribute("height")),o.schedule(e?e.type:"timeout"))};return t.addEventListener("load",s,!1),t.addEventListener("error",s,!1),t.addEventListener("abort",s,!1),t.namespaceURI==G.SVG?(t.setAttributeNS(G.XLINK,"xlink:href",e),setTimeout(s,300)):t.src=e,r.result()}),"loadElement "+e);return r.start(),r}var Wi,ji='\n@media screen {\n [data-vivliostyle-viewer-viewport] {\n background: #aaaaaa;\n }\n\n [data-vivliostyle-page-container] {\n background: white;\n z-index: 0;\n }\n\n [data-vivliostyle-viewer-viewport] {\n display: -webkit-flex;\n display: flex;\n overflow: auto;\n position: relative;\n }\n\n [data-vivliostyle-outer-zoom-box] {\n margin: auto;\n overflow: hidden;\n -webkit-flex: none;\n flex: none;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-spread-container] {\n display: -webkit-flex;\n display: flex;\n -webkit-flex: none;\n flex: none;\n -webkit-justify-content: center;\n justify-content: center;\n -moz-transform-origin: left top;\n -webkit-transform-origin: left top;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="ltr"]\n [data-vivliostyle-spread-container] {\n -webkit-flex-direction: row;\n flex-direction: row;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="rtl"]\n [data-vivliostyle-spread-container] {\n -webkit-flex-direction: row-reverse;\n flex-direction: row-reverse;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-page-container] {\n margin: 0 auto;\n -webkit-flex: none;\n flex: none;\n transform-origin: center top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="left"] {\n margin-right: 1px;\n transform-origin: right top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="right"] {\n margin-left: 1px;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-unpaired-page="true"] {\n margin-left: auto;\n margin-right: auto;\n transform-origin: center top;\n }\n}\n',Ki="\n[data-vivliostyle-layout-box] {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n z-index: -1;\n}\n\n[data-vivliostyle-debug] [data-vivliostyle-layout-box] {\n right: auto;\n bottom: auto;\n overflow: visible;\n z-index: auto;\n}\n\n[data-vivliostyle-page-container] {\n position: relative;\n overflow: hidden;\n}\n\n[data-vivliostyle-bleed-box] {\n position: absolute;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n}\n\n[data-vivliostyle-page-box] ~ [data-vivliostyle-page-box] {\n display: none;\n}\n\n[data-vivliostyle-toc-box] {\n position: absolute;\n left: 3px;\n top: 3px;\n overflow: scroll;\n overflow-x: hidden;\n background: rgba(248, 248, 248, 0.9);\n border-radius: 2px;\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);\n}\n\n@media print {\n [data-vivliostyle-toc-box] {\n display: none;\n }\n\n [data-vivliostyle-outer-zoom-box],\n [data-vivliostyle-spread-container] {\n width: 100% !important;\n height: 100% !important;\n }\n\n [data-vivliostyle-spread-container],\n [data-vivliostyle-page-container] {\n -moz-transform: none !important;\n -webkit-transform: none !important;\n transform: none !important;\n }\n\n [data-vivliostyle-page-container] {\n display: block !important;\n max-width: 100%;\n height: 100% !important;\n max-height: 100%;\n }\n\n /* Workaround for Chrome printing problem */\n /* [data-vivliostyle-page-box] {\n padding-bottom: 0 !important;\n overflow: visible !important;\n } */\n [data-vivliostyle-bleed-box] > div > div::before {\n display: block;\n content: \"\";\n padding-top: 0.015625px;\n margin-bottom: -0.015625px;\n }\n\n /* Gecko-only hack, see https://bugzilla.mozilla.org/show_bug.cgi?id=267029#c17 */\n @-moz-document regexp('.*') {\n [data-vivliostyle-page-container]:nth-last-child(n + 2) {\n top: -1px;\n margin-top: 1px;\n margin-bottom: -1px;\n }\n }\n}\n",Yi="\n/*\n * Copyright 2013 Google, Inc.\n * Copyright 2015 Trim-marks Inc.\n * Copyright 2019 Vivliostyle Foundation\n *\n * CSS property validation.\n */\nNUM = POS_NUM | ZERO | NEGATIVE;\nNNEG_NUM = POS_NUM | ZERO;\nINT = POS_INT | ZERO | NEGATIVE;\nNNEG_INT = POS_INT | ZERO;\nPERCENTAGE = POS_PERCENTAGE | ZERO | NEGATIVE;\nSTRICT_PERCENTAGE = POS_PERCENTAGE | ZERO_PERCENTAGE | NEGATIVE;\nNNEG_PERCENTAGE = POS_PERCENTAGE | ZERO;\nLENGTH = POS_LENGTH | ZERO | NEGATIVE;\nNNEG_LENGTH = POS_LENGTH | ZERO | NEGATIVE;\nPLENGTH = LENGTH | PERCENTAGE;\nPPLENGTH = POS_LENGTH | ZERO | POS_PERCENTAGE;\nALENGTH = LENGTH | auto;\nAPLENGTH = PLENGTH | auto;\nPAPLENGTH = PPLENGTH | auto;\nANGLE = POS_ANGLE | ZERO | NEGATIVE;\nLENGTH_OR_NUM = LENGTH | NUM;\nANGLE_OR_NUM = ANGLE | NUM;\nMIN_MAX_FIT_CONTENT = min-content | max-content | fit-content;\nSCOLOR = HASHCOLOR | aliceblue: #F0F8FF | antiquewhite: #FAEBD7 | aqua: #00FFFF | aquamarine: #7FFFD4 | azure: #F0FFFF |\n beige: #F5F5DC | bisque: #FFE4C4 | black: #000000 | blanchedalmond: #FFEBCD | blue: #0000FF | blueviolet: #8A2BE2 | brown: #A52A2A |\n burlywood: #DEB887 | cadetblue: #5F9EA0 | chartreuse: #7FFF00 | chocolate: #D2691E | coral: #FF7F50 | cornflowerblue: #6495ED |\n cornsilk: #FFF8DC | crimson: #DC143C | cyan: #00FFFF | darkblue: #00008B | darkcyan: #008B8B | darkgoldenrod: #B8860B |\n darkgray: #A9A9A9 | darkgreen: #006400 | darkgrey: #A9A9A9 | darkkhaki: #BDB76B | darkmagenta: #8B008B | darkolivegreen: #556B2F |\n darkorange: #FF8C00 | darkorchid: #9932CC | darkred: #8B0000 | darksalmon: #E9967A | darkseagreen: #8FBC8F | darkslateblue: #483D8B |\n darkslategray: #2F4F4F | darkslategrey: #2F4F4F | darkturquoise: #00CED1 | darkviolet: #9400D3 | deeppink: #FF1493 |\n deepskyblue: #00BFFF | dimgray: #696969 | dimgrey: #696969 | dodgerblue: #1E90FF | firebrick: #B22222 | floralwhite: #FFFAF0 |\n forestgreen: #228B22 | fuchsia: #FF00FF | gainsboro: #DCDCDC | ghostwhite: #F8F8FF | gold: #FFD700 | goldenrod: #DAA520 |\n gray: #808080 | green: #008000 | greenyellow: #ADFF2F | grey: #808080 | honeydew: #F0FFF0 | hotpink: #FF69B4 | indianred: #CD5C5C |\n indigo: #4B0082 | ivory: #FFFFF0 | khaki: #F0E68C | lavender: #E6E6FA | lavenderblush: #FFF0F5 | lawngreen: #7CFC00 |\n lemonchiffon: #FFFACD | lightblue: #ADD8E6 | lightcoral: #F08080 | lightcyan: #E0FFFF | lightgoldenrodyellow: #FAFAD2 |\n lightgray: #D3D3D3 | lightgreen: #90EE90 | lightgrey: #D3D3D3 | lightpink: #FFB6C1 | lightsalmon: #FFA07A | lightseagreen: #20B2AA |\n lightskyblue: #87CEFA | lightslategray: #778899 | lightslategrey: #778899 | lightsteelblue: #B0C4DE | lightyellow: #FFFFE0 |\n lime: #00FF00 | limegreen: #32CD32 | linen: #FAF0E6 | magenta: #FF00FF | maroon: #800000 | mediumaquamarine: #66CDAA |\n mediumblue: #0000CD | mediumorchid: #BA55D3 | mediumpurple: #9370DB | mediumseagreen: #3CB371 | mediumslateblue: #7B68EE |\n mediumspringgreen: #00FA9A | mediumturquoise: #48D1CC | mediumvioletred: #C71585 | midnightblue: #191970 | mintcream: #F5FFFA |\n mistyrose: #FFE4E1 | moccasin: #FFE4B5 | navajowhite: #FFDEAD | navy: #000080 | oldlace: #FDF5E6 | olive: #808000 |\n olivedrab: #6B8E23 | orange: #FFA500 | orangered: #FF4500 | orchid: #DA70D6 | palegoldenrod: #EEE8AA | palegreen: #98FB98 |\n paleturquoise: #AFEEEE | palevioletred: #DB7093 | papayawhip: #FFEFD5 | peachpuff: #FFDAB9 | peru: #CD853F | pink: #FFC0CB |\n plum: #DDA0DD | powderblue: #B0E0E6 | purple: #800080 | rebeccapurple: #663399 | red: #FF0000 | rosybrown: #BC8F8F | royalblue: #4169E1 |\n saddlebrown: #8B4513 | salmon: #FA8072 | sandybrown: #F4A460 | seagreen: #2E8B57 | seashell: #FFF5EE | sienna: #A0522D |\n silver: #C0C0C0 | skyblue: #87CEEB | slateblue: #6A5ACD | slategray: #708090 | slategrey: #708090 | snow: #FFFAFA |\n springgreen: #00FF7F | steelblue: #4682B4 | tan: #D2B48C | teal: #008080 | thistle: #D8BFD8 | tomato: #FF6347 |\n turquoise: #40E0D0 | violet: #EE82EE | wheat: #F5DEB3 | white: #FFFFFF | whitesmoke: #F5F5F5 | yellow: #FFFF00 |\n yellowgreen: #9ACD32 | transparent | currentcolor;\nRGBCOLOR = rgb(INT{3}) | rgb(STRICT_PERCENTAGE{3});\nRGBACOLOR = rgba(NUM{4}) | rgba(STRICT_PERCENTAGE{3} NUM);\nHSLCOLOR = hsl(NUM PERCENTAGE{2});\nHSLACOLOR = hsl(NUM PERCENTAGE{2} NUM);\nCOLOR = SCOLOR | RGBCOLOR | RGBACOLOR | HSLCOLOR | HSLACOLOR;\nBG_POSITION_TERM = PLENGTH | left | center | right | top | bottom;\nSIDE_OR_CORNER = [left | right] || [top | bottom];\nCOLOR_STOP = SPACE(COLOR [PERCENTAGE | LENGTH]?);\nLINEAR_GRADIENT = linear-gradient([ANGLE | SPACE(to SIDE_OR_CORNER)]? COLOR_STOP+) |\n repeating-linear-gradient([ANGLE | SPACE(to SIDE_OR_CORNER)]? COLOR_STOP+) |;\nGRADIENT_EXTENT = closest-corner | closest-side | farthest-corner | farthest-side;\nGRADIENT_POSITION = at BG_POSITION_TERM{1,4};\nGRADIENT_SHAPE = SPACE(circle LENGTH? GRADIENT_POSITION?) | SPACE(ellipse PLENGTH{2}? GRADIENT_POSITION?)| SPACE([circle | ellipse] GRADIENT_EXTENT? GRADIENT_POSITION?);\nRADIAL_GRADIENT = radial-gradient([GRADIENT_SHAPE | SPACE(GRADIENT_POSITION)]? COLOR_STOP+) |\n repeating-radial-gradient([GRADIENT_SHAPE | SPACE(GRADIENT_POSITION)]? COLOR_STOP+);\nURI_OR_NONE = URI | none;\nIMAGE = URI | LINEAR_GRADIENT | RADIAL_GRADIENT | none;\nbackground-attachment = COMMA( [scroll | fixed | local]+ );\nbackground-color = COLOR;\nbackground-image = COMMA( IMAGE+ );\nbackground-position = COMMA( SPACE(BG_POSITION_TERM{1,4})+ ); /* relaxed */\nbackground-repeat = COMMA( [repeat | repeat-x | repeat-y | no-repeat]+ );\nborder-collapse = collapse | separate;\nBORDER_SIDE_COLOR = COLOR;\nBORDER_SIDE_STYLE = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset;\nBORDER_SIDE_WIDTH = thin: 1px | medium: 3px | thick: 5px | NNEG_LENGTH;\nborder-spacing = LENGTH LENGTH?;\nborder-top-color = BORDER_SIDE_COLOR;\nborder-right-color = BORDER_SIDE_COLOR;\nborder-bottom-color = BORDER_SIDE_COLOR;\nborder-left-color = BORDER_SIDE_COLOR;\nborder-top-style = BORDER_SIDE_STYLE;\nborder-right-style = BORDER_SIDE_STYLE;\nborder-bottom-style = BORDER_SIDE_STYLE;\nborder-left-style = BORDER_SIDE_STYLE;\nborder-top-width = BORDER_SIDE_WIDTH;\nborder-right-width = BORDER_SIDE_WIDTH;\nborder-bottom-width = BORDER_SIDE_WIDTH;\nborder-left-width = BORDER_SIDE_WIDTH;\nBORDER_RADIUS = PLENGTH{1,2};\nborder-top-left-radius = BORDER_RADIUS;\nborder-top-right-radius = BORDER_RADIUS;\nborder-bottom-right-radius = BORDER_RADIUS;\nborder-bottom-left-radius = BORDER_RADIUS;\nborder-image-source = IMAGE;\nborder-image-slice = [NUM | PERCENTAGE]{1,4} || fill; /* relaxed */\nborder-image-width = [NUM | PLENGTH | auto]{1,4};\nborder-image-outset = [NUM | LENGTH]{1,4};\nborder-image-repeat = [ stretch | repeat | round | space ]{1,2};\nbottom = APLENGTH;\ncaption-side = top | bottom;\nclear = none | left | right | top | bottom | both | all | same;\nclip = rect(ALENGTH{4}) | rect(SPACE(ALENGTH{4})) | auto;\ncolor = COLOR;\nLIST_STYLE_TYPE = disc | circle | square | decimal | decimal-leading-zero | lower-roman |\n upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha |\n upper-alpha | russian | upper-russian | lower-russian | cjk-ideographic | trad-chinese-informal |\n hebrew | none;\nTYPE_OR_UNIT_IN_ATTR = string | color | url | integer | number | length | angle | time | frequency;\nATTR = attr(SPACE(IDENT TYPE_OR_UNIT_IN_ATTR?) [ STRING | IDENT | COLOR | INT | NUM | PLENGTH | ANGLE | POS_TIME | FREQUENCY]?);\nCONTENT_LIST = [ STRING | URI | counter(IDENT LIST_STYLE_TYPE?) |\n counters(IDENT STRING LIST_STYLE_TYPE?) | ATTR |\n target-counter([ STRING | URI ] IDENT LIST_STYLE_TYPE?) |\n target-counter(ATTR IDENT LIST_STYLE_TYPE?) |\n target-counters([ STRING | URI ] IDENT STRING LIST_STYLE_TYPE?) |\n target-counters(ATTR IDENT STRING LIST_STYLE_TYPE?) |\n open-quote | close-quote | no-open-quote | no-close-quote |\n content([ text | before | after | first-letter ]?) |\n string(IDENT [first | start | last | first-except]?) ]+;\nCONTENT = normal | none | CONTENT_LIST;\ncontent = CONTENT;\nCOUNTER = [ IDENT INT? ]+ | none;\ncounter-increment = COUNTER;\ncounter-reset = COUNTER;\ncounter-set = COUNTER;\ncursor = COMMA(URI* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize |\n n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ]);\ndirection = ltr | rtl;\ndisplay = inline | block | list-item | inline-block | table | inline-table | table-row-group |\n table-header-group | table-footer-group | table-row | table-column-group | table-column |\n table-cell | table-caption | none | oeb-page-head | oeb-page-foot | flex | inline-flex |\n ruby | ruby-base | ruby-text | ruby-base-container | ruby-text-container | run-in | compact | marker;\nempty-cells = show | hide;\nFAMILY = SPACE(IDENT+) | STRING;\nFAMILY_LIST = COMMA( FAMILY+ );\nfont-family = FAMILY_LIST;\nfont-size = xx-small | x-small | small | medium | large | x-large | xx-large | larger | smaller | PPLENGTH | POS_NUM;\nfont-style = normal | italic | oblique;\nfont-weight = normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\nheight = PAPLENGTH | POS_NUM | MIN_MAX_FIT_CONTENT;\nleft = APLENGTH;\nletter-spacing = normal | LENGTH_OR_NUM;\nline-height = normal | POS_NUM | PPLENGTH;\nlist-style-image = IMAGE;\nlist-style-position = inside | outside;\nlist-style-type = LIST_STYLE_TYPE;\nmargin-right = APLENGTH;\nmargin-left = APLENGTH;\nmargin-top = APLENGTH;\nmargin-bottom = APLENGTH;\nNPLENGTH = none | PLENGTH;\nmax-height = NPLENGTH | MIN_MAX_FIT_CONTENT;\nmax-width = NPLENGTH | MIN_MAX_FIT_CONTENT;\nmin-height = APLENGTH | MIN_MAX_FIT_CONTENT;\nmin-width = APLENGTH | MIN_MAX_FIT_CONTENT;\norphans = POS_INT;\noutline-offset = LENGTH;\noutline-color = COLOR | invert;\noutline-style = BORDER_SIDE_STYLE;\noutline-width = BORDER_SIDE_WIDTH;\noverflow = visible | hidden | scroll | auto;\npadding-right = PPLENGTH;\npadding-left = PPLENGTH;\npadding-top = PPLENGTH;\npadding-bottom = PPLENGTH;\nPAGE_BREAK = auto | always | avoid | left | right | recto | verso;\npage-break-after = PAGE_BREAK;\npage-break-before = PAGE_BREAK;\npage-break-inside = avoid | auto;\nposition = static | relative | absolute | fixed;\nquotes = [STRING STRING]+ | none;\nright = APLENGTH;\ntable-layout = auto | fixed;\ntext-align = left | right | center | justify | start | end;\ntext-decoration = none | [ underline || overline || line-through || blink ];\ntext-indent = PLENGTH;\ntext-transform = capitalize | uppercase | lowercase | none;\ntop = APLENGTH;\nvertical-align = baseline | sub | super | top | text-top | middle | bottom | text-bottom | PLENGTH;\nvisibility = visible | hidden | collapse;\nwhite-space = normal | pre | nowrap | pre-wrap | pre-line | break-spaces;\nwidows = POS_INT;\nwidth = PAPLENGTH | POS_NUM | MIN_MAX_FIT_CONTENT;\nword-spacing = normal | LENGTH_OR_NUM;\nz-index = auto | INT;\n\n[epub,moz,webkit]hyphens = auto | manual | none;\n[webkit]hyphenate-character = auto | STRING;\n\n/* css-logical */\nmargin-block-start = APLENGTH;\nmargin-block-end = APLENGTH;\nmargin-inline-start = APLENGTH;\nmargin-inline-end = APLENGTH;\npadding-block-start = APLENGTH;\npadding-block-end = APLENGTH;\npadding-inline-start = APLENGTH;\npadding-inline-end = APLENGTH;\nborder-block-start-color = BORDER_SIDE_COLOR;\nborder-block-end-color = BORDER_SIDE_COLOR;\nborder-inline-start-color = BORDER_SIDE_COLOR;\nborder-inline-end-color = BORDER_SIDE_COLOR;\nborder-block-start-style = BORDER_SIDE_STYLE;\nborder-block-end-style = BORDER_SIDE_STYLE;\nborder-inline-start-style = BORDER_SIDE_STYLE;\nborder-inline-end-style = BORDER_SIDE_STYLE;\nborder-block-start-width = BORDER_SIDE_WIDTH;\nborder-block-end-width = BORDER_SIDE_WIDTH;\nborder-inline-start-width = BORDER_SIDE_WIDTH;\nborder-inline-end-width = BORDER_SIDE_WIDTH;\nblock-start = APLENGTH;\nblock-end = APLENGTH;\ninline-start = APLENGTH;\ninline-end = APLENGTH;\nblock-size = PAPLENGTH | MIN_MAX_FIT_CONTENT;\ninline-size = PAPLENGTH | MIN_MAX_FIT_CONTENT;\nmax-block-size = NPLENGTH | MIN_MAX_FIT_CONTENT;\nmax-inline-size = NPLENGTH | MIN_MAX_FIT_CONTENT;\nmin-block-size = APLENGTH | MIN_MAX_FIT_CONTENT;\nmin-inline-size = APLENGTH | MIN_MAX_FIT_CONTENT;\n\nSHAPE = auto | rectangle( PLENGTH{4} ) | ellipse( PLENGTH{4} ) | circle( PLENGTH{3} ) |\n polygon( SPACE(PLENGTH+)+ );\n[epubx]shape-inside = SHAPE;\n[epubx,webkit]shape-outside = SHAPE;\n[epubx]wrap-flow = auto | both | start | end | maximum | clear | around /* epub al */;\n\nTRANSFORM_FUNCTION = matrix(NUM{6}) | translate(PLENGTH{1,2}) | translateX(PLENGTH) | translateY(PLENGTH) |\n scale(NUM{1,2}) | scaleX(NUM) | scaleY(NUM) | rotate(ANGLE) | skewX(ANGLE) | skewY(ANGLE);\n[epub]transform = none | TRANSFORM_FUNCTION+;\n[epub]transform-origin = [[[ top | bottom | left | right] PLENGTH?] | center | PLENGTH]{1,2}; /* relaxed */\n\nBOX = border-box | padding-box | content-box;\nSHADOW = SPACE(inset || LENGTH{2,4} || COLOR); /* relaxed */\n[webkit]background-size = COMMA( SPACE( [PLENGTH | auto ]{1,2} | cover | contain)+ );\n[webkit]background-origin = COMMA( BOX+ );\n[webkit]background-clip = COMMA( BOX+ );\n[webkit]box-shadow = none | COMMA( SHADOW+ );\ntext-shadow = none | COMMA( SHADOW+ );\n[webkit]box-decoration-break = slice | clone;\nFILTER_FUNCTION = blur(LENGTH) | brightness(NUM | PERCENTAGE) | contrast(NUM | PERCENTAGE) | drop-shadow(SPACE(LENGTH{2,3} COLOR?))\n | grayscale(NUM | PERCENTAGE) | hue-rotate(ANGLE) | invert(NUM | PERCENTAGE) | opacity(NUM | PERCENTAGE)\n | saturate(NUM | PERCENTAGE) | sepia(NUM | PERCENTAGE);\nFILTER_FUNCTION_LIST = FILTER_FUNCTION+;\n[webkit]filter = none | FILTER_FUNCTION_LIST;\n\nopacity = NUM;\n\n[moz,webkit]column-width = LENGTH | auto;\n[moz,webkit]column-count = INT | auto;\n[moz,webkit]column-gap = LENGTH | normal;\n[moz,webkit]column-rule-color = COLOR;\n[moz,webkit]column-rule-style = BORDER_SIDE_STYLE;\n[moz,webkit]column-rule-width = BORDER_SIDE_WIDTH;\nBREAK = auto | avoid | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region;\nbreak-before = BREAK;\nbreak-after = BREAK;\nbreak-inside = auto | avoid | avoid-page | avoid-column | avoid-region;\n[webkit]column-span = none | auto | all;\n[moz]column-fill = auto | balance | balance-all;\n\nsrc = COMMA([SPACE(URI format(STRING+)?) | local(FAMILY)]+); /* for font-face */\n\n[epubx,webkit]flow-from = IDENT;\n[epubx,webkit]flow-into = IDENT;\n[epubx]flow-linger = INT | none;\n[epubx]flow-priority = INT;\n[epubx]flow-options = none | [ exclusive || last || static ];\n[epubx]page = INT | auto | IDENT; /* page: IDENT is for CSS Paged Media */\n[epubx]min-page-width = LENGTH;\n[epubx]min-page-height = LENGTH;\n[epubx]required = true | false;\n[epubx]enabled = true | false;\n[epubx]conflicting-partitions = COMMA(IDENT+);\n[epubx]required-partitions = COMMA(IDENT+);\n[epubx]snap-height = LENGTH | none;\n[epubx]snap-width = LENGTH | none;\n[epubx]flow-consume = all | some;\n[epubx]utilization = NUM;\n[epubx]text-zoom = font-size | scale;\n\n[adapt]template = URI_OR_NONE;\n[adapt]behavior = IDENT;\n\n/* CSS Fonts */\nCOMMON_LIG_VALUES = [ common-ligatures | no-common-ligatures ];\nDISCRETIONARY_LIG_VALUES = [ discretionary-ligatures | no-discretionary-ligatures ];\nHISTORICAL_LIG_VALUES = [ historical-ligatures | no-historical-ligatures ];\nCONTEXTUAL_ALT_VALUES = [ contextual | no-contextual ];\nfont-variant-ligatures = normal | none | [ COMMON_LIG_VALUES || DISCRETIONARY_LIG_VALUES || HISTORICAL_LIG_VALUES || CONTEXTUAL_ALT_VALUES ];\nfont-variant-caps = normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps;\nNUMERIC_FIGURE_VALUES = [ lining-nums | oldstyle-nums ];\nNUMERIC_SPACING_VALUES = [ proportional-nums | tabular-nums ];\nNUMERIC_FRACTION_VALUES = [ diagonal-fractions | stacked-fractions ];\nfont-variant-numeric = normal | [ NUMERIC_FIGURE_VALUES || NUMERIC_SPACING_VALUES || NUMERIC_FRACTION_VALUES || ordinal || slashed-zero ];\nEAST_ASIAN_VARIANT_VALUES = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ];\nEAST_ASIAN_WIDTH_VALUES = [ full-width | proportional-width ];\nfont-variant-east-asian = normal | [ EAST_ASIAN_VARIANT_VALUES || EAST_ASIAN_WIDTH_VALUES || ruby ];\nfont-variant_css2 = normal | small-caps; /* for font shorthand */\nfont-size-adjust = none | NNEG_NUM;\n[webkit]font-kerning = auto | normal | none;\nfont-feature-settings = COMMA( normal | SPACE( STRING [ on | off | INT ]? )+ );\nFONT_STRETCH_CSS3_VALUES = normal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded;\nfont-stretch = FONT_STRETCH_CSS3_VALUES | PERCENTAGE;\nfont-stretch_css3 = FONT_STRETCH_CSS3_VALUES; /* for font shorthand */\nunicode-range = COMMA( URANGE+ );\n\n/* CSS Images */\nimage-resolution = RESOLUTION;\nobject-fit = fill | contain | cover | none | scale-down;\nobject-position = COMMA( SPACE(BG_POSITION_TERM{1,4})+ ); /* relaxed */\n\n/* CSS Paged Media */\nPAGE_SIZE = a10 | a9 | a8 | a7 | a6 | a5 | a4 | a3 | a2 | a1 | a0\n | b10 | b9 | b8 | b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0\n | c10 | c9 | c8 | c7 | c6 | c5 | c4 | c3 | c2 | c1 | c0\n | jis-b10 | jis-b9 | jis-b8 | jis-b7 | jis-b6 | jis-b5 | jis-b4 | jis-b3 | jis-b2 | jis-b1 | jis-b0\n | letter | legal | ledger;\nbleed = auto | LENGTH;\nmarks = none | [ crop || cross ];\nsize = POS_LENGTH{1,2} | auto | [ PAGE_SIZE || [ portrait | landscape ] ];\n\n/* CSS Page Floats */\nfloat-reference = inline | column | region | page;\nfloat = block-start | block-end | inline-start | inline-end | snap-block | snap-inline | left | right | top | bottom | none | footnote;\nfloat-min-wrap-block = PPLENGTH;\n\n/* CSS Ruby */\nruby-align = start | center | space-between | space-around;\nruby-position = over | under | inter-character;\n\n/* CSS Size Adjust */\n[moz]text-size-adjust = auto | none | POS_PERCENTAGE;\n\n/* CSS Text */\n[webkit]line-break = auto | loose | normal | strict | anywhere;\noverflow-wrap = normal | break-word | anywhere;\n[moz]tab-size = NNEG_INT | NNEG_LENGTH;\n[moz]text-align-last = auto | start | end | left | right | center | justify;\ntext-justify = auto | none | inter-word | inter-character;\nword-break = normal | keep-all | break-all | break-word;\n\n/* CSS Text Decoration */\n[webkit]text-decoration-color = COLOR;\n[webkit]text-decoration-line = none | [ underline || overline || line-through || blink ];\n[webkit]text-decoration-skip = none | [ objects || spaces || ink || edges || box-decoration ];\n[webkit]text-decoration-style = solid | double | dotted | dashed | wavy;\n[epub,webkit]text-emphasis-color = COLOR;\n[webkit]text-emphasis-position = [ over | under ] [ right | left ];\n[epub,webkit]text-emphasis-style = none | [[ filled | open ] || [ dot | circle | double-circle | triangle | sesame ]] | STRING;\n[webkit]text-underline-position = auto | [ under || [ left | right ]];\n\n/* CSS Transforms */\n[webkit]backface-visibility = visible | hidden;\n\n/* CSS UI */\nbox-sizing = content-box | padding-box | border-box;\ntext-overflow = [clip | ellipsis | STRING]{1,2};\n\n/* CSS Writing Modes */\n[epub,webkit]text-combine = none | horizontal;\ntext-combine-upright = none | all; /* relaxed */\n[epub,webkit]text-orientation = mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation /* the following values are kept for backward-compatibility */ | vertical-right | rotate-right | rotate-left | rotate-normal | auto;\nunicode-bidi = normal | embed | isolate | bidi-override | isolate-override | plaintext;\n[epub,webkit]writing-mode = horizontal-tb | vertical-rl | lr-tb | rl-tb | tb-rl | lr | rl | tb;\n\n/* CSS Flex box */\nFLEX_BASIS = content | PAPLENGTH;\nflex-direction = row | row-reverse | column | column-reverse;\nflex-wrap = nowrap | wrap | wrap-reverse;\norder = INT;\nflex-grow = NNEG_NUM;\nflex-shrink = NNEG_NUM;\nflex-basis = FLEX_BASIS;\nflex = none | [ [ NNEG_NUM NNEG_NUM? ] || FLEX_BASIS ];\njustify-content = flex-start | flex-end | center | space-between | space-around;\nalign-items = flex-start | flex-end | center | baseline | stretch;\nalign-self = auto | flex-start | flex-end | center | baseline | stretch;\nalign-content = flex-start | flex-end | center | space-between | space-around | stretch;\n\n/* Pointer Events */\ntouch-action = auto | none | [ pan-x || pan-y ] | manipulation;\n\n/* SVG 2 */\nOPACITY_VALUE = NUM | PERCENTAGE;\nDASH_ARRAY = COMMA( SPACE( [ LENGTH | PERCENTAGE | NUM ]+ )+ );\nPAINT = none | child | child(INT) | COLOR | SPACE( URI [none | COLOR]? ) | context-fill | context-stroke;\ncolor-interpolation = auto | sRGB | linearRGB;\ncolor-rendering = auto | optimizeSpeed | optimizeQuality;\nfill = PAINT;\nfill-opacity = OPACITY_VALUE;\nfill-rule = nonzero | evenodd;\nglyph-orientation-vertical = auto | NUM | ANGLE;\nimage-rendering = auto | optimizeSpeed | optimizeQuality | crisp-edges | pixelated;\nmarker-start = none | URI;\nmarker-mid = none | URI;\nmarker-end = none | URI;\npointer-events = bounding-box | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | none;\npaint-order = normal | [ fill || stroke || markers ];\nshape-rendering = auto | optimizeSpeed | crispEdges | geometricPrecision;\nstop-color = COLOR;\nstop-opacity = OPACITY_VALUE;\nstroke = PAINT;\nstroke-dasharray = none | DASH_ARRAY;\nstroke-dashoffset = PERCENTAGE | LENGTH_OR_NUM;\nstroke-linecap = butt | round | square;\nstroke-linejoin = miter | round | bevel;\nstroke-miterlimit = NUM;\nstroke-opacity = OPACITY_VALUE;\nstroke-width = PERCENTAGE | LENGTH_OR_NUM;\ntext-anchor = start | middle | end;\ntext-rendering = auto | optimizeSpeed | optimizeLegibility | geometricPrecision;\nvector-effect = none | SPACE( [ non-scaling-stroke | non-scaling-size | non-rotation | fixed-position ]+ [ viewport | screen ]? );\n\n/* SVG 1.1 */\nalignment-baseline = auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical;\nbaseline-shift = baseline | sub | super | PERCENTAGE | LENGTH_OR_NUM;\ndominant-baseline = auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge;\nmask = none | URI;\n\n/* css-masking-1 */\nSHAPE_RADIUS = PLENGTH | closest-side | farthest-side;\nFILL_RULE = nonzero | evenodd;\nSHAPE_BOX = BOX | margin-box;\nGEOMETRY_BOX = SHAPE_BOX | fill-box | stroke-box | view-box;\nBASIC_SHAPE =\n inset( SPACE( PLENGTH{1,4} [ round PLENGTH{1,4} [ SLASH PLENGTH{1,4} ]? ]? ) )\n | circle( SPACE( [SHAPE_RADIUS]? [at BG_POSITION_TERM{1,4}]? ) )\n | ellipse( SPACE( SHAPE_RADIUS{2}? [at BG_POSITION_TERM{1,4}]? ) )\n | polygon( FILL_RULE? COMMA( SPACE( PLENGTH{2} )+ )+ );\n[webkit]clip-path = none | URI | [ BASIC_SHAPE || GEOMETRY_BOX ];\nclip-rule = nonzero | evenodd;\n\n/* filters */\nflood-color = COLOR;\nflood-opacity = OPACITY_VALUE;\nlighting-color = COLOR;\n\n/* compositing-1 */\nBLEND_MODE = normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity;\nmix-blend-mode = BLEND_MODE;\nisolation = auto | isolate;\nbackground-blend-mode = COMMA( BLEND_MODE+ );\n\n/* CSS GCPM */\nstring-set = COMMA( SPACE( IDENT CONTENT_LIST )+ | none );\nfootnote-policy = auto | line;\n\n/* CSS Repeated Headers and Footers */\n[viv]repeat-on-break = auto | none | header | footer;\n\nDEFAULTS\n\nbackground-attachment: scroll;\nbackground-color: transparent;\nbackground-image: none;\nbackground-repeat: repeat;\nbackground-position: 0% 0%;\nbackground-clip: border-box;\nbackground-origin: padding-box;\nbackground-size: auto;\nborder-top-color: currentColor;\nborder-right-color: currentColor;\nborder-bottom-color: currentColor;\nborder-left-color: currentColor;\nborder-top-style: none;\nborder-right-style: none;\nborder-bottom-style: none;\nborder-left-style: none;\nborder-top-width: 3px;\nborder-right-width: 3px;\nborder-bottom-width: 3px;\nborder-left-width: 3px;\nborder-top-left-radius: 0;\nborder-top-right-radius: 0;\nborder-bottom-right-radius: 0;\nborder-bottom-left-radius: 0;\nborder-image-source: none;\nborder-image-slice: 100%;\nborder-image-width: 1;\nborder-image-outset: 0;\nborder-image-repeat: stretch;\ncolumn-count: auto;\ncolumn-gap: normal;\ncolumn-width: auto;\ncolumn-rule-color: currentColor;\ncolumn-rule-style: none;\ncolumn-rule-width: 3px;\ncolumn-fill: balance;\noutline-color: currentColor;\noutline-style: none;\noutline-width: 3px;\nflex-direction: row;\nflex-wrap: nowrap;\nfont-family: serif;\nfont-style: normal;\nfont-size: medium;\nfont-size-adjust: none;\nfont-kerning: auto;\nfont-feature-settings: normal;\nfont-variant-ligatures: normal;\nfont-variant-caps: normal;\nfont-variant-numeric: normal;\nfont-variant-east-asian: normal;\nfont-weight: normal;\nfont-stretch: normal;\nline-height: normal;\nlist-style-image: none;\nlist-style-position: outside;\nlist-style-type: disc;\nmargin-bottom: auto;\nmargin-left: auto;\nmargin-right: auto;\nmargin-top: auto;\npadding-bottom: auto;\npadding-left: auto;\npadding-right: auto;\npadding-top: auto;\ntext-emphasis-color: currentColor;\ntext-emphasis-style: none;\nmarker-start: none;\nmarker-mid: none;\nmarker-end: none;\n\n/* css-logical */\nborder-block-start-color: currentColor;\nborder-block-end-color: currentColor;\nborder-inline-start-color: currentColor;\nborder-inline-end-color: currentColor;\nborder-block-start-style: none;\nborder-block-end-style: none;\nborder-inline-start-style: none;\nborder-inline-end-style: none;\nborder-block-start-width: 3px;\nborder-block-end-width: 3px;\nborder-inline-start-width: 3px;\nborder-inline-end-width: 3px;\n\nSHORTHANDS\n\nbackground = COMMA background-image [background-position [ / background-size ]] background-repeat\n background-attachment [background-origin background-clip] background-color; /* background-color is a special case, see the code */\nborder-top = border-top-width border-top-style border-top-color;\nborder-right = border-right-width border-right-style border-right-color;\nborder-bottom = border-bottom-width border-bottom-style border-bottom-color;\nborder-left = border-left-width border-left-style border-left-color;\nborder-width = INSETS border-top-width border-right-width border-bottom-width border-left-width;\nborder-style = INSETS border-top-style border-right-style border-bottom-style border-left-style;\nborder-color = INSETS border-top-color border-right-color border-bottom-color border-left-color;\nborder = border-width border-style border-color;\nborder-image = border-image-source border-image-slice [ / border-image-width [ / border-image-outset ] ]\n border-image-repeat;\nborder-radius = INSETS_SLASH border-top-left-radius border-top-right-radius\n border-bottom-right-radius border-bottom-left-radius;\n[moz,webkit]columns = column-width column-count;\n[moz,webkit]column-rule = column-rule-width column-rule-style column-rule-color;\nflex-flow = flex-direction flex-wrap;\noeb-column-number = column-count;\noutline = outline-width outline-style outline-color;\nlist-style = list-style-type list-style-position list-style-image;\nmargin = INSETS margin-top margin-right margin-bottom margin-left;\npadding = INSETS padding-top padding-right padding-bottom padding-left;\nfont = FONT font-style font-variant_css2 font-weight font-stretch_css3 /* font-size line-height font-family are special-cased */;\nfont-variant = font-variant-ligatures font-variant-caps font-variant-numeric font-variant-east-asian;\n[epub,webkit]text-emphasis = text-emphasis-style text-emphasis-color;\nmarker = INSETS marker-start marker-mid marker-end;\n\n/* css-logical */\nmargin-block = INSETS margin-block-start margin-block-end;\nmargin-inline = INSETS margin-inline-start margin-inline-end;\npadding-block = INSETS padding-block-start padding-block-end;\npadding-inline = INSETS padding-inline-start padding-inline-end;\nborder-block-width = INSETS border-block-start-width border-block-end-width;\nborder-block-style = INSETS border-block-start-style border-block-end-style;\nborder-block-color = INSETS border-block-start-color border-block-end-color;\nborder-inline-width = INSETS border-inline-start-width border-inline-end-width;\nborder-inline-style = INSETS border-inline-start-style border-inline-end-style;\nborder-inline-color = INSETS border-inline-start-color border-inline-end-color;\nborder-block = border-block-width border-block-style border-block-color;\nborder-inline = border-inline-width border-inline-style border-inline-color;\nborder-block-start = border-block-start-width border-block-start-style border-block-start-color;\nborder-block-end = border-block-end-width border-block-end-style border-block-end-color;\nborder-inline-start = border-inline-start-width border-inline-start-style border-inline-start-color;\nborder-inline-end = border-inline-end-width border-inline-end-style border-inline-end-color;\ninset-block-start = block-start;\ninset-block-end = block-end;\ninset-inline-start = inline-start;\ninset-inline-end = inline-end;\ninset-block = INSETS block-start block-end;\ninset-inline = INSETS inline-start inline-end;\n\n/* old names */\nword-wrap = overflow-wrap;\n[adapt,webkit]margin-before = margin-block-start;\n[adapt,webkit]margin-after = margin-block-end;\n[adapt,webkit]margin-start = margin-inline-start;\n[adapt,webkit]margin-end = margin-inline-end;\n[adapt,webkit]padding-before = padding-block-start;\n[adapt,webkit]padding-after = padding-block-end;\n[adapt,webkit]padding-start = padding-inline-start;\n[adapt,webkit]padding-end = padding-inline-end;\n[adapt,webkit]border-before-color = border-block-start-color;\n[adapt,webkit]border-after-color = border-block-end-color;\n[adapt,webkit]border-start-color = border-inline-start-color;\n[adapt,webkit]border-end-color = border-inline-end-color;\n[adapt,webkit]border-before-style = border-block-start-style;\n[adapt,webkit]border-after-style = border-block-end-style;\n[adapt,webkit]border-start-style = border-inline-start-style;\n[adapt,webkit]border-end-style = border-inline-end-style;\n[adapt,webkit]border-before-width = border-block-start-width;\n[adapt,webkit]border-after-width = border-block-end-width;\n[adapt,webkit]border-start-width = border-inline-start-width;\n[adapt,webkit]border-end-width = border-inline-end-width;\n[adapt,webkit]before = block-start;\n[adapt,webkit]after = block-end;\n[adapt,webkit]start = inline-start;\n[adapt,webkit]end = inline-end;\n\n",qi='\n<!DOCTYPE html>\n<html xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://www.pyroxy.com/ns/shadow">\n<head>\n<style><![CDATA[\n\n.footnote-content {\n float: footnote;\n}\n\n.table-cell-container {\n display: block;\n}\n\n]]></style>\n</head>\n<body>\n\n<s:template id="footnote"><s:content/><s:include class="footnote-content"/></s:template>\n\n<s:template id="table-cell"><div data-vivliostyle-flow-root="true" class="table-cell-container"><s:content/></div></s:template>\n\n</body>\n</html>',Qi='\n@namespace html "http://www.w3.org/1999/xhtml";\n\n:root {\n hyphens: -epubx-expr(pref-hyphenate? "auto": "manual");\n}\n:root[data-vivliostyle-epub-spine-properties~="page-spread-left"] {\n break-before: left;\n}\n:root[data-vivliostyle-epub-spine-properties~="page-spread-right"] {\n break-before: right;\n}\n\n@-adapt-footnote-area {\n display: block;\n margin-block-start: 0.5em;\n margin-block-end: 0.5em;\n}\n\n@-adapt-footnote-area ::before {\n display: block;\n border-block-start-width: 1px;\n border-block-start-style: solid;\n border-block-start-color: black;\n margin-block-end: 0.4em;\n margin-inline-start: 0;\n margin-inline-end: 60%;\n}\n\n/* default page master */\n@-epubx-page-master :background-host {\n @-epubx-partition :layout-host {\n -epubx-flow-from: body;\n top: -epubx-expr(header.margin-bottom-edge);\n bottom: -epubx-expr(page-height - footer.margin-top-edge);\n left: 0px;\n right: 0px;\n column-width: 25em;\n }\n @-epubx-partition footer :oeb-page-foot {\n writing-mode: horizontal-tb;\n -epubx-flow-from: oeb-page-foot;\n bottom: 0px;\n left: 0px;\n right: 0px;\n }\n @-epubx-partition header :oeb-page-head {\n writing-mode: horizontal-tb;\n -epubx-flow-from: oeb-page-head;\n top: 0px;\n left: 0px;\n right: 0px;\n }\n}\n\n@page {\n @top-left-corner {\n text-align: right;\n vertical-align: middle;\n }\n @top-left {\n text-align: left;\n vertical-align: middle;\n }\n @top-center {\n text-align: center;\n vertical-align: middle;\n }\n @top-right {\n text-align: right;\n vertical-align: middle;\n }\n @top-right-corner {\n text-align: left;\n vertical-align: middle;\n }\n @left-top {\n text-align: center;\n vertical-align: top;\n }\n @left-middle {\n text-align: center;\n vertical-align: middle;\n }\n @left-bottom {\n text-align: center;\n vertical-align: bottom;\n }\n @right-top {\n text-align: center;\n vertical-align: top;\n }\n @right-middle {\n text-align: center;\n vertical-align: middle;\n }\n @right-bottom {\n text-align: center;\n vertical-align: bottom;\n }\n @bottom-left-corner {\n text-align: right;\n vertical-align: middle;\n }\n @bottom-left {\n text-align: left;\n vertical-align: middle;\n }\n @bottom-center {\n text-align: center;\n vertical-align: middle;\n }\n @bottom-right {\n text-align: right;\n vertical-align: middle;\n }\n @bottom-right-corner {\n text-align: left;\n vertical-align: middle;\n }\n}\n\n@media print {\n @page {\n margin: 10%;\n }\n}\n',$i='\n@namespace html "http://www.w3.org/1999/xhtml";\n\nhtml|html,\nhtml|address,\nhtml|blockquote,\nhtml|body,\nhtml|dd,\nhtml|div,\nhtml|dl,\nhtml|dt,\nhtml|fieldset,\nhtml|form,\nhtml|frame,\nhtml|frameset,\nhtml|h1,\nhtml|h2,\nhtml|h3,\nhtml|h4,\nhtml|h5,\nhtml|h6,\nhtml|noframes,\nhtml|ol,\nhtml|p,\nhtml|ul,\nhtml|center,\nhtml|dir,\nhtml|hr,\nhtml|menu,\nhtml|pre,\nhtml|article,\nhtml|section,\nhtml|nav,\nhtml|aside,\nhtml|hgroup,\nhtml|footer,\nhtml|header,\nhtml|figure,\nhtml|figcaption,\nhtml|main {\n display: block;\n unicode-bidi: normal;\n}\nhtml|li {\n display: list-item;\n}\nhtml|head {\n display: none !important;\n}\nhtml|table {\n display: table;\n}\nhtml|tr {\n display: table-row;\n}\nhtml|thead {\n display: table-header-group;\n break-after: avoid;\n}\nhtml|tbody {\n display: table-row-group;\n}\nhtml|tfoot {\n display: table-footer-group;\n break-before: avoid;\n}\nhtml|col {\n display: table-column;\n}\nhtml|colgroup {\n display: table-column-group;\n}\nhtml|td,\nhtml|th {\n display: table-cell;\n}\nhtml|caption {\n display: table-caption;\n text-align: center;\n}\nhtml|th {\n font-weight: bolder;\n text-align: center;\n}\nhtml|*[hidden],\nhtml|link,\nhtml|style,\nhtml|script {\n display: none;\n}\nhtml|h1 {\n font-size: 2em;\n margin-block-start: 0.67em;\n margin-block-end: 0.67em;\n margin-inline-start: 0em;\n margin-inline-end: 0em;\n}\nhtml|h2 {\n font-size: 1.5em;\n margin-block-start: 0.75em;\n margin-block-end: 0.75em;\n margin-inline-start: 0em;\n margin-inline-end: 0em;\n}\nhtml|h3 {\n font-size: 1.17em;\n margin-block-start: 0.83em;\n margin-block-end: 0.83em;\n margin-inline-start: 0em;\n margin-inline-end: 0em;\n}\nhtml|h4,\nhtml|p,\nhtml|blockquote,\nhtml|ul,\nhtml|fieldset,\nhtml|form,\nhtml|ol,\nhtml|dl,\nhtml|dir,\nhtml|menu,\nhtml|h5,\nhtml|h6 {\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0em;\n margin-inline-end: 0em;\n}\nhtml|h5 {\n font-size: 0.83em;\n}\nhtml|h6 {\n font-size: 0.75em;\n}\nhtml|h1,\nhtml|h2,\nhtml|h3,\nhtml|h4,\nhtml|h5,\nhtml|h6,\nhtml|b,\nhtml|strong {\n font-weight: bolder;\n}\nhtml|h1,\nhtml|h2,\nhtml|h3,\nhtml|h4,\nhtml|h5,\nhtml|h6 {\n break-after: avoid;\n}\nhtml|blockquote {\n margin-block-start: 0px;\n margin-block-end: 0px;\n margin-inline-start: 40px;\n margin-inline-end: 40px;\n}\nhtml|i,\nhtml|cite,\nhtml|em,\nhtml|var,\nhtml|address {\n font-style: italic;\n}\nhtml|pre,\nhtml|tt,\nhtml|code,\nhtml|kbd,\nhtml|samp {\n font-family: monospace;\n}\nhtml|pre {\n white-space: pre;\n}\nhtml|button,\nhtml|textarea,\nhtml|input,\nhtml|select {\n display: inline-block;\n}\nhtml|big {\n font-size: 1.17em;\n}\nhtml|small,\nhtml|sub,\nhtml|sup {\n font-size: 0.83em;\n}\nhtml|sub {\n vertical-align: sub;\n}\nhtml|sup {\n vertical-align: super;\n}\nhtml|table {\n border-spacing: 2px;\n}\nhtml|thead,\nhtml|tbody,\nhtml|tfoot {\n vertical-align: middle;\n}\n/* for XHTML tables without tbody */\nhtml|table > html|tr {\n vertical-align: middle;\n}\nhtml|td,\nhtml|th {\n vertical-align: inherit;\n}\nhtml|s,\nhtml|strike,\nhtml|del {\n text-decoration: line-through;\n}\nhtml|hr {\n border: 1px inset;\n}\nhtml|ol,\nhtml|ul,\nhtml|dir,\nhtml|menu,\nhtml|dd {\n margin: 0px;\n margin-inline-start: 40px;\n}\nhtml|ol html|ul,\nhtml|ul html|ol,\nhtml|ul html|ul,\nhtml|ol html|ol {\n margin-block-start: 0;\n margin-block-end: 0;\n}\nhtml|u,\nhtml|ins {\n text-decoration: underline;\n}\nhtml|center {\n text-align: center;\n}\nhtml|q:before {\n content: open-quote;\n}\nhtml|q:after {\n content: close-quote;\n}\n\nhtml|audio,\nhtml|video {\n break-inside: avoid;\n}\n\nhtml|ruby {\n display: ruby;\n}\nhtml|rp {\n display: none;\n}\nhtml|rbc {\n display: ruby-base-container;\n}\nhtml|rtc {\n display: ruby-text-container;\n}\nhtml|rb {\n display: ruby-base;\n white-space: nowrap;\n}\nhtml|rt {\n display: ruby-text;\n}\n\nhtml|rtc,\nhtml|rt {\n font-variant-east-asian: ruby;\n text-emphasis: none;\n white-space: nowrap;\n line-height: 1;\n}\n\nhtml|rtc:lang(zh),\nhtml|rt:lang(zh) {\n ruby-align: center;\n}\n\nhtml|rtc,\nhtml|rt {\n font-size: 50%;\n}\n\nhtml|rtc:lang(zh-TW),\nhtml|rt:lang(zh-TW) {\n font-size: 30%;\n}\n\nhtml|rtc > html|rt,\nhtml|rtc > html|rt:lang(zh-TW) {\n font-size: 100%;\n}\n\n/* Bidi settings */\nhtml|bdo[dir="ltr"] {\n direction: ltr;\n unicode-bidi: bidi-override;\n}\nhtml|bdo[dir="rtl"] {\n direction: rtl;\n unicode-bidi: bidi-override;\n}\nhtml|*[dir="ltr"] {\n direction: ltr;\n unicode-bidi: embed;\n}\nhtml|*[dir="rtl"] {\n direction: rtl;\n unicode-bidi: embed;\n}\n\n/*------------------ epub-specific ---------------------*/\n\n@namespace epub "http://www.idpf.org/2007/ops";\n\nhtml|a[epub|type="noteref"] {\n font-size: 0.75em;\n vertical-align: super;\n line-height: 0.01;\n}\n\nhtml|a[epub|type="noteref"]:href-epub-type(footnote) {\n -adapt-template: url(user-agent.xml#footnote);\n text-decoration: none;\n}\n\nhtml|aside[epub|type="footnote"] {\n display: none;\n}\n\nhtml|aside[epub|type="footnote"]:footnote-content {\n display: block;\n margin: 0.25em;\n font-size: 1.2em;\n line-height: 1.2;\n}\n\nepub|trigger {\n display: none;\n}\n\nepub|switch {\n display: inline;\n}\n\nepub|default {\n display: inline;\n}\n\nepub|case {\n display: none;\n}\n\nepub|case[required-namespace::supported] {\n display: inline;\n}\n\nepub|case[required-namespace::supported] ~ epub|case {\n display: none;\n}\n\nepub|case[required-namespace::supported] ~ epub|default {\n display: none;\n}\n\n/*--------------- ncx and toc ----------------------*/\n\n@namespace ncx "http://www.daisy.org/z3986/2005/ncx/";\n\nncx|ncx {\n display: block;\n padding-top: 10px;\n padding-bottom: 10px;\n}\n\nncx|content {\n display: none;\n}\n\nbody > * {\n -adapt-behavior: body-child;\n}\n\n[role="doc-toc"],\n[role="directory"],\nnav,\n.toc,\n#toc,\n#table-of-contents,\n#contents {\n -adapt-behavior: toc-root;\n}\n\n[role="doc-toc"] a,\n[role="directory"] a,\nnav a,\n.toc a,\n#toc a,\nncx|navLabel {\n -adapt-behavior: toc-node-anchor;\n}\n\n[role="doc-toc"] li,\n[role="directory"] li,\nnav li,\n.toc li,\n#toc li,\nncx|navPoint {\n -adapt-behavior: toc-node;\n}\n\n[role="doc-toc"] li > *:first-child,\n[role="directory"] li > *:first-child,\nnav li > *:first-child,\n.toc li > *:first-child,\n#toc li > *:first-child {\n -adapt-behavior: toc-node-first-child;\n}\n\n[role="doc-toc"] ol,\n[role="directory"] ol,\nnav ol,\n.toc ol,\n#toc ol,\n[role="doc-toc"] ul,\n[role="directory"] ul,\nnav ul,\n.toc ul,\n#toc ul,\nol[role="doc-toc"],\nol[role="directory"],\nol.toc,\nol#toc,\nul[role="doc-toc"],\nul[role="directory"],\nul.toc,\nul#toc {\n -adapt-behavior: toc-container;\n}\n';function Zi(t,e,n,i,r){var o=Pi("ajax"),a=new XMLHttpRequest,s=o.suspend(a),u={status:0,statusText:"",url:t,contentType:null,responseText:null,responseXML:null,responseBlob:null};a.open(n||"GET",t,!0),e&&(a.responseType=e),a.onreadystatechange=function(){if(4===a.readyState){if(u.status=a.status,u.statusText=a.statusText||404==a.status&&"Not Found"||"",200==u.status||0==u.status)if(e&&e!==Wi.DOCUMENT||!a.responseXML||"parsererror"==a.responseXML.documentElement.localName)if((!e||e===Wi.DOCUMENT)&&a.response instanceof HTMLDocument)u.responseXML=a.response,u.contentType=a.response.contentType;else{var n=a.response;e&&e!==Wi.TEXT||"string"!=typeof n?n?u.responseBlob="string"==typeof n?Ji([n]):n:c.warn("Unexpected empty success response for",t):u.responseText=n;var i=a.getResponseHeader("Content-Type");i&&(u.contentType=i.replace(/(.*);.*$/,"$1"))}else u.responseXML=a.responseXML,u.contentType=a.responseXML.contentType;s.schedule(u)}};try{i?(a.setRequestHeader("Content-Type",r||"text/plain; charset=UTF-8"),a.send(i)):(/^file:|^https?:\/\/[^/]+\.githubusercontent\.com|\.(xhtml|xht|opf)$/i.test(t)?/\/aozorabunko\/[^/]+\/cards\/[^/]+\/files\/[^/.]+\.html$/.test(t)?a.overrideMimeType("text/html; charset=Shift_JIS"):/\.(html|htm)$/i.test(t)?a.overrideMimeType("text/html; charset=UTF-8"):/\.(xhtml|xht|xml|opf)$/i.test(t)?a.overrideMimeType("application/xml; charset=UTF-8"):/\.(txt|css)$/i.test(t)?a.overrideMimeType("text/plain; charset=UTF-8"):a.overrideMimeType("text/html; charset=UTF-8"):/^data:,(<|%3c)/i.test(t)?a.overrideMimeType("text/html; charset=UTF-8"):/^data:,/i.test(t)&&a.overrideMimeType("text/plain; charset=UTF-8"),a.send(null))}catch(e){c.warn(e,"Error fetching "+t),s.schedule(u)}return o.result()}function Ji(t,e){var n=e||"application/octet-stream",i=window.WebKitBlobBuilder||window.MSBlobBuilder;if(i){for(var r=new i,o=0;o<t.length;o++)r.append(t[o]);return r.getBlob(n)}return new Blob(t,{type:n})}!function(t){t.DEFAULT="",t.ARRAYBUFFER="arraybuffer",t.BLOB="blob",t.DOCUMENT="document",t.JSON="json",t.TEXT="text"}(Wi||(Wi={}));var tr,er=function(){function t(t,e){this.parser=void 0,this.type=void 0,this.resources={},this.fetchers={},this.parser=t,this.type=e}var e=t.prototype;return e.load=function(t,e,n){t=V(t);var i=this.resources[t];return void 0!==i?Ri(i):this.fetch(t,e,n).get()},e.fetchInner=function(t,e,n){var i=this,r=Pi("fetch"),o=t.endsWith("?viv-toc-box");o&&(t=t.replace("?viv-toc-box",""));var a=j("user-agent.xml",X),s=!o&&t===a;return s&&(t="data:application/xml,"+encodeURIComponent(qi)),Zi(t,this.type).then((function(u){if(u.status>=400&&e)throw new Error((n||"Failed to fetch required resource: "+t)+" ("+u.status+(u.statusText?" "+u.statusText:"")+")");o?(t+="?viv-toc-box",u.url+="?viv-toc-box"):s&&(u.url=t=a),i.parser(u,i).then((function(e){delete i.fetchers[t],i.resources[t]=e,r.finish(e)}))})),r.result()},e.fetch=function(t,e,n){var i=this;if(t=V(t),this.resources[t])return null;var r=this.fetchers[t];return r||(r=new zi((function(){return i.fetchInner(t,e,n)}),"Fetch "+t),this.fetchers[t]=r,r.start()),r},e.get=function(t){return this.resources[V(t)]},e.delete=function(t){delete this.resources[V(t)]},t}();function nr(t,e){var n=t.responseText;return Ri(n?U(n):null)}function ir(t){var e=parseInt(t,16);if(isNaN(e))throw new Error("E_CSS_COLOR");if(6==t.length)return new We(e);if(3==t.length)return new We(e=15&e|(15&e)<<4|(240&e)<<4|(240&e)<<8|(3840&e)<<8|(3840&e)<<12);throw new Error("E_CSS_COLOR")}!function(t){t.USER_AGENT="UA",t.USER="User",t.AUTHOR="Author"}(tr||(tr={}));var rr,or=function(){function t(t){this.scope=void 0,this.flavor=void 0,this.scope=t,this.flavor=tr.AUTHOR}var e=t.prototype;return e.getCurrentToken=function(){return null},e.getScope=function(){return this.scope},e.error=function(t,e){},e.startStylesheet=function(t){this.flavor=t},e.tagSelector=function(t,e){},e.classSelector=function(t){},e.pseudoclassSelector=function(t,e){},e.pseudoelementSelector=function(t,e){},e.idSelector=function(t){},e.attributeSelector=function(t,e,n,i){},e.descendantSelector=function(){},e.childSelector=function(){},e.adjacentSiblingSelector=function(){},e.followingSiblingSelector=function(){},e.nextSelector=function(){},e.startSelectorRule=function(){},e.startFontFaceRule=function(){},e.startFootnoteRule=function(t){},e.startViewportRule=function(){},e.startDefineRule=function(){},e.startRegionRule=function(){},e.startPageRule=function(){},e.startPageMarginBoxRule=function(t){},e.startWhenRule=function(t){},e.startMediaRule=function(t){this.startWhenRule(t)},e.startFlowRule=function(t){},e.startPageTemplateRule=function(){},e.startPageMasterRule=function(t,e,n){},e.startPartitionRule=function(t,e,n){},e.startPartitionGroupRule=function(t,e,n){},e.startRuleBody=function(){},e.property=function(t,e,n){},e.endRule=function(){},e.startFuncWithSelector=function(t){},e.endFuncWithSelector=function(){},e.getImportantSpecificity=function(){switch(this.flavor){case tr.USER_AGENT:return 0;case tr.USER:return 100663296;default:return 83886080}},e.getBaseSpecificity=function(){switch(this.flavor){case tr.USER_AGENT:return 0;case tr.USER:return 16777216;default:return 33554432}},t}(),ar=function(t){function e(){var e;return(e=t.call(this,null)||this).stack=[],e.tokenizer=null,e.slave=null,e}x(e,t);var n=e.prototype;return n.pushHandler=function(t){this.stack.push(this.slave),this.slave=t},n.popHandler=function(){this.slave=this.stack.pop()},n.getCurrentToken=function(){return this.tokenizer?this.tokenizer.token():null},n.getScope=function(){return this.slave.getScope()},n.error=function(t,e){this.slave.error(t,e)},n.errorMsg=function(t,e){c.warn(t)},n.startStylesheet=function(e){t.prototype.startStylesheet.call(this,e),this.stack.length>0&&(this.slave=this.stack[0],this.stack=[]),this.slave.startStylesheet(e)},n.tagSelector=function(t,e){this.slave.tagSelector(t,e)},n.classSelector=function(t){this.slave.classSelector(t)},n.pseudoclassSelector=function(t,e){this.slave.pseudoclassSelector(t,e)},n.pseudoelementSelector=function(t,e){this.slave.pseudoelementSelector(t,e)},n.idSelector=function(t){this.slave.idSelector(t)},n.attributeSelector=function(t,e,n,i){this.slave.attributeSelector(t,e,n,i)},n.descendantSelector=function(){this.slave.descendantSelector()},n.childSelector=function(){this.slave.childSelector()},n.adjacentSiblingSelector=function(){this.slave.adjacentSiblingSelector()},n.followingSiblingSelector=function(){this.slave.followingSiblingSelector()},n.nextSelector=function(){this.slave.nextSelector()},n.startSelectorRule=function(){this.slave.startSelectorRule()},n.startFontFaceRule=function(){this.slave.startFontFaceRule()},n.startFootnoteRule=function(t){this.slave.startFootnoteRule(t)},n.startViewportRule=function(){this.slave.startViewportRule()},n.startDefineRule=function(){this.slave.startDefineRule()},n.startRegionRule=function(){this.slave.startRegionRule()},n.startPageRule=function(){this.slave.startPageRule()},n.startPageMarginBoxRule=function(t){this.slave.startPageMarginBoxRule(t)},n.startWhenRule=function(t){this.slave.startWhenRule(t)},n.startFlowRule=function(t){this.slave.startFlowRule(t)},n.startPageTemplateRule=function(){this.slave.startPageTemplateRule()},n.startPageMasterRule=function(t,e,n){this.slave.startPageMasterRule(t,e,n)},n.startPartitionRule=function(t,e,n){this.slave.startPartitionRule(t,e,n)},n.startPartitionGroupRule=function(t,e,n){this.slave.startPartitionGroupRule(t,e,n)},n.startRuleBody=function(){this.slave.startRuleBody()},n.property=function(t,e,n){this.slave.property(t,e,n)},n.endRule=function(){this.slave.endRule()},n.startFuncWithSelector=function(t){this.slave.startFuncWithSelector(t)},n.endFuncWithSelector=function(){this.slave.endFuncWithSelector()},e}(or),sr=function(t){function e(e,n,i){var r;return(r=t.call(this,e)||this).owner=void 0,r.topLevel=void 0,r.depth=0,r.owner=n,r.topLevel=i,n&&(r.flavor=n.flavor),r}x(e,t);var n=e.prototype;return n.getCurrentToken=function(){return this.owner.getCurrentToken()},n.error=function(t,e){this.owner.errorMsg(t,e)},n.startRuleBody=function(){this.depth++},n.endRule=function(){0!=--this.depth||this.topLevel||this.owner.popHandler()},e}(or),ur=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.report=function(t){this.error(t,this.getCurrentToken())},n.reportAndSkip=function(t){this.report(t),this.owner.pushHandler(new sr(this.scope,this.owner,!1))},n.startSelectorRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_SELECTOR")},n.startFontFaceRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_FONT_FACE")},n.startFootnoteRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_FOOTNOTE")},n.startViewportRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_VIEWPORT")},n.startDefineRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_DEFINE")},n.startRegionRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_REGION")},n.startPageRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE")},n.startWhenRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_WHEN")},n.startFlowRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_FLOW")},n.startPageTemplateRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE_TEMPLATE")},n.startPageMasterRule=function(t,e,n){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE_MASTER")},n.startPartitionRule=function(t,e,n){this.reportAndSkip("E_CSS_UNEXPECTED_PARTITION")},n.startPartitionGroupRule=function(t,e,n){this.reportAndSkip("E_CSS_UNEXPECTED_PARTITION_GROUP")},n.startFuncWithSelector=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_SELECTOR_FUNC")},n.endFuncWithSelector=function(){this.reportAndSkip("E_CSS_UNEXPECTED_END_SELECTOR_FUNC")},n.property=function(t,e,n){this.error("E_CSS_UNEXPECTED_PROPERTY",this.getCurrentToken())},e}(sr),lr=[],hr=[],cr=[],dr=[],fr=[],pr=[],gr=[],vr=[],mr=[],Er=[],Cr=[],Dr=[],wr=[];!function(t){t[t.SELECTOR_NAME_1=1]="SELECTOR_NAME_1",t[t.SELECTOR_NAME=2]="SELECTOR_NAME",t[t.SELECTOR_ANY_1=3]="SELECTOR_ANY_1",t[t.SELECTOR_ANY=4]="SELECTOR_ANY",t[t.SELECTOR_ID_1=5]="SELECTOR_ID_1",t[t.SELECTOR_ID=6]="SELECTOR_ID",t[t.SELECTOR_CLASS_1=7]="SELECTOR_CLASS_1",t[t.SELECTOR_CLASS=8]="SELECTOR_CLASS",t[t.SELECTOR_ATTR_1=9]="SELECTOR_ATTR_1",t[t.SELECTOR_ATTR=10]="SELECTOR_ATTR",t[t.SELECTOR_CHILD=11]="SELECTOR_CHILD",t[t.SELECTOR_SIBLING=12]="SELECTOR_SIBLING",t[t.SELECTOR_BODY=13]="SELECTOR_BODY",t[t.SELECTOR_PSEUDOCLASS=14]="SELECTOR_PSEUDOCLASS",t[t.VAL_IDENT=15]="VAL_IDENT",t[t.VAL_HASH=16]="VAL_HASH",t[t.VAL_NUM=17]="VAL_NUM",t[t.VAL_INT=18]="VAL_INT",t[t.VAL_NUMERIC=19]="VAL_NUMERIC",t[t.VAL_STR=20]="VAL_STR",t[t.VAL_URL=21]="VAL_URL",t[t.VAL_COMMA=22]="VAL_COMMA",t[t.VAL_SLASH=23]="VAL_SLASH",t[t.VAL_FUNC=24]="VAL_FUNC",t[t.VAL_C_PAR=25]="VAL_C_PAR",t[t.VAL_END=26]="VAL_END",t[t.RULE_END=27]="RULE_END",t[t.IDENT=28]="IDENT",t[t.SELECTOR_START=29]="SELECTOR_START",t[t.AT=30]="AT",t[t.EXPR_IDENT=31]="EXPR_IDENT",t[t.EXPR_NUM=32]="EXPR_NUM",t[t.EXPR_NUMERIC=33]="EXPR_NUMERIC",t[t.EXPR_STR=34]="EXPR_STR",t[t.EXPR_PARAM=35]="EXPR_PARAM",t[t.EXPR_PREFIX=36]="EXPR_PREFIX",t[t.EXPR_INFIX=37]="EXPR_INFIX",t[t.EXPR_FUNC=38]="EXPR_FUNC",t[t.EXPR_C_PAR=39]="EXPR_C_PAR",t[t.EXPR_O_PAR=40]="EXPR_O_PAR",t[t.SELECTOR_NEXT=41]="SELECTOR_NEXT",t[t.SELECTOR_PSEUDOELEM=42]="SELECTOR_PSEUDOELEM",t[t.EXPR_O_BRC=43]="EXPR_O_BRC",t[t.VAL_FINISH=44]="VAL_FINISH",t[t.EXPR_INFIX_NAME=45]="EXPR_INFIX_NAME",t[t.PROP=46]="PROP",t[t.VAL_BANG=47]="VAL_BANG",t[t.VAL_BRC=48]="VAL_BRC",t[t.EXPR_SEMICOL=49]="EXPR_SEMICOL",t[t.ERROR_PUSH=50]="ERROR_PUSH",t[t.ERROR_POP=51]="ERROR_POP",t[t.ERROR_POP_DECL=52]="ERROR_POP_DECL",t[t.ERROR_SEMICOL=53]="ERROR_SEMICOL",t[t.VAL_PLUS=54]="VAL_PLUS",t[t.SELECTOR_PSEUDOCLASS_1=55]="SELECTOR_PSEUDOCLASS_1",t[t.SELECTOR_FOLLOWING_SIBLING=56]="SELECTOR_FOLLOWING_SIBLING",t[t.VAL_URANGE=57]="VAL_URANGE",t[t.DONE=200]="DONE"}(rr||(rr={}));var yr,Nr=Vn.LAST+1,br=Vn.LAST+2,Sr=Vn.LAST+3;lr[Vn.IDENT]=rr.IDENT,lr[Vn.STAR]=rr.SELECTOR_START,lr[Vn.HASH]=rr.SELECTOR_START,lr[Vn.CLASS]=rr.SELECTOR_START,lr[Vn.O_BRK]=rr.SELECTOR_START,lr[Vn.COLON]=rr.SELECTOR_START,lr[Vn.AT]=rr.AT,lr[Vn.C_BRC]=rr.RULE_END,lr[Vn.EOF]=rr.DONE,hr[Vn.IDENT]=rr.PROP,hr[Vn.EOF]=rr.DONE,pr[Vn.IDENT]=rr.SELECTOR_NAME,pr[Vn.STAR]=rr.SELECTOR_ANY,pr[Vn.HASH]=rr.SELECTOR_ID,pr[Vn.CLASS]=rr.SELECTOR_CLASS,pr[Vn.O_BRK]=rr.SELECTOR_ATTR,pr[Vn.COLON]=rr.SELECTOR_PSEUDOCLASS,cr[Vn.GT]=rr.SELECTOR_CHILD,cr[Vn.PLUS]=rr.SELECTOR_SIBLING,cr[Vn.TILDE]=rr.SELECTOR_FOLLOWING_SIBLING,cr[Vn.IDENT]=rr.SELECTOR_NAME_1,cr[Vn.STAR]=rr.SELECTOR_ANY_1,cr[Vn.HASH]=rr.SELECTOR_ID_1,cr[Vn.CLASS]=rr.SELECTOR_CLASS_1,cr[Vn.O_BRK]=rr.SELECTOR_ATTR_1,cr[Vn.O_BRC]=rr.SELECTOR_BODY,cr[Vn.COLON]=rr.SELECTOR_PSEUDOCLASS_1,cr[Vn.COL_COL]=rr.SELECTOR_PSEUDOELEM,cr[Vn.COMMA]=rr.SELECTOR_NEXT,dr[Vn.GT]=rr.SELECTOR_CHILD,dr[Vn.PLUS]=rr.SELECTOR_SIBLING,dr[Vn.TILDE]=rr.SELECTOR_FOLLOWING_SIBLING,dr[Vn.IDENT]=rr.SELECTOR_NAME_1,dr[Vn.STAR]=rr.SELECTOR_ANY_1,dr[Vn.HASH]=rr.SELECTOR_ID_1,dr[Vn.CLASS]=rr.SELECTOR_CLASS_1,dr[Vn.O_BRK]=rr.SELECTOR_ATTR_1,dr[Vn.C_PAR]=rr.DONE,dr[Vn.COLON]=rr.SELECTOR_PSEUDOCLASS_1,fr[Vn.IDENT]=rr.SELECTOR_NAME,fr[Vn.STAR]=rr.SELECTOR_ANY,fr[Vn.HASH]=rr.SELECTOR_ID,fr[Vn.CLASS]=rr.SELECTOR_CLASS,fr[Vn.COLON]=rr.SELECTOR_PSEUDOCLASS,fr[Vn.COL_COL]=rr.SELECTOR_PSEUDOELEM,fr[Vn.O_BRK]=rr.SELECTOR_ATTR,fr[Vn.O_BRC]=rr.SELECTOR_BODY,gr[Vn.IDENT]=rr.VAL_IDENT,gr[Vn.HASH]=rr.VAL_HASH,gr[Vn.NUM]=rr.VAL_NUM,gr[Vn.INT]=rr.VAL_INT,gr[Vn.NUMERIC]=rr.VAL_NUMERIC,gr[Vn.STR]=rr.VAL_STR,gr[Vn.URL]=rr.VAL_URL,gr[Vn.URANGE]=rr.VAL_URANGE,gr[Vn.COMMA]=rr.VAL_COMMA,gr[Vn.SLASH]=rr.VAL_SLASH,gr[Vn.FUNC]=rr.VAL_FUNC,gr[Vn.C_PAR]=rr.VAL_C_PAR,gr[Vn.SEMICOL]=rr.VAL_END,gr[Vn.C_BRC]=rr.VAL_BRC,gr[Vn.BANG]=rr.VAL_BANG,gr[Vn.PLUS]=rr.VAL_PLUS,gr[Vn.EOF]=rr.VAL_FINISH,vr[Vn.IDENT]=rr.EXPR_IDENT,vr[Vn.NUM]=rr.EXPR_NUM,vr[Vn.INT]=rr.EXPR_NUM,vr[Vn.NUMERIC]=rr.EXPR_NUMERIC,vr[Vn.STR]=rr.EXPR_STR,vr[Vn.O_PAR]=rr.EXPR_O_PAR,vr[Vn.FUNC]=rr.EXPR_FUNC,vr[Vn.BANG]=rr.EXPR_PREFIX,vr[Vn.MINUS]=rr.EXPR_PREFIX,vr[Vn.DOLLAR]=rr.EXPR_PARAM,mr[Vn.IDENT]=rr.EXPR_INFIX_NAME,mr[Vn.COMMA]=rr.EXPR_INFIX,mr[Vn.GT]=rr.EXPR_INFIX,mr[Vn.LT]=rr.EXPR_INFIX,mr[Vn.GT_EQ]=rr.EXPR_INFIX,mr[Vn.LT_EQ]=rr.EXPR_INFIX,mr[Vn.EQ]=rr.EXPR_INFIX,mr[Vn.EQ_EQ]=rr.EXPR_INFIX,mr[Vn.BANG_EQ]=rr.EXPR_INFIX,mr[Vn.AMP_AMP]=rr.EXPR_INFIX,mr[Vn.BAR_BAR]=rr.EXPR_INFIX,mr[Vn.PLUS]=rr.EXPR_INFIX,mr[Vn.MINUS]=rr.EXPR_INFIX,mr[Vn.SLASH]=rr.EXPR_INFIX,mr[Vn.PERCENT]=rr.EXPR_INFIX,mr[Vn.STAR]=rr.EXPR_INFIX,mr[Vn.COLON]=rr.EXPR_INFIX,mr[Vn.QMARK]=rr.EXPR_INFIX,mr[Vn.C_PAR]=rr.EXPR_C_PAR,mr[Vn.O_BRC]=rr.EXPR_O_BRC,mr[Vn.SEMICOL]=rr.EXPR_SEMICOL,Er[Vn.EOF]=rr.DONE,Er[Vn.O_BRC]=rr.ERROR_PUSH,Er[Vn.C_BRC]=rr.ERROR_POP,Er[Vn.O_BRK]=rr.ERROR_PUSH,Er[Vn.C_BRK]=rr.ERROR_POP,Er[Vn.O_PAR]=rr.ERROR_PUSH,Er[Vn.C_PAR]=rr.ERROR_POP,Er[Vn.SEMICOL]=rr.ERROR_SEMICOL,Cr[Vn.EOF]=rr.DONE,Cr[Vn.O_BRC]=rr.ERROR_PUSH,Cr[Vn.C_BRC]=rr.ERROR_POP_DECL,Cr[Vn.O_BRK]=rr.ERROR_PUSH,Cr[Vn.C_BRK]=rr.ERROR_POP,Cr[Vn.O_PAR]=rr.ERROR_PUSH,Cr[Vn.C_PAR]=rr.ERROR_POP,Cr[Vn.SEMICOL]=rr.ERROR_SEMICOL,Dr[Vn.EOF]=rr.DONE,Dr[Vn.O_BRC]=rr.ERROR_PUSH,Dr[Vn.C_BRC]=rr.ERROR_POP,Dr[Vn.O_BRK]=rr.ERROR_PUSH,Dr[Vn.C_BRK]=rr.ERROR_POP,Dr[Vn.O_PAR]=rr.ERROR_PUSH,Dr[Vn.C_PAR]=rr.ERROR_POP,wr[Vn.C_PAR]=0,wr[Vn.COMMA]=0,wr[Vn.QMARK]=1,wr[Vn.COLON]=1,wr[Vn.AMP_AMP]=2,wr[Vn.BAR_BAR]=2,wr[Vn.LT]=3,wr[Vn.GT]=3,wr[Vn.LT_EQ]=3,wr[Vn.GT_EQ]=3,wr[Vn.EQ]=3,wr[Vn.EQ_EQ]=3,wr[Vn.BANG_EQ]=3,wr[Vn.PLUS]=4,wr[Vn.MINUS]=4,wr[Vn.STAR]=5,wr[Vn.SLASH]=5,wr[Vn.PERCENT]=5,wr[Vn.EOF]=6,wr[Nr]=2,wr[br]=2,function(t){t[t.PROP=0]="PROP",t[t.WHEN=1]="WHEN",t[t.MEDIA=2]="MEDIA",t[t.IMPORT=3]="IMPORT",t[t.SUPPORTS=4]="SUPPORTS"}(yr||(yr={}));var Ar=function(){function t(t,e,n,i){this.actions=void 0,this.tokenizer=void 0,this.handler=void 0,this.baseURL=void 0,this.valStack=[],this.namespacePrefixToURI={},this.defaultNamespaceURI=null,this.propName=null,this.propImportant=!1,this.exprContext=void 0,this.result=null,this.importReady=!1,this.importURL=null,this.importCondition=null,this.errorBrackets=[],this.ruleStack=[],this.regionRule=!1,this.pageRule=!1,this.actions=t,this.tokenizer=e,this.handler=n,this.baseURL=i,this.exprContext=yr.MEDIA}var e=t.prototype;return e.extractVals=function(t,e){for(var n=[],i=this.valStack;e<i.length&&(n.push(i[e++]),e!=i.length);)if(i[e++]!=t)throw new Error("Unexpected state");return n},e.valStackReduce=function(t,e){var n,i=this.valStack,r=i.length;do{n=i[--r]}while(void 0!==n&&"string"!=typeof n);var o=i.length-(r+1);if(o>1&&i.splice(r+1,o,new qe(i.slice(r+1,i.length))),","==t)return null;r++;do{n=i[--r]}while(void 0!==n&&("string"!=typeof n||","==n));if(o=i.length-(r+1),"("==n){if(")"!=t)return this.handler.error("E_CSS_MISMATCHED_C_PAR",e),this.actions=Cr,null;var a=new $e(i[r-1],this.extractVals(",",r+1));return i.splice(r-1,o+2,a),null}return";"!=t||r>=0?(this.handler.error("E_CSS_UNEXPECTED_VAL_END",e),this.actions=Cr,null):o>1?new Qe(this.extractVals(",",r+1)):i[0]},e.exprError=function(t,e){this.actions=this.propName?Cr:Er,c.warn(t)},e.exprStackReduce=function(t,e){for(var n,i=this.valStack,r=this.handler,o=i.pop();;){var a=i.pop();if(t==Vn.C_PAR){for(var s=[o];a==Vn.COMMA;)s.unshift(i.pop()),a=i.pop();if("string"==typeof a){if("{"==a){for(;s.length>=2;){var u=s.shift(),l=s.shift(),h=new ie(r.getScope(),u,l);s.unshift(h)}return i.push(new Ze(s[0])),!0}if("("==a){var c=i.pop(),d=i.pop();o=new De(r.getScope(),_t(d,c),s),t=Vn.EOF;continue}}if(a==Vn.O_PAR){o.isMediaName()&&(o=new Ne(r.getScope(),o,null)),t=Vn.EOF;continue}}else if("string"==typeof a){i.push(a);break}if(a<0)if(a==-Vn.BANG)o=new $t(r.getScope(),o);else if(a==-Vn.MINUS)o=new Jt(r.getScope(),o);else{if(a!=-Sr)return this.exprError("F_UNEXPECTED_STATE",e),!1;o=new Zt(r.getScope(),o)}else{if(wr[t]>wr[a]){i.push(a);break}switch(n=i.pop(),a){case Vn.AMP_AMP:o=new te(r.getScope(),n,o);break;case Nr:o=new ee(r.getScope(),n,o);break;case br:o=new re(r.getScope(),n,o);break;case Vn.BAR_BAR:o=new ne(r.getScope(),n,o);break;case Vn.LT:o=new oe(r.getScope(),n,o);break;case Vn.GT:o=new se(r.getScope(),n,o);break;case Vn.LT_EQ:o=new ae(r.getScope(),n,o);break;case Vn.GT_EQ:o=new ue(r.getScope(),n,o);break;case Vn.EQ:case Vn.EQ_EQ:o=new le(r.getScope(),n,o);break;case Vn.BANG_EQ:o=new he(r.getScope(),n,o);break;case Vn.PLUS:o=new ce(r.getScope(),n,o);break;case Vn.MINUS:o=new de(r.getScope(),n,o);break;case Vn.STAR:o=new fe(r.getScope(),n,o);break;case Vn.SLASH:o=new pe(r.getScope(),n,o);break;case Vn.PERCENT:o=new ge(r.getScope(),n,o);break;case Vn.COLON:if(!(i.length>1))return this.exprError("E_CSS_EXPR_COND",e),!1;switch(i[i.length-1]){case Vn.QMARK:i.pop(),o=new we(r.getScope(),i.pop(),n,o);break;case Vn.O_PAR:if(!n.isMediaName())return this.exprError("E_CSS_MEDIA_TEST",e),!1;o=new Ne(r.getScope(),n,o)}break;case Vn.QMARK:if(t!=Vn.COLON)return this.exprError("E_CSS_EXPR_COND",e),!1;case Vn.O_PAR:return i.push(n),i.push(a),i.push(o),!1;default:return this.exprError("F_UNEXPECTED_STATE",e),!1}}}return i.push(o),!1},e.readSupportsTest=function(t){var e,n,i=t.type===Vn.FUNC,r=this.tokenizer;if(i)e=t.position+(n=t.text).length+1;else{if(t.type!==Vn.O_PAR)return null;var o=r.nthToken(1),a=r.nthToken(2);if(o.type===Vn.IDENT&&a.type===Vn.COLON)r.consume(),r.consume(),n=o.text,e=a.position+1;else{if(o.type===Vn.O_PAR||o.type===Vn.FUNC||o.type===Vn.IDENT&&"not"===o.text.toLowerCase()&&(a.type===Vn.O_PAR||a.type===Vn.FUNC))return null;e=t.position+1}}for(var s,u=0;u>=0;)switch(r.consume(),(s=r.token()).type){case Vn.C_PAR:u--;break;case Vn.O_PAR:case Vn.FUNC:u++;break;case Vn.INVALID:case Vn.EOF:return this.exprError("E_CSS_UNEXPECTED_EOF",s),null}r.consume();var l=r.input.substring(e,s.position).trim();return new be(this.handler.getScope(),n,l,i)},e.readPseudoParams=function(){for(var t=[];;){var e=this.tokenizer.token();switch(e.type){case Vn.IDENT:t.push(e.text);break;case Vn.PLUS:t.push("+");break;case Vn.NUM:case Vn.INT:t.push(e.num);break;default:return t}this.tokenizer.consume()}},e.readNthPseudoParams=function(){var t=!1,e=this.tokenizer.token();if(e.type===Vn.PLUS)t=!0,this.tokenizer.consume(),e=this.tokenizer.token();else if(e.type===Vn.IDENT&&("even"===e.text||"odd"===e.text))return this.tokenizer.consume(),[2,"odd"===e.text?1:0];switch(e.type){case Vn.NUMERIC:if(t&&e.num<0)return null;case Vn.IDENT:if(t&&"-"===e.text.charAt(0))return null;if("n"===e.text||"-n"===e.text){if(t&&e.precededBySpace)return null;var n="-n"===e.text?-1:1;e.type===Vn.NUMERIC&&(n=e.num);var i=0;this.tokenizer.consume();var r=(e=this.tokenizer.token()).type===Vn.MINUS,o=e.type===Vn.PLUS||r;if(o&&(this.tokenizer.consume(),e=this.tokenizer.token()),e.type===Vn.INT){if(1/(i=e.num)==-1/0){if(i=0,o)return null}else if(i<0){if(o)return null}else if(i>=0&&!o)return null;this.tokenizer.consume()}else if(o)return null;return[n,r&&i>0?-i:i]}if("n-"===e.text||"-n-"===e.text){if(t&&e.precededBySpace)return null;var a="-n-"===e.text?-1:1;if(e.type===Vn.NUMERIC&&(a=e.num),this.tokenizer.consume(),(e=this.tokenizer.token()).type===Vn.INT)return e.num<0||1/e.num==-1/0?null:(this.tokenizer.consume(),[a,e.num])}else{var s=e.text.match(/^n(-[0-9]+)$/);if(s)return t&&e.precededBySpace?null:(this.tokenizer.consume(),[e.type===Vn.NUMERIC?e.num:1,parseInt(s[1],10)]);if(s=e.text.match(/^-n(-[0-9]+)$/))return this.tokenizer.consume(),[-1,parseInt(s[1],10)]}return null;case Vn.INT:return t&&(e.precededBySpace||e.num<0)?null:(this.tokenizer.consume(),[0,e.num])}return null},e.makeCondition=function(t,e){var n=this.handler.getScope();if(!n)return null;if(e=e||n._true,t)for(var i,r=B(t.split(/\s+/));!(i=r()).done;)switch(i.value){case"vertical":e=Ae(n,e,new $t(n,new me(n,"pref-horizontal")));break;case"horizontal":e=Ae(n,e,new me(n,"pref-horizontal"));break;case"day":e=Ae(n,e,new $t(n,new me(n,"pref-night-mode")));break;case"night":e=Ae(n,e,new me(n,"pref-night-mode"));break;default:e=n._false}return e===n._true?null:new Ze(e)},e.isInsidePropertyOnlyRule=function(){switch(this.ruleStack[this.ruleStack.length-1]){case"[selector]":case"font-face":case"-epubx-flow":case"-epubx-viewport":case"-epubx-define":case"-adapt-footnote-area":return!0}return!1},e.runParser=function(t,e,n,i,r){var o,a,s,u,l,h,c,d=this.handler,f=this.tokenizer,p=this.valStack;i&&(this.exprContext=yr.MEDIA,this.valStack.push("{"));t:for(;t>0;--t)switch(o=f.token(),this.actions[o.type]){case rr.IDENT:if(f.nthToken(1).type!=Vn.COLON){this.isInsidePropertyOnlyRule()?(d.error("E_CSS_COLON_EXPECTED",f.nthToken(1)),this.actions=Cr):(this.actions=pr,d.startSelectorRule());continue}(a=f.nthToken(2)).precededBySpace||a.type!=Vn.IDENT&&a.type!=Vn.FUNC||f.mark(),this.propName=o.text,this.propImportant=!1,f.consume(),f.consume(),this.actions=gr,p.splice(0,p.length);continue;case rr.PROP:if(f.nthToken(1).type!=Vn.COLON){this.actions=Cr,d.error("E_CSS_COLON_EXPECTED",f.nthToken(1));continue}this.propName=o.text,this.propImportant=!1,f.consume(),f.consume(),this.actions=gr,p.splice(0,p.length);continue;case rr.SELECTOR_START:this.actions=pr,d.startSelectorRule();continue;case rr.SELECTOR_NAME_1:if(!o.precededBySpace){this.actions=Dr,d.error("E_CSS_SPACE_EXPECTED",o);continue}d.descendantSelector();case rr.SELECTOR_NAME:if(f.nthToken(1).type==Vn.BAR)if(f.consume(),f.consume(),null!=(s=this.namespacePrefixToURI[o.text]))switch((o=f.token()).type){case Vn.IDENT:d.tagSelector(s,o.text),this.actions=r?dr:cr,f.consume();break;case Vn.STAR:d.tagSelector(s,null),this.actions=r?dr:cr,f.consume();break;default:this.actions=Er,d.error("E_CSS_NAMESPACE",o)}else this.actions=Er,d.error("E_CSS_UNDECLARED_PREFIX",o);else d.tagSelector(this.defaultNamespaceURI,o.text),this.actions=r?dr:cr,f.consume();continue;case rr.SELECTOR_ANY_1:if(!o.precededBySpace){this.actions=Dr,d.error("E_CSS_SPACE_EXPECTED",o);continue}d.descendantSelector();case rr.SELECTOR_ANY:if(f.nthToken(1).type==Vn.BAR)switch(f.consume(),f.consume(),(o=f.token()).type){case Vn.IDENT:d.tagSelector(null,o.text),this.actions=r?dr:cr,f.consume();break;case Vn.STAR:d.tagSelector(null,null),this.actions=r?dr:cr,f.consume();break;default:this.actions=Er,d.error("E_CSS_NAMESPACE",o)}else d.tagSelector(this.defaultNamespaceURI,null),this.actions=r?dr:cr,f.consume();continue;case rr.SELECTOR_ID_1:o.precededBySpace&&d.descendantSelector();case rr.SELECTOR_ID:d.idSelector(o.text),this.actions=r?dr:cr,f.consume();continue;case rr.SELECTOR_CLASS_1:o.precededBySpace&&d.descendantSelector();case rr.SELECTOR_CLASS:d.classSelector(o.text),this.actions=r?dr:cr,f.consume();continue;case rr.SELECTOR_PSEUDOCLASS_1:o.precededBySpace&&d.descendantSelector();case rr.SELECTOR_PSEUDOCLASS:f.consume();e:switch((o=f.token()).type){case Vn.IDENT:d.pseudoclassSelector(o.text,null),f.consume(),this.actions=r?dr:cr;continue;case Vn.FUNC:switch(u=o.text,f.consume(),u){case"not":this.actions=pr,d.startFuncWithSelector("not"),this.actions=this.runParser(Number.POSITIVE_INFINITY,!1,!1,!1,!0)?cr:Dr;break t;case"lang":case"href-epub-type":if((o=f.token()).type===Vn.IDENT){c=[o.text],f.consume();break}break e;case"nth-child":case"nth-of-type":case"nth-last-child":case"nth-last-of-type":case"nth":if(c=this.readNthPseudoParams())break;break e;default:c=this.readPseudoParams()}if((o=f.token()).type==Vn.C_PAR){d.pseudoclassSelector(u,c),f.consume(),this.actions=r?dr:cr;continue}}d.error("E_CSS_PSEUDOCLASS_SYNTAX",o),this.actions=Er;continue;case rr.SELECTOR_PSEUDOELEM:switch(f.consume(),(o=f.token()).type){case Vn.IDENT:d.pseudoelementSelector(o.text,null),this.actions=r?dr:cr,f.consume();continue;case Vn.FUNC:if(u=o.text,f.consume(),"nth-fragment"==u){if(null===(c=this.readNthPseudoParams()))break}else c=this.readPseudoParams();if((o=f.token()).type==Vn.C_PAR){d.pseudoelementSelector(u,c),this.actions=r?dr:cr,f.consume();continue}}d.error("E_CSS_PSEUDOELEM_SYNTAX",o),this.actions=Er;continue;case rr.SELECTOR_ATTR_1:o.precededBySpace&&d.descendantSelector();case rr.SELECTOR_ATTR:if(f.consume(),(o=f.token()).type==Vn.IDENT)u=o.text,f.consume();else if(o.type==Vn.STAR)u=null,f.consume();else{if(o.type!=Vn.BAR){this.actions=Dr,d.error("E_CSS_ATTR",o),f.consume();continue}u=""}if((o=f.token()).type==Vn.BAR){if(null==(s=u?this.namespacePrefixToURI[u]:u)){this.actions=Dr,d.error("E_CSS_UNDECLARED_PREFIX",o),f.consume();continue}if(f.consume(),(o=f.token()).type!=Vn.IDENT){this.actions=Dr,d.error("E_CSS_ATTR_NAME_EXPECTED",o);continue}u=o.text,f.consume(),o=f.token()}else s="";switch(o.type){case Vn.EQ:case Vn.TILDE_EQ:case Vn.BAR_EQ:case Vn.HAT_EQ:case Vn.DOLLAR_EQ:case Vn.STAR_EQ:case Vn.COL_COL:l=o.type,f.consume(),o=f.token();break;case Vn.C_BRK:d.attributeSelector(s,u,Vn.EOF,null),this.actions=r?dr:cr,f.consume();continue;default:this.actions=Dr,d.error("E_CSS_ATTR_OP_EXPECTED",o);continue}switch(o.type){case Vn.IDENT:case Vn.STR:d.attributeSelector(s,u,l,o.text),f.consume(),o=f.token();break;default:this.actions=Dr,d.error("E_CSS_ATTR_VAL_EXPECTED",o);continue}if(o.type!=Vn.C_BRK){this.actions=Dr,d.error("E_CSS_ATTR",o);continue}this.actions=r?dr:cr,f.consume();continue;case rr.SELECTOR_CHILD:d.childSelector(),this.actions=fr,f.consume();continue;case rr.SELECTOR_SIBLING:d.adjacentSiblingSelector(),this.actions=fr,f.consume();continue;case rr.SELECTOR_FOLLOWING_SIBLING:d.followingSiblingSelector(),this.actions=fr,f.consume();continue;case rr.SELECTOR_BODY:this.regionRule?(this.ruleStack.push("-epubx-region"),this.regionRule=!1):this.pageRule?(this.ruleStack.push("page"),this.pageRule=!1):this.ruleStack.push("[selector]"),d.startRuleBody(),this.actions=lr,f.consume();continue;case rr.SELECTOR_NEXT:d.nextSelector(),this.actions=pr,f.consume();continue;case rr.VAL_IDENT:p.push(He(o.text)),f.consume();continue;case rr.VAL_HASH:l=parseInt(o.text,16);try{p.push(ir(o.text))}catch(t){if(this.actions===gr&&f.hasMark()){f.reset(),this.actions=pr,d.startSelectorRule();continue}d.error("E_CSS_COLOR",o),this.actions=Er}f.consume();continue;case rr.VAL_NUM:p.push(new Ge(o.num)),f.consume();continue;case rr.VAL_INT:p.push(new Xe(o.num)),f.consume();continue;case rr.VAL_NUMERIC:Vt(o.text)?p.push(new Ze(new ve(d.getScope(),o.num,o.text))):p.push(new ze(o.num,o.text)),f.consume();continue;case rr.VAL_STR:p.push(new Me(o.text)),f.consume();continue;case rr.VAL_URL:p.push(new je(j(o.text,this.baseURL))),f.consume();continue;case rr.VAL_URANGE:p.push(new Ke(o.text)),f.consume();continue;case rr.VAL_COMMA:this.valStackReduce(",",o),p.push(","),f.consume();continue;case rr.VAL_SLASH:p.push(_e),f.consume();continue;case rr.VAL_FUNC:"-epubx-expr"==(u=o.text.toLowerCase())||"calc"==u||"env"==u?(this.actions=vr,this.exprContext=yr.PROP,p.push("{")):(p.push(u),p.push("(")),f.consume();continue;case rr.VAL_C_PAR:this.valStackReduce(")",o),f.consume();continue;case rr.VAL_BANG:if(f.consume(),o=f.token(),a=f.nthToken(1),o.type==Vn.IDENT&&"important"==o.text.toLowerCase()&&(a.type==Vn.SEMICOL||a.type==Vn.EOF||a.type==Vn.C_BRC)){f.consume(),this.propImportant=!0;continue}this.exprError("E_CSS_SYNTAX",o);continue;case rr.VAL_PLUS:switch((a=f.nthToken(1)).type){case Vn.NUM:case Vn.NUMERIC:case Vn.INT:if(!a.precededBySpace){f.consume();continue}}if(this.actions===gr&&f.hasMark()){f.reset(),this.actions=pr,d.startSelectorRule();continue}this.exprError("E_CSS_UNEXPECTED_PLUS",o);continue;case rr.VAL_END:f.consume();case rr.VAL_BRC:f.unmark(),(h=this.valStackReduce(";",o))&&this.propName&&d.property(this.propName,h,this.propImportant),this.actions=n?hr:lr;continue;case rr.VAL_FINISH:if(f.consume(),f.unmark(),h=this.valStackReduce(";",o),e)return this.result=h,!0;if(this.propName&&h&&d.property(this.propName,h,this.propImportant),n)return!0;this.exprError("E_CSS_SYNTAX",o);continue;case rr.EXPR_IDENT:if((a=f.nthToken(1)).type==Vn.CLASS)f.nthToken(2).type!=Vn.O_PAR||f.nthToken(2).precededBySpace?(p.push(new me(d.getScope(),_t(o.text,a.text))),this.actions=mr):(p.push(o.text,a.text,"("),f.consume()),f.consume();else{if(this.exprContext==yr.MEDIA||this.exprContext==yr.IMPORT)"not"==o.text.toLowerCase()?(f.consume(),p.push(new Ee(d.getScope(),!0,a.text))):("only"==o.text.toLowerCase()&&(f.consume(),o=a),p.push(new Ee(d.getScope(),!1,o.text)));else{if(this.exprContext===yr.SUPPORTS&&"not"===o.text.toLowerCase()&&p[p.length-1]!==Nr&&p[p.length-1]!==br&&(a.type===Vn.O_PAR||a.type===Vn.FUNC)){p.push(-Sr),f.consume();continue}p.push(new me(d.getScope(),o.text))}this.actions=mr}f.consume();continue;case rr.EXPR_FUNC:if(this.exprContext===yr.SUPPORTS){p.push(this.readSupportsTest(o)),this.actions=mr;continue}p.push(null,o.text,"("),f.consume();continue;case rr.EXPR_NUM:p.push(new ye(d.getScope(),o.num)),f.consume(),this.actions=mr;continue;case rr.EXPR_NUMERIC:"%"==(u=o.text)&&(u=this.propName&&this.propName.match(/height|^(top|bottom)$/)?"vh":"vw"),p.push(new ve(d.getScope(),o.num,u)),f.consume(),this.actions=mr;continue;case rr.EXPR_STR:p.push(new ye(d.getScope(),o.text)),f.consume(),this.actions=mr;continue;case rr.EXPR_PARAM:f.consume(),(o=f.token()).type!=Vn.INT||o.precededBySpace?this.exprError("E_CSS_SYNTAX",o):(p.push(new Se(d.getScope(),o.num)),f.consume(),this.actions=mr);continue;case rr.EXPR_PREFIX:p.push(-o.type),f.consume();continue;case rr.EXPR_INFIX:this.actions=vr,this.exprStackReduce(o.type,o),p.push(o.type),f.consume();continue;case rr.EXPR_INFIX_NAME:"and"===o.text.toLowerCase()&&p[p.length-2]!==br&&p[p.length-2]!==-Sr?(this.actions=vr,this.exprStackReduce(Nr,o),p.push(Nr),f.consume()):"or"===o.text.toLowerCase()&&p[p.length-2]!==Nr&&p[p.length-2]!==-Sr?(this.actions=vr,this.exprStackReduce(br,o),p.push(br),f.consume()):this.exprError("E_CSS_SYNTAX",o);continue;case rr.EXPR_C_PAR:this.exprStackReduce(o.type,o)&&(this.actions=gr),f.consume();continue;case rr.EXPR_O_BRC:this.exprStackReduce(Vn.C_PAR,o)&&(this.propName||this.exprContext==yr.IMPORT?this.exprError("E_CSS_UNEXPECTED_BRC",o):(this.exprContext==yr.WHEN?d.startWhenRule(p.pop()):d.startMediaRule(p.pop()),this.ruleStack.push("media"),d.startRuleBody(),this.actions=lr)),f.consume();continue;case rr.EXPR_SEMICOL:if(this.exprStackReduce(Vn.C_PAR,o))return this.propName||this.exprContext!=yr.IMPORT?(this.exprError("E_CSS_UNEXPECTED_SEMICOL",o),this.actions=lr,f.consume(),!1):(this.importCondition=p.pop(),this.importReady=!0,this.actions=lr,f.consume(),!1);f.consume();continue;case rr.EXPR_O_PAR:if(this.exprContext===yr.SUPPORTS){var g=this.readSupportsTest(o);if(g){p.push(g),this.actions=mr;continue}}p.push(o.type),f.consume();continue;case rr.RULE_END:this.actions=lr,f.consume(),d.endRule(),this.ruleStack.length&&this.ruleStack.pop();continue;case rr.AT:switch(u=o.text.toLowerCase()){case"import":if(f.consume(),(o=f.token()).type==Vn.STR||o.type==Vn.URL){if(this.importURL=o.text,f.consume(),(o=f.token()).type==Vn.SEMICOL||o.type==Vn.EOF)return this.importReady=!0,f.consume(),!1;this.propName=null,this.exprContext=yr.IMPORT,this.actions=vr,p.push("{");continue}d.error("E_CSS_IMPORT_SYNTAX",o),this.actions=Er;continue;case"namespace":switch(f.consume(),(o=f.token()).type){case Vn.IDENT:if(u=o.text,f.consume(),((o=f.token()).type==Vn.STR||o.type==Vn.URL)&&f.nthToken(1).type==Vn.SEMICOL){this.namespacePrefixToURI[u]=o.text,f.consume(),f.consume();continue}break;case Vn.STR:case Vn.URL:if(f.nthToken(1).type==Vn.SEMICOL){this.defaultNamespaceURI=o.text,f.consume(),f.consume();continue}}d.error("E_CSS_NAMESPACE_SYNTAX",o),this.actions=Er;continue;case"charset":if(f.consume(),(o=f.token()).type==Vn.STR&&f.nthToken(1).type==Vn.SEMICOL){"utf-8"!=(u=o.text.toLowerCase())&&"utf-16"!=u&&d.error("E_CSS_UNEXPECTED_CHARSET "+u,o),f.consume(),f.consume();continue}d.error("E_CSS_CHARSET_SYNTAX",o),this.actions=Er;continue;case"font-face":case"-epubx-page-template":case"-epubx-define":case"-epubx-viewport":if(f.nthToken(1).type==Vn.O_BRC){switch(f.consume(),f.consume(),u){case"font-face":d.startFontFaceRule();break;case"-epubx-page-template":d.startPageTemplateRule();break;case"-epubx-define":d.startDefineRule();break;case"-epubx-viewport":d.startViewportRule()}this.ruleStack.push(u),d.startRuleBody();continue}break;case"-adapt-footnote-area":switch(f.consume(),(o=f.token()).type){case Vn.O_BRC:f.consume(),d.startFootnoteRule(null),this.ruleStack.push(u),d.startRuleBody();continue;case Vn.COL_COL:if(f.consume(),(o=f.token()).type==Vn.IDENT&&f.nthToken(1).type==Vn.O_BRC){u=o.text,f.consume(),f.consume(),d.startFootnoteRule(u),this.ruleStack.push("-adapt-footnote-area"),d.startRuleBody();continue}}break;case"-epubx-region":f.consume(),d.startRegionRule(),this.regionRule=!0,this.actions=pr;continue;case"page":f.consume(),d.startPageRule(),this.pageRule=!0,this.actions=fr;continue;case"top-left-corner":case"top-left":case"top-center":case"top-right":case"top-right-corner":case"right-top":case"right-middle":case"right-bottom":case"bottom-right-corner":case"bottom-right":case"bottom-center":case"bottom-left":case"bottom-left-corner":case"left-bottom":case"left-middle":case"left-top":if(f.consume(),(o=f.token()).type==Vn.O_BRC){f.consume(),d.startPageMarginBoxRule(u),this.ruleStack.push(u),d.startRuleBody();continue}break;case"-epubx-when":f.consume(),this.propName=null,this.exprContext=yr.WHEN,this.actions=vr,p.push("{");continue;case"media":f.consume(),this.propName=null,this.exprContext=yr.MEDIA,this.actions=vr,p.push("{");continue;case"supports":f.consume(),this.propName=null,this.exprContext=yr.SUPPORTS,this.actions=vr,p.push("{");continue;case"-epubx-flow":if(f.nthToken(1).type==Vn.IDENT&&f.nthToken(2).type==Vn.O_BRC){d.startFlowRule(f.nthToken(1).text),f.consume(),f.consume(),f.consume(),this.ruleStack.push(u),d.startRuleBody();continue}break;case"-epubx-page-master":case"-epubx-partition":case"-epubx-partition-group":f.consume();var v=null,m=null,E=[];for((o=f.token()).type==Vn.IDENT&&(v=o.text,f.consume(),o=f.token()),o.type==Vn.COLON&&f.nthToken(1).type==Vn.IDENT&&(m=f.nthToken(1).text,f.consume(),f.consume(),o=f.token());o.type==Vn.FUNC&&"class"==o.text.toLowerCase()&&f.nthToken(1).type==Vn.IDENT&&f.nthToken(2).type==Vn.C_PAR;)E.push(f.nthToken(1).text),f.consume(),f.consume(),f.consume(),o=f.token();if(o.type==Vn.O_BRC){switch(f.consume(),u){case"-epubx-page-master":d.startPageMasterRule(v,m,E);break;case"-epubx-partition":d.startPartitionRule(v,m,E);break;case"-epubx-partition-group":d.startPartitionGroupRule(v,m,E)}this.ruleStack.push(u),d.startRuleBody();continue}break;case"":d.error("E_CSS_UNEXPECTED_AT"+u,o),this.actions=Dr;continue;default:d.error("E_CSS_AT_UNKNOWN "+u,o),this.actions=Er;continue}d.error("E_CSS_AT_SYNTAX "+u,o),this.actions=Er;continue;case rr.ERROR_PUSH:if(e||n)return!0;this.errorBrackets.push(o.type+1),f.consume();continue;case rr.ERROR_POP_DECL:if(e||n)return!0;if(0==this.errorBrackets.length){this.actions=lr;continue}case rr.ERROR_POP:this.errorBrackets.length>0&&this.errorBrackets[this.errorBrackets.length-1]==o.type&&this.errorBrackets.pop(),0==this.errorBrackets.length&&o.type==Vn.C_BRC&&(this.actions=lr),f.consume();continue;case rr.ERROR_SEMICOL:if(e||n)return!0;0==this.errorBrackets.length&&(this.actions=lr),f.consume();continue;case rr.DONE:return r&&(f.consume(),d.endFuncWithSelector()),!0;default:if(e||n)return!0;if(i)return!!this.exprStackReduce(Vn.C_PAR,o)&&(this.result=p.pop(),!0);if(r)return d.error(o.type==Vn.INVALID?o.text:"E_CSS_SYNTAX",o),!1;if(this.actions===gr&&f.hasMark()){f.reset(),this.actions=pr,d.startSelectorRule();continue}if(this.actions!==Er&&this.actions!==Dr&&this.actions!==Cr){if(o.type==Vn.INVALID)d.error(o.text,o);else{if(o.type===Vn.O_BRC){d.startMediaRule(p.pop()),this.ruleStack.push("media"),d.startRuleBody(),this.actions=lr,f.consume();continue}if(o.type===Vn.SEMICOL)return this.actions=lr,f.consume(),!1;d.error("E_CSS_SYNTAX",o)}this.actions=this.isInsidePropertyOnlyRule()?Cr:Dr;continue}f.consume();continue}return!1},t}(),Tr=function(t){function e(e){var n;return(n=t.call(this,null)||this).scope=void 0,n.scope=e,n}x(e,t);var n=e.prototype;return n.error=function(t,e){throw new Error(t)},n.getScope=function(){return this.scope},e}(or);function xr(t,e,n,i,r){return Li("parseStylesheetFromText",(function(o){(function(t,e,n,i,r){var o=Pi("parseStylesheet"),a=new Ar(lr,t,e,n),s=null;return r&&(s=function(t,e,n){var i=new Ar(vr,t,e,n);return i.runParser(Number.POSITIVE_INFINITY,!1,!1,!0,!1),i.result}(new Ti(r,e),e,n)),(s=a.makeCondition(i,s&&s.toExpr()))&&(e.startMediaRule(s),e.startRuleBody()),o.loop((function(){for(;!a.runParser(100,!1,!1,!1,!1);){if(a.importReady){var t=function(){var t=j(a.importURL,n);a.importCondition&&(e.startMediaRule(a.importCondition),e.startRuleBody());var i=Pi("parseStylesheet.import");return Ir(t,e,null,null).then((function(){a.importCondition&&e.endRule(),a.importReady=!1,a.importURL=null,a.importCondition=null,i.finish(!0)})),{v:i.result()}}();if("object"==typeof t)return t.v}var i=o.timeSlice();if(i.isPending)return i}return Ri(!1)})).then((function(){s&&e.endRule(),o.finish(!0)})),o.result()})(new Ti(t,e),e,n,i,r).thenFinish(o)}),(function(e,n){c.warn(n,"Failed to parse stylesheet text: "+t),e.finish(!1)}))}function Ir(t,e,n,i){return Li("parseStylesheetFromURL",(function(r){Zi(t).then((function(o){o.responseText?xr(o.responseText,e,t,n,i).then((function(e){e||c.warn("Failed to parse stylesheet from "+t),r.finish(!0)})):r.finish(!0)}))}),(function(e,n){c.warn(n,"Exception while fetching and parsing:",t),e.finish(!0)}))}function Fr(t,e,n){var i=new Ar(gr,e,new Tr(t),n);return i.runParser(Number.POSITIVE_INFINITY,!0,!1,!1,!1),i.result}var Pr={"z-index":!0,"column-count":!0,"flow-linger":!0,opacity:!0,page:!0,"flow-priority":!0,utilization:!0};function Rr(t,e,n){if(e.isExpr()){try{return function(t,e,n){var i=e.evaluate(t);switch(typeof i){case"number":return function(t){return!!Pr[t]}(n)?i==Math.round(i)?new Xe(i):new Ge(i):new ze(i,"px");case"string":return i?Fr(e.scope,new Ti(i,null),""):ke;case"boolean":return i?en._true:en._false;case"undefined":return ke}throw new Error("E_UNEXPECTED")}(t,e.expr,n)}catch(t){c.warn(t)}return ke}return e}function Lr(t,e,n){return t-=n,0===e?0===t:t%e==0&&t/e>=0}var Or=function(){function t(t){this.matchers=void 0,this.matchers=t}return t.prototype.matches=function(){return this.matchers.some((function(t){return t.matches()}))},t}(),kr=function(){function t(t){this.matchers=void 0,this.matchers=t}return t.prototype.matches=function(){return this.matchers.every((function(t){return t.matches()}))},t}(),Br=function(){function t(t,e,n){this.elementOffset=void 0,this.a=void 0,this.b=void 0,this.elementOffset=t,this.a=e,this.b=n}return t.registerFragmentIndex=function(e,n,i){var r=t.fragmentIndices;(!r[e]||r[e].priority<=i)&&(r[e]={fragmentIndex:n,priority:i})},t.clearFragmentIndices=function(){t.fragmentIndices={}},t.prototype.matches=function(){var e=t.fragmentIndices[this.elementOffset];return null!=e&&null!=e.fragmentIndex&&Lr(e.fragmentIndex,this.a,this.b)},t}();Br.fragmentIndices={};var _r,Mr,Ur,Vr,Hr,zr,Gr=function(){function t(){}return t.buildViewConditionMatcher=function(t,e){var n=e.split("_");return"NFS"==n[0]?new Br(t,parseInt(n[1],10),parseInt(n[2],10)):null},t.buildAllMatcher=function(t){return new kr(t)},t.buildAnyMatcher=function(t){return new Or(t)},t}();function Xr(t){return t.reduce((function(t,e){return e[0]===o.default.DELETE?t:t+e[1]}),"")}function Wr(t,e,n){var i=0,r=0;return t.some((function(t){for(var a=0;a<t[1].length;a++){switch(t[0]*n){case o.default.INSERT:i++;break;case o.default.DELETE:i--,r++;break;case o.default.EQUAL:r++}if(r>e)return!0}return!1})),Math.max(Math.min(e,r-1)+i,0)}!function(t){t.isInstanceOfBlockFormattingContext=function(t){return t&&"Block"===t.formattingContextType}}(_r||(_r={})),function(t){!function(t){t.INLINE="inline",t.COLUMN="column",t.REGION="region",t.PAGE="page"}(t.FloatReference||(t.FloatReference={}))}(Mr||(Mr={})),function(t){t.isInstanceOfAfterIfContinuesLayoutConstraint=function(t){return t&&"AfterIfContinue"==t.flagmentLayoutConstraintType}}(Ur||(Ur={})),function(t){t.isInstanceOfRepetitiveElementsOwnerFormattingContext=function(t){return!!t&&("RepetitiveElementsOwner"===t.formattingContextType||Hr.isInstanceOfTableFormattingContext(t))},t.isInstanceOfRepetitiveElementsOwnerLayoutConstraint=function(t){return!!t&&("RepetitiveElementsOwner"===t.flagmentLayoutConstraintType||Hr.isInstanceOfTableRowLayoutConstraint(t))}}(Vr||(Vr={})),function(t){t.isInstanceOfTableFormattingContext=function(t){return t&&"Table"===t.formattingContextType},t.isInstanceOfTableRowLayoutConstraint=function(t){return t&&"TableRow"===t.flagmentLayoutConstraintType}}(Hr||(Hr={})),function(t){!function(t){t[t.IGNORE=0]="IGNORE",t[t.NEWLINE=1]="NEWLINE",t[t.PRESERVE=2]="PRESERVE"}(t.Whitespace||(t.Whitespace={})),function(t){t[t.NONE=0]="NONE",t[t.CONTENT=1]="CONTENT",t[t.ROOTLESS=2]="ROOTLESS",t[t.ROOTED=3]="ROOTED"}(t.ShadowType||(t.ShadowType={}))}(zr||(zr={}));var jr={transform:!0,"transform-origin":!0},Kr={top:!0,bottom:!0,left:!0,right:!0},Yr=function(t,e,n){this.target=void 0,this.name=void 0,this.value=void 0,this.target=t,this.name=e,this.value=n},qr={show:function(t){t.style.visibility="visible"},hide:function(t){t.style.visibility="hidden"},play:function(t){t.currentTime=0,t.play()},pause:function(t){t.pause()},resume:function(t){t.play()},mute:function(t){t.muted=!0},unmute:function(t){t.muted=!1}};function Qr(t,e){var n=qr[e];return n?function(){for(var e=0;e<t.length;e++)try{n(t[e])}catch(t){}}:null}var $r=function(t){function e(e,n){var i;return(i=t.call(this)||this).container=void 0,i.bleedBox=void 0,i.pageAreaElement=null,i.delayedItems=[],i.hrefHandler=void 0,i.elementsById={},i.dimensions={width:0,height:0},i.isFirstPage=!1,i.isLastPage=!1,i.isBlankPage=!1,i.isAutoPageWidth=!0,i.isAutoPageHeight=!0,i.spineIndex=0,i.position=null,i.offset=-1,i.side=null,i.fetchers=[],i.marginBoxes={top:{},bottom:{},left:{},right:{}},i.container=e,i.bleedBox=n,i.hrefHandler=function(t){var e=t.currentTarget,n=e.getAttribute("href")||e.getAttributeNS(G.XLINK,"href");n&&i.dispatchEvent({type:"hyperlink",target:null,currentTarget:null,anchorElement:e,href:n,preventDefault:function(){t.preventDefault()}})},i}x(e,t);var n=e.prototype;return n.setAutoPageWidth=function(t){this.isAutoPageWidth=t,t?this.container.setAttribute(e.AUTO_PAGE_WIDTH_ATTRIBUTE,"true"):this.container.removeAttribute(e.AUTO_PAGE_WIDTH_ATTRIBUTE)},n.setAutoPageHeight=function(t){this.isAutoPageHeight=t,t?this.container.setAttribute(e.AUTO_PAGE_HEIGHT_ATTRIBUTE,"true"):this.container.removeAttribute(e.AUTO_PAGE_HEIGHT_ATTRIBUTE)},n.registerElementWithId=function(t,e){var n=this.elementsById[e];n?n.push(t):this.elementsById[e]=[t]},n.finish=function(t,e){var n=this;Object.keys(this.elementsById).forEach((function(t){for(var e=n.elementsById[t],i=0;i<e.length;)n.container.contains(e[i])?i++:e.splice(i,1);0===e.length&&delete n.elementsById[t]}));for(var i=this.delayedItems,r=0;r<i.length;r++){var o=i[r];(o.target!==this.container||"transform"!==o.name||this.isAutoPageWidth||this.isAutoPageHeight)&&tt(o.target,o.name,o.value.toString())}var a=e.getElementClientRect(this.container);this.dimensions.width=a.width,this.dimensions.height=a.height;for(var s=0;s<t.length;s++){var u=t[s],l=this.elementsById[u.ref],h=this.elementsById[u.observer];if(l&&h){var c=Qr(l,u.action);if(c)for(var d=0;d<h.length;d++)h[d].addEventListener(u.event,c,!1)}}},n.zoom=function(t){tt(this.container,"transform","scale("+t+")")},n.getPageAreaElement=function(){return this.pageAreaElement||this.container},e}(gt);$r.AUTO_PAGE_WIDTH_ATTRIBUTE="data-vivliostyle-auto-page-width",$r.AUTO_PAGE_HEIGHT_ATTRIBUTE="data-vivliostyle-auto-page-height";var Zr=zr.Whitespace;function Jr(t){switch(t){case"normal":case"nowrap":return Zr.IGNORE;case"pre-line":return Zr.NEWLINE;case"pre":case"pre-wrap":case"break-spaces":return Zr.PRESERVE;default:return null}}function to(t,e){if(1==t.nodeType)return!1;var n=t.textContent;switch(e){case Zr.IGNORE:return!!n.match(/^\s*$/);case Zr.NEWLINE:return!!n.match(/^[ \t\f]*$/);case Zr.PRESERVE:return 0==n.length}throw new Error("Unexpected whitespace: "+e)}var eo=function(t,e){this.flowName=void 0,this.parentFlowName=void 0,this.forcedBreakOffsets=[],this.formattingContext=null,this.flowName=t,this.parentFlowName=e},no=function(){function t(t,e,n,i,r,o,a,s,u){this.flowName=void 0,this.element=void 0,this.startOffset=void 0,this.priority=void 0,this.linger=void 0,this.exclusive=void 0,this.repeated=void 0,this.last=void 0,this.breakBefore=void 0,this.startPage=-1,this.flowName=t,this.element=e,this.startOffset=n,this.priority=i,this.linger=r,this.exclusive=o,this.repeated=a,this.last=s,this.breakBefore=u}return t.prototype.isBetter=function(t){return!!this.exclusive&&(!t.exclusive||this.priority>t.priority||this.last)},t}();function io(t,e){return t.top-e.top}function ro(t,e){return e.right-t.right}function oo(t,e){return t===e||!(!t||!e)&&t.node===e.node&&t.shadowType===e.shadowType&&co(t.shadowContext,e.shadowContext)&&co(t.nodeShadow,e.nodeShadow)&&oo(t.shadowSibling,e.shadowSibling)}function ao(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.offsetInNode!==e.offsetInNode||t.after!==e.after||t.steps.length!==e.steps.length)return!1;for(var n=0;n<t.steps.length;n++)if(!oo(t.steps[n],e.steps[n]))return!1;return!0}function so(t,e){return{steps:[{node:t.sourceNode,shadowType:lo.NONE,shadowContext:t.shadowContext,nodeShadow:null,shadowSibling:null,formattingContext:null,fragmentIndex:null!=e?e:t.fragmentIndex}],offsetInNode:0,after:!1,preprocessedTextContent:t.preprocessedTextContent}}function uo(t,e){var n=new po(t.node,e,0);return n.shadowType=t.shadowType,n.shadowContext=t.shadowContext,n.nodeShadow=t.nodeShadow,n.shadowSibling=t.shadowSibling?uo(t.shadowSibling,e.copy()):null,n.formattingContext=t.formattingContext,n.fragmentIndex=t.fragmentIndex+1,n}var lo=zr.ShadowType,ho=function(){function t(t,e,n,i,r,o,a){this.owner=void 0,this.root=void 0,this.xmldoc=void 0,this.parentShadow=void 0,this.type=void 0,this.styler=void 0,this.subShadow=null,this.owner=t,this.root=e,this.xmldoc=n,this.parentShadow=i,this.type=o,this.styler=a,r&&(r.subShadow=this)}return t.prototype.equals=function(t){return!!t&&this.owner===t.owner&&this.xmldoc===t.xmldoc&&this.type===t.type&&co(this.parentShadow,t.parentShadow)},t}();function co(t,e){return t===e||!!t&&!!e&&t.equals(e)}var fo=function(t,e){this.outer=void 0,this.count=void 0,this.outer=t,this.count=e},po=function(){function t(t,e,n){this.sourceNode=void 0,this.parent=void 0,this.boxOffset=void 0,this.offsetInNode=0,this.after=!1,this.shadowType=void 0,this.shadowContext=void 0,this.nodeShadow=null,this.shadowSibling=null,this.shared=!1,this.inline=!0,this.overflow=!1,this.breakPenalty=void 0,this.display=null,this.floatReference=void 0,this.floatSide=null,this.clearSide=null,this.floatMinWrapBlock=null,this.columnSpan=null,this.verticalAlign="baseline",this.captionSide="top",this.inlineBorderSpacing=0,this.blockBorderSpacing=0,this.flexContainer=!1,this.whitespace=void 0,this.hyphenateCharacter=void 0,this.breakWord=void 0,this.establishesBFC=!1,this.containingBlockForAbsolute=!1,this.breakBefore=null,this.breakAfter=null,this.viewNode=null,this.clearSpacer=null,this.inheritedProps=void 0,this.vertical=void 0,this.direction=void 0,this.firstPseudo=void 0,this.lang=null,this.preprocessedTextContent=null,this.formattingContext=void 0,this.repeatOnBreak=null,this.pluginProps={},this.fragmentIndex=1,this.afterIfContinues=null,this.footnotePolicy=null,this.pageType=void 0,this.sourceNode=t,this.parent=e,this.boxOffset=n,this.shadowType=lo.NONE,this.shadowContext=e?e.shadowContext:null,this.breakPenalty=e?e.breakPenalty:0,this.floatReference=Mr.FloatReference.INLINE,this.whitespace=e?e.whitespace:Zr.IGNORE,this.hyphenateCharacter=e?e.hyphenateCharacter:null,this.breakWord=!!e&&e.breakWord,this.inheritedProps=e?e.inheritedProps:{},this.vertical=!!e&&e.vertical,this.direction=e?e.direction:"ltr",this.firstPseudo=e?e.firstPseudo:null,this.formattingContext=e?e.formattingContext:null,this.pageType=e?e.pageType:null}var e=t.prototype;return e.resetView=function(){this.inline=!0,this.breakPenalty=this.parent?this.parent.breakPenalty:0,this.viewNode=null,this.clearSpacer=null,this.offsetInNode=0,this.after=!1,this.display=null,this.floatReference=Mr.FloatReference.INLINE,this.floatSide=null,this.clearSide=null,this.floatMinWrapBlock=null,this.columnSpan=null,this.verticalAlign="baseline",this.flexContainer=!1,this.whitespace=this.parent?this.parent.whitespace:Zr.IGNORE,this.hyphenateCharacter=this.parent?this.parent.hyphenateCharacter:null,this.breakWord=!!this.parent&&this.parent.breakWord,this.breakBefore=null,this.breakAfter=null,this.nodeShadow=null,this.establishesBFC=!1,this.containingBlockForAbsolute=!1,this.vertical=!!this.parent&&this.parent.vertical,this.nodeShadow=null,this.preprocessedTextContent=null,this.formattingContext=this.parent?this.parent.formattingContext:null,this.repeatOnBreak=null,this.pluginProps={},this.fragmentIndex=1,this.afterIfContinues=null,this.footnotePolicy=null},e.cloneItem=function(){var e=new t(this.sourceNode,this.parent,this.boxOffset);return e.offsetInNode=this.offsetInNode,e.after=this.after,e.nodeShadow=this.nodeShadow,e.shadowType=this.shadowType,e.shadowContext=this.shadowContext,e.shadowSibling=this.shadowSibling,e.inline=this.inline,e.breakPenalty=this.breakPenalty,e.display=this.display,e.floatReference=this.floatReference,e.floatSide=this.floatSide,e.clearSide=this.clearSide,e.floatMinWrapBlock=this.floatMinWrapBlock,e.columnSpan=this.columnSpan,e.verticalAlign=this.verticalAlign,e.captionSide=this.captionSide,e.inlineBorderSpacing=this.inlineBorderSpacing,e.blockBorderSpacing=this.blockBorderSpacing,e.establishesBFC=this.establishesBFC,e.containingBlockForAbsolute=this.containingBlockForAbsolute,e.flexContainer=this.flexContainer,e.whitespace=this.whitespace,e.hyphenateCharacter=this.hyphenateCharacter,e.breakWord=this.breakWord,e.breakBefore=this.breakBefore,e.breakAfter=this.breakAfter,e.viewNode=this.viewNode,e.clearSpacer=this.clearSpacer,e.firstPseudo=this.firstPseudo,e.vertical=this.vertical,e.overflow=this.overflow,e.preprocessedTextContent=this.preprocessedTextContent,e.formattingContext=this.formattingContext,e.repeatOnBreak=this.repeatOnBreak,e.pluginProps=Object.create(this.pluginProps),e.fragmentIndex=this.fragmentIndex,e.afterIfContinues=this.afterIfContinues,e.footnotePolicy=this.footnotePolicy,e},e.modify=function(){return this.shared?this.cloneItem():this},e.copy=function(){var t=this;do{if(t.shared)break;t.shared=!0,t=t.parent}while(t);return this},e.clone=function(){for(var t,e=this.cloneItem(),n=e;null!=(t=n.parent);)t=t.cloneItem(),n.parent=t,n=t;return e},e.toNodePositionStep=function(){return{node:this.sourceNode,shadowType:this.shadowType,shadowContext:this.shadowContext,nodeShadow:this.nodeShadow,shadowSibling:this.shadowSibling?this.shadowSibling.toNodePositionStep():null,formattingContext:this.formattingContext,fragmentIndex:this.fragmentIndex}},e.toNodePosition=function(){var t,e,n,i=this,r=[];i.shadowType!==zr.ShadowType.ROOTLESS||i.floatReference===Mr.FloatReference.INLINE&&"footnote"!==i.floatSide||null==(t=i.shadowContext)||null==(e=t.styler)||null==(n=e.style)||!n._pseudos||(i=i.parent);do{i.firstPseudo&&i.parent&&i.parent.firstPseudo!==i.firstPseudo||r.push(i.toNodePositionStep()),i=i.parent}while(i);return{steps:r,offsetInNode:this.preprocessedTextContent?Wr(this.preprocessedTextContent,this.offsetInNode,-1):this.offsetInNode,after:this.after,preprocessedTextContent:this.preprocessedTextContent}},e.isInsideBFC=function(){for(var t=this.parent;t;){if(t.establishesBFC)return!0;t=t.parent}return!1},e.getContainingBlockForAbsolute=function(){for(var t=this.parent;t;){if(t.containingBlockForAbsolute)return t;t=t.parent}return null},e.walkUpBlocks=function(t){for(var e=this;e;)e.inline||t(e),e=e.parent},e.belongsTo=function(t){return this.formattingContext===t&&!!this.parent&&this.parent.formattingContext===t},t}(),go=function(){function t(t){this.primary=void 0,this.floats=null,this.primary=t}var e=t.prototype;return e.clone=function(){var e=new t(this.primary);if(this.floats){e.floats=[];for(var n=0;n<this.floats.length;++n)e.floats[n]=this.floats[n]}return e},e.isSamePosition=function(t){if(!t)return!1;if(this===t)return!0;if(!ao(this.primary,t.primary))return!1;if(this.floats){if(!t.floats||this.floats.length!==t.floats.length)return!1;for(var e=0;e<this.floats.length;e++)if(!ao(this.floats[e],t.floats[e]))return!1}else if(t.floats)return!1;return!0},t}(),vo=function(){function t(t,e){this.chunkPosition=void 0,this.flowChunk=void 0,this.chunkPosition=t,this.flowChunk=e}var e=t.prototype;return e.clone=function(){return new t(this.chunkPosition.clone(),this.flowChunk)},e.isSamePosition=function(t){return!!t&&(this===t||this.chunkPosition.isSamePosition(t.chunkPosition))},t}(),mo=function(){function t(){this.positions=[],this.startSide="any",this.breakAfter=null}var e=t.prototype;return e.clone=function(){for(var e=new t,n=this.positions,i=e.positions,r=0;r<n.length;r++)i[r]=n[r].clone();return e.startSide=this.startSide,e.breakAfter=this.breakAfter,e},e.isSamePosition=function(t){if(this===t)return!0;if(!t||this.positions.length!==t.positions.length)return!1;for(var e=0;e<this.positions.length;e++)if(!this.positions[e].isSamePosition(t.positions[e]))return!1;return!0},e.hasContent=function(t){return this.positions.length>0&&this.positions[0].flowChunk.startOffset<=t},t}(),Eo=function(){function t(){this.page=0,this.flows={},this.flowPositions={},this.isBlankPage=!1,this.highestSeenOffset=0,this.highestSeenNode=void 0,this.lookupPositionOffset=void 0}var e=t.prototype;return e.clone=function(){var e=new t;for(var n in e.page=this.page,e.isBlankPage=this.isBlankPage,e.highestSeenNode=this.highestSeenNode,e.highestSeenOffset=this.highestSeenOffset,e.lookupPositionOffset=this.lookupPositionOffset,e.flows=this.flows,this.flowPositions)e.flowPositions[n]=this.flowPositions[n].clone();return e},e.isSamePosition=function(t){if(this===t)return!0;if(!t||this.page!==t.page||this.highestSeenOffset!==t.highestSeenOffset)return!1;var e=Object.keys(this.flowPositions),n=Object.keys(t.flowPositions);if(e.length!==n.length)return!1;for(var i=0,r=e;i<r.length;i++){var o=r[i];if(!this.flowPositions[o].isSamePosition(t.flowPositions[o]))return!1}return!0},e.hasContent=function(t,e){var n=this.flowPositions[t];return!!n&&n.hasContent(e)},e.startSideOfFlow=function(t){var e=this.flowPositions[t];return e?e.startSide:"any"},e.firstFlowChunkOfFlow=function(t){var e=this.flowPositions[t];if(!e)return null;var n=e.positions[0];return n?n.flowChunk:null},t}(),Co=function(){function t(t){this.element=void 0,this.left=0,this.top=0,this.marginLeft=0,this.marginRight=0,this.marginTop=0,this.marginBottom=0,this.borderLeft=0,this.borderRight=0,this.borderTop=0,this.borderBottom=0,this.paddingLeft=0,this.paddingRight=0,this.paddingTop=0,this.paddingBottom=0,this.width=0,this.height=0,this.originX=0,this.originY=0,this.exclusions=null,this.innerShape=null,this.computedBlockSize=0,this.snapWidth=0,this.snapHeight=0,this.snapOffsetX=0,this.snapOffsetY=0,this.vertical=!1,this.element=t}var e=t.prototype;return e.getInsetTop=function(){return this.marginTop+this.borderTop+this.paddingTop},e.getInsetBottom=function(){return this.marginBottom+this.borderBottom+this.paddingBottom},e.getInsetLeft=function(){return this.marginLeft+this.borderLeft+this.paddingLeft},e.getInsetRight=function(){return this.marginRight+this.borderRight+this.paddingRight},e.getInsetBefore=function(){return this.vertical?this.getInsetRight():this.getInsetTop()},e.getInsetAfter=function(){return this.vertical?this.getInsetLeft():this.getInsetBottom()},e.getInsetStart=function(){return this.vertical?this.getInsetTop():this.getInsetLeft()},e.getInsetEnd=function(){return this.vertical?this.getInsetBottom():this.getInsetRight()},e.getBeforeEdge=function(t){return this.vertical?t.right:t.top},e.getAfterEdge=function(t){return this.vertical?t.left:t.bottom},e.getStartEdge=function(t){return this.vertical?t.top:t.left},e.getEndEdge=function(t){return this.vertical?t.bottom:t.right},e.getInlineSize=function(t){return this.vertical?t.bottom-t.top:t.right-t.left},e.getBoxSize=function(t){return this.vertical?t.right-t.left:t.bottom-t.top},e.getBoxDir=function(){return this.vertical?-1:1},e.getInlineDir=function(){return 1},e.copyFrom=function(t){this.element=t.element,this.left=t.left,this.top=t.top,this.marginLeft=t.marginLeft,this.marginRight=t.marginRight,this.marginTop=t.marginTop,this.marginBottom=t.marginBottom,this.borderLeft=t.borderLeft,this.borderRight=t.borderRight,this.borderTop=t.borderTop,this.borderBottom=t.borderBottom,this.paddingLeft=t.paddingLeft,this.paddingRight=t.paddingRight,this.paddingTop=t.paddingTop,this.paddingBottom=t.paddingBottom,this.width=t.width,this.height=t.height,this.originX=t.originX,this.originY=t.originY,this.innerShape=t.innerShape,this.exclusions=t.exclusions,this.computedBlockSize=t.computedBlockSize,this.snapWidth=t.snapWidth,this.snapHeight=t.snapHeight,this.vertical=t.vertical},e.setVerticalPosition=function(t,e){this.top=t,this.height=e,tt(this.element,"top",t+"px"),tt(this.element,"height",e+"px")},e.setHorizontalPosition=function(t,e){this.left=t,this.width=e,tt(this.element,"left",t+"px"),tt(this.element,"width",e+"px")},e.setBlockPosition=function(t,e){this.vertical?this.setHorizontalPosition(t+e*this.getBoxDir(),e):this.setVerticalPosition(t,e)},e.setInlinePosition=function(t,e){this.vertical?this.setVerticalPosition(t,e):this.setHorizontalPosition(t,e)},e.clear=function(){for(var t,e=this.element;t=e.lastChild;)e.removeChild(t)},e.getInnerShape=function(){var t=this.getInnerRect();return this.innerShape?this.innerShape.withOffset(t.x1,t.y1):En(t.x1,t.y1,t.x2,t.y2)},e.getInnerRect=function(){var t=this.originX+this.left+this.getInsetLeft(),e=this.originY+this.top+this.getInsetTop();return new hn(t,e,t+this.width,e+this.height)},e.getPaddingRect=function(){var t=this.originX+this.left+this.marginLeft+this.borderLeft,e=this.originY+this.top+this.marginTop+this.borderTop;return new hn(t,e,t+(this.paddingLeft+this.width+this.paddingRight),e+(this.paddingTop+this.height+this.paddingBottom))},e.getOuterShape=function(t,e){var n=this.getOuterRect();return kn(t,n.x1,n.y1,n.x2-n.x1,n.y2-n.y1,e)},e.getOuterRect=function(){var t=this.originX+this.left,e=this.originY+this.top,n=this.getInsetLeft()+this.width+this.getInsetRight(),i=this.getInsetTop()+this.height+this.getInsetBottom();return new hn(t,e,t+n,e+i)},t}(),Do=function(t){function e(e,n,i,r){var o;return(o=t.call(this)||this).elem=void 0,o.context=void 0,o.rootContentValue=void 0,o.exprContentListener=void 0,o.elem=e,o.context=n,o.rootContentValue=i,o.exprContentListener=r,o}x(e,t);var n=e.prototype;return n.visitStrInner=function(t,e){e||(e=this.elem.ownerDocument.createTextNode(t)),this.elem.appendChild(e)},n.visitStr=function(t){return this.visitStrInner(t.str),null},n.visitURL=function(t){if(this.rootContentValue.url)this.elem.setAttribute("src",t.url);else{var e=this.elem.ownerDocument.createElementNS(G.XHTML,"img");e.setAttribute("src",t.url),this.elem.appendChild(e)}return null},n.visitSpaceList=function(t){return this.visitValues(t.values),null},n.visitExpr=function(t){var e=t.toExpr(),n=e.evaluate(this.context);if("string"==typeof n){e instanceof me&&(n=Fr(e.scope,new Ti(n,null),"").stringValue());var i=this.exprContentListener(e,n,this.elem.ownerDocument);this.visitStrInner(n,i)}return null},e}(Pe);function wo(t){return null!=t&&t!==ke&&t!==en.normal&&t!==en.none&&t!==en.inherit}var yo={"border-collapse":!0,"border-spacing":!0,"caption-side":!0,"clip-rule":!0,color:!0,"color-interpolation":!0,"color-rendering":!0,cursor:!0,direction:!0,"empty-cells":!0,fill:!0,"fill-opacity":!0,"fill-rule":!0,"font-kerning":!0,"font-size":!0,"font-size-adjust":!0,"font-family":!0,"font-feature-settings":!0,"font-style":!0,"font-stretch":!0,"font-variant-ligatures":!0,"font-variant-caps":!0,"font-variant-numeric":!0,"font-variant-east-asian":!0,"font-weight":!0,"glyph-orientation-vertical":!0,hyphens:!0,"hyphenate-character":!0,"hyphenate-limit-chars":!0,"hyphenate-limit-last":!0,"image-rendering":!0,"image-resolution":!0,"letter-spacing":!0,"line-break":!0,"line-height":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,marker:!0,"marker-end":!0,"marker-mid":!0,"marker-start":!0,orphans:!0,"overflow-wrap":!0,"paint-order":!0,"pointer-events":!0,quotes:!0,"ruby-align":!0,"ruby-position":!0,"shape-rendering":!0,stroke:!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,"stroke-linecap":!0,"stroke-linejoin":!0,"stroke-miterlimit":!0,"stroke-opacity":!0,"stroke-width":!0,"tab-size":!0,"text-align":!0,"text-align-last":!0,"text-anchor":!0,"text-decoration-skip":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-combine-upright":!0,"text-indent":!0,"text-justify":!0,"text-rendering":!0,"text-size-adjust":!0,"text-transform":!0,"text-underline-position":!0,visibility:!0,"white-space":!0,widows:!0,"word-break":!0,"word-spacing":!0,"writing-mode":!0},No=["box-decoration-break","image-resolution","orphans","widows"],bo={"http://www.idpf.org/2007/ops":!0,"http://www.w3.org/1999/xhtml":!0,"http://www.w3.org/2000/svg":!0},So=["margin-%","padding-%","border-%-width","border-%-style","border-%-color","%"],Ao=["max-%","min-%","%"],To=function(){for(var t=["left","right","top","bottom"],e={width:!0,height:!0,"max-width":!0,"max-height":!0,"min-width":!0,"min-height":!0},n=0;n<So.length;n++)for(var i=0;i<t.length;i++)e[So[n].replace("%",t[i])]=!0;return e}();function xo(t,e){for(var n,i={},r=B(So);!(n=r()).done;){var o=n.value;for(var a in t){var s=o.replace("%",a),u=o.replace("%",t[a]);i[s]=u,i[u]=s}}for(var l,h=B(Ao);!(l=h()).done;){var c=l.value;for(var d in e){var f=c.replace("%",d),p=c.replace("%",e[d]);i[f]=p,i[p]=f}}return i}var Io=xo({"block-start":"right","block-end":"left","inline-start":"top","inline-end":"bottom"},{"block-size":"width","inline-size":"height"}),Fo=xo({"block-start":"top","block-end":"bottom","inline-start":"left","inline-end":"right"},{"block-size":"height","inline-size":"width"}),Po=xo({"block-start":"right","block-end":"left","inline-start":"bottom","inline-end":"top"},{"block-size":"width","inline-size":"height"}),Ro=xo({"block-start":"top","block-end":"bottom","inline-start":"right","inline-end":"left"},{"block-size":"height","inline-size":"width"}),Lo=function(){function t(t,e){this.value=void 0,this.priority=void 0,this.value=t,this.priority=e}var e=t.prototype;return e.getBaseValue=function(){return this},e.filterValue=function(e){var n=this.value.visit(e);return n===this.value?this:new t(n,this.priority)},e.increaseSpecificity=function(e){return 0==e?this:new t(this.value,this.priority+e)},e.evaluate=function(t,e){return Rr(t,this.value,e)},e.isEnabled=function(t){return!0},t}(),Oo=function(t){function e(e,n,i){var r;return(r=t.call(this,e,n)||this).condition=void 0,r.condition=i,r}x(e,t);var n=e.prototype;return n.getBaseValue=function(){return new Lo(this.value,this.priority)},n.filterValue=function(t){var n=this.value.visit(t);return n===this.value?this:new e(n,this.priority,this.condition)},n.increaseSpecificity=function(t){return 0==t?this:new e(this.value,this.priority+t,this.condition)},n.isEnabled=function(t){try{return!!this.condition.evaluate(t)}catch(t){c.warn(t)}return!1},e}(Lo);function ko(t,e,n){return(null==e||n.priority>e.priority)&&n.isEnabled(t)?n.getBaseValue():e}var Bo={"region-id":!0,"fragment-selector-id":!0};function _o(t){return"_"!=t.charAt(0)&&!Bo[t]}function Mo(t){return!!yo[t]}function Uo(t,e){return t[e]}function Vo(t,e,n){n?t[e]=n:delete t[e]}function Ho(t,e){return t[e]}function zo(t,e){var n=t[e];return n||(t[e]=n={}),n}var Go=function(t){var e=t._viewConditionalStyles;return e||(t._viewConditionalStyles=e=[]),e};function Xo(t,e){return t[e]}function Wo(t,e){var n=t[e];return n||(t[e]=n=[]),n}function jo(t,e,n,i,r,o,a){for(var s in[{id:r,styleKey:"_pseudos"},{id:o,styleKey:"_regions"}].forEach((function(t){if(t.id){var n=zo(e,t.styleKey);(e=n[t.id])||(n[t.id]=e={})}})),a&&Go(e).push({styles:e={},matcher:a}),n)if("_"!=s.charAt(0))if(Bo[s]){var u=Xo(n,s),l=Wo(e,s);Array.prototype.push.apply(l,u)}else{var h=Uo(n,s).increaseSpecificity(i),c=Uo(e,s);Vo(e,s,ko(t,c,h))}}function Ko(t,e){if(t.length>0){t.sort((function(t,e){return e.getPriority()-t.getPriority()}));for(var n=null,i=t.length-1;i>=0;i--)(n=t[i]).chained=e,e=n;return n}return e}var Yo=function(t){function e(e,n){var i;return(i=t.call(this)||this).props=void 0,i.context=void 0,i.propName="",i.props=e,i.context=n,i}x(e,t);var n=e.prototype;return n.setPropName=function(t){this.propName=t},n.getFontSize=function(){var t=Uo(this.props,"font-size");if(!t.value.isNumeric())return Ht.em;var e=t.value;if(!function(t){switch(t.toLowerCase()){case"px":case"in":case"pt":case"pc":case"cm":case"mm":case"q":return!0;default:return!1}}(e.unit))throw new Error("Unexpected state");return e.num*Ht[e.unit]},n.visitNumeric=function(t){if("font-size"===this.propName)return function(t,e,n){var i=(t=qo(t,e,n)).unit,r=t.num;return"px"===i?t:new ze("%"===i?r/100*e:r*n.queryUnitSize(i,!1),"px")}(t,this.getFontSize(),this.context);if("em"==t.unit||"ex"==t.unit||"rem"==t.unit)return qo(t,this.getFontSize(),this.context);if("%"==t.unit){if("line-height"===this.propName)return t;var e=this.propName.match(/height|^(top|bottom)$/)?"vh":"vw";return new ze(t.num,e)}return t},n.visitExpr=function(t){return"font-size"==this.propName?Rr(this.context,t,this.propName).visit(this):t},e}(Re);function qo(t,e,n){var i=t.unit,r=t.num;return"em"===i||"ex"===i?new ze(r*(Ht[i]/Ht.em)*e,"px"):"rem"===i?new ze(r*n.fontSize(),"px"):t}var Qo=function(){function t(){}var e=t.prototype;return e.apply=function(t){},e.mergeWith=function(t){return new Zo([this,t])},e.clone=function(){return this},t}(),$o=function(t){function e(e){var n;return(n=t.call(this)||this).conditionItem=void 0,n.conditionItem=e,n}return x(e,t),e.prototype.apply=function(t){t.pushConditionItem(this.conditionItem.fresh(t))},e}(Qo),Zo=function(t){function e(e){var n;return(n=t.call(this)||this).list=void 0,n.list=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){for(var e=0;e<this.list.length;e++)this.list[e].apply(t)},n.mergeWith=function(t){return this.list.push(t),this},n.clone=function(){return new e([].concat(this.list))},e}(Qo),Jo=function(t){function e(e,n,i,r,o){var a;return(a=t.call(this)||this).style=void 0,a.specificity=void 0,a.pseudoelement=void 0,a.regionId=void 0,a.viewConditionId=void 0,a.style=e,a.specificity=n,a.pseudoelement=i,a.regionId=r,a.viewConditionId=o,a}return x(e,t),e.prototype.apply=function(t){jo(t.context,t.currentStyle,this.style,this.specificity,this.pseudoelement,this.regionId,t.buildViewConditionMatcher(this.viewConditionId))},e}(Qo),ta=function(t){function e(){var e;return(e=t.call(this)||this).chained=null,e}x(e,t);var n=e.prototype;return n.apply=function(t){this.chained.apply(t)},n.getPriority=function(){return 0},n.makePrimary=function(t){return!1},e}(Qo),ea=function(t){function e(e){var n;return(n=t.call(this)||this).className=void 0,n.className=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){t.currentClassNames.includes(this.className)&&this.chained.apply(t)},n.getPriority=function(){return 10},n.makePrimary=function(t){return this.chained&&t.insertInTable(t.classes,this.className,this.chained),!0},e}(ta),na=function(t){function e(e){var n;return(n=t.call(this)||this).id=void 0,n.id=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){t.currentId!=this.id&&t.currentXmlId!=this.id||this.chained.apply(t)},n.getPriority=function(){return 11},n.makePrimary=function(t){return this.chained&&t.insertInTable(t.ids,this.id,this.chained),!0},e}(ta),ia=function(t){function e(e){var n;return(n=t.call(this)||this).localName=void 0,n.localName=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){t.currentLocalName==this.localName&&this.chained.apply(t)},n.getPriority=function(){return 8},n.makePrimary=function(t){return this.chained&&t.insertInTable(t.tags,this.localName,this.chained),!0},e}(ta),ra=function(t){function e(e,n){var i;return(i=t.call(this)||this).ns=void 0,i.localName=void 0,i.ns=e,i.localName=n,i}x(e,t);var n=e.prototype;return n.apply=function(t){t.currentLocalName==this.localName&&t.currentNamespace==this.ns&&this.chained.apply(t)},n.getPriority=function(){return 8},n.makePrimary=function(t){if(this.chained){var e=t.nsPrefix[this.ns];e||(e="ns"+t.nsCount+++":",t.nsPrefix[this.ns]=e),t.insertInTable(t.nstags,e+this.localName,this.chained)}return!0},e}(ta),oa=function(t){function e(e){var n;return(n=t.call(this)||this).epubTypePatt=void 0,n.epubTypePatt=e,n}return x(e,t),e.prototype.apply=function(t){var e=t.currentElement;if(e&&"a"==t.currentLocalName){var n=e.getAttribute("href");if(n&&n.match(/^#/)){var i=n.substring(1),r=e.ownerDocument.getElementById(i);if(r){var o=r.getAttributeNS(G.epub,"type");o&&o.match(this.epubTypePatt)&&this.chained.apply(t)}}}},e}(ta),aa=function(t){function e(e){var n;return(n=t.call(this)||this).ns=void 0,n.ns=e,n}return x(e,t),e.prototype.apply=function(t){t.currentNamespace==this.ns&&this.chained.apply(t)},e}(ta),sa=function(t){function e(e,n){var i;return(i=t.call(this)||this).ns=void 0,i.name=void 0,i.ns=e,i.name=n,i}return x(e,t),e.prototype.apply=function(t){t.currentElement&&t.currentElement.hasAttributeNS(this.ns,this.name)&&this.chained.apply(t)},e}(ta),ua=function(t){function e(e,n,i){var r;return(r=t.call(this)||this).ns=void 0,r.name=void 0,r.value=void 0,r.ns=e,r.name=n,r.value=i,r}x(e,t);var n=e.prototype;return n.apply=function(t){t.currentElement&&t.currentElement.getAttributeNS(this.ns,this.name)==this.value&&this.chained.apply(t)},n.getPriority=function(){return"type"==this.name&&this.ns==G.epub?9:0},n.makePrimary=function(t){return"type"==this.name&&this.ns==G.epub&&(this.chained&&t.insertInTable(t.epubtypes,this.value,this.chained),!0)},e}(ta),la=function(t){function e(e,n){var i;return(i=t.call(this)||this).ns=void 0,i.name=void 0,i.ns=e,i.name=n,i}x(e,t);var n=e.prototype;return n.apply=function(t){if(t.currentElement){var e=t.currentElement.getAttributeNS(this.ns,this.name);e&&bo[e]&&this.chained.apply(t)}},n.getPriority=function(){return 0},n.makePrimary=function(t){return!1},e}(ta),ha=function(t){function e(e,n,i){var r;return(r=t.call(this)||this).ns=void 0,r.name=void 0,r.regexp=void 0,r.ns=e,r.name=n,r.regexp=i,r}return x(e,t),e.prototype.apply=function(t){if(t.currentElement){var e=t.currentElement.getAttributeNS(this.ns,this.name);e&&e.match(this.regexp)&&this.chained.apply(t)}},e}(ta),ca=function(t){function e(e){var n;return(n=t.call(this)||this).langRegExp=void 0,n.langRegExp=e,n}return x(e,t),e.prototype.apply=function(t){t.lang.match(this.langRegExp)&&this.chained.apply(t)},e}(ta),da=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.apply=function(t){t.isFirst&&this.chained.apply(t)},n.getPriority=function(){return 6},e}(ta),fa=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.apply=function(t){t.isRoot&&this.chained.apply(t)},n.getPriority=function(){return 12},e}(ta),pa=function(t){function e(e,n){var i;return(i=t.call(this)||this).a=void 0,i.b=void 0,i.a=e,i.b=n,i}return x(e,t),e.prototype.matchANPlusB=function(t){return Lr(t,this.a,this.b)},e}(ta),ga=function(t){function e(e,n){return t.call(this,e,n)||this}x(e,t);var n=e.prototype;return n.apply=function(t){this.matchANPlusB(t.currentSiblingOrder)&&this.chained.apply(t)},n.getPriority=function(){return 5},e}(pa),va=function(t){function e(e,n){return t.call(this,e,n)||this}x(e,t);var n=e.prototype;return n.apply=function(t){this.matchANPlusB(t.currentSiblingTypeCounts[t.currentNamespace][t.currentLocalName])&&this.chained.apply(t)},n.getPriority=function(){return 5},e}(pa),ma=function(t){function e(e,n){return t.call(this,e,n)||this}x(e,t);var n=e.prototype;return n.apply=function(t){var e=t.currentFollowingSiblingOrder;null===e&&(e=t.currentFollowingSiblingOrder=t.currentElement.parentNode.childElementCount-t.currentSiblingOrder+1),this.matchANPlusB(e)&&this.chained.apply(t)},n.getPriority=function(){return 4},e}(pa),Ea=function(t){function e(e,n){return t.call(this,e,n)||this}x(e,t);var n=e.prototype;return n.apply=function(t){var e=t.currentFollowingSiblingTypeCounts;if(!e[t.currentNamespace]){var n=t.currentElement;do{var i=n.namespaceURI,r=n.localName,o=e[i];o||(o=e[i]={}),o[r]=(o[r]||0)+1}while(n=n.nextElementSibling)}this.matchANPlusB(e[t.currentNamespace][t.currentLocalName])&&this.chained.apply(t)},n.getPriority=function(){return 4},e}(pa),Ca=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.apply=function(t){for(var e=t.currentElement.firstChild;e;){switch(e.nodeType){case Node.ELEMENT_NODE:return;case Node.TEXT_NODE:if(e.length>0)return}e=e.nextSibling}this.chained.apply(t)},n.getPriority=function(){return 4},e}(ta),Da=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.apply=function(t){!1===t.currentElement.disabled&&this.chained.apply(t)},n.getPriority=function(){return 5},e}(ta),wa=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.apply=function(t){!0===t.currentElement.disabled&&this.chained.apply(t)},n.getPriority=function(){return 5},e}(ta),ya=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.apply=function(t){var e=t.currentElement;!0!==e.selected&&!0!==e.checked||this.chained.apply(t)},n.getPriority=function(){return 5},e}(ta),Na=function(t){function e(e){var n;return(n=t.call(this)||this).condition=void 0,n.condition=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){if(t.conditions[this.condition])try{t.dependentConditions.push(this.condition),this.chained.apply(t)}finally{t.dependentConditions.pop()}},n.getPriority=function(){return 5},e}(ta),ba=function(t){function e(){var e;return(e=t.call(this)||this).applied=!1,e}x(e,t);var n=e.prototype;return n.apply=function(t){this.applied=!0},n.clone=function(){var t=new e;return t.applied=this.applied,t},e}(Qo),Sa=function(t){function e(e){var n;return(n=t.call(this)||this).checkAppliedAction=void 0,n.firstAction=void 0,n.checkAppliedAction=new ba,n.firstAction=Ko(e,n.checkAppliedAction),n}x(e,t);var n=e.prototype;return n.apply=function(t){this.firstAction.apply(t),this.checkAppliedAction.applied||this.chained.apply(t),this.checkAppliedAction.applied=!1},n.getPriority=function(){return this.firstAction.getPriority()},e}(ta),Aa=function(){function t(t,e,n){this.condition=void 0,this.viewConditionId=void 0,this.viewCondition=void 0,this.condition=t,this.viewConditionId=e,this.viewCondition=n}var e=t.prototype;return e.increment=function(t){t.increment(this.condition,this.viewCondition)},e.decrement=function(t){t.decrement(this.condition,this.viewCondition)},e.buildViewConditionMatcher=function(t){return t.buildViewConditionMatcher(this.viewConditionId)},t}(),Ta=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},n.push=function(t,e){return 0==e&&this.increment(t),!1},n.pop=function(t,e){return 0==e&&(this.decrement(t),!0)},e}(Aa),xa=function(t){function e(e,n,i){return t.call(this,e,n,i)||this}x(e,t);var n=e.prototype;return n.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},n.push=function(t,e){return 0==e?this.increment(t):1==e&&this.decrement(t),!1},n.pop=function(t,e){return 0==e?(this.decrement(t),!0):(1==e&&this.increment(t),!1)},e}(Aa),Ia=function(t){function e(e,n,i){var r;return(r=t.call(this,e,n,i)||this).fired=!1,r}x(e,t);var n=e.prototype;return n.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},n.push=function(t,e){return!!this.fired&&(this.decrement(t),!0)},n.pop=function(t,e){return this.fired?(this.decrement(t),!0):(0==e&&(this.fired=!0,this.increment(t)),!1)},e}(Aa),Fa=function(t){function e(e,n,i){var r;return(r=t.call(this,e,n,i)||this).fired=!1,r}x(e,t);var n=e.prototype;return n.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},n.push=function(t,e){return this.fired&&(-1==e?this.increment(t):0==e&&this.decrement(t)),!1},n.pop=function(t,e){if(this.fired){if(-1==e)return this.decrement(t),!0;0==e&&this.increment(t)}else 0==e&&(this.fired=!0,this.increment(t));return!1},e}(Aa),Pa=function(){function t(t,e){this.afterprop=void 0,this.element=void 0,this.afterprop=t,this.element=e}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.processPseudoelementProps(this.afterprop,this.element),!0)},t}(),Ra=function(){function t(t){this.lang=void 0,this.lang=t}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.lang=this.lang,!0)},t}(),La=function(){function t(t){this.oldQuotes=void 0,this.oldQuotes=t}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.quotes=this.oldQuotes,!0)},t}(),Oa=function(t){function e(e){var n;return(n=t.call(this)||this).element=void 0,n.element=e,n}x(e,t);var n=e.prototype;return n.createValueFromString=function(t,e){return"url"===e?new je(t||"about:invalid"):new Me(t||"")},n.visitFunc=function(e){if("attr"!==e.name)return t.prototype.visitFunc.call(this,e);var n,i="string",r=null;if(e.values[0]instanceof qe){var o=e.values[0].values;o.length>=2&&(i=o[1].stringValue()),r=o[0].stringValue()}else r=e.values[0].stringValue();return n=this.createValueFromString(e.values.length>1?e.values[1].stringValue():null,i),this.element&&this.element.hasAttribute(r)?this.createValueFromString(this.element.getAttribute(r),i):n},e}(Re);function ka(t){if(wo(t)){if(t instanceof Me)return t.stringValue();if(t instanceof qe)return t.values.map((function(t){return ka(t)})).join("")}return""}var Ba=function(t){function e(e,n,i){var r;return(r=t.call(this)||this).cascade=void 0,r.element=void 0,r.counterResolver=void 0,r.cascade=e,r.element=n,r.counterResolver=i,r}x(e,t);var n=e.prototype;return n.visitIdent=function(t){var e=this.cascade,n=e.quotes,i=Math.floor(n.length/2)-1;switch(t.name){case"open-quote":var r=n[2*Math.min(i,e.quoteDepth)];return e.quoteDepth++,r;case"close-quote":return e.quoteDepth>0&&e.quoteDepth--,n[2*Math.min(i,e.quoteDepth)+1];case"no-open-quote":return e.quoteDepth++,new Me("");case"no-close-quote":return e.quoteDepth>0&&e.quoteDepth--,new Me("")}return t},n.format=function(t,e){var n,i=!1,r=!1;null!=(n=e.match(/^upper-(.*)/))?(i=!0,e=n[1]):null!=(n=e.match(/^lower-(.*)/))&&(r=!0,e=n[1]);var o="";return _a[e]?o=function(t,e){if(e>t[0]||e<=0||e!=Math.round(e))return"";for(var n="",i=1;i<t.length;i+=2){var r=t[i],o=Math.floor(e/r);if(o>20)return"";for(e-=o*r;o>0;)n+=t[i+1],o--}return n}(_a[e],t):Ma[e]?o=function(t,e){if(e<=0||e!=Math.round(e))return"";var n=function(t){for(var e=[],n=0;n<t.length;)if("-"==t.substr(n+1,1)){var i=t.charCodeAt(n),r=t.charCodeAt(n+2);n+=3;for(var o=i;o<=r;o++)e.push(String.fromCharCode(o))}else e.push(t.substr(n++,1));return e}(t),i="";do{var r=--e%n.length;i=n[r]+i,e=(e-r)/n.length}while(e>0);return i}(Ma[e],t):null!=Ua[e]?o=Ua[e]:"decimal-leading-zero"==e?1==(o=""+t).length&&(o="0"+o):o="cjk-ideographic"==e||"trad-chinese-informal"==e?function(t,e){if(t>9999||t<-9999)return""+t;if(0==t)return e.digits.charAt(0);var n=new it;if(t<0&&(n.append(e.negative),t=-t),t<10)n.append(e.digits.charAt(t));else if(!e.formal&&t<=19)n.append(e.markers.charAt(0)),0!=t&&n.append(e.digits.charAt(t-10));else{var i=Math.floor(t/1e3);i&&(n.append(e.digits.charAt(i)),n.append(e.markers.charAt(2)));var r=Math.floor(t/100)%10;r&&(n.append(e.digits.charAt(r)),n.append(e.markers.charAt(1)));var o=Math.floor(t/10)%10;o&&(n.append(e.digits.charAt(o)),n.append(e.markers.charAt(0)));var a=t%10;a&&n.append(e.digits.charAt(a))}return n.toString()}(t,Va):""+t,i?o.toUpperCase():r?o.toLowerCase():o},n.visitFuncCounter=function(t){var e=this,n=t[0].toString(),i=t.length>1?t[1].stringValue():"decimal",r=this.cascade.counters[n];if(r&&r.length)return new Me(this.format(r&&r.length&&r[r.length-1]||0,i));var o=new Ze(this.counterResolver.getPageCounterVal(n,(function(t){return e.format(t||0,i)})));return new qe([o])},n.visitFuncCounters=function(t){var e=this,n=t[0].toString(),i=t[1].stringValue(),r=t.length>2?t[2].stringValue():"decimal",o=this.cascade.counters[n],a=new it;if(o&&o.length)for(var s=0;s<o.length;s++)s>0&&a.append(i),a.append(this.format(o[s],r));var u=new Ze(this.counterResolver.getPageCountersVal(n,(function(t){var n=[];if(t.length)for(var o=0;o<t.length;o++)n.push(e.format(t[o],r));var s=a.toString();return s.length&&n.push(s),n.length?n.join(i):e.format(0,r)})));return new qe([u])},n.visitFuncTargetCounter=function(t){var e,n=this,i=t[0];e=i instanceof je?i.url:i.stringValue();var r=t[1].toString(),o=t.length>2?t[2].stringValue():"decimal",a=new Ze(this.counterResolver.getTargetCounterVal(e,r,(function(t){return n.format(t||0,o)})));return new qe([a])},n.visitFuncTargetCounters=function(t){var e,n=this,i=t[0];e=i instanceof je?i.url:i.stringValue();var r=t[1].toString(),o=t[2].stringValue(),a=t.length>3?t[3].stringValue():"decimal",s=new Ze(this.counterResolver.getTargetCountersVal(e,r,(function(t){var e=t.map((function(t){return n.format(t,a)}));return e.length?e.join(o):n.format(0,a)})));return new qe([s])},n.visitFuncString=function(t){var e=t.length>0?t[0].stringValue():"",n=t.length>1?t[1].stringValue():"first",i=new Ze(this.counterResolver.getNamedStringVal(e,n));return new qe([i])},n.visitFuncContent=function(t){var e=t.length>0?t[0].stringValue():"text",n="";switch(e){case"text":case"first-letter":if(n=this.element.textContent.trim().replace(/\s+/g," "),"first-letter"===e){var i=n.match(_);n=i?i[0]:""}break;case"before":case"after":var r,o,a=Ho(this.cascade.currentStyle,"_pseudos");n=ka(null==a||null==(r=a[e])||null==(o=r.content)?void 0:o.value)}return new Me(n)},n.visitFunc=function(t){switch(t.name){case"counter":if(t.values.length<=2)return this.visitFuncCounter(t.values);break;case"counters":if(t.values.length<=3)return this.visitFuncCounters(t.values);break;case"target-counter":if(t.values.length<=3)return this.visitFuncTargetCounter(t.values);break;case"target-counters":if(t.values.length<=4)return this.visitFuncTargetCounters(t.values);break;case"string":if(t.values.length<=2)return this.visitFuncString(t.values);break;case"content":if(t.values.length<=1)return this.visitFuncContent(t.values)}return c.warn("E_CSS_CONTENT_PROP:",t.toString()),new Me("")},e}(Re),_a={roman:[4999,1e3,"M",900,"CM",500,"D",400,"CD",100,"C",90,"XC",50,"L",40,"XL",10,"X",9,"IX",5,"V",4,"IV",1,"I"],armenian:[9999,9e3,"ք",8e3,"փ",7e3,"ւ",6e3,"ց",5e3,"ր",4e3,"տ",3e3,"վ",2e3,"ս",1e3,"ռ",900,"ջ",800,"պ",700,"չ",600,"ո",500,"շ",400,"ն",300,"յ",200,"մ",100,"ճ",90,"ղ",80,"ձ",70,"հ",60,"կ",50,"ծ",40,"խ",30,"լ",20,"ի",10,"ժ",9,"թ",8,"ը",7,"է",6,"զ",5,"ե",4,"դ",3,"գ",2,"բ",1,"ա"],georgian:[19999,1e4,"ჵ",9e3,"ჰ",8e3,"ჯ",7e3,"ჴ",6e3,"ხ",5e3,"ჭ",4e3,"წ",3e3,"ძ",2e3,"ც",1e3,"ჩ",900,"შ",800,"ყ",700,"ღ",600,"ქ",500,"ფ",400,"ჳ",300,"ტ",200,"ს",100,"რ",90,"ჟ",80,"პ",70,"ო",60,"ჲ",50,"ნ",40,"მ",30,"ლ",20,"კ",10,"ი",9,"თ",8,"ჱ",7,"ზ",6,"ვ",5,"ე",4,"დ",3,"გ",2,"ბ",1,"ა"],hebrew:[999,400,"ת",300,"ש",200,"ר",100,"ק",90,"צ",80,"פ",70,"ע",60,"ס",50,"נ",40,"מ",30,"ל",20,"כ",19,"יט",18,"יח",17,"יז",16,"טז",15,"טו",10,"י",9,"ט",8,"ח",7,"ז",6,"ו",5,"ה",4,"ד",3,"ג",2,"ב",1,"א"]},Ma={latin:"a-z",alpha:"a-z",greek:"α-ρσ-ω",russian:"а-ик-щэ-я"},Ua={square:"■",disc:"•",circle:"◦",none:""},Va={formal:!1,digits:"零一二三四五六七八九",markers:"十百千",negative:"負"};function Ha(t,e){for(var n in t)e[n]=t[n].clone()}var za,Ga=function(){function t(){this.nsCount=0,this.nsPrefix={},this.tags={},this.nstags={},this.epubtypes={},this.classes={},this.ids={},this.pagetypes={},this.order=0}var e=t.prototype;return e.clone=function(){var e=new t;for(var n in e.nsCount=this.nsCount,this.nsPrefix)e.nsPrefix[n]=this.nsPrefix[n];return Ha(this.tags,e.tags),Ha(this.nstags,e.nstags),Ha(this.epubtypes,e.epubtypes),Ha(this.classes,e.classes),Ha(this.ids,e.ids),Ha(this.pagetypes,e.pagetypes),e.order=this.order,e},e.insertInTable=function(t,e,n){var i=t[e];i&&(n=i.mergeWith(n)),t[e]=n},e.createInstance=function(t,e,n,i){return new Xa(this,t,e,n,i)},e.nextOrder=function(){return this.order+=9.5367431640625e-7},t}(),Xa=function(){function t(t,e,n,i,r){this.context=void 0,this.counterListener=void 0,this.counterResolver=void 0,this.code=void 0,this.stack=[[],[]],this.conditions={},this.currentElement=null,this.currentElementOffset=null,this.currentStyle=null,this.currentClassNames=null,this.currentLocalName="",this.currentNamespace="",this.currentId="",this.currentXmlId="",this.currentNSTag="",this.currentEpubTypes=null,this.currentPageType=null,this.previousPageType=null,this.firstPageType=null,this.isFirst=!0,this.isRoot=!0,this.counters={},this.counterScoping=[{}],this.quotes=void 0,this.quoteDepth=0,this.lang="",this.siblingOrderStack=[0],this.currentSiblingOrder=0,this.siblingTypeCountsStack=[{}],this.currentSiblingTypeCounts=void 0,this.currentFollowingSiblingOrder=null,this.followingSiblingOrderStack=void 0,this.followingSiblingTypeCountsStack=[{}],this.currentFollowingSiblingTypeCounts=void 0,this.viewConditions={},this.dependentConditions=[],this.elementStack=void 0,this.context=e,this.counterListener=n,this.counterResolver=i,this.code=t,this.quotes=[new Me("“"),new Me("”"),new Me("‘"),new Me("’")],this.currentSiblingTypeCounts=this.siblingTypeCountsStack[0],this.followingSiblingOrderStack=[this.currentFollowingSiblingOrder],this.currentFollowingSiblingTypeCounts=this.siblingTypeCountsStack[0]}var e=t.prototype;return e.pushConditionItem=function(t){this.stack[this.stack.length-1].push(t)},e.increment=function(t,e){this.conditions[t]=(this.conditions[t]||0)+1,e&&(this.viewConditions[t]?this.viewConditions[t].push(e):this.viewConditions[t]=[e])},e.decrement=function(t,e){this.conditions[t]--,this.viewConditions[t]&&(this.viewConditions[t]=this.viewConditions[t].filter((function(t){return t!==e})),0===this.viewConditions[t].length&&delete this.viewConditions[t])},e.buildViewConditionMatcher=function(t){var e=this,n=null;t&&(n=Gr.buildViewConditionMatcher(this.currentElementOffset,t));var i=this.dependentConditions.map((function(t){var n=e.viewConditions[t];return n&&n.length>0?1===n.length?n[0]:Gr.buildAnyMatcher([].concat(n)):null})).filter((function(t){return t}));return i.length<=0?n:null===n?1===i.length?i[0]:Gr.buildAllMatcher(i):Gr.buildAllMatcher([n].concat(i))},e.applyAction=function(t,e){var n=t[e];n&&n.apply(this)},e.pushRule=function(t,e,n){this.currentElement=null,this.currentElementOffset=null,this.currentStyle=n,this.currentNamespace="",this.currentLocalName="",this.currentId="",this.currentXmlId="",this.currentClassNames=t,this.currentNSTag="",this.currentEpubTypes=Wa,this.currentPageType=e,this.applyActions()},e.defineCounter=function(t,e){this.counters[t]?this.counters[t].push(e):this.counters[t]=[e];var n=this.counterScoping[this.counterScoping.length-1];n||(this.counterScoping[this.counterScoping.length-1]=n={}),n[t]=!0},e.pushCounters=function(t){var e,n=en.inline,i=t.display;i&&(n=i.evaluate(this.context));var r=en.inline,o=t.float;o&&(r=o.evaluate(this.context));var a=null,s=null,u=null,l=t["counter-reset"];if(l){var h=l.evaluate(this.context);h&&(a=_n(h,!0))}var c=t["counter-set"];if(c){var d=c.evaluate(this.context);d&&(u=_n(d,!1))}var f,p,g,v,m=t["counter-increment"];if(m){var E=m.evaluate(this.context);E&&(s=_n(E,!1))}if("ol"!=this.currentLocalName&&"ul"!=this.currentLocalName||this.currentNamespace!=G.XHTML||(a||(a={}),a["ua-list-item"]=(null!=(f=null==(p=this.currentElement)?void 0:p.start)?f:1)-1),n===en.list_item&&(s||(s={}),s["ua-list-item"]=1,/^\s*[-+]?\d/.test(null!=(g=null==(v=this.currentElement)?void 0:v.getAttribute("value"))?g:"")&&(a||(a={}),a["ua-list-item"]=this.currentElement.value-1)),(null==(e=this.currentElement)?void 0:e.parentNode.nodeType)===Node.DOCUMENT_NODE&&(a||(a={}),void 0===a.footnote&&(a.footnote=0)),r===en.footnote&&(s||(s={}),void 0===s.footnote)){var C,D,w=null==(C=this.currentStyle["counter-increment"])?void 0:C.value;w&&(w===en.footnote||null!=(D=w.values)&&D.includes(en.footnote))||(s.footnote=1)}if(a)for(var y in a)this.defineCounter(y,a[y]);if(u)for(var N in u)if(this.counters[N]){var b=this.counters[N];b[b.length-1]=u[N]}else this.defineCounter(N,u[N]);if(s)for(var S in s){this.counters[S]||this.defineCounter(S,0);var A=this.counters[S];A[A.length-1]+=s[S]}if(n===en.list_item){var T=this.counters["ua-list-item"];t["ua-list-item-count"]=new Lo(new Ge(T[T.length-1]),0)}this.counterScoping.push(null)},e.popCounters=function(){var t=this.counterScoping.pop();if(t)for(var e in t){var n=this.counters[e];n&&(1==n.length?delete this.counters[e]:n.pop())}},e.setNamedStrings=function(t){var e=t["string-set"];if(e){for(var n,i=B((e=e.filterValue(new Ba(this,this.currentElement,this.counterResolver))).value instanceof Qe?e.value.values:[e.value]);!(n=i()).done;){var r=n.value;if(r instanceof qe){var o=r.values[0].stringValue(),a=r.values.slice(1).map((function(t){return ka(t)})).join("");this.counterResolver.setNamedString(o,a,this)}}delete t["string-set"]}},e.processPseudoelementProps=function(t,e){this.pushCounters(t),t.content&&(t.content=t.content.filterValue(new Ba(this,e,this.counterResolver))),this.popCounters()},e.pushElement=function(t,e,n){var i=this;this.currentPageType=null,this.currentElement=t,this.currentElementOffset=n,this.currentStyle=e,this.currentNamespace=t.namespaceURI,this.currentLocalName=t.localName;var r=this.code.nsPrefix[this.currentNamespace];this.currentNSTag=r?r+this.currentLocalName:"",this.currentId=t.getAttribute("id"),this.currentXmlId=t.getAttributeNS(G.XML,"id");var o=t.getAttribute("class");this.currentClassNames=o?o.split(/\s+/):Wa;var a=t.getAttributeNS(G.epub,"type");this.currentEpubTypes=a?a.split(/\s+/):Wa;var s=nt(t);s&&(this.stack[this.stack.length-1].push(new Ra(this.lang)),this.lang=s.toLowerCase());var u=this.isRoot,l=this.siblingOrderStack;this.currentSiblingOrder=++l[l.length-1],l.push(0);var h=this.siblingTypeCountsStack,c=this.currentSiblingTypeCounts=h[h.length-1],d=c[this.currentNamespace];d||(d=c[this.currentNamespace]={}),d[this.currentLocalName]=(d[this.currentLocalName]||0)+1,h.push({});var f=this.followingSiblingOrderStack;this.currentFollowingSiblingOrder=null!==f[f.length-1]?--f[f.length-1]:null,f.push(null);var p=this.followingSiblingTypeCountsStack,g=this.currentFollowingSiblingTypeCounts=p[p.length-1];g&&g[this.currentNamespace]&&g[this.currentNamespace][this.currentLocalName]--,p.push({}),this.applyActions(),this.applyAttrFilter(t);var v=e.quotes,m=null;if(v){var E=v.evaluate(this.context);E&&(m=new La(this.quotes),E===en.none?this.quotes=[new Me(""),new Me("")]:E instanceof qe&&(this.quotes=E.values))}this.pushCounters(this.currentStyle);var C=this.currentId||this.currentXmlId||t.getAttribute("name")||"";if(u||C){var D={};Object.keys(this.counters).forEach((function(t){D[t]=Array.from(i.counters[t])})),this.counterListener.countersOfId(C,D)}var w=Ho(this.currentStyle,"_pseudos");if(w)for(var y,N=!0,b=B(ja);!(y=b()).done;){var S=y.value;S||(N=!1);var A=w[S];A&&(N?this.processPseudoelementProps(A,t):this.stack[this.stack.length-2].push(new Pa(A,t)))}this.setNamedStrings(this.currentStyle),m&&this.stack[this.stack.length-2].push(m)},e.applyAttrFilterInner=function(t,e){for(var n in e)_o(n)&&(e[n]=e[n].filterValue(t))},e.applyAttrFilter=function(t){var e=new Oa(t),n=this.currentStyle,i=Ho(n,"_pseudos");for(var r in i)this.applyAttrFilterInner(e,i[r]);this.applyAttrFilterInner(e,n)},e.applyActions=function(){var t;for(t=0;t<this.currentClassNames.length;t++)this.applyAction(this.code.classes,this.currentClassNames[t]);for(t=0;t<this.currentEpubTypes.length;t++)this.applyAction(this.code.epubtypes,this.currentEpubTypes[t]);this.applyAction(this.code.ids,this.currentId),this.applyAction(this.code.tags,this.currentLocalName),""!=this.currentLocalName&&this.applyAction(this.code.tags,"*"),this.applyAction(this.code.nstags,this.currentNSTag),null!==this.currentPageType&&(this.applyAction(this.code.pagetypes,this.currentPageType),this.applyAction(this.code.pagetypes,"*")),this.stack.push([]);for(var e=1;e>=-1;--e){var n=this.stack[this.stack.length-e-2];for(t=0;t<n.length;)n[t].push(this,e)?n.splice(t,1):t++}this.isFirst=!0,this.isRoot=!1},e.pop=function(){for(var t=1;t>=-1;--t)for(var e=this.stack[this.stack.length-t-2],n=0;n<e.length;)e[n].pop(this,t)?e.splice(n,1):n++;this.stack.pop(),this.isFirst=!1},e.popRule=function(){this.pop()},e.popElement=function(t){this.siblingOrderStack.pop(),this.siblingTypeCountsStack.pop(),this.followingSiblingOrderStack.pop(),this.followingSiblingTypeCountsStack.pop(),this.pop(),this.popCounters()},t}(),Wa=[],ja=["before","transclusion-before","footnote-call","footnote-marker","inner","first-letter","first-line","","transclusion-after","after"];!function(t){t[t.TOP=0]="TOP",t[t.SELECTOR=1]="SELECTOR",t[t.RULE=2]="RULE"}(za||(za={}));var Ka=null,Ya=function(t){function e(e,n,i,r,o,a,s){var u;return(u=t.call(this,e,n,s)||this).condition=void 0,u.regionId=void 0,u.validatorSet=void 0,u.chain=null,u.specificity=0,u.elementStyle=null,u.conditionCount=0,u.pseudoelement=null,u.footnoteContent=!1,u.cascade=void 0,u.state=void 0,u.viewConditionId=null,u.insideSelectorRule=void 0,u.condition=i,u.regionId=o,u.validatorSet=a,u.cascade=r?r.cascade:Ka?Ka.clone():new Ga,u.state=za.TOP,u}x(e,t);var n=e.prototype;return n.insertNonPrimary=function(t){this.cascade.insertInTable(this.cascade.tags,"*",t)},n.processChain=function(t){var e=Ko(this.chain,t);e!==t&&e.makePrimary(this.cascade)||this.insertNonPrimary(e)},n.isInsideSelectorRule=function(t){return this.state!=za.TOP&&(this.reportAndSkip(t),!0)},n.tagSelector=function(t,e){(e||t)&&(this.specificity+=1,this.chain.push(e&&t?new ra(t,e.toLowerCase()):e?new ia(e.toLowerCase()):new aa(t)))},n.classSelector=function(t){if(this.pseudoelement)return c.warn("::"+this.pseudoelement,"followed by ."+t),void this.chain.push(new Na(""));this.specificity+=256,this.chain.push(new ea(t))},n.pseudoclassSelector=function(t,e){if(this.pseudoelement)return c.warn("::"+this.pseudoelement,"followed by :"+t),void this.chain.push(new Na(""));switch(t.toLowerCase()){case"enabled":this.chain.push(new Da);break;case"disabled":this.chain.push(new wa);break;case"checked":this.chain.push(new ya);break;case"root":this.chain.push(new fa);break;case"link":this.chain.push(new ia("a")),this.chain.push(new sa("","href"));break;case"-adapt-href-epub-type":case"href-epub-type":if(e&&1==e.length&&"string"==typeof e[0]){var n=new RegExp("(^|s)"+ht(e[0])+"($|s)");this.chain.push(new oa(n))}else this.chain.push(new Na(""));break;case"-adapt-footnote-content":case"footnote-content":this.footnoteContent=!0;break;case"visited":case"active":case"hover":case"focus":this.chain.push(new Na(""));break;case"lang":this.chain.push(e&&1==e.length&&"string"==typeof e[0]?new ca(new RegExp("^"+ht(e[0].toLowerCase())+"($|-)")):new Na(""));break;case"nth-child":case"nth-last-child":case"nth-of-type":case"nth-last-of-type":var i=qa[t.toLowerCase()];this.chain.push(e&&2==e.length?new i(e[0],e[1]):new Na(""));break;case"first-child":this.chain.push(new da);break;case"last-child":this.chain.push(new ma(0,1));break;case"first-of-type":this.chain.push(new va(0,1));break;case"last-of-type":this.chain.push(new Ea(0,1));break;case"only-child":this.chain.push(new da),this.chain.push(new ma(0,1));break;case"only-of-type":this.chain.push(new va(0,1)),this.chain.push(new Ea(0,1));break;case"empty":this.chain.push(new Ca);break;case"before":case"after":case"first-line":case"first-letter":return void this.pseudoelementSelector(t,e);default:c.warn("unknown pseudo-class selector: "+t),this.chain.push(new Na(""))}this.specificity+=256},n.pseudoelementSelector=function(t,e){switch(t){case"before":case"after":case"first-line":case"first-letter":case"footnote-call":case"footnote-marker":case"inner":case"after-if-continues":this.pseudoelement?(c.warn("Double pseudoelement ::"+this.pseudoelement+"::"+t),this.chain.push(new Na(""))):this.pseudoelement=t;break;case"first-n-lines":if(e&&1==e.length&&"number"==typeof e[0]){var n=Math.round(e[0]);if(n>0&&n==e[0]){this.pseudoelement?(c.warn("Double pseudoelement ::"+this.pseudoelement+"::"+t),this.chain.push(new Na(""))):this.pseudoelement="first-"+n+"-lines";break}}this.chain.push(new Na(""));break;case"nth-fragment":e&&2==e.length?this.viewConditionId="NFS_"+e[0]+"_"+e[1]:this.chain.push(new Na(""));break;default:c.warn("Unrecognized pseudoelement: ::"+t),this.chain.push(new Na(""))}this.specificity+=1},n.idSelector=function(t){this.specificity+=65536,this.chain.push(new na(t))},n.attributeSelector=function(t,e,n,i){var r;switch(this.specificity+=256,e=e.toLowerCase(),i=i||"",n){case Vn.EOF:r=new sa(t,e);break;case Vn.EQ:r=new ua(t,e,i);break;case Vn.TILDE_EQ:r=!i||i.match(/\s/)?new Na(""):new ha(t,e,new RegExp("(^|\\s)"+ht(i)+"($|\\s)"));break;case Vn.BAR_EQ:r=new ha(t,e,new RegExp("^"+ht(i)+"($|-)"));break;case Vn.HAT_EQ:r=i?new ha(t,e,new RegExp("^"+ht(i))):new Na("");break;case Vn.DOLLAR_EQ:r=i?new ha(t,e,new RegExp(ht(i)+"$")):new Na("");break;case Vn.STAR_EQ:r=i?new ha(t,e,new RegExp(ht(i))):new Na("");break;case Vn.COL_COL:"supported"==i?r=new la(t,e):(c.warn("Unsupported :: attr selector op:",i),r=new Na(""));break;default:c.warn("Unsupported attr selector:",n),r=new Na("")}this.chain.push(r)},n.descendantSelector=function(){var t="d"+Qa++;this.processChain(new $o(new Ta(t,this.viewConditionId,null))),this.chain=[new Na(t)],this.viewConditionId=null},n.childSelector=function(){var t="c"+Qa++;this.processChain(new $o(new xa(t,this.viewConditionId,null))),this.chain=[new Na(t)],this.viewConditionId=null},n.adjacentSiblingSelector=function(){var t="a"+Qa++;this.processChain(new $o(new Ia(t,this.viewConditionId,null))),this.chain=[new Na(t)],this.viewConditionId=null},n.followingSiblingSelector=function(){var t="f"+Qa++;this.processChain(new $o(new Fa(t,this.viewConditionId,null))),this.chain=[new Na(t)],this.viewConditionId=null},n.nextSelector=function(){this.finishChain(),this.pseudoelement=null,this.footnoteContent=!1,this.specificity=0,this.chain=[]},n.startSelectorRule=function(){this.isInsideSelectorRule("E_CSS_UNEXPECTED_SELECTOR")||(this.state=za.SELECTOR,this.elementStyle={},this.pseudoelement=null,this.specificity=0,this.footnoteContent=!1,this.chain=[])},n.error=function(e,n){t.prototype.error.call(this,e,n),this.state==za.SELECTOR&&(this.state=za.TOP)},n.startStylesheet=function(e){t.prototype.startStylesheet.call(this,e),this.state=za.TOP},n.startRuleBody=function(){this.finishChain(),t.prototype.startRuleBody.call(this),this.state==za.SELECTOR&&(this.state=za.TOP)},n.endRule=function(){t.prototype.endRule.call(this),this.insideSelectorRule=za.TOP},n.finishChain=function(){if(this.chain){var t=this.specificity+this.cascade.nextOrder();this.processChain(this.makeApplyRuleAction(t)),this.chain=null,this.pseudoelement=null,this.viewConditionId=null,this.footnoteContent=!1,this.specificity=0}},n.makeApplyRuleAction=function(t){var e=this.regionId;return this.footnoteContent&&(e=e?"xxx-bogus-xxx":"footnote"),new Jo(this.elementStyle,t,this.pseudoelement,e,this.viewConditionId)},n.special=function(t,e){var n;n=this.condition?new Oo(e,0,this.condition):new Lo(e,0),Wo(this.elementStyle,t).push(n)},n.property=function(t,e,n){this.validatorSet.validatePropertyAndHandleShorthand(t,e,n,this)},n.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},n.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},n.simpleProperty=function(t,e,n){"display"!=t||e!==en.oeb_page_head&&e!==en.oeb_page_foot||(this.simpleProperty("flow-options",new qe([en.exclusive,en._static]),n),this.simpleProperty("flow-into",e,n),e=en.block),v("SIMPLE_PROPERTY").forEach((function(i){var r=i({name:t,value:e,important:n});t=r.name,e=r.value,n=r.important}));var i=n?this.getImportantSpecificity():this.getBaseSpecificity(),r=this.condition?new Oo(e,i,this.condition):new Lo(e,i);Vo(this.elementStyle,t,r)},n.finish=function(){return this.cascade},n.startFuncWithSelector=function(t){if("not"===t){var e=new $a(this);e.startSelectorRule(),this.owner.pushHandler(e)}},e}(ur),qa={"nth-child":ga,"nth-of-type":va,"nth-last-child":ma,"nth-last-of-type":Ea},Qa=0,$a=function(t){function e(e){var n;return(n=t.call(this,e.scope,e.owner,e.condition,e,e.regionId,e.validatorSet,!1)||this).parent=void 0,n.parentChain=void 0,n.parent=e,n.parentChain=e.chain,n}x(e,t);var n=e.prototype;return n.startFuncWithSelector=function(t){"not"==t&&this.reportAndSkip("E_CSS_UNEXPECTED_NOT")},n.startRuleBody=function(){this.reportAndSkip("E_CSS_UNEXPECTED_RULE_BODY")},n.nextSelector=function(){this.reportAndSkip("E_CSS_UNEXPECTED_NEXT_SELECTOR")},n.endFuncWithSelector=function(){this.chain&&this.chain.length>0&&this.parentChain.push(new Sa(this.chain)),this.parent.specificity+=this.specificity,this.owner.popHandler()},n.error=function(e,n){t.prototype.error.call(this,e,n),this.owner.popHandler()},e}(Ya),Za=function(t){function e(e,n){return t.call(this,e,n,!1)||this}return x(e,t),e.prototype.property=function(t,e,n){if(this.scope.values[t])this.error("E_CSS_NAME_REDEFINED "+t,this.getCurrentToken());else{var i=t.match(/height|^(top|bottom)$/)?"vh":"vw",r=new ve(this.scope,100,i);this.scope.defineName(t,e.toExpr(this.scope,r))}},e}(ur),Ja=function(t){function e(e,n,i,r,o){var a;return(a=t.call(this,e,n,!1)||this).condition=void 0,a.elementStyle=void 0,a.validatorSet=void 0,a.order=void 0,a.condition=i,a.elementStyle=r,a.validatorSet=o,a.order=0,a}x(e,t);var n=e.prototype;return n.property=function(t,e,n){n?c.warn("E_IMPORTANT_NOT_ALLOWED"):this.validatorSet.validatePropertyAndHandleShorthand(t,e,n,this)},n.invalidPropertyValue=function(t,e){c.warn("E_INVALID_PROPERTY_VALUE",t+":",e.toString())},n.unknownProperty=function(t,e){c.warn("E_INVALID_PROPERTY",t+":",e.toString())},n.simpleProperty=function(t,e,n){var i=n?this.getImportantSpecificity():this.getBaseSpecificity();i+=this.order,this.order+=9.5367431640625e-7;var r=this.condition?new Oo(e,i,this.condition):new Lo(e,i);Vo(this.elementStyle,t,r)},e}(ur),ts=function(t){function e(e,n){var i;return(i=t.call(this,e)||this).validatorSet=void 0,i.elementStyle={},i.order=0,i.validatorSet=n,i}x(e,t);var n=e.prototype;return n.property=function(t,e,n){this.validatorSet.validatePropertyAndHandleShorthand(t,e,n,this)},n.invalidPropertyValue=function(t,e){c.warn("E_INVALID_PROPERTY_VALUE",t+":",e.toString())},n.unknownProperty=function(t,e){c.warn("E_INVALID_PROPERTY",t+":",e.toString())},n.simpleProperty=function(t,e,n){var i=n?67108864:50331648;i+=this.order,this.order+=9.5367431640625e-7;var r=new Lo(e,i);Vo(this.elementStyle,t,r)},e}(Tr);function es(t,e){var n=Go(t);n&&n.forEach((function(t){t.matcher.matches()&&e(t.styles)}))}function ns(t,e,n){es(n,(function(n){ss(t,n,e)}))}function is(t,e,n){var i=t["writing-mode"];if(i){var r=i.evaluate(e,"writing-mode");if(r&&r!==en.inherit)return r===en.vertical_rl}return n}function rs(t,e,n){var i=t.direction;if(i){var r=i.evaluate(e,"direction");if(r&&r!==en.inherit)return r===en.rtl}return n}function os(t,e,n,i,r){var o={};for(var a in t)_o(a)&&(o[a]=Uo(t,a));return ns(o,e,t),as(t,n,i,(function(t,n){ss(o,n,e),ns(o,e,n)})),o}function as(t,e,n,i){var r=Ho(t,"_regions");if((e||n)&&r){if(n){var o=["footnote"];e=e?e.concat(o):o}for(var a,s=B(e);!(a=s()).done;){var u=a.value,l=r[u];l&&i(u,l)}}}function ss(t,e,n){for(var i in e)if(_o(i)){var r=Uo(e,i);t[i]=ko(n,t[i],r)}}var us=function(t,e,n,i,r){var o=n?i?Po:Io:i?Ro:Fo;for(var a in t)if(t.hasOwnProperty(a)){var s=t[a];if(!s)continue;var u=o[a],l=void 0;if(u){var h=t[u];if(h&&h.priority>s.priority)continue;l=To[u]?u:a}else l=a;e[l]=r(a,s)}};function ls(t,e){var n={};return Object.keys(t).forEach((function(i){var r=n[i]={},o=t[i];Object.keys(o).forEach((function(t){r[t]=o[t].map((function(t){var n=e?t.physical:t.logical;return{regexp:new RegExp("(-?)"+(e?t.logical:t.physical)+"(-?)"),to:"$1"+n+"$2"}}))}))})),n}function hs(t,e,n,i){var r=i[e];if(!r)throw new Error("unknown writing-mode: "+e);var o=r[n||"ltr"];if(!o)throw new Error("unknown direction: "+n);for(var a,s=B(o);!(a=s()).done;){var u=a.value,l=t.replace(u.regexp,u.to);if(l!==t)return l}return t}var cs={"horizontal-tb":{ltr:[{logical:"inline-start",physical:"left"},{logical:"inline-end",physical:"right"},{logical:"block-start",physical:"top"},{logical:"block-end",physical:"bottom"},{logical:"inline-size",physical:"width"},{logical:"block-size",physical:"height"}],rtl:[{logical:"inline-start",physical:"right"},{logical:"inline-end",physical:"left"},{logical:"block-start",physical:"top"},{logical:"block-end",physical:"bottom"},{logical:"inline-size",physical:"width"},{logical:"block-size",physical:"height"}]},"vertical-rl":{ltr:[{logical:"inline-start",physical:"top"},{logical:"inline-end",physical:"bottom"},{logical:"block-start",physical:"right"},{logical:"block-end",physical:"left"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}],rtl:[{logical:"inline-start",physical:"bottom"},{logical:"inline-end",physical:"top"},{logical:"block-start",physical:"right"},{logical:"block-end",physical:"left"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}]},"vertical-lr":{ltr:[{logical:"inline-start",physical:"top"},{logical:"inline-end",physical:"bottom"},{logical:"block-start",physical:"left"},{logical:"block-end",physical:"right"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}],rtl:[{logical:"inline-start",physical:"bottom"},{logical:"inline-end",physical:"top"},{logical:"block-start",physical:"left"},{logical:"block-end",physical:"right"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}]}},ds=ls(cs,!0);function fs(t,e,n){return hs(t,e,n||null,ds)}var ps=ls(cs,!1);function gs(t,e,n){return hs(t,e,n||null,ps)}var vs,ms={"horizontal-tb":[{logical:"line-left",physical:"left"},{logical:"line-right",physical:"right"},{logical:"over",physical:"top"},{logical:"under",physical:"bottom"}],"vertical-rl":[{logical:"line-left",physical:"top"},{logical:"line-right",physical:"bottom"},{logical:"over",physical:"right"},{logical:"under",physical:"left"}],"vertical-lr":[{logical:"line-left",physical:"top"},{logical:"line-right",physical:"bottom"},{logical:"over",physical:"right"},{logical:"under",physical:"left"}]};function Es(t,e,n){var i={display:e.style.display,position:e.style.position,width:e.style.width,maxWidth:e.style.maxWidth,minWidth:e.style.minWidth,height:e.style.height,maxHeight:e.style.maxHeight,minHeight:e.style.minHeight},r=e.parentNode,o=e.ownerDocument.createElement("div");function a(n){return t.getElementComputedStyle(e).getPropertyValue(n)}tt(o,"position",i.position),r.insertBefore(o,e),o.appendChild(e),tt(e,"width","auto"),tt(e,"max-width","none"),tt(e,"min-width","0"),tt(e,"height","auto"),tt(e,"max-height","none"),tt(e,"min-height","0");var s=J("writing-mode"),u=(s?a(s[0]):null)||a("writing-mode"),l="vertical-rl"===u||"tb-rl"===u||"vertical-lr"===u||"tb-lr"===u,h=l?"height":"width",c=l?"width":"height";function d(){return tt(e,"display","block"),tt(e,"position","static"),a(h)}function f(){tt(e,"display","inline-block"),tt(o,h,"99999999px");var t=a(h);return tt(o,h,""),t}function p(){tt(e,"display","inline-block"),tt(o,h,"0");var t=a(h);return tt(o,h,""),t}function g(){var t=d(),e=p(),n=parseFloat(t);if(n<=parseFloat(e))return e;var i=f();return n<=parseFloat(i)?t:i}function v(){return a(c)}function m(){throw new Error("Getting fill-available block size is not implemented")}var E={};return n.forEach((function(t){var n;switch(t){case vs.FILL_AVAILABLE_INLINE_SIZE:n=d();break;case vs.MAX_CONTENT_INLINE_SIZE:n=f();break;case vs.MIN_CONTENT_INLINE_SIZE:n=p();break;case vs.FIT_CONTENT_INLINE_SIZE:n=g();break;case vs.FILL_AVAILABLE_BLOCK_SIZE:n=m();break;case vs.MAX_CONTENT_BLOCK_SIZE:case vs.MIN_CONTENT_BLOCK_SIZE:case vs.FIT_CONTENT_BLOCK_SIZE:n=v();break;case vs.FILL_AVAILABLE_WIDTH:n=l?m():d();break;case vs.FILL_AVAILABLE_HEIGHT:n=l?d():m();break;case vs.MAX_CONTENT_WIDTH:n=l?v():f();break;case vs.MAX_CONTENT_HEIGHT:n=l?f():v();break;case vs.MIN_CONTENT_WIDTH:n=l?v():p();break;case vs.MIN_CONTENT_HEIGHT:n=l?p():v();break;case vs.FIT_CONTENT_WIDTH:n=l?v():g();break;case vs.FIT_CONTENT_HEIGHT:n=l?g():v()}E[t]=parseFloat(n),tt(e,"position",i.position),tt(e,"display",i.display)})),tt(e,"width",i.width),tt(e,"max-width",i.maxWidth),tt(e,"min-width",i.minWidth),tt(e,"height",i.height),tt(e,"max-height",i.maxHeight),tt(e,"min-height",i.minHeight),r.insertBefore(e,o),r.removeChild(o),E}!function(t){t.FILL_AVAILABLE_INLINE_SIZE="fill-available inline size",t.FILL_AVAILABLE_BLOCK_SIZE="fill-available block size",t.FILL_AVAILABLE_WIDTH="fill-available width",t.FILL_AVAILABLE_HEIGHT="fill-available height",t.MAX_CONTENT_INLINE_SIZE="max-content inline size",t.MAX_CONTENT_BLOCK_SIZE="max-content block size",t.MAX_CONTENT_WIDTH="max-content width",t.MAX_CONTENT_HEIGHT="max-content height",t.MIN_CONTENT_INLINE_SIZE="min-content inline size",t.MIN_CONTENT_BLOCK_SIZE="min-content block size",t.MIN_CONTENT_WIDTH="min-content width",t.MIN_CONTENT_HEIGHT="min-content height",t.FIT_CONTENT_INLINE_SIZE="fit-content inline size",t.FIT_CONTENT_BLOCK_SIZE="fit-content block size",t.FIT_CONTENT_WIDTH="fit-content width",t.FIT_CONTENT_HEIGHT="fit-content height"}(vs||(vs={}));var Cs=Mr.FloatReference;function Ds(t){switch(t){case Cs.INLINE:return!1;case Cs.COLUMN:case Cs.REGION:case Cs.PAGE:return!0;default:throw new Error("Unknown float-reference: "+t)}}var ws=function(){function t(t,e,n,i,r,o){this.nodePosition=void 0,this.floatReference=void 0,this.floatSide=void 0,this.clearSide=void 0,this.flowName=void 0,this.floatMinWrapBlock=void 0,this.order=null,this.id=null,this.nodePosition=t,this.floatReference=e,this.floatSide=n,this.clearSide=i,this.flowName=r,this.floatMinWrapBlock=o}var e=t.prototype;return e.getOrder=function(){if(null===this.order)throw new Error("The page float is not yet added");return this.order},e.getId=function(){if(!this.id)throw new Error("The page float is not yet added");return this.id},e.isAllowedOnContext=function(t){return t.isAnchorAlreadyAppeared(this.getId())},e.isAllowedToPrecede=function(t){return!1},t}(),ys=function(){function t(){this.floats=[],this.nextPageFloatIndex=0}var e=t.prototype;return e.nextOrder=function(){return this.nextPageFloatIndex++},e.createPageFloatId=function(t){return"pf"+t},e.addPageFloat=function(t){if(this.floats.findIndex((function(e){return ao(e.nodePosition,t.nodePosition)}))>=0)throw new Error("A page float with the same source node is already registered");var e=t.order=this.nextOrder();t.id=this.createPageFloatId(e),this.floats.push(t)},e.findPageFloatByNodePosition=function(t){var e=this.floats.findIndex((function(e){return ao(e.nodePosition,t)}));return e>=0?this.floats[e]:null},e.findPageFloatById=function(t){var e=this.floats.findIndex((function(e){return e.id===t}));return e>=0?this.floats[e]:null},t}(),Ns=function(){function t(t,e,n,i,r){this.floatReference=void 0,this.floatSide=void 0,this.continuations=void 0,this.area=void 0,this.continues=void 0,this.floatReference=t,this.floatSide=e,this.continuations=n,this.area=i,this.continues=r}var e=t.prototype;return e.hasFloat=function(t){return this.continuations.some((function(e){return e.float===t}))},e.findNotAllowedFloat=function(t){for(var e=this.continuations.length-1;e>=0;e--){var n=this.continuations[e].float;if(!n.isAllowedOnContext(t))return n}return null},e.getOuterShape=function(){return this.area.getOuterShape(null,null)},e.getOuterRect=function(){return this.area.getOuterRect()},e.getOrder=function(){var t=this.continuations.map((function(t){return t.float}));return Math.min.apply(null,t.map((function(t){return t.getOrder()})))},e.shouldBeStashedBefore=function(t){return this.getOrder()<t.getOrder()},e.addContinuations=function(t){var e=this;t.forEach((function(t){e.continuations.push(t)}))},e.getFlowName=function(){var t=this.continuations[0].float.flowName;return this.continuations.every((function(e){return e.float.flowName===t})),t},t}(),bs=function(){function t(t,e){this.float=void 0,this.nodePosition=void 0,this.float=t,this.nodePosition=e}return t.prototype.equals=function(t){return!!t&&(this===t||this.float===t.float&&ao(this.nodePosition,t.nodePosition))},t}(),Ss=function(){function t(t,e,n,i,r,o,a){this.parent=void 0,this.floatReference=void 0,this.container=void 0,this.flowName=void 0,this.generatingNodePosition=void 0,this.children=[],this.writingMode=void 0,this.direction=void 0,this.invalidated=!1,this.floatStore=void 0,this.forbiddenFloats=[],this.floatFragments=[],this.stashedFloatFragments=[],this.floatAnchors={},this.floatsDeferredToNext=[],this.floatsDeferredFromPrevious=void 0,this.layoutConstraints=[],this.locked=!1,this.parent=t,this.floatReference=e,this.container=n,this.flowName=i,this.generatingNodePosition=r,t&&t.children.push(this),this.writingMode=o||t&&t.writingMode||en.horizontal_tb,this.direction=a||t&&t.direction||en.ltr,this.floatStore=t?t.floatStore:new ys;var s=this.getPreviousSibling();this.floatsDeferredFromPrevious=s?[].concat(s.floatsDeferredToNext):[]}var e=t.prototype;return e.getParent=function(t){if(!this.parent)throw new Error("No PageFloatLayoutContext for "+t);return this.parent},e.getPreviousSiblingOf=function(t,e,n,i){var r=this.children.indexOf(t);r<0&&(r=this.children.length);for(var o=r-1;o>=0;o--){var a=this.children[o];if(a.floatReference===e&&a.flowName===n&&ao(a.generatingNodePosition,i))return a;if(a=a.getPreviousSiblingOf(null,e,n,i))return a}return null},e.getPreviousSibling=function(){for(var t,e=this,n=this.parent;n;){if(t=n.getPreviousSiblingOf(e,this.floatReference,this.flowName,this.generatingNodePosition))return t;e=n,n=n.parent}return null},e.getContainer=function(t){return t&&t!==this.floatReference?this.getParent(t).getContainer(t):this.container},e.setContainer=function(t){this.container=t,this.reattachFloatFragments()},e.addPageFloat=function(t){this.floatStore.addPageFloat(t)},e.getPageFloatLayoutContext=function(t){return t===this.floatReference?this:this.getParent(t).getPageFloatLayoutContext(t)},e.findPageFloatByNodePosition=function(t){return this.floatStore.findPageFloatByNodePosition(t)},e.forbid=function(t){var e=t.getId(),n=t.floatReference;n===this.floatReference?this.forbiddenFloats.includes(e)||(this.forbiddenFloats.push(e),(new Ts).findByFloat(t).forbid(t,this)):this.getParent(n).forbid(t)},e.isForbidden=function(t){var e=t.getId(),n=t.floatReference;return n===this.floatReference?this.forbiddenFloats.includes(e):this.getParent(n).isForbidden(t)},e.addPageFloatFragment=function(t,e){var n=t.floatReference;n!==this.floatReference?this.getParent(n).addPageFloatFragment(t,e):this.floatFragments.includes(t)||(this.floatFragments.push(t),this.floatFragments.sort((function(t,e){return t.getOrder()-e.getOrder()}))),e||this.invalidate()},e.removePageFloatFragment=function(t,e){var n=t.floatReference;if(n!==this.floatReference)this.getParent(n).removePageFloatFragment(t,e);else{var i=this.floatFragments.indexOf(t);if(i>=0){var r=this.floatFragments.splice(i,1)[0],o=r.area&&r.area.element;o&&o.parentNode&&o.parentNode.removeChild(o),e||this.invalidate()}}},e.findPageFloatFragment=function(t){if(t.floatReference!==this.floatReference)return this.getParent(t.floatReference).findPageFloatFragment(t);var e=this.floatFragments.findIndex((function(e){return e.hasFloat(t)}));return e>=0?this.floatFragments[e]:null},e.hasFloatFragments=function(t){return!(!(this.floatFragments.length>0)||t&&!this.floatFragments.some(t))||!!this.parent&&this.parent.hasFloatFragments(t)},e.hasContinuingFloatFragmentsInFlow=function(t){return this.hasFloatFragments((function(e){return e.continues&&e.getFlowName()===t}))},e.registerPageFloatAnchor=function(t,e){this.floatAnchors[t.getId()]=e},e.collectPageFloatAnchors=function(){var t=Object.assign({},this.floatAnchors);return this.children.reduce((function(t,e){return Object.assign(t,e.collectPageFloatAnchors())}),t)},e.isAnchorAlreadyAppeared=function(t){if(this.getDeferredPageFloatContinuations().some((function(e){return e.float.getId()===t})))return!0;var e=this.collectPageFloatAnchors()[t];return!!e&&!(!this.container||!this.container.element)&&this.container.element.contains(e)},e.deferPageFloat=function(t){var e=t.float;if(e.floatReference===this.floatReference){var n=this.floatsDeferredToNext.findIndex((function(t){return t.float===e}));n>=0?this.floatsDeferredToNext.splice(n,1,t):this.floatsDeferredToNext.push(t)}else this.getParent(e.floatReference).deferPageFloat(t)},e.hasPrecedingFloatsDeferredToNext=function(t,e){if(!e&&t.floatReference!==this.floatReference)return this.getParent(t.floatReference).hasPrecedingFloatsDeferredToNext(t,!1);var n=t.getOrder();return!!this.floatsDeferredToNext.some((function(e){return e.float.getOrder()<n&&!t.isAllowedToPrecede(e.float)}))||!!this.parent&&this.parent.hasPrecedingFloatsDeferredToNext(t,!0)},e.getLastFollowingFloatInFragments=function(t){var e=t.getOrder(),n=null;if(this.floatFragments.forEach((function(t){t.continuations.forEach((function(t){var i=t.float,r=i.getOrder();r>e&&(!n||r>n.getOrder())&&(n=i)}))})),this.parent){var i=this.parent.getLastFollowingFloatInFragments(t);i&&(!n||i.getOrder()>n.getOrder())&&(n=i)}return n},e.getDeferredPageFloatContinuations=function(t){t=t||this.flowName;var e=this.floatsDeferredFromPrevious.filter((function(e){return!t||e.float.flowName===t}));return this.parent&&(e=this.parent.getDeferredPageFloatContinuations(t).concat(e)),e.sort((function(t,e){return t.float.getOrder()-e.float.getOrder()}))},e.getPageFloatContinuationsDeferredToNext=function(t){t=t||this.flowName;var e=this.floatsDeferredToNext.filter((function(e){return!t||e.float.flowName===t}));return this.parent?this.parent.getPageFloatContinuationsDeferredToNext(t).concat(e):e},e.getFloatsDeferredToNextInChildContexts=function(){for(var t=[],e=[],n=this.children.length-1;n>=0;n--){var i=this.children[n];e.includes(i.flowName)||(e.push(i.flowName),t=(t=t.concat(i.floatsDeferredToNext.map((function(t){return t.float})))).concat(i.getFloatsDeferredToNextInChildContexts()))}return t},e.checkAndForbidNotAllowedFloat=function(){if(this.checkAndForbidFloatFollowingDeferredFloat())return!0;for(var t=this.floatFragments.length-1;t>=0;t--){var e=this.floatFragments[t],n=e.findNotAllowedFloat(this);if(n)return this.locked?this.invalidate():(this.removePageFloatFragment(e),this.forbid(n),this.removeEndFloatFragments(e.floatSide)),!0}return!(this.floatReference!==Cs.REGION||!this.parent.locked)&&this.parent.checkAndForbidNotAllowedFloat()},e.checkAndForbidFloatFollowingDeferredFloat=function(){var t=this,e=this.getFloatsDeferredToNextInChildContexts(),n=this.floatFragments.reduce((function(t,e){return t.concat(e.continuations.map((function(t){return t.float})))}),[]);n.sort((function(t,e){return e.getOrder()-t.getOrder()}));for(var i,r=function(){var n=i.value,r=n.getOrder();if(e.some((function(t){return!n.isAllowedToPrecede(t)&&r>t.getOrder()}))){if(t.locked)t.invalidate();else{t.forbid(n);var o=t.findPageFloatFragment(n);t.removePageFloatFragment(o)}return{v:!0}}},o=B(n);!(i=o()).done;){var a=r();if("object"==typeof a)return a.v}return!1},e.finish=function(){var t=this;if(!this.checkAndForbidNotAllowedFloat()){for(var e=this.floatsDeferredToNext.length-1;e>=0;e--)if(!this.floatsDeferredToNext[e].float.isAllowedOnContext(this)){if(this.locked)return void this.invalidate();this.floatsDeferredToNext.splice(e,1)}this.floatsDeferredFromPrevious.forEach((function(e){t.floatsDeferredToNext.findIndex((function(t){return e.equals(t)}))>=0||t.floatFragments.some((function(t){return t.hasFloat(e.float)}))||t.floatsDeferredToNext.push(e)}))}},e.hasSameContainerAs=function(t){return!!this.container&&!!t.container&&this.container.element===t.container.element},e.invalidate=function(){var t=this;this.invalidated=!0,this.locked||(this.container&&(this.children.forEach((function(e){t.hasSameContainerAs(e)&&e.floatFragments.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))})),this.container.clear()),this.children.forEach((function(t){t.layoutConstraints.splice(0)})),this.children.splice(0),Object.keys(this.floatAnchors).forEach((function(e){delete t.floatAnchors[e]})))},e.detachChildren=function(){var t=this.children.splice(0);return t.forEach((function(t){t.floatFragments.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))})),t},e.attachChildren=function(t){var e=this;t.forEach((function(t){e.children.push(t),t.reattachFloatFragments()}))},e.isInvalidated=function(){return this.invalidated||!!this.parent&&this.parent.isInvalidated()},e.validate=function(){this.invalidated=!1},e.toLogical=function(t){return gs(t,this.writingMode.toString(),this.direction.toString())},e.toPhysical=function(t){return fs(t,this.writingMode.toString(),this.direction.toString())},e.removeEndFloatFragments=function(t){var e=this.toLogical(t);if("block-end"===e||"inline-end"===e)for(var n=0;n<this.floatFragments.length;){var i=this.floatFragments[n];this.toLogical(i.floatSide)===e?this.removePageFloatFragment(i):n++}},e.stashEndFloatFragments=function(t){var e=t.floatReference;if(e===this.floatReference){var n=this.toLogical(t.floatSide);if("block-end"===n||"snap-block"===n||"inline-end"===n)for(var i=0;i<this.floatFragments.length;){var r=this.floatFragments[i],o=this.toLogical(r.floatSide);(o===n||"snap-block"===n&&"block-end"===o)&&r.shouldBeStashedBefore(t)?(this.stashedFloatFragments.push(r),this.floatFragments.splice(i,1)):i++}}else this.getParent(e).stashEndFloatFragments(t)},e.restoreStashedFragments=function(t){var e=this;t===this.floatReference?(this.stashedFloatFragments.forEach((function(t){e.addPageFloatFragment(t,!0)})),this.stashedFloatFragments.splice(0)):this.getParent(t).restoreStashedFragments(t)},e.discardStashedFragments=function(t){t===this.floatReference?this.stashedFloatFragments.splice(0):this.getParent(t).discardStashedFragments(t)},e.getStashedFloatFragments=function(t){return t===this.floatReference?this.stashedFloatFragments.concat().sort((function(t,e){return e.getOrder()-t.getOrder()})):this.getParent(t).getStashedFloatFragments(t)},e.getLimitValue=function(t,e,n,i){var r=this.toLogical(t),o=this.toPhysical(t),a=this.getLimitValueInner(r,e,n,i);if(this.parent&&this.parent.container){var s=this.parent.getLimitValue(o,e,n,i);switch(o){case"top":case"left":return Math.max(a,s);case"bottom":case"right":return Math.min(a,s)}}return a},e.getLimitValueInner=function(t,e,n,i){var r=this.getLimitValuesInner(e,n,i);switch(t){case"block-start":return this.container.vertical?r.right:r.top;case"block-end":return this.container.vertical?r.left:r.bottom;case"inline-start":return this.container.vertical?r.top:r.left;case"inline-end":return this.container.vertical?r.bottom:r.right;default:throw new Error("Unknown logical side: "+t)}},e.getLimitValuesInner=function(t,e,n){var i=this,r=this.container.originX,o=this.container.originY,a=this.container.getPaddingRect(),s={top:a.y1-o,left:a.x1-r,bottom:a.y2-o,right:a.x2-r,floatMinWrapBlockStart:0,floatMinWrapBlockEnd:0};function u(n,i,r){return"%"===n.unit?r*n.num/100:t.convertLengthToPx(n,i,e)}var l=this.floatFragments;return l.length>0&&(s=l.reduce((function(t,e){if(n&&!n(e,i))return t;var r=i.toLogical(e.floatSide),o=e.area,s=e.continuations[0].float.floatMinWrapBlock,l=t.top,h=t.left,c=t.bottom,d=t.right,f=t.floatMinWrapBlockStart,p=t.floatMinWrapBlockEnd;switch(r){case"inline-start":o.vertical?l=Math.max(l,o.top+o.height):h=Math.max(h,o.left+o.width);break;case"block-start":o.vertical?(s&&o.left<d&&(f=u(s,o.rootViewNodes[0],a.x2-a.x1)),d=Math.min(d,o.left)):(s&&o.top+o.height>l&&(f=u(s,o.rootViewNodes[0],a.y2-a.y1)),l=Math.max(l,o.top+o.height));break;case"inline-end":o.vertical?c=Math.min(c,o.top):d=Math.min(d,o.left);break;case"block-end":o.vertical?(s&&o.left+o.width>h&&(p=u(s,o.rootViewNodes[0],a.x2-a.x1)),h=Math.max(h,o.left+o.width)):(s&&o.top<c&&(p=u(s,o.rootViewNodes[0],a.y2-a.y1)),c=Math.min(c,o.top));break;default:throw new Error("Unknown logical float side: "+r)}return{top:l,left:h,bottom:c,right:d,floatMinWrapBlockStart:f,floatMinWrapBlockEnd:p}}),s)),s.left+=r,s.right+=r,s.top+=o,s.bottom+=o,s},e.setFloatAreaDimensions=function(t,e,n,i,r,o,a){if(e!==this.floatReference)return this.getParent(e).setFloatAreaDimensions(t,e,n,i,r,o,a);var s=this.toLogical(n);if("snap-block"===s){if(!a["block-start"]&&!a["block-end"])return null}else if(!a[s])return null;var u,l,h,c,d=this.getLimitValue("block-start",t.layoutContext,t.clientLayout),f=this.getLimitValue("block-end",t.layoutContext,t.clientLayout),p=this.getLimitValue("inline-start",t.layoutContext,t.clientLayout),g=this.getLimitValue("inline-end",t.layoutContext,t.clientLayout),v=t.vertical?t.originX:t.originY,m=t.vertical?t.originY:t.originX;function E(e,n){var i=e(t.bands,n);return i?(t.vertical&&(i=Sn(i)),d=t.vertical?Math.min(d,i.x2):Math.max(d,i.y1),f=t.vertical?Math.max(f,i.x1):Math.min(f,i.y2),!0):o}if(d=t.vertical?Math.min(d,t.left+t.getInsetLeft()+t.width+t.getInsetRight()+v):Math.max(d,t.top+v),f=t.vertical?Math.max(f,t.left+v):Math.min(f,t.top+t.getInsetTop()+t.height+t.getInsetBottom()+v),r){var C=t.vertical?bn(new hn(f,p,d,g)):new hn(p,d,g,f);if(("block-start"===s||"snap-block"===s||"inline-start"===s)&&!E(In,C))return null;if(("block-end"===s||"snap-block"===s||"inline-end"===s)&&!E(Fn,C))return null;if(u=(h=(f-d)*t.getBoxDir())-t.getInsetBefore()-t.getInsetAfter(),l=(c=g-p)-t.getInsetStart()-t.getInsetEnd(),!o&&(u<=0||l<=0))return null}else{h=(u=t.computedBlockSize)+t.getInsetBefore()+t.getInsetAfter();var D=(f-d)*t.getBoxDir();if("snap-block"===s){if(null===i)s="block-start";else{var w=this.container.getPaddingRect();s=this.container.getBoxDir()*(i-(this.container.vertical?w.x2:w.y1))<=this.container.getBoxDir()*((this.container.vertical?w.x1:w.y2)-i-h)?"block-start":"block-end"}if(!a[s]){if(!a["block-end"])return null;s="block-end"}}if(!o&&D<h)return null;if(c=(l="inline-start"===s||"inline-end"===s?Es(t.clientLayout,t.element,[vs.FIT_CONTENT_INLINE_SIZE])[vs.FIT_CONTENT_INLINE_SIZE]:t.adjustContentRelativeSize?t.getContentInlineSize():t.vertical?t.height:t.width)+t.getInsetStart()+t.getInsetEnd(),!o&&g-p<c)return null}switch(d-=v,f-=v,p-=m,g-=m,s){case"inline-start":case"block-start":case"snap-block":t.setInlinePosition(p,l),t.setBlockPosition(d,u);break;case"inline-end":case"block-end":t.setInlinePosition(g-c,l),t.setBlockPosition(f-h*t.getBoxDir(),u);break;default:throw new Error("unknown float direction: "+n)}return s},e.getFloatFragmentExclusions=function(){var t=this.floatFragments.map((function(t){return t.getOuterShape()}));return this.parent?this.parent.getFloatFragmentExclusions().concat(t):t},e.reattachFloatFragments=function(){var t=this.container.element&&this.container.element.parentNode;t&&this.floatFragments.forEach((function(e){t.appendChild(e.area.element)}))},e.getMaxReachedAfterEdge=function(){var t=this.getContainer().vertical;return this.floatFragments.reduce((function(e,n){var i=n.getOuterRect();return t?Math.min(e,i.x1):Math.max(e,i.y2)}),t?1/0:0)},e.getBlockStartEdgeOfBlockEndFloats=function(){var t=this.getContainer().vertical;return this.floatFragments.filter((function(t){return"block-end"===t.floatSide})).reduce((function(e,n){var i=n.getOuterRect();return t?Math.max(e,i.x2):Math.min(e,i.y1)}),t?0:1/0)},e.getPageFloatClearEdge=function(t,e){function n(t){return function(e){return t.isAnchorAlreadyAppeared(e.float.getId())}}function i(t,e){return t.continuations.some(n(e))}for(var r=e.getPaddingRect(),o=e.vertical?r.x1:r.y2,a=this;a;){if(a.floatsDeferredToNext.some(n(a)))return o;a=a.parent}var s=this.getLimitValue("block-start",e.layoutContext,e.clientLayout,i);return this.getLimitValue("block-end",e.layoutContext,e.clientLayout,i)*e.getBoxDir()<o*e.getBoxDir()?o:s},e.getPageFloatPlacementCondition=function(t,e,n){var i=this;if(t.floatReference!==this.floatReference)return this.getParent(t.floatReference).getPageFloatPlacementCondition(t,e,n);var r={"block-start":!0,"block-end":!0,"inline-start":!0,"inline-end":!0};if(!n)return r;var o,a=this.toLogical(e),s=this.toLogical(n);o="all"===s?["block-start","block-end","inline-start","inline-end"]:"both"===s?["inline-start","inline-end"]:"same"===s?"snap-block"===a?["block-start","block-end"]:[a]:[s];var u=t.getOrder();function l(t){return function(e){return e.floatSide===t&&e.getOrder()<u}}function h(t,e){return t.children.some((function(t){return t.floatFragments.some(l(e))||h(t,e)}))}function c(t,e){var n=t.parent;return!!n&&(n.floatFragments.some(l(e))||c(n,e))}return o.forEach((function(t){switch(t){case"block-start":case"inline-start":r[t]=!h(i,t);break;case"block-end":case"inline-end":r[t]=!c(i,t);break;default:throw new Error("Unexpected side: "+t)}})),r},e.getLayoutConstraints=function(){return(this.parent?this.parent.getLayoutConstraints():[]).concat(this.layoutConstraints)},e.addLayoutConstraint=function(t,e){e===this.floatReference?this.layoutConstraints.push(t):this.getParent(e).addLayoutConstraint(t,e)},e.isColumnFullWithPageFloats=function(t){for(var e=t.layoutContext,n=t.clientLayout,i=this,r=null;i&&i.container;){var o=i.getLimitValuesInner(e,n);r?t.vertical?(o.right<r.right&&(r.right=o.right,r.floatMinWrapBlockStart=o.floatMinWrapBlockStart),o.left>r.left&&(r.left=o.left,r.floatMinWrapBlockEnd=o.floatMinWrapBlockEnd)):(o.top>r.top&&(r.top=o.top,r.floatMinWrapBlockStart=o.floatMinWrapBlockStart),o.bottom<r.bottom&&(r.bottom=o.bottom,r.floatMinWrapBlockEnd=o.floatMinWrapBlockEnd)):r=o,i=i.parent}var a=Math.max(r.floatMinWrapBlockStart,r.floatMinWrapBlockEnd);return(t.vertical?r.right-r.left:r.bottom-r.top)<=a},e.getMaxBlockSizeOfPageFloats=function(){var t=this.getContainer().vertical;return this.floatFragments.length?Math.max.apply(null,this.floatFragments.map((function(e){var n=e.area;return t?n.width:n.height}))):0},e.lock=function(){this.locked=!0},e.unlock=function(){this.locked=!1},e.isLocked=function(){return this.locked},t}(),As=[],Ts=function(){function t(){}t.register=function(t){As.push(t)};var e=t.prototype;return e.findByNodeContext=function(t){for(var e=As.length-1;e>=0;e--){var n=As[e];if(n.appliesToNodeContext(t))return n}throw new Error("No PageFloatLayoutStrategy found for "+t)},e.findByFloat=function(t){for(var e=As.length-1;e>=0;e--){var n=As[e];if(n.appliesToFloat(t))return n}throw new Error("No PageFloatLayoutStrategy found for "+t)},t}();Ts.register(new(function(){function t(){}var e=t.prototype;return e.appliesToNodeContext=function(t){return Ds(t.floatReference)},e.appliesToFloat=function(t){return!0},e.createPageFloat=function(t,e,n){var i=t.floatReference,r=t.floatSide,o=t.toNodePosition();return n.resolveFloatReferenceFromColumnSpan(i,t.columnSpan,t).thenAsync((function(n){var a=new ws(o,i=n,r,t.clearSide,e.flowName,t.floatMinWrapBlock);return e.addPageFloat(a),Ri(a)}))},e.createPageFloatFragment=function(t,e,n,i){return new Ns(t[0].float.floatReference,e,t,n,i)},e.findPageFloatFragment=function(t,e){return e.findPageFloatFragment(t)},e.adjustPageFloatArea=function(t,e,n){},e.forbid=function(t,e){},t}()));var xs=Ns,Is=function(t){function e(e,n,i,r,o){var a;return(a=t.call(this,e,n,"block-end",null,i,o)||this).footnotePolicy=void 0,a.footnotePolicy=r,a}return x(e,t),e.prototype.isAllowedToPrecede=function(t){return!(t instanceof e)},e}(ws),Fs=function(t){function e(e,n,i,r){return t.call(this,e,"block-end",n,i,r)||this}x(e,t);var n=e.prototype;return n.getOrder=function(){return 1/0},n.shouldBeStashedBefore=function(t){return t instanceof Is||this.getOrder()<t.getOrder()},e}(xs),Ps=function(){function t(t){this.footnote=void 0,this.footnote=t}return t.prototype.allowLayout=function(t){return!ao(t.toNodePosition(),this.footnote.nodePosition)},t}();Ts.register(new(function(){function t(){}var e=t.prototype;return e.appliesToNodeContext=function(t){return"footnote"===t.floatSide},e.appliesToFloat=function(t){return t instanceof Is},e.createPageFloat=function(t,e,n){var i=Cs.REGION,r=e.getPageFloatLayoutContext(i);e.getPageFloatLayoutContext(Cs.PAGE).hasSameContainerAs(r)&&(i=Cs.PAGE);var o=t.toNodePosition(),a=new Is(o,i,e.flowName,t.footnotePolicy,t.floatMinWrapBlock);return e.addPageFloat(a),Ri(a)},e.createPageFloatFragment=function(t,e,n,i){return new Fs(t[0].float.floatReference,t,n,i)},e.findPageFloatFragment=function(t,e){return e.getPageFloatLayoutContext(t.floatReference).floatFragments.filter((function(t){return t instanceof Fs}))[0]||null},e.adjustPageFloatArea=function(t,e,n){t.isFootnote=!0,t.adjustContentRelativeSize=!1;var i=t.element;t.vertical=n.layoutContext.applyFootnoteStyle(e.vertical,n.layoutContext.nodeContext&&"rtl"===n.layoutContext.nodeContext.direction,i),t.convertPercentageSizesToPx(i),n.setComputedInsets(i,t),n.setComputedWidthAndHeight(i,t)},e.forbid=function(t,e){var n=t;if(n.footnotePolicy===en.line){var i=new Ps(n);e.addLayoutConstraint(i,n.floatReference)}},t}()));var Rs={page:!0,left:!0,right:!0,recto:!0,verso:!0,column:!0,region:!0};function Ls(t){return!!Rs[t]}var Os={left:!0,right:!0,recto:!0,verso:!0};function ks(t){return!!Os[t]}var Bs={avoid:!0,"avoid-page":!0,"avoid-column":!0,"avoid-region":!0};function _s(t){return!!Bs[t]}function Ms(t,e){if(!t)return e;if(!e)return t;if(ks(e))return e;if(ks(t))return t;var n=Ls(t),i=Ls(e);if(!n||!i)return i?e:n?t:_s(e)?e:_s(t)?t:e;switch(e){case"column":return t;case"region":return"column"===t?e:t;default:return e}}function Us(t){switch(t){case"left":case"right":case"recto":case"verso":return t;default:return"any"}}function Vs(t){switch(t){case"left":case"right":case"recto":case"verso":return t;default:return null}}function Hs(t,e,n,i){var r=t.viewNode;if(!r)return NaN;if(1==r.nodeType){if(t.after||!t.inline){var o=e.getElementClientRect(r);if(o.right>=o.left&&o.bottom>=o.top)return t.after?i?o.left:o.bottom:i?o.right:o.top}return NaN}var a=r.ownerDocument.createRange(),s=r.textContent.length;if(!s)return NaN;t.after&&(n+=s),n>=s&&(n=s-1),a.setStart(r,n),a.setEnd(r,n+1);var u=e.getRangeClientRects(a);return i&&function(t){if(null==vt){var e=t.ownerDocument,n=e.createElement("div");n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.width="100px",n.style.height="100px",n.style.overflow="hidden",n.style.lineHeight="16px",n.style.fontSize="16px",tt(n,"writing-mode","vertical-rl"),t.appendChild(n);var i=e.createTextNode("a a a a a a a a a a a a a a a a");n.appendChild(i);var r=e.createRange();r.setStart(i,0),r.setEnd(i,1);var o=r.getBoundingClientRect();vt=o.right-o.left<10,t.removeChild(n)}return vt}(document.body)&&(u=function(t,e,n){var i=n.ownerDocument.createRange();i.setStart(n,0),i.setEnd(n,n.textContent.length);for(var r,o=t.getRangeClientRects(i),a=[],s=B(e);!(r=s()).done;){var u=r.value,l=void 0;for(l=0;l<o.length;l++){var h=o[l];if(u.top>=h.top&&u.bottom<=h.bottom&&Math.abs(u.left-h.left)<1){a.push({top:u.top,left:h.left,bottom:u.bottom,right:h.right});break}}l==o.length&&(c.warn("Could not fix character box"),a.push(u))}return a}(e,u,r)),(u=u.filter((function(t){return t.right>t.left&&t.bottom>t.top}))).length?i?Math.min.apply(null,u.map((function(t){return t.left}))):Math.max.apply(null,u.map((function(t){return t.bottom}))):NaN}function zs(t,e,n){var i=e.clientLayout.getElementClientRect(t),r=e.getComputedMargin(t);return n?i.width+r.left+r.right:i.height+r.top+r.bottom}function Gs(t){for(;t;){if(t.parentNode===t.ownerDocument)return!1;t=t.parentNode}return!0}function Xs(t,e){if(t)for(var n;(n=t.lastChild)!=e;)t.removeChild(n)}function Ws(t){return!!t.getAttribute("data-adapt-spec")}function js(t){if(!t)return!1;var e=t.viewNode;return!(!e||1!==e.nodeType)&&Ws(e)}p("SIMPLE_PROPERTY",(function(t){var e=t.name,n=t.value;switch(e){case"page-break-before":case"page-break-after":case"page-break-inside":return{name:e.replace(/^page-/,""),value:n===en.always?en.page:n,important:t.important};default:return t}}));var Ks=function(){function t(){}var e=t.prototype;return e.calculateOffset=function(t){return Ys(this.getNodeContext(),t.collectElementsOffset())},e.breakPositionChosen=function(t){},e.getNodeContext=function(){return null},t}();function Ys(t,e){return{current:e.reduce((function(e,n){return e+n.calculateOffset(t)}),0),minimum:e.reduce((function(e,n){return e+n.calculateMinimumOffset(t)}),0)}}var qs=function(t){function e(e,n,i,r){var o;return(o=t.call(this)||this).position=void 0,o.breakOnEdge=void 0,o.overflows=void 0,o.computedBlockSize=void 0,o.overflowIfRepetitiveElementsDropped=void 0,o.isEdgeUpdated=!1,o.edge=0,o.position=e,o.breakOnEdge=n,o.overflows=i,o.computedBlockSize=r,o.overflowIfRepetitiveElementsDropped=i,o}x(e,t);var n=e.prototype;return n.findAcceptableBreak=function(t,e){return this.updateOverflows(t),e<this.getMinBreakPenalty()?null:t.findEdgeBreakPosition(this)},n.getMinBreakPenalty=function(){if(!this.isEdgeUpdated)throw new Error("EdgeBreakPosition.prototype.updateEdge not called");var t=this.isFirstContentOfRepetitiveElementsOwner()&&!this.overflowIfRepetitiveElementsDropped;return(_s(this.breakOnEdge)?1:0)+(this.overflows&&!t?3:0)+(this.position.parent?this.position.parent.breakPenalty:0)},n.updateEdge=function(t){var e=t.calculateClonedPaddingBorder(this.position);this.edge=Hs(this.position,t.clientLayout,0,t.vertical)+e,this.isEdgeUpdated=!0},n.updateOverflows=function(t){this.isEdgeUpdated||this.updateEdge(t);var e=this.edge,n=this.calculateOffset(t);this.overflowIfRepetitiveElementsDropped=t.isOverflown(e+(t.vertical?-1:1)*n.minimum),this.overflows=this.position.overflow=t.isOverflown(e+(t.vertical?-1:1)*n.current)},n.getNodeContext=function(){return this.position},n.isFirstContentOfRepetitiveElementsOwner=function(){var t=this.getNodeContext();if(!t||!t.parent)return!1;var e=t.parent.formattingContext;if(!Vr.isInstanceOfRepetitiveElementsOwnerFormattingContext(e))return!1;var n=e.getRepetitiveElements();return!!n&&n.isFirstContentNode(t)},e}(Ks);function Qs(t){var e,n=t.toString();switch(n){case"inline-flex":e="flex";break;case"inline-grid":e="grid";break;case"inline-table":e="table";break;case"inline":case"table-row-group":case"table-column":case"table-column-group":case"table-header-group":case"table-footer-group":case"table-row":case"table-cell":case"table-caption":case"inline-block":e="block";break;default:e=n}return He(e)}function $s(t){return t===en.absolute||t===en.fixed}function Zs(t,e,n,i){return t===en.none||($s(e)?(n=en.none,t=Qs(t)):(n&&n!==en.none||i)&&(t=Qs(t))),{display:t,position:e,float:n}}function Js(t,e,n,i){return Zs(t,e,n,i).display===en.block}function tu(t){switch(t.toString()){case"inline":case"inline-block":case"inline-list-item":case"inline-flex":case"inline-grid":case"ruby":case"inline-table":return!0;default:return!1}}var eu=function(){function t(){}return t.prototype.find=function(t){for(var n=v(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR),i=0;i<n.length;i++){var r=n[i](t);if(r)return r}throw new Error("No processor found for a formatting context: "+t.getName())},t}(),nu=function(){function t(){}var e=t.prototype;return e.layout=function(t,e,n){return e.isFloatNodeContext(t)?e.layoutFloatOrFootnote(t):e.isBreakable(t)?e.layoutBreakableBlock(t):e.layoutUnbreakable(t)},e.createEdgeBreakPosition=function(t,e,n,i){return new qs(t.copy(),e,n,i)},e.startNonInlineElementNode=function(t){return!1},e.afterNonInlineElementNode=function(t,e){return!1},e.clearOverflownViewNodes=function(t,e,n,i){if(n.viewNode&&n.viewNode.parentNode&&(n.shadowType!==zr.ShadowType.ROOTLESS||!js(n))){var r=n.viewNode.parentNode;Xs(r,n.viewNode),i&&r.removeChild(n.viewNode)}},e.finishBreak=function(t,e,n,i){var r=n||null!=e.viewNode&&1==e.viewNode.nodeType&&!e.after;return t.clearOverflownViewNodes(e,r),i&&(t.fixJustificationIfNeeded(e,!0),t.layoutContext.processFragmentedBlockEdge(r?e:e.parent)),Ri(!0)},t}(),iu=function(){function t(t){this.parent=void 0,this.formattingContextType="Block",this.parent=t}var e=t.prototype;return e.getName=function(){return"Block formatting context (BlockFormattingContext)"},e.isFirstTime=function(t,e){return e},e.getParent=function(){return this.parent},e.saveState=function(){},e.restoreState=function(t){},t}(),ru=new nu,ou=_r.isInstanceOfBlockFormattingContext;p(e.HOOKS.RESOLVE_FORMATTING_CONTEXT,(function(t,e,n,i,r,o){var a=t.parent;return!a&&t.formattingContext||a&&t.formattingContext!==a.formattingContext?null:t.establishesBFC||!t.formattingContext&&Js(n,i,r,o)?new iu(a?a.formattingContext:null):null})),p(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR,(function(t){return t instanceof iu?ru:null}));var au=function(){function t(){this.initialBreakPositions=null,this.initialStateOfFormattingContext=null,this.initialPosition=void 0,this.initialFragmentLayoutConstraints=void 0}var e=t.prototype;return e.layout=function(t,e){return this.prepareLayout(t,e),this.tryLayout(t,e)},e.tryLayout=function(t,e){var n=this,i=Pi("AbstractLayoutRetryer.tryLayout");this.saveState(t,e);var r=this.resolveLayoutMode(t);return r.doLayout(t,e).then((function(o){var a=r.accept(o,e);(a=r.postLayout(o,n.initialPosition,e,a))?i.finish(o):(n.clearNodes(n.initialPosition),n.restoreState(t,e),n.tryLayout(n.initialPosition,e).thenFinish(i))})),i.result()},e.prepareLayout=function(t,e){},e.clearNodes=function(t){for(var e,n,i=t.viewNode||t.parent.viewNode;e=i.lastChild;)i.removeChild(e);for(;n=i.nextSibling;)n.parentNode.removeChild(n)},e.saveState=function(t,e){this.initialPosition=t.copy(),this.initialBreakPositions=[].concat(e.breakPositions),this.initialFragmentLayoutConstraints=[].concat(e.fragmentLayoutConstraints),t.formattingContext&&(this.initialStateOfFormattingContext=t.formattingContext.saveState())},e.restoreState=function(t,e){e.breakPositions=this.initialBreakPositions,e.fragmentLayoutConstraints=this.initialFragmentLayoutConstraints,t.formattingContext&&t.formattingContext.restoreState(this.initialStateOfFormattingContext)},t}(),su=function(){function t(){}var e=t.prototype;return e.initialState=function(t){return{nodeContext:t,atUnforcedBreak:!1,break:!1}},e.startNonDisplayableNode=function(t){},e.afterNonDisplayableNode=function(t){},e.startIgnoredTextNode=function(t){},e.afterIgnoredTextNode=function(t){},e.startNonElementNode=function(t){},e.afterNonElementNode=function(t){},e.startInlineElementNode=function(t){},e.afterInlineElementNode=function(t){},e.startNonInlineElementNode=function(t){},e.afterNonInlineElementNode=function(t){},e.finish=function(t){},t}(),uu=function(){function t(t,e){this.strategy=void 0,this.layoutContext=void 0,this.strategy=t,this.layoutContext=e}return t.prototype.iterate=function(t){var e=this,n=this.strategy,i=n.initialState(t),r=Pi("LayoutIterator");return r.loopWithFrame((function(t){for(var r;i.nodeContext;){var o=((r=i.nodeContext.viewNode?1!==i.nodeContext.viewNode.nodeType?to(i.nodeContext.viewNode,i.nodeContext.whitespace)?i.nodeContext.after?n.afterIgnoredTextNode(i):n.startIgnoredTextNode(i):i.nodeContext.after?n.afterNonElementNode(i):n.startNonElementNode(i):i.nodeContext.inline?i.nodeContext.after?n.afterInlineElementNode(i):n.startInlineElementNode(i):i.nodeContext.after?n.afterNonInlineElementNode(i):n.startNonInlineElementNode(i):i.nodeContext.after?n.afterNonDisplayableNode(i):n.startNonDisplayableNode(i))&&r.isPending()?r:Ri(!0)).thenAsync((function(){return i.break?Ri(null):e.layoutContext.nextInTree(i.nodeContext,i.atUnforcedBreak)}));if(o.isPending())return void o.then((function(e){i.break?t.breakLoop():(i.nodeContext=e,t.continueLoop())}));if(i.break)return void t.breakLoop();i.nodeContext=o.get()}n.finish(i),t.breakLoop()})).then((function(){r.finish(i.nodeContext)})),r.result()},t}(),lu=function(t){function e(e){var n;return(n=t.call(this)||this).leadingEdge=void 0,n.leadingEdge=e,n}x(e,t);var n=e.prototype;return n.startNonInlineBox=function(t){},n.endEmptyNonInlineBox=function(t){},n.endNonInlineBox=function(t){},n.initialState=function(t){return{nodeContext:t,atUnforcedBreak:!!this.leadingEdge&&t.after,break:!1,leadingEdge:this.leadingEdge,breakAtTheEdge:null,onStartEdges:!1,leadingEdgeContexts:[],lastAfterNodeContext:null}},n.processForcedBreak=function(t,e){var n=!t.leadingEdge&&Ls(t.breakAtTheEdge);if(n){var i=t.nodeContext=t.leadingEdgeContexts[0]||t.nodeContext;i.viewNode.parentNode.removeChild(i.viewNode),e.pageBreakType=t.breakAtTheEdge}return n},n.saveEdgeAndProcessOverflow=function(t,e){var n=e.checkOverflowAndSaveEdgeAndBreakPosition(t.lastAfterNodeContext,null,!0,t.breakAtTheEdge);return n&&(t.nodeContext=(t.lastAfterNodeContext||t.nodeContext).modify(),t.nodeContext.overflow=!0),n},n.processLayoutConstraint=function(t,e,n){var i=t.nodeContext,r=!e.allowLayout(i);return r&&(n.checkOverflowAndSaveEdgeAndBreakPosition(t.lastAfterNodeContext,null,!1,t.breakAtTheEdge),(i=t.nodeContext=i.modify()).overflow=!0),r},n.startNonElementNode=function(t){t.onStartEdges=!1},n.startNonInlineElementNode=function(t){return t.leadingEdgeContexts.push(t.nodeContext.copy()),t.breakAtTheEdge=Ms(t.breakAtTheEdge,t.nodeContext.breakBefore),t.onStartEdges=!0,this.startNonInlineBox(t)},n.afterNonInlineElementNode=function(t){var e;return(t.onStartEdges?((e=this.endEmptyNonInlineBox(t))&&e.isPending()?e:Ri(!0)).thenAsync((function(){return t.break||(t.leadingEdgeContexts=[],t.leadingEdge=!1,t.atUnforcedBreak=!1,t.breakAtTheEdge=null),Ri(!0)})):(e=this.endNonInlineBox(t))&&e.isPending()?e:Ri(!0)).thenAsync((function(){return t.break||(t.onStartEdges=!1,t.lastAfterNodeContext=t.nodeContext.copy(),t.breakAtTheEdge=Ms(t.breakAtTheEdge,t.nodeContext.breakAfter)),Ri(!0)}))},e}(su),hu=[],cu=(new DOMParser).parseFromString('<root xmlns="'+G.SHADOW+'"/>',"text/xml"),du=["footnote-marker","first-5-lines","first-4-lines","first-3-lines","first-2-lines","first-line","first-letter","before","","after"];function fu(t){return t.getAttribute("data-adapt-pseudo")||""}function pu(t,e){t.setAttribute("data-adapt-pseudo",e)}var gu=function(){function t(t,e,n,i,r){this.element=void 0,this.style=void 0,this.styler=void 0,this.context=void 0,this.exprContentListener=void 0,this.contentProcessed={},this.element=t,this.style=e,this.styler=n,this.context=i,this.exprContentListener=r}var e=t.prototype;return e.getStyle=function(t,e){var n=fu(t);this.styler&&n&&n.match(/after$/)&&(this.style=this.styler.getStyle(this.element,!0),this.styler=null);var i=Ho(this.style,"_pseudos")[n]||{};if(n.match(/^first-/)&&!i["x-first-pseudo"]){var r,o=1;"first-letter"==n?o=0:null!=(r=n.match(/^first-([0-9]+)-lines$/))&&(o=r[1]-0),i["x-first-pseudo"]=new Lo(new Xe(o),0)}return i},e.processContent=function(t,e){var n=fu(t);if(!this.contentProcessed[n]){this.contentProcessed[n]=!0;var i=e.content;i&&wo(i)&&i.visit(new Do(t,this.context,i,this.exprContentListener))}},t}(),vu=Br.registerFragmentIndex,mu=function(){function t(t,e){this.sourceNode=void 0,this.styler=void 0,this.sourceNode=t,this.styler=e}var e=t.prototype;return e.createElement=function(t,e){var n=this,i=e.viewNode.ownerDocument.createElement("div"),r=new Tu(t,i,e),o=r.getColumn().pageBreakType;return r.getColumn().pageBreakType=null,r.layout(this.createNodePositionForPseudoElement(),!0).thenAsync((function(){n.styler.contentProcessed["after-if-continues"]=!1,r.getColumn().pageBreakType=o;var t=i.firstChild;return tt(t,"display","block"),Ri(t)}))},e.createNodePositionForPseudoElement=function(){var t=cu.createElementNS(G.XHTML,"div");pu(t,"after-if-continues");var e=this.createShadowContext(t);return new go({steps:[{node:t,shadowType:e.type,shadowContext:e,nodeShadow:null,shadowSibling:null}],offsetInNode:0,after:!1,preprocessedTextContent:null})},e.createShadowContext=function(t){return new ho(this.sourceNode,t,null,null,null,zr.ShadowType.ROOTED,this.styler)},t}(),Eu=function(){function t(t,e,n){this.nodeContext=void 0,this.afterIfContinues=void 0,this.pseudoElementHeight=void 0,this.flagmentLayoutConstraintType="AfterIfContinue",this.nodeContext=t,this.afterIfContinues=e,this.pseudoElementHeight=n}var e=t.prototype;return e.allowLayout=function(t,e,n){return!(e&&!t||t&&t.overflow)},e.nextCandidate=function(t){return!1},e.postLayout=function(t,e,n,i){},e.finishBreak=function(t,e){var n=this;return this.getRepetitiveElements().affectTo(t)?this.afterIfContinues.createElement(e,this.nodeContext).thenAsync((function(t){return n.nodeContext.viewNode.appendChild(t),Ri(!0)})):Ri(!0)},e.getRepetitiveElements=function(){return new Cu(this.nodeContext,this.pseudoElementHeight)},e.equalsTo=function(e){return e instanceof t&&this.afterIfContinues==e.afterIfContinues},e.getPriorityOfFinishBreak=function(){return 9},t}(),Cu=function(){function t(t,e){this.nodeContext=void 0,this.pseudoElementHeight=void 0,this.nodeContext=t,this.pseudoElementHeight=e}var e=t.prototype;return e.calculateOffset=function(t){return this.affectTo(t)?this.pseudoElementHeight:0},e.calculateMinimumOffset=function(t){return this.calculateOffset(t)},e.affectTo=function(t){if(!t)return!1;var e=t.shadowContext?t.shadowContext.owner:t.sourceNode;if(e===this.nodeContext.sourceNode)return!!t.after;for(var n=e.parentNode;n;n=n.parentNode)if(n===this.nodeContext.sourceNode)return!0;return!1},t}();function Du(t,e){if(!t||!t.afterIfContinues||t.after||e.isFloatNodeContext(t))return Ri(t);var n=t.afterIfContinues;return n.createElement(e,t).thenAsync((function(i){var r=function(t,e,n){var i=t.viewNode;i.appendChild(n);var r=zs(n,e,t.vertical);return i.removeChild(n),r}(t,e,i);return e.fragmentLayoutConstraints.push(new Eu(t,n,r)),Ri(t)}))}function wu(t,e){return t.thenAsync((function(t){return Du(t,e)}))}var yu={img:!0,svg:!0,audio:!0,video:!0},Nu=function(){function t(t){this.constraints=void 0,this.constraints=t}return t.prototype.allowLayout=function(t){return this.constraints.every((function(e){return e.allowLayout(t)}))},t}(),bu=function(t){function e(e,n){var i;return(i=t.call(this)||this).checkPoints=void 0,i.penalty=void 0,i.alreadyEvaluated=!1,i.breakNodeContext=null,i.checkPoints=e,i.penalty=n,i}x(e,t);var n=e.prototype;return n.findAcceptableBreak=function(t,e){return e<this.getMinBreakPenalty()?null:(this.alreadyEvaluated||(this.breakNodeContext=t.findBoxBreakPosition(this,e>0),this.alreadyEvaluated=!0),this.breakNodeContext)},n.getMinBreakPenalty=function(){return this.penalty},n.getNodeContext=function(){return this.alreadyEvaluated?this.breakNodeContext:this.checkPoints[this.checkPoints.length-1]},e}(Ks);function Su(t){switch(t){case"ruby":case"ruby-base":case"ruby-base-container":case"ruby-text":case"ruby-text-container":case"inline-block":case"inline-flex":case"inline-grid":case"inline-list-item":case"inline-table":return!0}return!1}var Au=function(t){function n(e,n,i,r,o){var a;return(a=t.call(this,e)||this).layoutContext=void 0,a.clientLayout=void 0,a.layoutConstraint=void 0,a.pageFloatLayoutContext=void 0,a.last=void 0,a.viewDocument=void 0,a.flowRootFormattingContext=null,a.isFloat=!1,a.isFootnote=!1,a.startEdge=0,a.endEdge=0,a.beforeEdge=0,a.afterEdge=0,a.footnoteEdge=0,a.box=null,a.chunkPositions=null,a.bands=null,a.overflown=!1,a.breakPositions=null,a.pageBreakType=null,a.forceNonfitting=!0,a.leftFloatEdge=0,a.rightFloatEdge=0,a.bottommostFloatTop=0,a.stopAtOverflow=!0,a.lastAfterPosition=null,a.fragmentLayoutConstraints=[],a.pseudoParent=null,a.nodeContextOverflowingDueToRepetitiveElements=null,a.blockDistanceToBlockEndFloats=NaN,a.layoutContext=n,a.clientLayout=i,a.layoutConstraint=r,a.pageFloatLayoutContext=o,a.last=e.lastChild,a.viewDocument=e.ownerDocument,o.setContainer(O(a)),a}x(n,t);var i=n.prototype;return i.getTopEdge=function(){return this.vertical?this.startEdge:this.beforeEdge},i.getBottomEdge=function(){return this.vertical?this.endEdge:this.afterEdge},i.getLeftEdge=function(){return this.vertical?this.afterEdge:this.startEdge},i.getRightEdge=function(){return this.vertical?this.beforeEdge:this.endEdge},i.isFloatNodeContext=function(t){return!(!t.floatSide||this.isFloat&&!t.parent)},i.stopByOverflow=function(t){return this.stopAtOverflow&&!!t&&t.overflow},i.isOverflown=function(t){return this.vertical?t<this.footnoteEdge:t>this.footnoteEdge},i.getExclusions=function(){var t=this.pageFloatLayoutContext.getFloatFragmentExclusions();return this.exclusions.concat(t)},i.openAllViews=function(t){var e=this,n=Pi("openAllViews"),i=t.steps;this.layoutContext.setViewRoot(this.element,this.isFootnote);var r=i.length-1,o=null;return n.loop((function(){for(;r>=0&&(o=uo(i[r],o),r!==i.length-1||o.formattingContext||(o.formattingContext=e.flowRootFormattingContext),0!=r||(o.offsetInNode=e.calculateOffsetInNodeForNodeContext(t),o.after=t.after,o.preprocessedTextContent=t.preprocessedTextContent,!o.after));){var n=e.layoutContext.setCurrent(o,0==r&&0==o.offsetInNode);if(r--,n.isPending())return n}return Ri(!1)})).then((function(){n.finish(o)})),n.result()},i.calculateOffsetInNodeForNodeContext=function(t){return t.preprocessedTextContent?Wr(t.preprocessedTextContent,t.offsetInNode,1):t.offsetInNode},i.maybePeelOff=function(t,e){if(t.firstPseudo&&t.inline&&!t.after&&0==t.firstPseudo.count&&1!=t.viewNode.nodeType){var n=t.viewNode.textContent.match(_);return this.layoutContext.peelOff(t,n?n[0].length:0)}return Ri(t)},i.buildViewToNextBlockEdge=function(t,e){var n=this,i=!1,r=Pi("buildViewToNextBlockEdge");return r.loopWithFrame((function(r){t.viewNode&&!js(t)&&e.push(t.copy()),n.maybePeelOff(t,0).then((function(o){o!==t&&(js(t=o)||e.push(t.copy())),n.nextInTree(t).then((function(e){(t=e)?(!i&&n.layoutConstraint.allowLayout(t)||(i=!0,(t=t.modify()).overflow=!0),n.isFloatNodeContext(t)&&!n.vertical?n.layoutFloatOrFootnote(t).then((function(e){t=e,n.pageFloatLayoutContext.isInvalidated()&&(t=null),t?r.continueLoop():r.breakLoop()})):t.inline?r.continueLoop():r.breakLoop()):r.breakLoop()}))}))})).then((function(){r.finish(t)})),r.result()},i.nextInTree=function(t,e){return wu(this.layoutContext.nextInTree(t,e),this)},i.buildDeepElementView=function(t){var e=this;if(!t.viewNode)return Ri(t);var n=[],i=t.sourceNode,r=Pi("buildDeepElementView");return r.loopWithFrame((function(r){t.viewNode&&t.inline&&!js(t)?n.push(t.copy()):(n.length>0&&e.postLayoutBlock(t,n),n=[]),e.maybePeelOff(t,0).then((function(o){var a=o;if(a!==t){for(var s=a;s&&s.sourceNode!=i;)s=s.parent;if(null==s)return t=a,void r.breakLoop();js(a)||n.push(a.copy())}e.nextInTree(a).then((function(n){(t=n)&&t.sourceNode!=i?e.layoutConstraint.allowLayout(t)?r.continueLoop():((t=t.modify()).overflow=!0,e.stopAtOverflow?r.breakLoop():r.continueLoop()):r.breakLoop()}))}))})).then((function(){n.length>0&&e.postLayoutBlock(t,n),r.finish(t)})),r.result()},i.createFloat=function(t,e,n,i){var r=this.viewDocument.createElement("div");return this.vertical?(i>=this.height&&(i-=.1),tt(r,"height",n+"px"),tt(r,"width",i+"px")):(n>=this.width&&(n-=.1),tt(r,"width",n+"px"),tt(r,"height",i+"px")),tt(r,"float",e),tt(r,"clear",e),this.element.insertBefore(r,t),r},i.killFloats=function(){for(var t=this.element.firstChild;t;){var e=t.nextSibling;if(1==t.nodeType){var n=t,i=n.style.cssFloat;if("left"!=i&&"right"!=i)break;this.element.removeChild(n)}t=e}},i.createFloats=function(){for(var t,e=this.element.firstChild,n=this.bands,i=this.vertical?this.getTopEdge():this.getLeftEdge(),r=this.vertical?this.getBottomEdge():this.getRightEdge(),o=B(n);!(t=o()).done;){var a=t.value,s=a.y2-a.y1;a.left=this.createFloat(e,"left",a.x1-i,s),a.right=this.createFloat(e,"right",r-a.x2,s)}},i.calculateEdge=function(t,e,n,i){var r;if(t&&Gs(t.viewNode))return NaN;if(t&&t.after&&!t.inline&&(r=Hs(t,this.clientLayout,0,this.vertical),!isNaN(r)))return r;for(var o=i-(t=e[n]).boxOffset;;){if(r=Hs(t,this.clientLayout,o,this.vertical),!isNaN(r))return r;if(o>0)o--;else{if(--n<0)return this.beforeEdge;1!=(t=e[n]).viewNode.nodeType&&(o=t.viewNode.textContent.length)}}},i.parseComputedLength=function(t){if("number"==typeof t)return t;var e=t.match(/^(-?[0-9]*(\.[0-9]*)?)px$/);return e?parseFloat(e[0]):0},i.getComputedMargin=function(t){var e=this.clientLayout.getElementComputedStyle(t),n=new dn(0,0,0,0);return e&&(n.left=this.parseComputedLength(e.marginLeft),n.top=this.parseComputedLength(e.marginTop),n.right=this.parseComputedLength(e.marginRight),n.bottom=this.parseComputedLength(e.marginBottom)),n},i.getComputedPaddingBorder=function(t){var e=this.clientLayout.getElementComputedStyle(t),n=new dn(0,0,0,0);return e&&(n.left=this.parseComputedLength(e.borderLeftWidth)+this.parseComputedLength(e.paddingLeft),n.top=this.parseComputedLength(e.borderTopWidth)+this.parseComputedLength(e.paddingTop),n.right=this.parseComputedLength(e.borderRightWidth)+this.parseComputedLength(e.paddingRight),n.bottom=this.parseComputedLength(e.borderBottomWidth)+this.parseComputedLength(e.paddingBottom)),n},i.getComputedInsets=function(t){var e=this.clientLayout.getElementComputedStyle(t),n=new dn(0,0,0,0);if(e){if("border-box"==e.boxSizing)return this.getComputedMargin(t);n.left=this.parseComputedLength(e.marginLeft)+this.parseComputedLength(e.borderLeftWidth)+this.parseComputedLength(e.paddingLeft),n.top=this.parseComputedLength(e.marginTop)+this.parseComputedLength(e.borderTopWidth)+this.parseComputedLength(e.paddingTop),n.right=this.parseComputedLength(e.marginRight)+this.parseComputedLength(e.borderRightWidth)+this.parseComputedLength(e.paddingRight),n.bottom=this.parseComputedLength(e.marginBottom)+this.parseComputedLength(e.borderBottomWidth)+this.parseComputedLength(e.paddingBottom)}return n},i.setComputedInsets=function(t,e){var n=this.clientLayout.getElementComputedStyle(t);n&&(e.marginLeft=this.parseComputedLength(n.marginLeft),e.borderLeft=this.parseComputedLength(n.borderLeftWidth),e.paddingLeft=this.parseComputedLength(n.paddingLeft),e.marginTop=this.parseComputedLength(n.marginTop),e.borderTop=this.parseComputedLength(n.borderTopWidth),e.paddingTop=this.parseComputedLength(n.paddingTop),e.marginRight=this.parseComputedLength(n.marginRight),e.borderRight=this.parseComputedLength(n.borderRightWidth),e.paddingRight=this.parseComputedLength(n.paddingRight),e.marginBottom=this.parseComputedLength(n.marginBottom),e.borderBottom=this.parseComputedLength(n.borderBottomWidth),e.paddingBottom=this.parseComputedLength(n.paddingBottom))},i.setComputedWidthAndHeight=function(t,e){var n=this.clientLayout.getElementComputedStyle(t);n&&(e.width=this.parseComputedLength(n.width),e.height=this.parseComputedLength(n.height))},i.layoutUnbreakable=function(t){return this.buildDeepElementView(t)},i.layoutFloat=function(t){var e=this,n=Pi("layoutFloat"),i=t.viewNode,r=function(t,e,n){var i=e?"vertical-rl":"horizontal-tb";if("top"!==t&&"bottom"!==t||(t=gs(t,i,n)),"block-start"===t&&(t="inline-start"),"block-end"===t&&(t="inline-end"),"inline-start"===t||"inline-end"===t){var r=function(t,e){var n=ms[e];if(!n)throw new Error("unknown writing-mode: "+e);for(var i=0;i<n.length;i++)if(n[i].physical===t)return n[i].logical;return t}(fs(t,i,n),i);"line-left"===r?t="left":"line-right"===r&&(t="right")}return"left"!==t&&"right"!==t&&(c.warn("Invalid float value: "+t+". Fallback to left."),t="left"),t}(t.floatSide,t.vertical,t.direction);return tt(i,"float","none"),tt(i,"display","inline-block"),tt(i,"vertical-align","top"),this.buildDeepElementView(t).then((function(o){for(var a=e.clientLayout.getElementClientRect(i),s=e.getComputedMargin(i),u=new hn(a.left-s.left,a.top-s.top,a.right+s.right,a.bottom+s.bottom),l=e.startEdge,h=e.endEdge,c=t.parent;c&&c.inline;)c=c.parent;if(c){var d=c.viewNode.ownerDocument.createElement("div");d.style.left="0px",d.style.top="0px",e.vertical?(d.style.bottom="0px",d.style.width="1px"):(d.style.right="0px",d.style.height="1px"),c.viewNode.appendChild(d);var f=e.clientLayout.getElementClientRect(d);l=Math.max(e.getStartEdge(f),l),h=Math.min(e.getEndEdge(f),h),c.viewNode.removeChild(d);var p=e.vertical?u.y2-u.y1:u.x2-u.x1;"left"==r?h=Math.max(h,l+p):l=Math.min(l,h-p),c.viewNode.appendChild(t.viewNode)}var g=new hn(l,e.getBoxDir()*e.beforeEdge,h,e.getBoxDir()*e.afterEdge),v=u;e.vertical&&(v=bn(u));var m=e.getBoxDir();if(v.y1<e.bottommostFloatTop*m){var E=v.y2-v.y1;v.y1=e.bottommostFloatTop*m,v.y2=v.y1+E}!function(t,e,n,i){for(var r=n.y1,o=n.x2-n.x1,a=n.y2-n.y1,s=xn(e,r);;){var u=r+a;if(u>t.y2)return!1;for(var l=t.x1,h=t.x2,c=s;c<e.length&&e[c].y1<u;c++){var d=e[c];d.x1>l&&(l=d.x1),d.x2<h&&(h=d.x2)}if(l+o<=h||s>=e.length)return"left"==i?(n.x1=l,n.x2=l+o):(n.x1=h-o,n.x2=h),n.y2+=r-n.y1,n.y1=r,!0;r=e[s].y2,s++}}(g,e.bands,v,r),e.vertical&&(u=Sn(v));var C,D=e.getComputedInsets(i);tt(i,"width",u.x2-u.x1-D.left-D.right+"px"),tt(i,"height",u.y2-u.y1-D.top-D.bottom+"px"),tt(i,"position","absolute"),tt(i,"display",t.display);var w=null;if(c&&(w=c.containingBlockForAbsolute?c:c.getContainingBlockForAbsolute()),w){var y=w.viewNode.ownerDocument.createElement("div");y.style.position="absolute",w.vertical?y.style.right="0":y.style.left="0",y.style.top="0",w.viewNode.appendChild(y),C=e.clientLayout.getElementClientRect(y),w.viewNode.removeChild(y)}else C={left:e.getLeftEdge()-e.paddingLeft,right:e.getRightEdge()+e.paddingRight,top:e.getTopEdge()-e.paddingTop};(w?w.vertical:e.vertical)?tt(i,"right",C.right-u.x2+"px"):tt(i,"left",u.x1-C.left+"px"),tt(i,"top",u.y1-C.top+"px"),t.clearSpacer&&(t.clearSpacer.parentNode.removeChild(t.clearSpacer),t.clearSpacer=null);var N=e.vertical?u.x1:u.y2,b=e.vertical?u.x2:u.y1;e.isOverflown(N)&&0!=e.breakPositions.length?((t=t.modify()).overflow=!0,n.finish(t)):(e.killFloats(),g=new hn(e.getLeftEdge(),e.getTopEdge(),e.getRightEdge(),e.getBottomEdge()),e.vertical&&(g=bn(g)),function(t,e,n,i,r){for(i||(i=[new pn(n.y1,n.y2,n.x1,n.x2)]);i.length>0&&i[0].y2<=t.y1;)i.shift();if(0!=i.length){var o;i[0].y1<t.y1&&(i[0].y1=t.y1);var a=0==e.length?t.y1:e[e.length-1].y2;a<t.y2&&e.push(new pn(a,t.y2,t.x1,t.x2));for(var s,u=xn(e,i[0].y1),l=B(i);!(s=l()).done;){var h=s.value;if(u==e.length)break;for(e[u].y1<h.y1&&(o=e[u],u++,e.splice(u,0,new pn(h.y1,o.y2,o.x1,o.x2)),o.y2=h.y1);u<e.length&&((o=e[u++]).y2>h.y2&&(e.splice(u,0,new pn(h.y2,o.y2,o.x1,o.x2)),o.y2=h.y2),h.x1!=h.x2&&("left"==r?o.x1=Math.min(h.x2,t.x2):o.x2=Math.max(h.x1,t.x1)),o.y2!=h.y2););}Tn(t,e)}}(g,e.bands,v,null,r),e.createFloats(),"left"==r?e.leftFloatEdge=N:e.rightFloatEdge=N,e.bottommostFloatTop=b,e.updateMaxReachedAfterEdge(N),n.finish(o))})),n.result()},i.setupFloatArea=function(t,e,n,i,r,o){var a=this.pageFloatLayoutContext,s=a.getContainer(e),u=t.element;s.element.parentNode.appendChild(u),t.isFloat=!0,t.originX=s.originX,t.originY=s.originY,t.vertical=s.vertical,t.marginLeft=t.marginRight=t.marginTop=t.marginBottom=0,t.borderLeft=t.borderRight=t.borderTop=t.borderBottom=0,t.paddingLeft=t.paddingRight=t.paddingTop=t.paddingBottom=0,t.exclusions=(s.exclusions||[]).concat(),t.forceNonfitting=!a.hasFloatFragments(),t.innerShape=null;var l=s.getPaddingRect();t.setHorizontalPosition(l.x1-s.originX,l.x2-l.x1),t.setVerticalPosition(l.y1-s.originY,l.y2-l.y1),r.adjustPageFloatArea(t,s,this),t.init();var h=!!a.setFloatAreaDimensions(t,e,n,i,!0,!a.hasFloatFragments(),o);return h?(t.killFloats(),t.init()):s.element.parentNode.removeChild(u),h},i.createPageFloatArea=function(t,e,n,i,r){var o=this.element.ownerDocument.createElement("div");tt(o,"position","absolute");var a=this.pageFloatLayoutContext.getPageFloatLayoutContext(t.floatReference),s=new Ss(null,Cs.COLUMN,null,this.pageFloatLayoutContext.flowName,t.nodePosition,null,null),u=a.getContainer(),l=new Ru(e,o,this.layoutContext.clone(),this.clientLayout,this.layoutConstraint,s,u);return s.setContainer(l),this.setupFloatArea(l,t.floatReference,e,n,i,r)?l:null},i.layoutSinglePageFloatFragment=function(t,e,n,i,r,o,a){var s=this.pageFloatLayoutContext,u=(t=(a?a.continuations:[]).concat(t))[0].float,l=s.getPageFloatPlacementCondition(u,e,n),h=this.createPageFloatArea(u,e,o,r,l),c={floatArea:h,pageFloatFragment:null,newPosition:null};if(!h)return Ri(c);var d=Pi("layoutSinglePageFloatFragment"),f=!1,p=0;return d.loopWithFrame((function(e){if(p>=t.length)e.breakLoop();else{var n=new go(t[p].nodePosition);h.layout(n,!0).then((function(t){c.newPosition=t,!t||i?(p++,e.continueLoop()):(f=!0,e.breakLoop())}))}})).then((function(){if(!f){var n=s.setFloatAreaDimensions(h,u.floatReference,e,o,!1,i,l);if(n){var a=r.createPageFloatFragment(t,n,h,!!c.newPosition);s.addPageFloatFragment(a,!0),c.pageFloatFragment=a}else f=!0}d.finish(c)})),d.result()},i.layoutPageFloatInner=function(t,e,n,i){var r=this,o=this.pageFloatLayoutContext,a=t.float;function s(e,n){n?o.removePageFloatFragment(n,!0):e&&e.element.parentNode.removeChild(e.element),o.restoreStashedFragments(a.floatReference),o.deferPageFloat(t)}o.stashEndFloatFragments(a);var u=Pi("layoutPageFloatInner");return this.layoutSinglePageFloatFragment([t],a.floatSide,a.clearSide,!o.hasFloatFragments(),e,n,i).then((function(t){var e=t.floatArea,n=t.pageFloatFragment,l=t.newPosition;n?r.layoutStashedPageFloats(a.floatReference,[i]).then((function(t){if(t){if(o.addPageFloatFragment(n),o.discardStashedFragments(a.floatReference),l){var i=new bs(a,l.primary);o.deferPageFloat(i)}u.finish(!0)}else s(e,n),u.finish(!1)})):(s(e,n),u.finish(!1))})),u.result()},i.layoutStashedPageFloats=function(t,e){var n=this,i=this.pageFloatLayoutContext,r=i.getStashedFloatFragments(t),o=[],a=[],s=!1,u=Pi("layoutStashedPageFloats"),l=0;return u.loopWithFrame((function(t){if(l>=r.length)t.breakLoop();else{var i=r[l];if(e.includes(i))return l++,void t.continueLoop();var u=(new Ts).findByFloat(i.continuations[0].float);n.layoutSinglePageFloatFragment(i.continuations,i.floatSide,null,!1,u,null).then((function(e){var n=e.floatArea;n&&o.push(n);var i=e.pageFloatFragment;i?(a.push(i),l++,t.continueLoop()):(s=!0,t.breakLoop())}))}})).then((function(){s?(a.forEach((function(t){i.removePageFloatFragment(t,!0)})),o.forEach((function(t){var e=t.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))):r.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)})),u.finish(!s)})),u.result()},i.setFloatAnchorViewNode=function(t){var e=t.viewNode.parentNode,n=e.ownerDocument.createElement("span");n.setAttribute("data-adapt-spec","1"),"footnote"===t.floatSide&&this.layoutContext.applyPseudoelementStyle(t,"footnote-call",n),e.appendChild(n),e.removeChild(t.viewNode);var i=t.modify();return i.after=!0,i.viewNode=n,i},i.resolveFloatReferenceFromColumnSpan=function(t,e,n){var i=this,r=Pi("resolveFloatReferenceFromColumnSpan"),o=this.pageFloatLayoutContext,a=o.getPageFloatLayoutContext(Cs.REGION);return o.getContainer().width<a.getContainer().width&&t===Cs.COLUMN?e===en.auto?this.buildDeepElementView(n.copy()).then((function(e){var n=e.viewNode,o=Es(i.clientLayout,n,[vs.MIN_CONTENT_INLINE_SIZE])[vs.MIN_CONTENT_INLINE_SIZE],a=i.getComputedMargin(n);r.finish((o+=i.vertical?a.top+a.bottom:a.left+a.right)>i.width?Cs.REGION:t)})):r.finish(e===en.all?Cs.REGION:t):r.finish(t),r.result()},i.layoutPageFloat=function(t){var e=this,n=this.pageFloatLayoutContext,i=(new Ts).findByNodeContext(t),r=n.findPageFloatByNodePosition(t.toNodePosition());return(r?Ri(r):i.createPageFloat(t,n,this)).thenAsync((function(r){var o=so(t,0),a=e.setFloatAnchorViewNode(t),s=i.findPageFloatFragment(r,n),u=new bs(r,o);if(s&&s.hasFloat(r))return n.registerPageFloatAnchor(r,a.viewNode),Ri(a);if(n.isForbidden(r)||n.hasPrecedingFloatsDeferredToNext(r))return n.deferPageFloat(u),n.registerPageFloatAnchor(r,a.viewNode),Ri(a);if(e.nodeContextOverflowingDueToRepetitiveElements)return Ri(null);var l=Hs(a,e.clientLayout,0,e.vertical);return e.isOverflown(l)?Ri(a):e.layoutPageFloatInner(u,i,l,s).thenAsync((function(t){return t?Ri(null):(n.registerPageFloatAnchor(r,a.viewNode),Ri(a))}))}))},i.createJustificationAdjustmentElement=function(t,e,n,i){var r=e.createElement("span");r.style.visibility="hidden",r.style.verticalAlign="top",r.setAttribute("data-adapt-spec","1");var o=e.createElement("span");o.style.fontSize="0",o.style.lineHeight="0",o.textContent=" #",r.appendChild(o),r.style.display="block",r.style.textIndent="0",r.style.textAlign="left",n.insertBefore(r,t);var a=this.clientLayout.getElementClientRect(o);r.style.textAlign="right";var s=this.clientLayout.getElementClientRect(o);r.style.textAlign="",r.style.display=function(t){if(null===mt){var e=t.ownerDocument,n=e.createElement("div");n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.width="30px",n.style.height="100px",n.style.lineHeight="16px",n.style.fontSize="16px",n.style.textAlign="justify",t.appendChild(n);var i=e.createTextNode("a | ");n.appendChild(i);var r=e.createElement("span");r.style.display="inline-block",r.style.width="30px",n.appendChild(r);var o=e.createRange();o.setStart(i,0),o.setEnd(i,3);var a=o.getBoundingClientRect();mt=a.right<27,t.removeChild(n)}return mt}(document.body)?"inline":"inline-block";var u=i?s.top-a.top:s.left-a.left,l=u>=1?u-1+"px":"100%";return i?r.style.paddingTop=l:r.style.paddingLeft=l,r},i.addAndAdjustJustificationElement=function(t,e,n,i,r,o){return function(t,e,n,i){if(function(t){if(null===Et){var e=t.ownerDocument,n=e.createElement("div");n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.width="40px",n.style.height="100px",n.style.lineHeight="16px",n.style.fontSize="16px",n.style.textAlign="justify",t.appendChild(n);var i=e.createTextNode("a a-");n.appendChild(i);var r=e.createElement("span");r.style.display="inline-block",r.style.width="40px",n.appendChild(r);var o=e.createRange();o.setStart(i,2),o.setEnd(i,4);var a=o.getBoundingClientRect();Et=a.right<37,t.removeChild(n)}return Et}(document.body)){var r=Iu(t),o=e?n:n.previousSibling,a=o?o.textContent:"";if(a.charAt(a.length-1)===r){var s=n.ownerDocument,u=n.parentNode;!function(t){if(null===Ct){var e=t.ownerDocument,n=e.createElement("div");n.style.position="absolute",n.style.top="0px",n.style.left="0px",n.style.width="40px",n.style.height="100px",n.style.lineHeight="16px",n.style.fontSize="16px",n.style.textAlign="justify",t.appendChild(n);var i=e.createTextNode("a a-");n.appendChild(i),n.appendChild(e.createElement("wbr"));var r=e.createElement("span");r.style.display="inline-block",r.style.width="40px",n.appendChild(r);var o=e.createRange();o.setStart(i,2),o.setEnd(i,4);var a=o.getBoundingClientRect();Ct=a.right<37,t.removeChild(n)}return Ct}(document.body)?u.insertBefore(s.createElement("wbr"),i):u.insertBefore(s.createTextNode(" "),i)}}}(t,e,n,i),this.createJustificationAdjustmentElement(i,r,o,t.vertical)},i.compensateJustificationLineHeight=function(t,e,n){var i=this.clientLayout.getElementClientRect(t),r=this.clientLayout.getElementClientRect(e);n.vertical?(e.style.marginRight=r.right-i.right+"px",e.style.width="0px"):(e.style.marginTop=i.top-r.top+"px",e.style.height="0px"),e.setAttribute("data-adapt-spec","1")},i.fixJustificationIfNeeded=function(t,e){if(!t.after||t.inline){if(e){for(var n="",i=t.parent;i&&!n;i=i.parent)!i.inline&&i.viewNode&&(n=i.viewNode.style.textAlign);if("justify"!==n)return}var r=t.viewNode,o=r.ownerDocument,a=e&&(t.after||1!=r.nodeType),s=a?r.nextSibling:r;s&&!s.parentNode&&(s=null);var u=r.parentNode||t.parent&&t.parent.viewNode;if(u){var l=this.addAndAdjustJustificationElement(t,a,r,s,o,u);if(!e){var h=o.createElement("div");u.insertBefore(h,s),this.compensateJustificationLineHeight(l,h,t)}}}},i.processLineStyling=function(t,e,n){var i=this,r=Pi("processLineStyling"),o=n.concat([]);n.splice(0,n.length);var a=0,s=t.firstPseudo;return 0==s.count&&(s=s.outer),r.loopWithFrame((function(n){if(s){var r=i.findLinePositions(o),u=s.count-a;if(r.length<=u)n.breakLoop();else{var l=i.findAcceptableBreakInside(o,r[u-1],!0);null!=l?i.finishBreak(l,!1,!1).then((function(){a+=u,i.layoutContext.peelOff(l,0).then((function(r){i.fixJustificationIfNeeded(t=r,!1),s=t.firstPseudo,i.buildViewToNextBlockEdge(t,o=[]).then((function(t){e=t,n.continueLoop()}))}))})):n.breakLoop()}}else n.breakLoop()})).then((function(){Array.prototype.push.apply(n,o),r.finish(e)})),r.result()},i.isLoneImage=function(t){return!(2!=t.length&&this.breakPositions.length>0)&&t[0].sourceNode==t[1].sourceNode&&yu[t[0].sourceNode.localName]},i.getTrailingMarginEdgeAdjustment=function(t){for(var e=0,n=0,i=t.length-1;i>=0;i--){var r=t[i];if(!r.after||!r.viewNode||1!=r.viewNode.nodeType)break;var o=this.getComputedMargin(r.viewNode),a=this.vertical?-o.left:o.bottom;a>0?e=Math.max(e,a):n=Math.min(n,a)}return e-n},i.layoutBreakableBlock=function(t){var e=this,n=Pi("layoutBreakableBlock"),i=[];return this.buildViewToNextBlockEdge(t,i).then((function(r){var o=i.length-1;if(o<0)n.finish(r);else{var a=e.calculateEdge(r,i,o,i[o].boxOffset),s=!1;if(!r||!Gs(r.viewNode)){var u=Ys(r,e.collectElementsOffset());s=e.isOverflown(a+(e.vertical?-1:1)*u.minimum),e.isOverflown(a+(e.vertical?-1:1)*u.current)&&!e.nodeContextOverflowingDueToRepetitiveElements&&(e.nodeContextOverflowingDueToRepetitiveElements=r)}null==r&&(a+=e.getTrailingMarginEdgeAdjustment(i)),e.updateMaxReachedAfterEdge(a),(t.firstPseudo?e.processLineStyling(t,r,i):Ri(r)).then((function(t){e.postLayoutBlock(t,i),i.length>0&&(e.saveBoxBreakPosition(i),s&&!e.isLoneImage(i)&&t&&((t=t.modify()).overflow=!0)),n.finish(t)}))}})),n.result()},i.postLayoutBlock=function(t,n){var i=this;v(e.HOOKS.POST_LAYOUT_BLOCK).forEach((function(e){e(t,n,i)}))},i.findEndOfLine=function(t,e,n){for(var i,r=this.vertical?t-1:t+1,o=0,a=e[0].boxOffset,s=o,u=e.length-1,l=e[u].boxOffset;a<l;){i=a+Math.ceil((l-a)/2),s=o;for(var h=u;s<h;){var c=s+Math.ceil((h-s)/2);e[c].boxOffset>i?h=c-1:s=c}var d=this.calculateEdge(null,e,s,i);if(this.vertical?d<=r:d>=r){for(l=i-1;e[s].boxOffset==i;)s--;u=s}else n&&this.updateMaxReachedAfterEdge(d),a=i,o=s}return{nodeContext:e[s],index:a,checkPointIndex:s}},i.findAcceptableBreakInside=function(t,e,n){var i=this.findEndOfLine(e,t,!0),r=i.nodeContext,o=r.viewNode;if(1!=o.nodeType){var a=o;r=this.resolveTextNodeBreaker(r).breakTextNode(a,r,i.index,t,i.checkPointIndex,n)}return this.clearOverflownViewNodes(r,!1),r},i.resolveTextNodeBreaker=function(t){return v(e.HOOKS.RESOLVE_TEXT_NODE_BREAKER).reduce((function(e,n){return n(t)||e}),xu.instance)},i.getRangeBoxes=function(t,e){for(var n=[],i=t.ownerDocument.createRange(),r=!1,o=t,a=null,s=!1,u=!0;u;){var l=!0;do{var h=null;o==e&&(u=1===e.nodeType&&!(!e.firstChild||r)),1!=o.nodeType?(s||(null==o.parentNode?u=!1:(i.setStartBefore(o),s=!0)),a=o):r?r=!1:Ws(o)?l=!s:/^r(uby|[bt]c?)$/.test(o.localName)||Su(this.clientLayout.getElementComputedStyle(o).display)?((l=!s)&&(i.setStartBefore(o),s=!0,a=o),o.contains(e)&&(u=!1)):h=o.firstChild,h||(h=o.nextSibling)||(r=!0,h=o.parentNode),o=h}while(l&&u);if(s){i.setEndAfter(a);for(var c=this.clientLayout.getRangeClientRects(i),d=0;d<c.length;d++)n.push(c[d]);s=!1}}return n},i.findLinePositions=function(t){var e=[],n=this.getRangeBoxes(t[0].viewNode,t[t.length-1].viewNode);n.sort(this.vertical?ro:io);for(var i=0,r=0,o=0,a=0,s=0,u=this.getBoxDir();;){if(s<n.length){var l=n[s],h=1;if(a>0){var c=Math.max(this.getBoxSize(l),1);h=u*this.getBeforeEdge(l)<u*i?u*(this.getAfterEdge(l)-i)/c:u*this.getAfterEdge(l)>u*r?u*(r-this.getBeforeEdge(l))/c:1}if(0==a||h>=.6||h>=.2&&this.getStartEdge(l)>=o-1){o=this.getEndEdge(l),this.vertical?(i=0==a?l.right:Math.max(i,l.right),r=0==a?l.left:Math.min(r,l.left)):(i=0==a?l.top:Math.min(i,l.top),r=0==a?l.bottom:Math.max(r,l.bottom)),a++,s++;continue}}if(a>0&&(e.push(r),a=0),s>=n.length)break}return e.sort(dt),this.vertical&&e.reverse(),e},i.calculateClonedPaddingBorder=function(t){var e=this,n=0;return t.walkUpBlocks((function(t){if("clone"===t.inheritedProps["box-decoration-break"]){var i=e.getComputedPaddingBorder(t.viewNode);n+=t.vertical?-i.left:i.bottom,"table"===t.display&&(n+=t.blockBorderSpacing)}})),n},i.getOffsetByRepetitiveElements=function(t){return(t?t.calculateOffset(this):Ys(null,this.collectElementsOffset())).current},i.findBoxBreakPosition=function(t,e){for(var n,i,r=this,o=t.checkPoints,a=o[0];a.parent&&a.inline;)a=a.parent;e?(n=1,i=1):(n=Math.max((a.inheritedProps.widows||2)-0,1),i=Math.max((a.inheritedProps.orphans||2)-0,1));var s=this.calculateClonedPaddingBorder(a),u=this.findLinePositions(o),l=this.footnoteEdge-s,h=this.getBoxDir(),c=this.getOffsetByRepetitiveElements(t);l-=h*c;var d=this.findFirstOverflowingEdgeAndCheckPoint(o);isNaN(d.edge)&&(d.edge=1/0*h);var f,p=ct(u.length,(function(t){var e=u[t];return r.vertical?e<l||e<=d.edge:e>l||e>=d.edge})),g=p<=0;if(g&&(p=ct(u.length,(function(t){return r.vertical?u[t]<l:u[t]>l}))),(p=Math.min(u.length-n,p))<i)return null;if(l=u[p-1],f=g?d.checkPoint:this.findAcceptableBreakInside(t.checkPoints,l,e)){var v=this.getAfterEdgeOfBlockContainer(f);!isNaN(v)&&v<l&&(l=v),this.computedBlockSize=h*(l-this.beforeEdge)+c}return f},i.getAfterEdgeOfBlockContainer=function(t){var e=t;do{e=e.parent}while(e&&e.inline);return e?((e=e.copy().modify()).after=!0,Hs(e,this.clientLayout,0,this.vertical)):NaN},i.findFirstOverflowingEdgeAndCheckPoint=function(t){var e=t.findIndex((function(t){return t.overflow}));if(e<0)return{edge:NaN,checkPoint:null};var n=t[e];return{edge:this.calculateEdge(null,t,e,n.boxOffset),checkPoint:n}},i.findEdgeBreakPosition=function(t){return this.computedBlockSize=t.computedBlockSize+this.getOffsetByRepetitiveElements(t),t.position},i.finishBreak=function(t,e,n){var i=(new eu).find(t.formattingContext).finishBreak(this,t,e,n);return i||(i=ru.finishBreak(this,t,e,n)),i},i.findAcceptableBreakPosition=function(){var t=null,e=null,n=0,i=0;do{n=i,i=Number.MAX_VALUE;for(var r=this.breakPositions.length-1;r>=0&&!e;--r){e=(t=this.breakPositions[r]).findAcceptableBreak(this,n);var o=t.getMinBreakPenalty();o>n&&(i=Math.min(i,o))}}while(i>n&&!e&&this.forceNonfitting);return{breakPosition:e?t:null,nodeContext:e}},i.doFinishBreak=function(t,e,n,i){var r=this;if(this.pageFloatLayoutContext.isInvalidated()||this.pageBreakType||!e)return Ri(t);var o=Pi("doFinishBreak"),a=!1;if(!t){if(this.forceNonfitting)return c.warn("Could not find any page breaks?!!"),this.skipTailEdges(e).then((function(t){t?((t=t.modify()).overflow=!1,r.finishBreak(t,a,!0).then((function(){o.finish(t)}))):o.finish(t)})),o.result();t=n,a=!0,this.computedBlockSize=i}return this.finishBreak(t,a,!0).then((function(){o.finish(t)})),o.result()},i.isBreakable=function(t){return!!t.after||t.sourceNode.namespaceURI!==G.SVG&&!t.flexContainer},i.zeroIndent=function(t){var e=t.toString();return""==e||"auto"==e||!!e.match(/^0+(.0*)?[^0-9]/)},i.checkOverflowAndSaveEdge=function(t,e){if(!t)return!1;if(Gs(t.viewNode))return!1;var n=Hs(t,this.clientLayout,0,this.vertical),i=Ys(t,this.collectElementsOffset()),r=this.isOverflown(n+(this.vertical?-1:1)*i.minimum);if(this.isOverflown(n+(this.vertical?-1:1)*i.current)&&!this.nodeContextOverflowingDueToRepetitiveElements)this.nodeContextOverflowingDueToRepetitiveElements=t;else if(e){var o=n+this.getTrailingMarginEdgeAdjustment(e),a=this.footnoteEdge-this.getBoxDir()*i.current;n=this.vertical?Math.min(n,Math.max(o,a)):Math.max(n,Math.min(o,a))}return this.updateMaxReachedAfterEdge(n),r},i.checkOverflowAndSaveEdgeAndBreakPosition=function(t,e,n,i){if(!t)return!1;if(Gs(t.viewNode))return!1;var r=this.checkOverflowAndSaveEdge(t,e);return!n&&r||this.saveEdgeBreakPosition(t,i,r),r},i.applyClearance=function(t){if(!t.viewNode.parentNode)return!1;var e=this.getComputedMargin(t.viewNode),n=t.viewNode.ownerDocument.createElement("div");this.vertical?(n.style.bottom="0px",n.style.width="1px",n.style.marginRight=e.right+"px"):(n.style.right="0px",n.style.height="1px",n.style.marginTop=e.top+"px"),t.viewNode.parentNode.insertBefore(n,t.viewNode);var i=this.clientLayout.getElementClientRect(n),r=this.getBeforeEdge(i),o=this.getBoxDir(),a=t.clearSide,s=1/0*-this.getBoxDir();switch("all"===a&&(s=this.pageFloatLayoutContext.getPageFloatClearEdge(a,this)),a){case"left":s=o*Math.max(s*o,this.leftFloatEdge*o);break;case"right":s=o*Math.max(s*o,this.rightFloatEdge*o);break;default:s=o*Math.max(s*o,Math.max(this.rightFloatEdge*o,this.leftFloatEdge*o))}if(r*o>=s*o)return t.viewNode.parentNode.removeChild(n),!1;var u=Math.max(1,(s-r)*o);this.vertical?n.style.width=u+"px":n.style.height=u+"px",i=this.clientLayout.getElementClientRect(n);var l=this.getAfterEdge(i);if(this.vertical){var h=l+e.right-s;h>0==e.right>=0&&(h+=e.right),n.style.marginLeft=h+"px"}else{var c=s-(l+e.top);c>0==e.top>=0&&(c+=e.top),n.style.marginBottom=c+"px"}return t.clearSpacer=n,!0},i.isBFC=function(t){return!!ou(t)||!!Vr.isInstanceOfRepetitiveElementsOwnerFormattingContext(t)},i.skipEdges=function(t,e,n){var i,r=this,o=t.after?null==(i=t.parent)?void 0:i.formattingContext:t.formattingContext;if(o&&!this.isBFC(o))return Ri(t);var a=Pi("skipEdges"),s=!n&&e&&t&&t.after,u=n,l=null,h=[],c=[],d=!1;function f(){return!!n||!e&&Ls(u)}var p=function(){(t=h[0]||t).viewNode.parentNode.removeChild(t.viewNode),r.pageBreakType=u};return a.loopWithFrame((function(n){for(;t;){var i=(new eu).find(t.formattingContext);do{if(!t.viewNode)break;if(t.inline&&1!=t.viewNode.nodeType){if(to(t.viewNode,t.whitespace))break;if(!t.after)return f()?p():r.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,u)?(t=(r.stopAtOverflow&&l||t).modify()).overflow=!0:(t=t.modify()).breakBefore=u,void n.breakLoop()}if(!t.after){if(i&&i.startNonInlineElementNode(t))break;if(t.clearSide&&r.applyClearance(t)&&e&&0===r.breakPositions.length&&r.saveEdgeBreakPosition(t.copy(),u,!1),!r.isBFC(t.formattingContext)||Vr.isInstanceOfRepetitiveElementsOwnerFormattingContext(t.formattingContext)||r.isFloatNodeContext(t)||t.flexContainer)return h.push(t.copy()),u=Ms(u,t.breakBefore),f()?p():!r.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,u)&&r.layoutConstraint.allowLayout(t)||((t=(r.stopAtOverflow&&l||t).modify()).overflow=!0),void n.breakLoop()}if(1!=t.viewNode.nodeType)break;var o=t.viewNode.style;if(t.after){var a=t.sourceNode;if("svg"===a.localName||"math"===a.localName||"true"===a.getAttribute("data-math-typeset")){d=!1,l=t.copy(),c.push(l),u=Ms(null,t.breakAfter),r.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!r.stopAtOverflow,u);break}if(t.inline)break;if(i&&i.afterNonInlineElementNode(t,r.stopAtOverflow))break;if(d){if(f())return p(),void n.breakLoop();h=[],e=!1,s=!1,u=null}d=!1,l=t.copy(),c.push(l),u=Ms(u,t.breakAfter),!o||r.zeroIndent(o.paddingBottom)&&r.zeroIndent(o.borderBottomWidth)||(c=[l])}else{var g;if(h.push(t.copy()),u=Ms(u,t.breakBefore),!(t.pageType==(null==(g=t.parent)?void 0:g.pageType)&&Ls(u)||r.layoutConstraint.allowLayout(t))&&(r.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!r.stopAtOverflow,u),(t=t.modify()).overflow=!0,r.stopAtOverflow))return void n.breakLoop();if(yu[t.viewNode.localName])return f()?p():r.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,u)&&((t=(r.stopAtOverflow&&l||t).modify()).overflow=!0),void n.breakLoop();!o||r.zeroIndent(o.paddingTop)&&r.zeroIndent(o.borderTopWidth)||(s=!1,c=[]),d=!0}}while(0);var v=r.nextInTree(t,s);if(v.isPending())return void v.then((function(e){t=e,n.continueLoop()}));t=v.get()}r.checkOverflowAndSaveEdgeAndBreakPosition(l,c,!r.stopAtOverflow,u)?l&&r.stopAtOverflow&&((t=l.modify()).overflow=!0):Ls(u)&&(r.pageBreakType=u),n.breakLoop()})).then((function(){l&&(r.lastAfterPosition=l.toNodePosition()),a.finish(t)})),a.result()},i.skipTailEdges=function(t){var e=this,n=t.copy(),i=Pi("skipEdges"),r=null,o=!1;return i.loopWithFrame((function(i){for(;t;){do{if(!t.viewNode)break;if(t.inline&&1!=t.viewNode.nodeType){if(to(t.viewNode,t.whitespace))break;if(!t.after)return Ls(r)&&(e.pageBreakType=r),void i.breakLoop()}if(!t.after&&(e.isFloatNodeContext(t)||t.flexContainer))return Ls(r=Ms(r,t.breakBefore))&&(e.pageBreakType=r),void i.breakLoop();if(1!=t.viewNode.nodeType)break;var a=t.viewNode.style;if(t.after){if(o){if(Ls(r))return e.pageBreakType=r,void i.breakLoop();r=null}o=!1,r=Ms(r,t.breakAfter)}else{if(r=Ms(r,t.breakBefore),yu[t.viewNode.localName])return Ls(r)&&(e.pageBreakType=r),void i.breakLoop();if(a&&(!e.zeroIndent(a.paddingTop)||!e.zeroIndent(a.borderTopWidth)))return void i.breakLoop()}o=!0}while(0);var s=e.layoutContext.nextInTree(t);if(s.isPending())return void s.then((function(e){t=e,i.continueLoop()}));t=s.get()}n=null,i.breakLoop()})).then((function(){i.finish(n)})),i.result()},i.layoutFloatOrFootnote=function(t){return Ds(t.floatReference)||"footnote"===t.floatSide?this.layoutPageFloat(t):this.layoutFloat(t)},i.layoutNext=function(t,e,n){var i=this,r=Pi("layoutNext");return this.skipEdges(t,e,n||null).then((function(n){if(!(t=n)||i.pageBreakType||i.stopByOverflow(t))r.finish(t);else{var o=t.formattingContext;(new eu).find(o).layout(t,i,e).thenFinish(r)}})),r.result()},i.clearOverflownViewNodes=function(t,e){if(t)for(var n=t.parent;t;t=n,n=n?n.parent:null){var i=(n||t).formattingContext;(new eu).find(i).clearOverflownViewNodes(this,n,t,e),e=!1}},i.initGeom=function(){var t=this.element.ownerDocument.createElement("div");t.style.position="absolute",t.style.top=this.paddingTop+"px",t.style.right=this.paddingRight+"px",t.style.bottom=this.paddingBottom+"px",t.style.left=this.paddingLeft+"px",this.element.appendChild(t);var e=this.clientLayout.getElementClientRect(t);this.element.removeChild(t);var n=this.originX+this.left+this.getInsetLeft(),i=this.originY+this.top+this.getInsetTop();this.box=new hn(n,i,n+this.width,i+this.height),this.startEdge=e?this.vertical?e.top:e.left:0,this.endEdge=e?this.vertical?e.bottom:e.right:0,this.beforeEdge=e?this.vertical?e.right:e.top:0,this.afterEdge=e?this.vertical?e.left:e.bottom:0,this.leftFloatEdge=this.beforeEdge,this.rightFloatEdge=this.beforeEdge,this.bottommostFloatTop=this.beforeEdge,this.footnoteEdge=this.afterEdge,this.bands=function(t,e,n,i,r,o){o&&(t=bn(t),e=e.map((function(t){return An(t)})),n=n.map((function(t){return An(t)})));var a,s,u,l=e.length,h=n?n.length:0,c=[],d=[];for(a=0;a<l;a++)e[a].addSegments(d,a);for(a=0;a<h;a++)n[a].addSegments(d,a+l);var f=d.length;d.sort(gn);for(var p=0;d[p].shapeId>=l;)p++;var g=d[p].low.y;g>t.y1&&c.push(new pn(t.y1,g,t.x2,t.x2));for(var v,m,E=0,C=[];E<f&&(u=d[E]).low.y<g;)u.high.y>g&&C.push(u),E++;for(;E<f||C.length>0;){var D=t.y2,w=Math.min((v=Math.ceil(g+8),(m=r)?Math.ceil(v/m)*m:v),t.y2);for(s=0;s<C.length&&D>w;s++)(u=C[s]).low.x==u.high.x?u.high.y<D&&(D=Math.max(Nn(u.high.y,r),w)):u.low.x!=u.high.x&&(D=w);for(D>t.y2&&(D=t.y2);E<f&&(u=d[E]).low.y<D;)if(u.high.y<g)E++;else{if(!(u.low.y<w)){var y=Nn(u.low.y,r);y<D&&(D=y);break}u.low.y==u.high.y&&u.low.y==g||(C.push(u),D=w),E++}var N=[];for(s=0;s<C.length;s++)wn(N,C[s],g,D);N.sort((function(t,e){return t.x-e.x||t.lowOrHigh-e.lowOrHigh}));var b=yn(N,l,h);if(0==b.length)c.push(new pn(g,D,t.x2,t.x2));else{var S=0,A=t.x1;for(s=0;s<b.length;s+=2){var T=Math.max(t.x1,b[s]),x=Math.min(t.x2,b[s+1])-T;x>S&&(S=x,A=T)}c.push(0==S?new pn(g,D,t.x2,t.x2):new pn(g,D,Math.max(A,t.x1),Math.min(A+S,t.x2)))}if(D==t.y2)break;for(g=D,s=C.length-1;s>=0;s--)C[s].high.y<=D&&C.splice(s,1)}return Tn(t,c),c}(this.box,[this.getInnerShape()],this.getExclusions(),0,this.snapHeight,this.vertical),this.createFloats()},i.init=function(){this.chunkPositions=[],tt(this.element,"width",this.width+"px"),tt(this.element,"height",this.height+"px"),this.initGeom(),this.computedBlockSize=0,this.overflown=!1,this.pageBreakType=null,this.lastAfterPosition=null},i.saveEdgeBreakPosition=function(t,e,n){var i=t.copy(),r=(new eu).find(t.formattingContext),o=this.calculateClonedPaddingBorder(i),a=r.createEdgeBreakPosition(i,e,n,this.computedBlockSize+o);this.breakPositions.push(a)},i.saveBoxBreakPosition=function(t){var e=t[0].breakPenalty;if(e){for(var n=t[0];n.parent&&n.inline;)n=n.parent;e=n.breakPenalty}var i=new bu(t,e);this.breakPositions.push(i)},i.updateMaxReachedAfterEdge=function(t){if(!isNaN(t)){var e=this.getBoxDir()*(t-this.beforeEdge);this.computedBlockSize=Math.max(e,this.computedBlockSize)}},i.layout=function(t,e,n){var i=this;if(this.chunkPositions.push(t),t.primary.after&&(this.lastAfterPosition=t.primary),this.stopAtOverflow&&this.overflown)return Ri(t);if(this.isFullWithPageFloats())return Ri(t.primary.after&&1===t.primary.steps.length?null:t);var r=Pi("layout");return this.openAllViews(t.primary).then((function(t){var o=null;t.viewNode?o=t.copy():i.layoutContext.addEventListener("nextInTree",(function t(e){e.nodeContext.viewNode&&(o=e.nodeContext,i.layoutContext.removeEventListener("nextInTree",t))}));var a=new Fu(e,n);a.layout(t,i).then((function(t){i.doFinishBreak(t,a.context.overflownNodeContext,o,a.initialComputedBlockSize).then((function(t){(i.pseudoParent?Ri(null):i.doFinishBreakOfFragmentLayoutConstraints(t)).then((function(){if(i.pageFloatLayoutContext.isInvalidated())r.finish(null);else if(t){i.overflown=!0;var e=new go(t.toNodePosition());r.finish(e)}else r.finish(null)}))}))}))})),r.result()},i.isFullWithPageFloats=function(){return this.pageFloatLayoutContext.isColumnFullWithPageFloats(this)},i.getMaxBlockSizeOfPageFloats=function(){return this.pageFloatLayoutContext.getMaxBlockSizeOfPageFloats()},i.doFinishBreakOfFragmentLayoutConstraints=function(t){var e=this,n=Pi("doFinishBreakOfFragmentLayoutConstraints"),i=[].concat(this.fragmentLayoutConstraints);i.sort((function(t,e){return t.getPriorityOfFinishBreak()-e.getPriorityOfFinishBreak()}));var r=0;return n.loop((function(){return r<i.length?i[r++].finishBreak(t,e).thenReturn(!0):Ri(!1)})).then((function(){n.finish(!0)})),n.result()},i.doLayout=function(t,e,n){var i=this,r=Pi("doLayout"),o=null;return this.breakPositions=[],this.nodeContextOverflowingDueToRepetitiveElements=null,r.loopWithFrame((function(r){for(var a=function(){var a=!0;if(i.layoutNext(t,e,n||null).then((function(s){if(e=!1,n=null,i.nodeContextOverflowingDueToRepetitiveElements&&i.stopAtOverflow?(i.pageBreakType=null,(t=i.nodeContextOverflowingDueToRepetitiveElements).overflow=!0):t=s,i.pageFloatLayoutContext.isInvalidated())r.breakLoop();else if(i.pageBreakType)r.breakLoop();else if(t&&i.stopByOverflow(t)){o=t;var u=i.findAcceptableBreakPosition();t=u.nodeContext,u.breakPosition&&u.breakPosition.breakPositionChosen(i),r.breakLoop()}else a?a=!1:r.continueLoop()})),a)return a=!1,{v:void 0}};t;){var s=a();if("object"==typeof s)return s.v}i.computedBlockSize+=i.getOffsetByRepetitiveElements(),r.breakLoop()})).then((function(){r.finish({nodeContext:t,overflownNodeContext:o})})),r.result()},i.redoLayout=function(){for(var t=this,e=this.chunkPositions,n=this.element.lastChild;n!=this.last;){var i=n.previousSibling;this.element===n.parentNode&&this.layoutContext.isPseudoelement(n)||this.element.removeChild(n),n=i}this.killFloats(),this.init();var r=Pi("redoLayout"),o=0,a=null,s=!0;return r.loopWithFrame((function(n){if(o<e.length){var i=e[o++];t.layout(i,s).then((function(t){s=!1,t?(a=t,n.breakLoop()):n.continueLoop()}))}else n.breakLoop()})).then((function(){r.finish(a)})),r.result()},i.saveDistanceToBlockEndFloats=function(){var t=this.pageFloatLayoutContext.getBlockStartEdgeOfBlockEndFloats();t>0&&isFinite(t)&&(this.blockDistanceToBlockEndFloats=this.getBoxDir()*(t-this.beforeEdge-this.computedBlockSize))},i.collectElementsOffset=function(){for(var t=this,e=[],n=this;n;n=n.pseudoParent)n.fragmentLayoutConstraints.forEach((function(n){if(Vr.isInstanceOfRepetitiveElementsOwnerLayoutConstraint(n)){var i=n.getRepetitiveElements();e.push(i)}if(Ur.isInstanceOfAfterIfContinuesLayoutConstraint(n)){var r=n.getRepetitiveElements();e.push(r)}Hr.isInstanceOfTableRowLayoutConstraint(n)&&n.getElementsOffsetsForTableCell(t).forEach((function(t){e.push(t)}))}));return e},n}(Co),Tu=function(){function t(t,e,n){this.startNodeContexts=[],this.column=void 0,this.column=Object.create(t),this.column.element=e,this.column.layoutContext=t.layoutContext.clone(),this.column.stopAtOverflow=!1,this.column.flowRootFormattingContext=n.formattingContext,this.column.pseudoParent=t;var i=this.column.calculateClonedPaddingBorder(n);this.column.footnoteEdge=this.column.footnoteEdge-i;var r=this;this.column.openAllViews=function(t){return Au.prototype.openAllViews.call(this,t).thenAsync((function(t){return r.startNodeContexts.push(t.copy()),Ri(t)}))}}var e=t.prototype;return e.layout=function(t,e){return this.column.layout(t,e)},e.findAcceptableBreakPosition=function(t){var e=this.column.findAcceptableBreakPosition();if(t){var n=this.startNodeContexts[0].copy(),i=new qs(n,null,n.overflow,0);if(i.findAcceptableBreak(this.column,0),!e.nodeContext)return{breakPosition:i,nodeContext:n}}return e},e.finishBreak=function(t,e,n){return this.column.finishBreak(t,e,n)},e.doFinishBreakOfFragmentLayoutConstraints=function(t){this.column.doFinishBreakOfFragmentLayoutConstraints(t)},e.isStartNodeContext=function(t){var e=this.startNodeContexts[0];return e.viewNode===t.viewNode&&e.after===t.after&&e.offsetInNode===t.offsetInNode},e.isLastAfterNodeContext=function(t){return ao(t.toNodePosition(),this.column.lastAfterPosition)},e.getColumnElement=function(){return this.column.element},e.getColumn=function(){return this.column},t}(),xu=function(){function t(){}var e=t.prototype;return e.breakTextNode=function(t,e,n,i,r,o){if(e.after)e.offsetInNode=t.length;else{var a=n-e.boxOffset,s=t.data;(a=173==s.charCodeAt(a)?this.breakAfterSoftHyphen(t,s,a,e):this.breakAfterOtherCharacter(t,s,a,e))>0&&(e=this.updateNodeContext(e,a,t))}return e},e.breakAfterSoftHyphen=function(t,e,n,i){return t.replaceData(n,e.length-n,i.breakWord?"":Iu(i)),n+1},e.breakAfterOtherCharacter=function(t,e,n,i){var r=e.charAt(n);n++;var o=e.charAt(n);return t.replaceData(n,e.length-n,!i.breakWord&&ut(r)&&ut(o)?Iu(i):""),n},e.updateNodeContext=function(t,e,n){return(t=t.modify()).offsetInNode+=e,t.breakBefore=null,t},t}();function Iu(t){return t.hyphenateCharacter||t.parent&&t.parent.hyphenateCharacter||"-"}xu.instance=void 0,xu.instance=new xu;var Fu=function(t){function e(e,n){var i;return(i=t.call(this)||this).leadingEdge=void 0,i.breakAfter=void 0,i.initialPageBreakType=null,i.initialComputedBlockSize=0,i.initialOverflown=!1,i.context={overflownNodeContext:null},i.leadingEdge=e,i.breakAfter=n||null,i}x(e,t);var n=e.prototype;return n.resolveLayoutMode=function(t){return new Pu(this.leadingEdge,this.breakAfter,this.context)},n.prepareLayout=function(t,e){e.fragmentLayoutConstraints=[],e.pseudoParent||(hu=[])},n.clearNodes=function(e){t.prototype.clearNodes.call(this,e);for(var n=e;n;){var i=n.viewNode;i&&Xs(i.parentNode,i),n=n.parent}},n.saveState=function(e,n){t.prototype.saveState.call(this,e,n),this.initialPageBreakType=n.pageBreakType,this.initialComputedBlockSize=n.computedBlockSize,this.initialOverflown=n.overflown},n.restoreState=function(e,n){t.prototype.restoreState.call(this,e,n),n.pageBreakType=this.initialPageBreakType,n.computedBlockSize=this.initialComputedBlockSize,n.overflown=this.initialOverflown},e}(au),Pu=function(){function t(t,e,n){this.leadingEdge=void 0,this.breakAfter=void 0,this.context=void 0,this.leadingEdge=t,this.breakAfter=e,this.context=n}var e=t.prototype;return e.doLayout=function(t,e){var n=this,i=Pi("DefaultLayoutMode.doLayout");return function(t,e){var n=Pi("processAfterIfContinuesOfAncestors"),i=t;return n.loop((function(){if(null!==i){var t=Du(i,e);return i=i.parent,t.thenReturn(!0)}return Ri(!1)})).then((function(){n.finish(!0)})),n.result()}(t,e).then((function(){e.doLayout(t,n.leadingEdge,n.breakAfter).then((function(t){n.context.overflownNodeContext=t.overflownNodeContext,i.finish(t.nodeContext)}))})),i.result()},e.accept=function(t,e){var n=this;return!(!e.pageFloatLayoutContext.isInvalidated()&&!e.pageBreakType)||e.fragmentLayoutConstraints.length<=0||e.fragmentLayoutConstraints.every((function(i){return i.allowLayout(t,n.context.overflownNodeContext,e)}))},e.postLayout=function(t,e,n,i){if(!i){var r=n.fragmentLayoutConstraints.some((function(e){return e.nextCandidate(t)}));i=!r}return n.fragmentLayoutConstraints.forEach((function(r){r.postLayout(i,t,e,n)})),i},t}(),Ru=function(t){function e(e,n,i,r,o,a,s){var u;return(u=t.call(this,n,i,r,o,a)||this).floatSide=void 0,u.parentContainer=void 0,u.rootViewNodes=[],u.floatMargins=[],u.adjustContentRelativeSize=!0,u.floatSide=e,u.parentContainer=s,u}x(e,t);var n=e.prototype;return n.openAllViews=function(e){var n=this;return t.prototype.openAllViews.call(this,e).thenAsync((function(t){return t&&n.fixFloatSizeAndPosition(t),Ri(t)}))},n.convertPercentageSizesToPx=function(t){var e=this.parentContainer.getPaddingRect(),n=e.x2-e.x1,i=e.y2-e.y1;function r(e,n){e.forEach((function(e){var i=et(t,e);if(i&&"%"===i.charAt(i.length-1)){var r=parseFloat(i);tt(t,e,n*r/100+"px")}}))}r(["width","max-width","min-width"],n),r(["height","max-height","min-height"],i),r(["margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left"],this.vertical?i:n),["margin-top","margin-right","margin-bottom","margin-left"].forEach((function(e){"auto"===et(t,e)&&tt(t,e,"0")}))},n.fixFloatSizeAndPosition=function(t){for(;t.parent;)t=t.parent;var e=t.viewNode;if(this.rootViewNodes.push(e),this.adjustContentRelativeSize&&this.convertPercentageSizesToPx(e),this.floatMargins.push(this.getComputedMargin(e)),this.adjustContentRelativeSize){var n=this.floatSide;if(this.parentContainer.vertical){if("block-end"===n||"left"===n){var i=et(e,"height");""!==i&&"auto"!==i&&tt(e,"margin-top","auto")}}else if("block-end"===n||"bottom"===n){var r=et(e,"width");""!==r&&"auto"!==r&&tt(e,"margin-left","auto")}}},n.getContentInlineSize=function(){var t=this;return Math.max.apply(null,this.rootViewNodes.map((function(e,n){var i=t.clientLayout.getElementClientRect(e),r=t.floatMargins[n];return t.vertical?r.top+i.height+r.bottom:r.left+i.width+r.right})))},e}(Au),Lu=function(){function t(t,e){this.parent=void 0,this.rootSourceNode=void 0,this.formattingContextType="RepetitiveElementsOwner",this.isRoot=!1,this.repetitiveElements=null,this.parent=t,this.rootSourceNode=e}var e=t.prototype;return e.getName=function(){return"Repetitive elements owner formatting context (RepetitiveElementsOwnerFormattingContext)"},e.isFirstTime=function(t,e){return e},e.getParent=function(){return this.parent},e.getRepetitiveElements=function(){return this.repetitiveElements},e.getRootViewNode=function(t){var e=this.getRootNodeContext(t);return e?e.viewNode:null},e.getRootNodeContext=function(t){do{if(!t.belongsTo(this)&&t.sourceNode===this.rootSourceNode)return t}while(t=t.parent);return null},e.initializeRepetitiveElements=function(t){var e=this;this.repetitiveElements||hu.some((function(t){return t.root===e.rootSourceNode&&(e.repetitiveElements=t.elements,!0)}))||(this.repetitiveElements=new Ou(t,this.rootSourceNode),hu.push({root:this.rootSourceNode,elements:this.repetitiveElements}))},e.saveState=function(){},e.restoreState=function(t){},t}(),Ou=function(){function t(t,e){this.vertical=void 0,this.ownerSourceNode=void 0,this.headerSourceNode=null,this.footerSourceNode=null,this.headerViewNode=null,this.footerViewNode=null,this.headerNodePosition=null,this.footerNodePosition=null,this.headerHeight=0,this.footerHeight=0,this.isSkipHeader=!1,this.isSkipFooter=!1,this.enableSkippingFooter=!0,this.enableSkippingHeader=!0,this.doneInitialLayout=!1,this.firstContentSourceNode=null,this.lastContentSourceNode=null,this.affectedNodeCache=[],this.afterLastContentNodeCache=[],this.allowInsert=!1,this.allowInsertRepeatitiveElements=void 0,this.vertical=t,this.ownerSourceNode=e}var e=t.prototype;return e.setHeaderNodeContext=function(t){this.headerNodePosition||(this.headerNodePosition=so(t,0),this.headerSourceNode=t.sourceNode,this.headerViewNode=t.viewNode)},e.setFooterNodeContext=function(t){this.footerNodePosition||(this.footerNodePosition=so(t,0),this.footerSourceNode=t.sourceNode,this.footerViewNode=t.viewNode)},e.updateHeight=function(t){this.headerViewNode&&(this.headerHeight=zs(this.headerViewNode,t,this.vertical),this.headerViewNode=null),this.footerViewNode&&(this.footerHeight=zs(this.footerViewNode,t,this.vertical),this.footerViewNode=null)},e.prepareLayoutFragment=function(){this.isSkipHeader=this.isSkipFooter=!1,this.enableSkippingFooter=!0,this.enableSkippingHeader=!0},e.appendHeaderToFragment=function(t,e,n){return!this.headerNodePosition||this.isSkipHeader?Ri(!0):this.appendElementToFragment(this.headerNodePosition,t,e,n)},e.appendFooterToFragment=function(t,e,n){return!this.footerNodePosition||this.isSkipFooter?Ri(!0):this.appendElementToFragment(this.footerNodePosition,t,e,n)},e.appendElementToFragment=function(t,e,n,i){var r=this,o=e.viewNode,a=e.viewNode.ownerDocument.createElement("div");o.appendChild(a);var s=new Tu(i,a,e),u=s.getColumn().pageBreakType;return s.getColumn().pageBreakType=null,this.allowInsertRepeatitiveElements=!0,s.layout(new go(t),!0).thenAsync((function(){return r.allowInsertRepeatitiveElements=!1,o.removeChild(a),r.moveChildren(a,o,n),s.getColumn().pageBreakType=u,Ri(!0)}))},e.moveChildren=function(t,e,n){if(e)for(;t.firstChild;){var i=t.firstChild;t.removeChild(i),i.setAttribute("data-adapt-spec","1"),n?e.insertBefore(i,n):e.appendChild(i)}},e.calculateOffset=function(t){var e=0;return t&&!this.affectTo(t)||((!this.isSkipFooter||t&&this.isAfterLastContent(t))&&(e+=this.footerHeight),this.isSkipHeader||(e+=this.headerHeight)),e},e.calculateMinimumOffset=function(t){var e=0;return t&&!this.affectTo(t)||(t&&this.isAfterLastContent(t)&&(e+=this.footerHeight),this.enableSkippingHeader||(e+=this.headerHeight)),e},e.isAfterLastContent=function(t){var e=this;return this.findResultFromCache(t,this.afterLastContentNodeCache,(function(n){return e.isAfterNodeContextOf(e.lastContentSourceNode,t,!1)}))},e.affectTo=function(t){var e=this;return this.findResultFromCache(t,this.affectedNodeCache,(function(n){return e.isAfterNodeContextOf(e.ownerSourceNode,t,!0)}))},e.findResultFromCache=function(t,e,n){var i=e.filter((function(e){return e.nodeContext.sourceNode===t.sourceNode&&e.nodeContext.after===t.after}));if(i.length>0)return i[0].result;var r=n(t);return e.push({nodeContext:t,result:r}),r},e.isAfterNodeContextOf=function(t,e,n){for(var i=[],r=t;r;r=r.parentNode){if(e.sourceNode===r)return e.after;i.push(r)}for(var o=e.sourceNode;o;o=o.parentNode){var a=i.indexOf(o);if(a>=0)return!!n&&0===a;for(var s=o;s;s=s.previousElementSibling)if(i.includes(s))return!0}return e.after},e.isFirstContentNode=function(t){return t&&this.firstContentSourceNode===t.sourceNode},e.isEnableToUpdateState=function(){return!!(!this.isSkipFooter&&this.enableSkippingFooter&&this.footerNodePosition||!this.isSkipHeader&&this.enableSkippingHeader&&this.headerNodePosition)},e.updateState=function(){!this.isSkipFooter&&this.enableSkippingFooter&&this.footerNodePosition?this.isSkipFooter=!0:!this.isSkipHeader&&this.enableSkippingHeader&&this.headerNodePosition&&(this.isSkipHeader=!0)},e.preventSkippingHeader=function(){this.isSkipHeader=!1,this.enableSkippingHeader=!1},e.preventSkippingFooter=function(){this.isSkipFooter=!1,this.enableSkippingFooter=!1},e.isHeaderRegistered=function(){return!!this.headerNodePosition},e.isFooterRegistered=function(){return!!this.footerNodePosition},e.isHeaderSourceNode=function(t){return this.headerSourceNode===t},e.isFooterSourceNode=function(t){return this.footerSourceNode===t},t}(),ku=function(){function t(t){this.formattingContext=void 0,this.formattingContext=t}var e=t.prototype;return e.accept=function(t,e){return!!t},e.postLayout=function(t,e,n,i){var r=this.formattingContext.getRepetitiveElements();return r&&(r.doneInitialLayout||(r.updateHeight(n),r.doneInitialLayout=!0)),i},t}(),Bu=function(){function t(t){this.formattingContext=void 0,this.formattingContext=t}var e=t.prototype;return e.accept=function(t,e){return!0},e.postLayout=function(t,e,n,i){return i},t}(),_u=function(t){function e(e,n){var i;return(i=t.call(this,e)||this).processor=void 0,i.processor=n,i}x(e,t);var n=e.prototype;return n.doLayout=function(t,e){return this.processor.doInitialLayout(t,e)},n.accept=function(t,e){return!1},e}(ku),Mu=function(t){function e(e,n){var i;return(i=t.call(this,e)||this).processor=void 0,i.processor=n,i}return x(e,t),e.prototype.doLayout=function(t,e){return t.belongsTo(this.formattingContext)||t.after||e.fragmentLayoutConstraints.unshift(new Uu(t)),this.processor.doLayout(t,e)},e}(Bu),Uu=function(){function t(t){this.flagmentLayoutConstraintType="RepetitiveElementsOwner",this.nodeContext=void 0,this.nodeContext=t.formattingContext.getRootNodeContext(t)}var e=t.prototype;return e.allowLayout=function(t,e,n){var i=this.getRepetitiveElements();return!(i&&!Gs(this.nodeContext.viewNode)&&i.isEnableToUpdateState()&&(e&&!t||t&&t.overflow))},e.nextCandidate=function(t){var e=this.getRepetitiveElements();return!!e&&!!e.isEnableToUpdateState()&&(e.updateState(),!0)},e.postLayout=function(t,e,n,i){var r=this.getRepetitiveElements();r&&t&&i.stopAtOverflow&&(null==e||r.isAfterLastContent(e))&&r.preventSkippingFooter()},e.finishBreak=function(t,e){var n=this.nodeContext.formattingContext,i=this.getRepetitiveElements();if(!i)return Ri(!0);var r=this.nodeContext;return function(t,e,n){var i=t.getRepetitiveElements();if(i){var r=t.getRootNodeContext(e);if(r.viewNode)return i.appendHeaderToFragment(r,r.viewNode.firstChild,n)}return Ri(!0)}(n,r,e).thenAsync((function(){return function(t,e,n){var i=t.getRepetitiveElements();if(i&&!i.isSkipFooter){var r=t.getRootNodeContext(e);if(r.viewNode)return i.appendFooterToFragment(r,null,n)}return Ri(!0)}(n,r,e).thenAsync((function(){return i.prepareLayoutFragment(),Ri(!0)}))}))},e.getRepetitiveElements=function(){return this.nodeContext.formattingContext.getRepetitiveElements()},e.equalsTo=function(e){return e instanceof t&&this.nodeContext.formattingContext===e.nodeContext.formattingContext},e.getPriorityOfFinishBreak=function(){return 10},t}(),Vu=function(t){function e(e,n){var i;return(i=t.call(this)||this).formattingContext=void 0,i.processor=void 0,i.formattingContext=e,i.processor=n,i}return x(e,t),e.prototype.resolveLayoutMode=function(t){var e=this.formattingContext.getRepetitiveElements();return t.belongsTo(this.formattingContext)||e.doneInitialLayout?(t.belongsTo(this.formattingContext)||t.after||e&&e.preventSkippingHeader(),new Mu(this.formattingContext,this.processor)):new _u(this.formattingContext,this.processor)},e}(au),Hu=function(t){function e(e,n){var i;return(i=t.call(this)||this).formattingContext=void 0,i.column=void 0,i.formattingContext=e,i.column=n,i}x(e,t);var n=e.prototype;return n.startNonInlineElementNode=function(t){var e=this.formattingContext,n=t.nodeContext,i=e.getRepetitiveElements();if(n.parent&&e.rootSourceNode===n.parent.sourceNode){switch(n.repeatOnBreak){case"header":if(!i.isHeaderRegistered())return i.setHeaderNodeContext(n),Ri(!0);n.repeatOnBreak="none";break;case"footer":if(!i.isFooterRegistered())return i.setFooterNodeContext(n),Ri(!0);n.repeatOnBreak="none"}i.firstContentSourceNode||(i.firstContentSourceNode=n.sourceNode)}return lu.prototype.startNonInlineElementNode.call(this,t)},n.afterNonInlineElementNode=function(t){var e=this.formattingContext,n=t.nodeContext;return n.sourceNode===e.rootSourceNode&&(e.getRepetitiveElements().lastContentSourceNode=t.lastAfterNodeContext&&t.lastAfterNodeContext.sourceNode,t.break=!0),"header"===n.repeatOnBreak||"footer"===n.repeatOnBreak?Ri(!0):lu.prototype.afterNonInlineElementNode.call(this,t)},e}(lu);function zu(t,e){t&&function(t,e){for(var n=t;n;n=n.parent){var i=n.formattingContext;i&&i instanceof Lu&&!n.belongsTo(i)&&e(i,n)}}(t.after?t.parent:t,(function(t,n){Hr.isInstanceOfTableFormattingContext(t)||e.fragmentLayoutConstraints.push(new Uu(n))}))}var Gu=new(function(t){function e(){return t.apply(this,arguments)||this}x(e,t);var n=e.prototype;return n.layout=function(t,e,n){if(e.isFloatNodeContext(t))return e.layoutFloatOrFootnote(t);var i=t.formattingContext;return i.getRootViewNode(t)?(n&&zu(t.parent,e),t.belongsTo(i)?nu.prototype.layout.call(this,t,e,n):new Vu(i,this).layout(t,e)):e.buildDeepElementView(t)},n.startNonInlineElementNode=function(t){var e=function(t){var e=t.formattingContext;return e&&e instanceof Lu?e:null}(t),n=e.getRepetitiveElements();return!!n&&(n.allowInsertRepeatitiveElements||!n.isHeaderSourceNode(t.sourceNode)&&!n.isFooterSourceNode(t.sourceNode)||t.viewNode.parentNode.removeChild(t.viewNode),!1)},n.doInitialLayout=function(t,e){var n=Pi("BlockLayoutProcessor.doInitialLayout");return this.layoutEntireBlock(t,e).thenFinish(n),n.result()},n.layoutEntireBlock=function(t,e){var n=new Hu(t.formattingContext,e);return new uu(n,e.layoutContext).iterate(t)},n.doLayout=function(t,e){var n=t.formattingContext,i=Pi("doLayout");return wu(e.layoutContext.nextInTree(t,!1),e).then((function(t){var r=t;i.loopWithFrame((function(t){for(var i=function(){var i=!0;if(e.layoutNext(r,!1).then((function(o){r=o,e.pageFloatLayoutContext.isInvalidated()||e.pageBreakType||r&&e.stopByOverflow(r)||r&&r.after&&r.sourceNode==n.rootSourceNode?t.breakLoop():i?i=!1:t.continueLoop()})),i)return i=!1,{v:void 0}};r;){var o=i();if("object"==typeof o)return o.v}t.breakLoop()})).then((function(){i.finish(r)}))})),i.result()},n.finishBreak=function(t,e,n,i){return nu.prototype.finishBreak.call(this,t,e,n,i)},n.clearOverflownViewNodes=function(t,e,n,i){nu.prototype.clearOverflownViewNodes(t,e,n,i)},e}(nu));p(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR,(function(t){return t instanceof Lu&&!Hr.isInstanceOfTableFormattingContext(t)?Gu:null}));var Xu=function(){function t(t,e){this.rowIndex=void 0,this.sourceNode=void 0,this.cells=[],this.rowIndex=t,this.sourceNode=e}var e=t.prototype;return e.addCell=function(t){this.cells.push(t)},e.getMinimumHeight=function(){return Math.min.apply(null,this.cells.map((function(t){return t.height})))},t}(),Wu=function(){function t(t,e,n){this.rowIndex=void 0,this.columnIndex=void 0,this.viewElement=void 0,this.colSpan=void 0,this.rowSpan=void 0,this.height=0,this.anchorSlot=null,this.rowIndex=t,this.columnIndex=e,this.viewElement=n,this.colSpan=n.colSpan||1,this.rowSpan=n.rowSpan||1}var e=t.prototype;return e.setHeight=function(t){this.height=t},e.setAnchorSlot=function(t){this.anchorSlot=t},t}(),ju=function(t,e,n){this.rowIndex=void 0,this.columnIndex=void 0,this.cell=void 0,this.rowIndex=t,this.columnIndex=e,this.cell=n},Ku=function(){function t(t,e,n){this.column=void 0,this.cellNodeContext=void 0,this.pseudoColumn=void 0,this.empty=!1,this.column=t,this.cellNodeContext=n,this.pseudoColumn=new Tu(t,e,n)}return t.prototype.findAcceptableBreakPosition=function(){var t=this.cellNodeContext.viewNode,e=this.cellNodeContext.verticalAlign;"middle"!==e&&"bottom"!==e||tt(t,"vertical-align","top");var n=this.pseudoColumn.findAcceptableBreakPosition(!0);return tt(t,"vertical-align",e),n},t}(),Yu=function(t,e){this.viewNode=void 0,this.side=void 0,this.viewNode=t,this.side=e},qu=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,n,i,r)||this).formattingContext=void 0,o.acceptableCellBreakPositions=null,o.rowIndex=null,o.formattingContext=e.formattingContext,o}x(e,t);var n=e.prototype;return n.findAcceptableBreak=function(e,n){var i=t.prototype.findAcceptableBreak.call(this,e,n);return n<this.getMinBreakPenalty()?null:this.getAcceptableCellBreakPositions().every((function(t){return!!t.nodeContext}))?i:null},n.getMinBreakPenalty=function(){var e=t.prototype.getMinBreakPenalty.call(this);return this.getAcceptableCellBreakPositions().forEach((function(t){e+=t.breakPosition.getMinBreakPenalty()})),e},n.getAcceptableCellBreakPositions=function(){if(!this.acceptableCellBreakPositions){var t=this.getCellFragments();this.acceptableCellBreakPositions=t.map((function(t){return t.findAcceptableBreakPosition()}))}return this.acceptableCellBreakPositions},n.getRowIndex=function(){return null!=this.rowIndex?this.rowIndex:this.rowIndex=this.formattingContext.findRowIndexBySourceNode(this.position.sourceNode)},n.getCellFragments=function(){return this.formattingContext.getRowSpanningCellsOverflowingTheRow(this.getRowIndex()).map(this.formattingContext.getCellFragmentOfCell,this.formattingContext)},e}(qs),Qu=function(t){function e(e,n,i){var r;return(r=t.call(this)||this).rowIndex=void 0,r.beforeNodeContext=void 0,r.formattingContext=void 0,r.acceptableCellBreakPositions=null,r.rowIndex=e,r.beforeNodeContext=n,r.formattingContext=i,r}x(e,t);var n=e.prototype;return n.findAcceptableBreak=function(t,e){if(e<this.getMinBreakPenalty())return null;var n=this.getCellFragments(),i=this.getAcceptableCellBreakPositions(),r=i.every((function(t){return!!t.nodeContext}))&&i.some((function(t,e){var i=n[e].pseudoColumn,r=t.nodeContext;return!i.isStartNodeContext(r)&&!i.isLastAfterNodeContext(r)}));return this.beforeNodeContext.overflow=i.some((function(t){return t.nodeContext&&t.nodeContext.overflow})),r?this.beforeNodeContext:null},n.getMinBreakPenalty=function(){var t=this.formattingContext,e=t.getRowByIndex(this.rowIndex),n=0;return t.isFreelyFragmentableRow(e)||(n+=10),this.getAcceptableCellBreakPositions().forEach((function(t){n+=t.breakPosition.getMinBreakPenalty()})),n},n.getAcceptableCellBreakPositions=function(){if(!this.acceptableCellBreakPositions){var t=this.getCellFragments();this.acceptableCellBreakPositions=t.map((function(t){return t.findAcceptableBreakPosition()}))}return this.acceptableCellBreakPositions},n.getCellFragments=function(){return this.formattingContext.getCellsFallingOnRow(this.rowIndex).map(this.formattingContext.getCellFragmentOfCell,this.formattingContext)},e}(Ks),$u=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).tableSourceNode=void 0,i.formattingContextType="Table",i.vertical=!1,i.columnCount=-1,i.tableWidth=0,i.captions=[],i.colGroups=null,i.colWidths=null,i.inlineBorderSpacing=0,i.rows=[],i.slots=[],i.cellFragments=[],i.lastRowViewNode=null,i.cellBreakPositions=[],i.repetitiveElements=null,i.tableSourceNode=n,i}x(e,t);var n=e.prototype;return n.getName=function(){return"Table formatting context (Table.TableFormattingContext)"},n.isFirstTime=function(t,e){if(!e)return e;switch(t.display){case"table-row":return 0===this.cellBreakPositions.length;case"table-cell":return!this.cellBreakPositions.some((function(e){return e.cellNodePosition.steps[0].node===t.sourceNode}));default:return e}},n.getParent=function(){return this.parent},n.finishFragment=function(){this.cellFragments=[]},n.addRow=function(t,e){this.rows[t]=e},n.getRowSlots=function(t){var e=this.slots[t];return e||(e=this.slots[t]=[]),e},n.addCell=function(t,e){var n=this.rows[t];n||(this.addRow(t,new Xu(t,null)),n=this.rows[t]),n.addCell(e);for(var i=t+e.rowSpan,r=this.getRowSlots(t),o=0;r[o];)o++;for(;t<i;t++){r=this.getRowSlots(t);for(var a=o;a<o+e.colSpan;a++){var s=r[a]=new ju(t,a,e);e.anchorSlot||e.setAnchorSlot(s)}}},n.getRowByIndex=function(t){return this.rows[t]},n.findRowIndexBySourceNode=function(t){return this.rows.findIndex((function(e){return t===e.sourceNode}))},n.addCellFragment=function(t,e,n){var i=this.cellFragments[t];i||(i=this.cellFragments[t]=[]),i[e]=n},n.getCellsFallingOnRow=function(t){return this.getRowSlots(t).reduce((function(t,e){return e.cell!==t[t.length-1]?t.concat(e.cell):t}),[])},n.getRowSpanningCellsOverflowingTheRow=function(t){return this.getCellsFallingOnRow(t).filter((function(e){return e.rowIndex+e.rowSpan-1>t}))},n.getCellFragmentOfCell=function(t){return this.cellFragments[t.rowIndex]&&this.cellFragments[t.rowIndex][t.columnIndex]},n.isFreelyFragmentableRow=function(t){return t.getMinimumHeight()>this.tableWidth/2},n.getColumnCount=function(){return this.columnCount<0&&(this.columnCount=Math.max.apply(null,this.rows.map((function(t){return t.cells.reduce((function(t,e){return t+e.colSpan}),0)})))),this.columnCount},n.updateCellSizes=function(t){var e=this;this.rows.forEach((function(n){n.cells.forEach((function(n){var i=t.getElementClientRect(n.viewElement);n.viewElement=null,n.setHeight(e.vertical?i.width:i.height)}))}))},n.findCellFromColumn=function(t){if(!t)return null;var e=null,n=0,i=0;t:for(n=0;n<this.cellFragments.length;n++)if(this.cellFragments[n])for(i=0;i<this.cellFragments[n].length;i++)if(this.cellFragments[n][i]&&t===this.cellFragments[n][i].pseudoColumn.getColumn()){e=this.rows[n].cells[i];break t}if(!e)return null;for(;n<this.slots.length;n++)for(;i<this.slots[n].length;i++){var r=this.slots[n][i];if(r.cell===e)return{rowIndex:r.rowIndex,columnIndex:r.columnIndex}}return null},n.collectElementsOffsetOfUpperCells=function(t){var e=this,n=[];return this.slots.reduce((function(i,r,o){if(o>=t.rowIndex)return i;var a=r[t.columnIndex]&&e.getCellFragmentOfCell(r[t.columnIndex].cell);return!a||n.includes(a)||(e.collectElementsOffsetFromColumn(a.pseudoColumn.getColumn(),i),n.push(a)),i}),[])},n.collectElementsOffsetOfHighestColumn=function(){var t=this,e=[];return this.rows.forEach((function(n){n.cells.forEach((function(n,i){e[i]||(e[i]={collected:[],elements:[]});var r=e[i],o=t.getCellFragmentOfCell(n);o&&!r.collected.includes(o)&&(t.collectElementsOffsetFromColumn(o.pseudoColumn.getColumn(),r.elements),r.collected.push(o))}))})),[new Zu(e.map((function(t){return t.elements})))]},n.collectElementsOffsetFromColumn=function(t,e){t.fragmentLayoutConstraints.forEach((function(t){if(Vr.isInstanceOfRepetitiveElementsOwnerLayoutConstraint(t)){var n=t.getRepetitiveElements();e.push(n)}Hr.isInstanceOfTableRowLayoutConstraint(t)&&t.getElementsOffsetsForTableCell(null).forEach((function(t){e.push(t)}))}))},n.saveState=function(){return[].concat(this.cellBreakPositions)},n.restoreState=function(t){this.cellBreakPositions=t},e}(Lu),Zu=function(){function t(t){this.repeatitiveElementsInColumns=void 0,this.repeatitiveElementsInColumns=t}var e=t.prototype;return e.calculateOffset=function(t){return this.calculateMaxOffsetOfColumn(t,(function(t){return t.current}))},e.calculateMinimumOffset=function(t){return this.calculateMaxOffsetOfColumn(t,(function(t){return t.minimum}))},e.calculateMaxOffsetOfColumn=function(t,e){var n=0;return this.repeatitiveElementsInColumns.forEach((function(i){var r=Ys(t,i);n=Math.max(n,e(r))})),n},t}();function Ju(t){return function(t){return"table-row-group"===t||"table-header-group"===t||"table-footer-group"===t}(t)||function(t){return"table"===t||"inline-table"===t}(t)}function tl(t,e,n){var i=t.nodeContext,r=i.display,o=i.parent?i.parent.display:null,a=!1;if("inline-table"===o&&!(i.formattingContext instanceof $u))for(var s=i.parent;s;s=s.parent)if(s.formattingContext instanceof $u){a=s.formattingContext===e;break}return a||"table-row"===r&&!Ju(o)||"table-cell"===r&&"table-row"!==o&&!Ju(o)||i.formattingContext instanceof $u&&i.formattingContext!==e?n.buildDeepElementView(i).thenAsync((function(e){return t.nodeContext=e,Ri(!0)})):null}var el=function(t){function e(e,n){var i;return(i=t.call(this)||this).formattingContext=void 0,i.column=void 0,i.rowIndex=-1,i.columnIndex=0,i.inRow=!1,i.checkPoints=[],i.inHeaderOrFooter=!1,i.formattingContext=e,i.column=n,i}x(e,t);var n=e.prototype;return n.startNonInlineElementNode=function(e){var n=this.formattingContext,i=tl(e,n,this.column);if(i)return i;this.postLayoutBlockContents(e);var r=e.nodeContext,o=r.display,a=n.getRepetitiveElements();switch(o){case"table":n.inlineBorderSpacing=r.inlineBorderSpacing;break;case"table-caption":var s=new Yu(r.viewNode,r.captionSide);n.captions.push(s);break;case"table-header-group":return a.isHeaderRegistered()||(this.inHeaderOrFooter=!0,a.setHeaderNodeContext(r)),Ri(!0);case"table-footer-group":return a.isFooterRegistered()||(this.inHeaderOrFooter=!0,a.setFooterNodeContext(r)),Ri(!0);case"table-row":this.inHeaderOrFooter||(this.inRow=!0,this.rowIndex++,this.columnIndex=0,n.addRow(this.rowIndex,new Xu(this.rowIndex,r.sourceNode)),a.firstContentSourceNode||(a.firstContentSourceNode=r.sourceNode))}return t.prototype.startNonInlineElementNode.call(this,e)},n.afterNonInlineElementNode=function(e){var n=this.formattingContext,i=e.nodeContext,r=i.display,o=this.column.clientLayout;if(this.postLayoutBlockContents(e),i.sourceNode===n.tableSourceNode){var a=o.getElementComputedStyle(n.getRootViewNode(i));n.tableWidth=parseFloat(a[n.vertical?"height":"width"]),n.getRepetitiveElements().lastContentSourceNode=e.lastAfterNodeContext&&e.lastAfterNodeContext.sourceNode,e.break=!0}else switch(r){case"table-header-group":case"table-footer-group":if(this.inHeaderOrFooter)return this.inHeaderOrFooter=!1,Ri(!0);break;case"table-row":this.inHeaderOrFooter||(n.lastRowViewNode=i.viewNode,this.inRow=!1);break;case"table-cell":this.inHeaderOrFooter||(this.inRow||(this.rowIndex++,this.columnIndex=0,this.inRow=!0),n.addCell(this.rowIndex,new Wu(this.rowIndex,this.columnIndex,i.viewNode)),this.columnIndex++)}return t.prototype.afterNonInlineElementNode.call(this,e)},n.startNonElementNode=function(t){this.registerCheckPoint(t)},n.afterNonElementNode=function(t){this.registerCheckPoint(t)},n.startInlineElementNode=function(t){this.registerCheckPoint(t)},n.afterInlineElementNode=function(t){this.registerCheckPoint(t)},n.registerCheckPoint=function(t){var e=t.nodeContext;e&&e.viewNode&&!js(e)&&this.checkPoints.push(e.clone())},n.postLayoutBlockContents=function(t){this.checkPoints.length>0&&this.column.postLayoutBlock(t.nodeContext,this.checkPoints),this.checkPoints=[]},e}(lu),nl=function(t){function e(e,n){var i;return(i=t.call(this,!0)||this).formattingContext=void 0,i.column=void 0,i.inRow=!1,i.currentRowIndex=-1,i.currentColumnIndex=0,i.originalStopAtOverflow=void 0,i.inHeader=void 0,i.inFooter=void 0,i.formattingContext=e,i.column=n,i.originalStopAtOverflow=n.stopAtOverflow,n.stopAtOverflow=!1,i}x(e,t);var n=e.prototype;return n.resetColumn=function(){this.column.stopAtOverflow=this.originalStopAtOverflow},n.getColSpanningCellWidth=function(t){for(var e=this.formattingContext.colWidths,n=0,i=0;i<t.colSpan;i++)n+=e[t.anchorSlot.columnIndex+i];return n+this.formattingContext.inlineBorderSpacing*(t.colSpan-1)},n.layoutCell=function(t,e,n){var i=t.rowIndex,r=t.columnIndex,o=e.viewNode;t.colSpan>1&&(tt(o,"box-sizing","border-box"),tt(o,this.formattingContext.vertical?"height":"width",this.getColSpanningCellWidth(t)+"px"));var a=o.ownerDocument.createElement("div");o.appendChild(a);var s=new Ku(this.column,a,e);return this.formattingContext.addCellFragment(i,r,s),1===n.primary.steps.length&&n.primary.after&&(s.empty=!0),s.pseudoColumn.layout(n,!0).thenReturn(!0)},n.hasBrokenCellAtSlot=function(t){var e=this.formattingContext.cellBreakPositions[0];return!!e&&e.cell.anchorSlot.columnIndex===t},n.extractRowSpanningCellBreakPositions=function(){var t=this.formattingContext.cellBreakPositions;if(0===t.length)return[];var e=[],n=0;do{var i=t[n],r=i.cell.rowIndex;if(r<this.currentRowIndex){var o=e[r];o||(o=e[r]=[]),o.push(i),t.splice(n,1)}else n++}while(n<t.length);return e},n.layoutRowSpanningCellsFromPreviousFragment=function(t){var e=this,n=this.formattingContext,i=this.extractRowSpanningCellBreakPositions(),r=i.reduce((function(t){return t+1}),0);if(0===r)return Ri(!0);var o=this.column.layoutContext,a=t.nodeContext;a.viewNode.parentNode.removeChild(a.viewNode);var s=Pi("layoutRowSpanningCellsFromPreviousFragment"),u=Ri(!0),l=0,h=[];return i.forEach((function(t){u=u.thenAsync((function(){var i=uo(t[0].cellNodePosition.steps[1],a.parent);return o.setCurrent(i,!1).thenAsync((function(){var a=Ri(!0),s=0;function u(t){for(;s<t;){if(!h.includes(s)){var e=i.viewNode.ownerDocument.createElement("td");tt(e,"padding","0"),i.viewNode.appendChild(e)}s++}}return t.forEach((function(t){a=a.thenAsync((function(){var n=t.cell;u(n.anchorSlot.columnIndex);var a=t.cellNodePosition,c=uo(a.steps[0],i);return c.offsetInNode=a.offsetInNode,c.after=a.after,c.fragmentIndex=a.steps[0].fragmentIndex+1,o.setCurrent(c,!1).thenAsync((function(){for(var i=t.breakChunkPosition,o=0;o<n.colSpan;o++)h.push(s+o);return s+=n.colSpan,e.layoutCell(n,c,i).thenAsync((function(){return c.viewNode.rowSpan=n.rowIndex+n.rowSpan-e.currentRowIndex+r-l,Ri(!0)}))}))}))})),a.thenAsync((function(){return u(n.getColumnCount()),l++,Ri(!0)}))}))}))})),u.then((function(){o.setCurrent(a,!0,t.atUnforcedBreak).then((function(){s.finish(!0)}))})),s.result()},n.startTableRow=function(t){var e=this;if(this.inHeader||this.inFooter)return Ri(!0);var n=t.nodeContext,i=this.formattingContext;return this.currentRowIndex<0?this.currentRowIndex=i.findRowIndexBySourceNode(n.sourceNode):this.currentRowIndex++,this.currentColumnIndex=0,this.inRow=!0,this.layoutRowSpanningCellsFromPreviousFragment(t).thenAsync((function(){return e.registerCellFragmentIndex(),e.column.checkOverflowAndSaveEdgeAndBreakPosition(t.lastAfterNodeContext,null,!0,t.breakAtTheEdge)&&0===i.getRowSpanningCellsOverflowingTheRow(e.currentRowIndex-1).length&&(e.resetColumn(),n.overflow=!0,t.break=!0),Ri(!0)}))},n.registerCellFragmentIndex=function(){var t=this;this.formattingContext.getRowByIndex(this.currentRowIndex).cells.forEach((function(e){var n=t.formattingContext.cellBreakPositions[e.columnIndex];if(n&&n.cell.anchorSlot.columnIndex==e.anchorSlot.columnIndex){var i=n.cellNodePosition.steps[0],r=t.column.layoutContext.xmldoc.getElementOffset(i.node);vu(r,i.fragmentIndex+1,1)}}))},n.startTableCell=function(t){var e=this;if(this.inHeader||this.inFooter)return Ri(!0);var n=t.nodeContext;this.inRow||(this.currentRowIndex<0?this.currentRowIndex=0:this.currentRowIndex++,this.currentColumnIndex=0,this.inRow=!0);var i=this.formattingContext.getRowByIndex(this.currentRowIndex).cells[this.currentColumnIndex];if(!i)return t.break=!0,Ri(!0);var r=n.copy().modify();r.after=!0,t.nodeContext=r;var o,a=Pi("startTableCell");if(this.hasBrokenCellAtSlot(i.anchorSlot.columnIndex)){var s=this.formattingContext.cellBreakPositions.shift();n.fragmentIndex=s.cellNodePosition.steps[0].fragmentIndex+1,o=Ri(s.breakChunkPosition)}else o=this.column.nextInTree(n,t.atUnforcedBreak).thenAsync((function(t){t.viewNode&&n.viewNode.removeChild(t.viewNode);var e=so(t,0);return Ri(new go(e))}));return o.then((function(r){e.layoutCell(i,n,r).then((function(){e.afterNonInlineElementNode(t),e.currentColumnIndex++,a.finish(!0)}))})),a.result()},n.startNonInlineBox=function(t){var e=tl(t,this.formattingContext,this.column);if(e)return e;var n=t.nodeContext,i=this.formattingContext.getRepetitiveElements(),r=n.display;return"table-header-group"===r&&i&&i.isHeaderSourceNode(n.sourceNode)?(this.inHeader=!0,Ri(!0)):"table-footer-group"===r&&i&&i.isFooterSourceNode(n.sourceNode)?(this.inFooter=!0,Ri(!0)):"table-row"===r?this.startTableRow(t):"table-cell"===r?this.startTableCell(t):Ri(!0)},n.endNonInlineBox=function(t){var e=t.nodeContext;if("table-row"===e.display&&(this.inRow=!1,!this.inHeader&&!this.inFooter)){var n=e.copy().modify();n.after=!1;var i=new Qu(this.currentRowIndex,n,this.formattingContext);this.column.breakPositions.push(i)}return Ri(!0)},n.afterNonInlineElementNode=function(n){var i=n.nodeContext,r=this.formattingContext.getRepetitiveElements(),o=i.display;if("table-header-group"===o?r&&!r.allowInsertRepeatitiveElements&&r.isHeaderSourceNode(i.sourceNode)?(this.inHeader=!1,i.viewNode.parentNode.removeChild(i.viewNode)):tt(i.viewNode,"display","table-row-group"):"table-footer-group"===o&&(r&&!r.allowInsertRepeatitiveElements&&r.isFooterSourceNode(i.sourceNode)?(this.inFooter=!1,i.viewNode.parentNode.removeChild(i.viewNode)):tt(i.viewNode,"display","table-row-group")),o&&e.ignoreList[o])i.viewNode.parentNode.removeChild(i.viewNode);else{if(i.sourceNode!==this.formattingContext.tableSourceNode)return t.prototype.afterNonInlineElementNode.call(this,n);i.overflow=this.column.checkOverflowAndSaveEdge(i,null),this.resetColumn(),n.break=!0}return Ri(!0)},e}(lu);nl.ignoreList={"table-caption":!0,"table-column-group":!0,"table-column":!0};var il=[],rl=function(){function t(){}var e=t.prototype;return e.layoutEntireTable=function(t,e){var n=new el(t.formattingContext,e);return new uu(n,e.layoutContext).iterate(t)},e.getColumnWidths=function(t,e,n,i){for(var r=t.ownerDocument,o=r.createElement("tr"),a=[],s=0;s<e;s++){var u=r.createElement("td");o.appendChild(u),a.push(u)}t.parentNode.insertBefore(o,t.nextSibling);var l=a.map((function(t){var e=i.getElementClientRect(t);return n?e.height:e.width}));return t.parentNode.removeChild(o),l},e.getColGroupElements=function(t){for(var e=[],n=t.firstElementChild;n;)"colgroup"===n.localName&&e.push(n),n=n.nextElementSibling;return e},e.normalizeAndGetColElements=function(t){var e=[];return t.forEach((function(t){var n=t.span;t.removeAttribute("span");for(var i=t.firstElementChild;i;){if("col"===i.localName){var r=i.span;for(i.removeAttribute("span"),n-=r;r-- >1;){var o=i.cloneNode(!0);t.insertBefore(o,i),e.push(o)}e.push(i)}i=i.nextElementSibling}for(;n-- >0;)i=t.ownerDocument.createElement("col"),t.appendChild(i),e.push(i)})),e},e.addMissingColElements=function(t,e,n,i){if(t.length<n){var r=i.ownerDocument.createElement("colgroup");e.push(r);for(var o=t.length;o<n;o++){var a=i.ownerDocument.createElement("col");r.appendChild(a),t.push(a)}}},e.normalizeColGroups=function(t,e,n){var i=t.vertical,r=t.lastRowViewNode;if(r){t.lastRowViewNode=null;var o=r.ownerDocument.createDocumentFragment(),a=t.getColumnCount();if(a>0){var s=t.colWidths=this.getColumnWidths(r,a,i,n.clientLayout),u=this.getColGroupElements(e),l=this.normalizeAndGetColElements(u);this.addMissingColElements(l,u,a,e),l.forEach((function(t,e){tt(t,i?"height":"width",s[e]+"px")})),u.forEach((function(t){o.appendChild(t.cloneNode(!0))})),t.colGroups=o}else t.colGroups=o}},e.doInitialLayout=function(t,e){var n=this,i=t.formattingContext;i.vertical=t.vertical,i.initializeRepetitiveElements(t.vertical);var r,o,a,s=(r=t.sourceNode,o=il.findIndex((function(t){return t.root===r})),(a=il[o])?a.tableLayoutOption:null);!function(t){var e=il.findIndex((function(e){return e.root===t}));e>=0&&il.splice(e,1)}(t.sourceNode);var u=Pi("TableLayoutProcessor.doInitialLayout"),l=t.copy();return this.layoutEntireTable(t,e).then((function(r){var o=r.viewNode,a=e.clientLayout.getElementClientRect(o),h=e.vertical?a.left:a.bottom;if(h+=(e.vertical?-1:1)*Ys(t,e.collectElementsOffset()).current,!(e.isOverflown(h)||s&&s.calculateBreakPositionsInside))return e.breakPositions.push(new sl(l)),void u.finish(r);n.normalizeColGroups(i,o,e),i.updateCellSizes(e.clientLayout),u.finish(null)})),u.result()},e.addCaptions=function(t,e,n){var i=t.captions;i.forEach((function(t,r){t&&(e.insertBefore(t.viewNode,n),"top"===t.side&&(i[r]=null))}))},e.addColGroups=function(t,e,n){t.colGroups&&0===this.getColGroupElements(e).length&&e.insertBefore(t.colGroups.cloneNode(!0),n)},e.removeColGroups=function(t,e){if(t.colGroups&&e){var n=this.getColGroupElements(e);n&&n.forEach((function(t){e.removeChild(t)}))}},e.doLayout=function(t,e){var n=t.formattingContext,i=n.getRootViewNode(t),r=i.firstChild;this.addCaptions(n,i,r),this.addColGroups(n,i,r);var o=new nl(n,e),a=new uu(o,e.layoutContext),s=Pi("TableFormattingContext.doLayout");return a.iterate(t).thenFinish(s),s.result()},e.layout=function(t,e,n){var i=t.formattingContext;return i.getRootViewNode(t)?(n&&zu(t.parent,e),new ol(i,this).layout(t,e)):e.buildDeepElementView(t)},e.createEdgeBreakPosition=function(t,e,n,i){return new qu(t,e,n,i)},e.startNonInlineElementNode=function(t){return!1},e.afterNonInlineElementNode=function(t,e){return!1},e.finishBreak=function(t,e,n,i){var r=e.formattingContext;if("table-row"===e.display){var o,a=r.findRowIndexBySourceNode(e.sourceNode);if(r.cellBreakPositions=[],(o=e.after?r.getRowSpanningCellsOverflowingTheRow(a):r.getCellsFallingOnRow(a)).length){var s=Pi("TableLayoutProcessor.finishBreak"),u=0;return s.loopWithFrame((function(t){if(u!==o.length){var e=o[u++],n=r.getCellFragmentOfCell(e),i=n.findAcceptableBreakPosition().nodeContext,s=n.cellNodeContext,l=s.toNodePosition(),h=new go(i.toNodePosition());r.cellBreakPositions.push({cellNodePosition:l,breakChunkPosition:h,cell:e});var c=s.viewNode;n.column.layoutContext.processFragmentedBlockEdge(n.cellNodeContext),a<e.rowIndex+e.rowSpan-1&&(c.rowSpan=a-e.rowIndex+1),n.empty?t.continueLoop():n.pseudoColumn.finishBreak(i,!1,!0).then((function(){!function(t,e,n){var i=e.getRepetitiveElements();if(i){var r=e.vertical,o=t.column,a=t.pseudoColumn.getColumnElement(),s=t.cellNodeContext.viewNode,u=o.clientLayout.getElementClientRect(s),l=o.getComputedPaddingBorder(s);r?tt(a,"max-width",u.right-o.footnoteEdge-i.calculateOffset(n)-l.right+"px"):tt(a,"max-height",o.footnoteEdge-i.calculateOffset(n)-u.top-l.top+"px"),tt(a,"overflow","hidden")}}(n,r,i),t.continueLoop()}))}else t.breakLoop()})).then((function(){t.clearOverflownViewNodes(e,!1),t.layoutContext.processFragmentedBlockEdge(e),r.finishFragment(),s.finish(!0)})),s.result()}}return r.finishFragment(),ru.finishBreak(t,e,n,i)},e.clearOverflownViewNodes=function(t,e,n,i){nu.prototype.clearOverflownViewNodes(t,e,n,i)},t}(),ol=function(t){function e(e,n){var i;return(i=t.call(this)||this).tableFormattingContext=void 0,i.processor=void 0,i.tableFormattingContext=e,i.processor=n,i}x(e,t);var n=e.prototype;return n.resolveLayoutMode=function(t){var e=this.tableFormattingContext.getRepetitiveElements();return e&&e.doneInitialLayout?(t.sourceNode!==this.tableFormattingContext.tableSourceNode||t.after||e&&e.preventSkippingHeader(),new ll(this.tableFormattingContext,this.processor)):new al(this.tableFormattingContext,this.processor)},n.clearNodes=function(e){t.prototype.clearNodes.call(this,e);var n=this.tableFormattingContext.getRootViewNode(e);this.processor.removeColGroups(this.tableFormattingContext,n)},n.restoreState=function(e,n){t.prototype.restoreState.call(this,e,n),this.tableFormattingContext.finishFragment()},e}(au),al=function(t){function e(e,n){var i;return(i=t.call(this,e)||this).processor=void 0,i.processor=n,i}return x(e,t),e.prototype.doLayout=function(t,e){return this.processor.doInitialLayout(t,e)},e}(ku),sl=function(t){function e(e){return t.call(this,e,null,e.overflow,0)||this}x(e,t);var n=e.prototype;return n.getMinBreakPenalty=function(){if(!this.isEdgeUpdated)throw new Error("EdgeBreakPosition.prototype.updateEdge not called");return(this.overflows?3:0)+(this.position.parent?this.position.parent.breakPenalty:0)},n.breakPositionChosen=function(t){t.fragmentLayoutConstraints.push(new ul(this.position.sourceNode))},e}(qs),ul=function(){function t(t){this.tableRootNode=void 0,this.flagmentLayoutConstraintType="EntireTable",this.tableRootNode=t}var e=t.prototype;return e.allowLayout=function(t,e,n){return!1},e.nextCandidate=function(t){return!0},e.postLayout=function(t,e,n,i){il.push({root:e.sourceNode,tableLayoutOption:{calculateBreakPositionsInside:!0}})},e.finishBreak=function(t,e){return Ri(!0)},e.equalsTo=function(e){return e instanceof t&&e.tableRootNode===this.tableRootNode},e.getPriorityOfFinishBreak=function(){return 0},t}(),ll=function(t){function e(e,n){var i;return(i=t.call(this,e)||this).processor=void 0,i.processor=n,i}return x(e,t),e.prototype.doLayout=function(t,e){var n=this.formattingContext.getRepetitiveElements();if(n&&!n.isAfterLastContent(t)){var i=new hl(t);e.fragmentLayoutConstraints.some((function(t){return i.equalsTo(t)}))||e.fragmentLayoutConstraints.unshift(i)}return this.processor.doLayout(t,e)},e}(Bu),hl=function(t){function e(e){var n;return(n=t.call(this,e)||this).flagmentLayoutConstraintType="TableRow",n.cellFragmentLayoutConstraints=[],n}x(e,t);var n=e.prototype;return n.allowLayout=function(t,e,n){var i=this.getRepetitiveElements();return!(i&&!n.pseudoParent&&!Gs(this.nodeContext.viewNode)&&i.isEnableToUpdateState()&&(e&&!t||t&&t.overflow))},n.nextCandidate=function(e){return!!this.collectCellFragmentLayoutConstraints(e,this.nodeContext.formattingContext).some((function(t){return t.constraints.some((function(t){return t.nextCandidate(e)}))}))||t.prototype.nextCandidate.call(this,e)},n.postLayout=function(e,n,i,r){var o=this.nodeContext.formattingContext;if(this.cellFragmentLayoutConstraints=this.collectCellFragmentLayoutConstraints(n,o),this.cellFragmentLayoutConstraints.forEach((function(t){t.constraints.forEach((function(n){n.postLayout(e,t.breakPosition,i,r)}))})),!e){var a=o.getRootViewNode(this.nodeContext);(new rl).removeColGroups(o,a),this.removeDummyRowNodes(i)}t.prototype.postLayout.call(this,e,n,i,r)},n.finishBreak=function(e,n){var i=this,r=Pi("finishBreak"),o=this.cellFragmentLayoutConstraints.reduce((function(t,e){return t.concat(e.constraints.map((function(t){return{constraint:t,breakPosition:e.breakPosition}})))}),[]),a=0;return r.loop((function(){if(a<o.length){var t=o[a++];return t.constraint.finishBreak(t.breakPosition,n).thenReturn(!0)}return Ri(!1)})).then((function(){r.finish(!0)})),r.result().thenAsync((function(){return t.prototype.finishBreak.call(i,e,n)}))},n.removeDummyRowNodes=function(t){if(t&&"table-row"===t.display&&t.viewNode)for(;t.viewNode.previousElementSibling;){var e=t.viewNode.previousElementSibling;e.parentNode&&e.parentNode.removeChild(e)}},n.collectCellFragmentLayoutConstraints=function(t,e){return this.getCellFragemnts(t,e).map((function(t){return{constraints:t.fragment.pseudoColumn.getColumn().fragmentLayoutConstraints,breakPosition:t.breakPosition}}))},n.getCellFragemnts=function(t,e){var n=Number.MAX_VALUE;t&&"table-row"===t.display&&(n=e.findRowIndexBySourceNode(t.sourceNode)+1),n=Math.min(e.cellFragments.length,n);for(var i=[],r=0;r<n;r++)e.cellFragments[r]&&e.cellFragments[r].forEach((function(t){t&&i.push({fragment:t,breakPosition:t.findAcceptableBreakPosition().nodeContext})}));return i},n.getElementsOffsetsForTableCell=function(t){var e=this.nodeContext.formattingContext,n=e.findCellFromColumn(t);return n?e.collectElementsOffsetOfUpperCells(n):e.collectElementsOffsetOfHighestColumn()},n.equalsTo=function(t){return t instanceof e&&this.nodeContext.formattingContext===t.nodeContext.formattingContext},e}(Uu),cl=new rl;function dl(t){return t.reduce((function(t,e){return t+e}),0)/t.length}p(e.HOOKS.RESOLVE_FORMATTING_CONTEXT,(function(t,e,n,i,r,o){if(!e)return null;if(n===en.table){var a=t.parent;return new $u(a?a.formattingContext:null,t.sourceNode)}return null})),p(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR,(function(t){return t instanceof $u?cl:null}));var fl=function(t,e){this.layoutResult=void 0,this.penalty=void 0,this.layoutResult=t,this.penalty=e};function pl(t){return t.vertical?t.width:t.height}function gl(t,e){t.vertical?t.width=e:t.height=e}var vl=function(){function t(t,e,n){this.layoutContainer=void 0,this.columnGenerator=void 0,this.regionPageFloatLayoutContext=void 0,this.originalContainerBlockSize=void 0,this.layoutContainer=t,this.columnGenerator=e,this.regionPageFloatLayoutContext=n,this.originalContainerBlockSize=pl(t)}var e=t.prototype;return e.balanceColumns=function(t){var e=this,n=Pi("ColumnBalancer#balanceColumns");this.preBalance(t),this.savePageFloatLayoutContexts(t),this.layoutContainer.clear();var i=[this.createTrialResult(t)];return n.loopWithFrame((function(t){e.hasNextCandidate(i)?(e.updateCondition(i),e.columnGenerator().then((function(n){e.savePageFloatLayoutContexts(n),e.layoutContainer.clear(),n?(i.push(e.createTrialResult(n)),t.continueLoop()):t.breakLoop()}))):t.breakLoop()})).then((function(){var t=i.reduce((function(t,e){return e.penalty<t.penalty?e:t}),i[0]);e.restoreContents(t.layoutResult),e.postBalance(),n.finish(t.layoutResult)})),n.result()},e.createTrialResult=function(t){var e=this.calculatePenalty(t);return new fl(t,e)},e.preBalance=function(t){},e.postBalance=function(){gl(this.layoutContainer,this.originalContainerBlockSize)},e.savePageFloatLayoutContexts=function(t){var e=this.regionPageFloatLayoutContext.detachChildren();t&&(t.columnPageFloatLayoutContexts=e)},e.restoreContents=function(t){var e=this.layoutContainer.element;t.columns.forEach((function(t){e.appendChild(t.element)})),this.regionPageFloatLayoutContext.attachChildren(t.columnPageFloatLayoutContexts)},t}();function ml(t){var e=t[t.length-1];if(0===e.penalty)return!1;var n=t[t.length-2];if(n&&e.penalty>=n.penalty)return!1;var i=e.layoutResult.columns;return Math.max.apply(null,i.map((function(t){return t.computedBlockSize})))>Math.max.apply(null,i.map((function(t){return t.getMaxBlockSizeOfPageFloats()})))+1}function El(t,e){var n=Math.max.apply(null,t[t.length-1].layoutResult.columns.map((function(t){return isNaN(t.blockDistanceToBlockEndFloats)?t.computedBlockSize:t.computedBlockSize-t.blockDistanceToBlockEndFloats+1})))-1;n<pl(e)?gl(e,n):gl(e,pl(e)-1)}var Cl=function(t){function e(e,n,i,r){var o;return(o=t.call(this,i,e,n)||this).columnCount=void 0,o.originalPosition=null,o.foundUpperBound=!1,o.columnCount=r,o}x(e,t);var n=e.prototype;return n.preBalance=function(t){var e=t.columns.reduce((function(t,e){return t+e.computedBlockSize}),0);gl(this.layoutContainer,e/this.columnCount),this.originalPosition=t.position},n.checkPosition=function(t){return this.originalPosition?this.originalPosition.isSamePosition(t):null===t},n.calculatePenalty=function(t){if(!this.checkPosition(t.position))return 1/0;var e=t.columns;return Dl(e)?1/0:Math.max.apply(null,e.map((function(t){return t.computedBlockSize})))},n.hasNextCandidate=function(t){if(1===t.length)return!0;if(this.foundUpperBound)return ml(t);var e=t[t.length-1];return this.checkPosition(e.layoutResult.position)&&!Dl(e.layoutResult.columns)?(this.foundUpperBound=!0,!0):pl(this.layoutContainer)<this.originalContainerBlockSize},n.updateCondition=function(t){if(this.foundUpperBound)El(t,this.layoutContainer);else{var e=Math.min(this.originalContainerBlockSize,pl(this.layoutContainer)+.1*this.originalContainerBlockSize);gl(this.layoutContainer,e)}},e}(vl);function Dl(t){if(t.length<=1)return!1;var e=t[t.length-1].computedBlockSize;return t.slice(0,t.length-1).every((function(t){return e>t.computedBlockSize}))}var wl,yl=function(t){function e(e,n,i){return t.call(this,i,e,n)||this}x(e,t);var n=e.prototype;return n.calculatePenalty=function(t){if(t.columns.every((function(t){return 0===t.computedBlockSize})))return 1/0;var e,n,i=t.columns.filter((function(t){return!t.pageBreakType})).map((function(t){return t.computedBlockSize}));return n=dl(e=i),dl(e.map((function(t){var e=t-n;return e*e})))},n.hasNextCandidate=function(t){return ml(t)},n.updateCondition=function(t){El(t,this.layoutContainer)},e}(vl),Nl=function(t,e,n){this.endStuckFixed=void 0,this.endFixed=void 0,this.endSlipped=void 0,this.endStuckFixed=t,this.endFixed=e,this.endSlipped=n},bl=function(){function t(){this.map=[]}var e=t.prototype;return e.getMaxFixed=function(){return 0==this.map.length?0:this.map[this.map.length-1].endFixed},e.getMaxSlipped=function(){return 0==this.map.length?0:this.map[this.map.length-1].endSlipped},e.addStuckRange=function(t){if(0==this.map.length)this.map.push(new Nl(t,t,t));else{var e=this.map[this.map.length-1],n=e.endSlipped+t-e.endFixed;e.endFixed==e.endStuckFixed?(e.endFixed=t,e.endStuckFixed=t,e.endSlipped=n):this.map.push(new Nl(t,t,n))}},e.addSlippedRange=function(t){0==this.map.length?this.map.push(new Nl(t,0,0)):this.map[this.map.length-1].endFixed=t},e.slippedByFixed=function(t){var e=this,n=ct(this.map.length,(function(n){return t<=e.map[n].endFixed})),i=this.map[n];return i.endSlipped-Math.max(0,i.endStuckFixed-t)},e.fixedBySlipped=function(t){var e=this,n=ct(this.map.length,(function(n){return t<=e.map[n].endSlipped})),i=this.map[n];return i.endStuckFixed-(i.endSlipped-t)},t}(),Sl=function(){function t(e,n,i,r,o,a,s,u){if(this.context=void 0,this.style=void 0,this.offset=void 0,this.isRoot=void 0,this.flowChunk=void 0,this.atBlockStart=void 0,this.atFlowStart=void 0,this.isParentBoxDisplayed=void 0,this.flowName=void 0,this.isBlockValue=null,this.hasBoxValue=null,this.styleValues={},this.beforeBox=null,this.afterBox=null,this.breakBefore=null,this.context=e,this.style=n,this.offset=i,this.isRoot=r,this.flowChunk=o,this.atBlockStart=a,this.atFlowStart=s,this.isParentBoxDisplayed=u,this.flowName=o.flowName,this.hasBox()){var l=n._pseudos;if(l&&l.before){var h=new t(e,l.before,i,!1,o,this.isBlock(),s,!0);wo(h.styleValue("content"))&&(this.beforeBox=h,this.breakBefore=h.breakBefore)}}this.breakBefore=Ms(this.getBreakValue("before"),this.breakBefore),this.atFlowStart&&Ls(this.breakBefore)&&(o.breakBefore=Ms(o.breakBefore,this.breakBefore))}var e=t.prototype;return e.buildAfterPseudoElementBox=function(e,n,i){if(this.hasBox()){var r=this.style._pseudos;if(r&&r.after){var o=new t(this.context,r.after,e,!1,this.flowChunk,n,i,!0);wo(o.styleValue("content"))&&(this.afterBox=o)}}},e.styleValue=function(t,e){if(!(t in this.styleValues)){var n=this.style[t];this.styleValues[t]=n?n.evaluate(this.context,t):e||null}return this.styleValues[t]},e.displayValue=function(){return this.styleValue("display",en.inline)},e.isBlock=function(){if(null===this.isBlockValue){var t=this.displayValue(),e=this.styleValue("position"),n=this.styleValue("float");this.isBlockValue=Js(t,e,n,this.isRoot)}return this.isBlockValue},e.hasBox=function(){return null===this.hasBoxValue&&(this.hasBoxValue=this.isParentBoxDisplayed&&this.displayValue()!==en.none),this.hasBoxValue},e.getBreakValue=function(t){var e=null;if(this.isBlock()){var n=this.styleValue("break-"+t);n&&(e=n.toString())}return e},t}(),Al=function(){function t(t){this.context=void 0,this.stack=[],this.atBlockStart=!0,this.atFlowStart=!0,this.atStartStack=[],this.context=t}var e=t.prototype;return e.empty=function(){return 0===this.stack.length},e.lastBox=function(){return this.stack[this.stack.length-1]},e.lastFlowName=function(){var t=this.lastBox();return t?t.flowChunk.flowName:null},e.isCurrentBoxDisplayed=function(){return this.stack.every((function(t){return t.displayValue()!==en.none}))},e.push=function(t,e,n,i){var r=this.lastBox();i&&r&&i.flowName!==r.flowName&&this.atStartStack.push({atBlockStart:this.atBlockStart,atFlowStart:this.atFlowStart});var o=i||r.flowChunk,a=this.atFlowStart||!!i,s=this.isCurrentBoxDisplayed(),u=new Sl(this.context,t,e,n,o,a||this.atBlockStart,a,s);return this.stack.push(u),this.atBlockStart=u.hasBox()?!u.beforeBox&&u.isBlock():this.atBlockStart,this.atFlowStart=u.hasBox()?!u.beforeBox&&a:this.atFlowStart,u},e.encounteredTextNode=function(t){var e=this.lastBox();t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.CDATA_SECTION_NODE||!this.atBlockStart&&!this.atFlowStart||!e.hasBox()||to(t,Jr(e.styleValue("white-space",en.normal).toString()))||(this.atBlockStart=!1,this.atFlowStart=!1)},e.pop=function(t){var e=this.stack.pop();if(e.buildAfterPseudoElementBox(t,this.atBlockStart,this.atFlowStart),this.atFlowStart&&e.afterBox){var n=e.afterBox.getBreakValue("before");e.flowChunk.breakBefore=Ms(e.flowChunk.breakBefore,n)}var i=this.lastBox();if(i)if(i.flowName===e.flowName)e.hasBox()&&(this.atBlockStart=this.atFlowStart=!1);else{var r=this.atStartStack.pop();this.atBlockStart=r.atBlockStart,this.atFlowStart=r.atFlowStart}return e},e.nearestBlockStartOffset=function(t){if(!t.atBlockStart)return t.offset;var e=this.stack.length-1,n=this.stack[e];for(n===t&&(e--,n=this.stack[e]);e>=0;){if(n.flowName!==t.flowName)return t.offset;if(!n.atBlockStart)return n.offset;if(n.isRoot)return n.offset;t=n,n=this.stack[--e]}throw new Error("No block start offset found!")},t}(),Tl=function(){function t(t,e,n,i,r,o,a,s){this.xmldoc=void 0,this.scope=void 0,this.context=void 0,this.primaryFlows=void 0,this.validatorSet=void 0,this.counterListener=void 0,this.root=void 0,this.cascadeHolder=void 0,this.last=void 0,this.rootStyle={},this.styleMap={},this.flows={},this.flowChunks=[],this.flowListener=null,this.flowToReach=null,this.idToReach=null,this.cascade=void 0,this.offsetMap=void 0,this.primary=!0,this.primaryStack=[],this.rootBackgroundAssigned=!1,this.rootLayoutAssigned=!1,this.lastOffset=void 0,this.breakBeforeValues={},this.boxStack=void 0,this.bodyReached=!0,this.xmldoc=t,this.scope=n,this.context=i,this.primaryFlows=r,this.validatorSet=o,this.counterListener=a,this.root=t.root,this.cascadeHolder=e,this.last=this.root,this.cascade=e.createInstance(i,a,s,t.lang),this.offsetMap=new bl;var u=t.getElementOffset(this.root);this.lastOffset=u,this.boxStack=new Al(i),this.offsetMap.addStuckRange(u);var l=this.getAttrStyle(this.root);this.cascade.pushElement(this.root,l,u),this.postprocessTopStyle(l,!1),this.root.namespaceURI===G.XHTML&&(this.bodyReached=!1),this.primaryStack.push(!0),this.styleMap={},this.styleMap["e"+u]=l,this.lastOffset++,this.replayFlowElementsFromOffset(-1)}var e=t.prototype;return e.hasProp=function(t,e,n){var i=t[n];return i&&i.evaluate(this.context)!==e[n]},e.transferPropsToRoot=function(t,e){for(var n in e){var i=t[n];if(i)this.rootStyle[n]=i,delete t[n];else{var r=e[n];r&&(this.rootStyle[n]=new Lo(r,33554432))}}},e.postprocessTopStyle=function(t,e){var n=this;if(["writing-mode","direction"].forEach((function(i){!t[i]||e&&n.rootStyle[i]||(n.rootStyle[i]=t[i])})),!this.rootBackgroundAssigned){var i=this.hasProp(t,this.validatorSet.backgroundProps,"background-color")?t["background-color"].evaluate(this.context):null,r=this.hasProp(t,this.validatorSet.backgroundProps,"background-image")?t["background-image"].evaluate(this.context):null;(i&&i!==en.inherit||r&&r!==en.inherit)&&(this.transferPropsToRoot(t,this.validatorSet.backgroundProps),this.rootBackgroundAssigned=!0)}if(!this.rootLayoutAssigned)for(var o=0;o<xl.length;o++)if(this.hasProp(t,this.validatorSet.layoutProps,xl[o])){this.transferPropsToRoot(t,this.validatorSet.layoutProps),this.rootLayoutAssigned=!0;break}if(!e){var a=t["font-size"],s=!0;if(a){var u=a.evaluate(this.context),l=u.num;switch(u.unit){case"em":case"rem":l*=this.context.initialFontSize;break;case"ex":l*=this.context.initialFontSize*Ht.ex/Ht.em;break;case"%":l*=this.context.initialFontSize/100;break;default:var h=Ht[u.unit];h&&(l*=h),s=!1}this.context.rootFontSize=l,this.context.isRelativeRootFontSize=s}}},e.getTopContainerStyle=function(){for(var t=0;!this.bodyReached&&this.styleUntil(t+=5e3,0)!=Number.POSITIVE_INFINITY;);return this.rootStyle},e.getAttrStyle=function(t){if(t.style instanceof CSSStyleDeclaration){var e=t.getAttribute("style");if(e)return function(t,e,n,i){var r=new ts(t,e),o=new Ti(i,r);try{!function(t,e,n){new Ar(hr,t,e,n).runParser(Number.POSITIVE_INFINITY,!1,!0,!1,!1)}(o,r,n)}catch(t){c.warn(t,"Style attribute parse error:")}return r.elementStyle}(this.scope,this.validatorSet,this.xmldoc.url,e)}return{}},e.getReachedOffset=function(){return this.lastOffset},e.replayFlowElementsFromOffset=function(t){if(!(t>=this.lastOffset)){var e=this.context,n=this.xmldoc.getElementOffset(this.root);if(t<n){var i=this.getStyle(this.root,!1),r=Uo(i,"flow-into"),o=r?r.evaluate(e,"flow-into").toString():"body",a=this.encounteredFlowElement(o,i,this.root,n);this.boxStack.empty()&&this.boxStack.push(i,n,!0,a)}var s=this.xmldoc.getNodeByOffset(t),u=this.xmldoc.getNodeOffset(s,0,!1);if(!(u>=this.lastOffset))for(;;){if(1!=s.nodeType)u+=s.textContent.length;else{var l=s,h=this.getStyle(l,!1),c=h["flow-into"];if(c){var d=c.evaluate(e,"flow-into").toString();this.encounteredFlowElement(d,h,l,u)}u++}if(u>=this.lastOffset)break;var f=s.firstChild;if(null==f)for(;!(f=s.nextSibling);)if((s=s.parentNode)===this.root)return;s=f}}},e.resetFlowChunkStream=function(t){this.flowListener=t;for(var e=0;e<this.flowChunks.length;e++)this.flowListener.encounteredFlowChunk(this.flowChunks[e],this.flows[this.flowChunks[e].flowName])},e.styleUntilFlowIsReached=function(t){this.flowToReach=t;for(var e=0;null!=this.flowToReach&&this.styleUntil(e+=5e3,0)!=Number.POSITIVE_INFINITY;);},e.styleUntilIdIsReached=function(t){if(t){this.idToReach=t;for(var e=0;this.idToReach&&this.styleUntil(e+=5e3,0)!==Number.POSITIVE_INFINITY;);this.idToReach=null}},e.encounteredFlowElement=function(t,e,n,i){var r=0,o=Number.POSITIVE_INFINITY,a=!1,s=!1,u=!1,l=e["flow-options"];if(l){var h=function(t){if(t){var e=new Pn;try{return t.visit(e),e.propSet}catch(t){c.warn(t,"toSet:")}}return{}}(l.evaluate(this.context,"flow-options"));a=!!h.exclusive,s=!!h.static,u=!!h.last}var d=e["flow-linger"];d&&(o=Ln(d.evaluate(this.context,"flow-linger"),Number.POSITIVE_INFINITY));var f=e["flow-priority"];f&&(r=Ln(f.evaluate(this.context,"flow-priority"),0));var p=this.breakBeforeValues[i]||null,g=this.flows[t];if(!g){var v=this.boxStack.lastFlowName();g=this.flows[t]=new eo(t,v)}var m=new no(t,n,i,r,o,a,s,u,p);return this.flowChunks.push(m),this.flowToReach==t&&(this.flowToReach=null),this.flowListener&&this.flowListener.encounteredFlowChunk(m,g),m},e.registerForcedBreakOffset=function(t,e,n){if(Ls(t)){var i=this.flows[n].forcedBreakOffsets;(0===i.length||i[i.length-1]<e)&&i.push(e)}this.breakBeforeValues[e]=Ms(this.breakBeforeValues[e],t)},e.styleUntil=function(t,e){var n=-1;if(t<=this.lastOffset&&(n=this.offsetMap.slippedByFixed(t)+e)<this.offsetMap.getMaxSlipped())return this.offsetMap.fixedBySlipped(n);if(null==this.last)return Number.POSITIVE_INFINITY;for(var i=this.context;;){var r=this.last.firstChild;if(null==r)for(;;){if(1==this.last.nodeType){this.cascade.popElement(this.last),this.primary=this.primaryStack.pop();var o=this.boxStack.pop(this.lastOffset),a=null;if(o.afterBox){var s=o.afterBox.getBreakValue("before");this.registerForcedBreakOffset(s,o.afterBox.atBlockStart?this.boxStack.nearestBlockStartOffset(o):o.afterBox.offset,o.flowName),a=o.afterBox.getBreakValue("after")}a=Ms(a,o.getBreakValue("after")),this.registerForcedBreakOffset(a,this.lastOffset,o.flowName)}if(r=this.last.nextSibling)break;if(this.last=this.last.parentNode,this.last===this.root)return this.last=null,t<this.lastOffset&&(n<0&&(n=this.offsetMap.slippedByFixed(t)+e),n<=this.offsetMap.getMaxSlipped())?this.offsetMap.fixedBySlipped(n):Number.POSITIVE_INFINITY}if(this.last=r,1!=this.last.nodeType)this.lastOffset+=this.last.textContent.length,this.boxStack.encounteredTextNode(this.last),this.primary?this.offsetMap.addStuckRange(this.lastOffset):this.offsetMap.addSlippedRange(this.lastOffset);else{var u=this.last,l=this.getAttrStyle(u);this.primaryStack.push(this.primary),this.cascade.pushElement(u,l,this.lastOffset);var h=u.getAttribute("id")||u.getAttributeNS(G.XML,"id");h&&h===this.idToReach&&(this.idToReach=null),this.bodyReached||"body"!=u.localName||u.parentNode!=this.root||(this.postprocessTopStyle(l,!0),this.bodyReached=!0);var c=void 0,d=l["flow-into"];if(d){var f=d.evaluate(i,"flow-into").toString(),p=this.encounteredFlowElement(f,l,u,this.lastOffset);this.primary=!!this.primaryFlows[f],c=this.boxStack.push(l,this.lastOffset,u===this.root,p)}else c=this.boxStack.push(l,this.lastOffset,u===this.root),u===this.xmldoc.body&&(c.breakBefore=Ms(c.flowChunk.breakBefore,c.breakBefore));var g=this.boxStack.nearestBlockStartOffset(c);if(0===g){var v,m=null==(v=l.page)?void 0:v.value.toString();m&&"auto"!==m.toLowerCase()&&(this.cascade.firstPageType=m)}if(this.registerForcedBreakOffset(c.breakBefore,g,c.flowName),c.beforeBox){var E=c.beforeBox.getBreakValue("after");this.registerForcedBreakOffset(E,c.beforeBox.atBlockStart?g:c.offset,c.flowName)}if(this.primary&&c.displayValue()===en.none&&(this.primary=!1),this.styleMap["e"+this.lastOffset]=l,this.lastOffset++,this.primary?this.offsetMap.addStuckRange(this.lastOffset):this.offsetMap.addSlippedRange(this.lastOffset),this.bodyReached&&0===g)continue;if(t<this.lastOffset&&(n<0&&(n=this.offsetMap.slippedByFixed(t)+e),n<=this.offsetMap.getMaxSlipped()))return this.offsetMap.fixedBySlipped(n)}}},e.getStyle=function(t,e){var n=this.xmldoc.getElementOffset(t),i="e"+n;return e&&(n=this.xmldoc.getNodeOffset(t,0,!0)),this.lastOffset<=n&&this.styleUntil(n,0),this.styleMap[i]},e.processContent=function(t,e){},t}(),xl=["column-count","column-width","column-fill"],Il=function(){function t(t){this.validator=void 0,this.success=null,this.failure=null,this.code=0,this.validator=t}var e=t.prototype;return e.isSpecial=function(){return 0!=this.code},e.markAsStartGroup=function(){this.code=-1},e.isStartGroup=function(){return-1==this.code},e.markAsEndGroup=function(){this.code=-2},e.isEndGroup=function(){return-2==this.code},e.markAsStartAlternate=function(t){this.code=2*t+1},e.isStartAlternate=function(){return this.code>0&&this.code%2!=0},e.markAsEndAlternate=function(t){this.code=2*t+2},e.isEndAlternate=function(){return this.code>0&&this.code%2==0},e.getAlternate=function(){return Math.floor((this.code-1)/2)},t}(),Fl=function(t,e){this.where=void 0,this.success=void 0,this.what=-1,this.where=t,this.success=e};!function(t){t[t.FOLLOW=1]="FOLLOW",t[t.OPTIONAL=2]="OPTIONAL",t[t.REPEATED=3]="REPEATED",t[t.ALTERNATE=4]="ALTERNATE"}(wl||(wl={}));var Pl=function(){function t(){this.nodes=[],this.connections=[],this.match=[],this.nomatch=[],this.error=[],this.emptyHead=!0}var e=t.prototype;return e.connect=function(t,e){for(var n=0;n<t.length;n++)this.connections[t[n]].what=e;t.splice(0,t.length)},e.clone=function(){for(var e,n,i,r=new t,o=0;o<this.nodes.length;o++){var a=this.nodes[o],s=new Il(a.validator);s.code=a.code,r.nodes.push(s)}for(var u=0;u<this.connections.length;u++){var l=this.connections[u],h=new Fl(l.where,l.success);h.what=l.what,r.connections.push(h)}return(e=r.match).push.apply(e,this.match),(n=r.nomatch).push.apply(n,this.nomatch),(i=r.error).push.apply(i,this.error),r},e.addSpecialToArr=function(t,e,n){var i=this.nodes.length,r=new Il(kl);n>=0?e?r.markAsStartAlternate(n):r.markAsEndAlternate(n):e?r.markAsStartGroup():r.markAsEndGroup(),this.nodes.push(r),this.connect(t,i);var o=new Fl(i,!0),a=new Fl(i,!1);t.push(this.connections.length),this.connections.push(a),t.push(this.connections.length),this.connections.push(o)},e.endSpecialGroup=function(){for(var t=[this.match,this.nomatch,this.error],e=0;e<t.length;e++)this.addSpecialToArr(t[e],!1,-1)},e.startSpecialGroup=function(){if(this.nodes.length)throw new Error("invalid call");this.addSpecialToArr(this.match,!0,-1)},e.endClause=function(t){this.addSpecialToArr(this.match,!1,t)},e.startClause=function(t){if(this.nodes.length)throw new Error("invalid call");var e=new Il(kl);e.markAsStartAlternate(t),this.nodes.push(e);var n=new Fl(0,!0),i=new Fl(0,!1);this.nomatch.push(this.connections.length),this.connections.push(i),this.match.push(this.connections.length),this.connections.push(n)},e.addPrimitive=function(t){var e=this.nodes.length;this.nodes.push(new Il(t));var n=new Fl(e,!0),i=new Fl(e,!1);this.connect(this.match,e),this.emptyHead?(this.nomatch.push(this.connections.length),this.emptyHead=!1):this.error.push(this.connections.length),this.connections.push(i),this.match.push(this.connections.length),this.connections.push(n)},e.isSimple=function(){return 1==this.nodes.length&&!this.nodes[0].isSpecial()},e.isPrimitive=function(){return this.isSimple()&&this.nodes[0].validator instanceof Ll},e.addGroup=function(t,e){if(0!=t.nodes.length){var n=this.nodes.length;if(e==wl.ALTERNATE&&1==n&&t.isPrimitive()&&this.isPrimitive())this.nodes[0].validator=this.nodes[0].validator.combine(t.nodes[0].validator);else{for(var i=0;i<t.nodes.length;i++)this.nodes.push(t.nodes[i]);e==wl.ALTERNATE?(this.emptyHead=!0,this.connect(this.nomatch,n)):this.connect(this.match,n);for(var r=this.connections.length,o=0;o<t.connections.length;o++){var a=t.connections[o];a.where+=n,a.what>=0&&(a.what+=n),this.connections.push(a)}for(var s=0;s<t.match.length;s++)this.match.push(t.match[s]+r);if(e==wl.REPEATED&&this.connect(this.match,n),e==wl.OPTIONAL||e==wl.REPEATED)for(var u=0;u<t.nomatch.length;u++)this.match.push(t.nomatch[u]+r);else if(this.emptyHead){for(var l=0;l<t.nomatch.length;l++)this.nomatch.push(t.nomatch[l]+r);this.emptyHead=t.emptyHead}else for(var h=0;h<t.nomatch.length;h++)this.error.push(t.nomatch[h]+r);for(var c=0;c<t.error.length;c++)this.error.push(t.error[c]+r);t.nodes=null,t.connections=null}}},e.finish=function(t,e){var n=this.nodes.length;this.nodes.push(t),this.nodes.push(e),this.connect(this.match,n),this.connect(this.nomatch,n+1),this.connect(this.error,n+1);for(var i,r=B(this.connections);!(i=r()).done;){var o=i.value;o.success?this.nodes[o.where].success=this.nodes[o.what]:this.nodes[o.where].failure=this.nodes[o.what]}for(var a=0;a<n;a++)if(null==this.nodes[a].failure||null==this.nodes[a].success)throw new Error("Invalid validator state");return this.nodes[0]},t}(),Rl=function(t){function e(){return t.call(this)||this}return x(e,t),e.prototype.validateForShorthand=function(t,e){var n=t[e].visit(this);return n?[n]:null},e}(Pe),Ll=function(t){function e(e,n,i){var r;return(r=t.call(this)||this).allowed=void 0,r.idents=void 0,r.units=void 0,r.allowed=e,r.idents=n,r.units=i,r}x(e,t);var n=e.prototype;return n.visitEmpty=function(t){return 1&this.allowed?t:null},n.visitSlash=function(t){return 2048&this.allowed?t:null},n.visitStr=function(t){return 2&this.allowed?t:null},n.visitIdent=function(t){return this.idents[t.name.toLowerCase()]||(4&this.allowed?t:null)},n.visitNumeric=function(t){return 0!=t.num||512&this.allowed?t.num<0&&!(256&this.allowed)?null:this.units[t.unit]?t:null:"%"==t.unit&&1024&this.allowed?t:null},n.visitNum=function(t){return 0==t.num?512&this.allowed?t:null:t.num<=0&&!(256&this.allowed)?null:16&this.allowed?t:null},n.visitInt=function(t){return 0==t.num?512&this.allowed?t:null:t.num<=0&&!(256&this.allowed)?null:48&this.allowed?t:this.idents[""+t.num]||null},n.visitColor=function(t){return 64&this.allowed?t:null},n.visitURL=function(t){return 128&this.allowed?t:null},n.visitURange=function(t){return 4096&this.allowed?t:null},n.visitSpaceList=function(t){return null},n.visitCommaList=function(t){return null},n.visitFunc=function(t){return null},n.visitExpr=function(t){return 2046&this.allowed?t:null},n.combine=function(t){var n={},i={};for(var r in this.idents)n[r]=this.idents[r];for(var o in t.idents)n[o]=t.idents[o];for(var a in this.units)i[a]=this.units[a];for(var s in t.units)i[s]=t.units[s];return new e(this.allowed|t.allowed,n,i)},e}(Rl),Ol={},kl=new Ll(0,Ol,Ol),Bl=function(t){function e(e){var n;return(n=t.call(this)||this).successTerminal=void 0,n.failureTerminal=void 0,n.first=void 0,n.successTerminal=new Il(null),n.failureTerminal=new Il(null),n.first=e.finish(n.successTerminal,n.failureTerminal),n}x(e,t);var n=e.prototype;return n.validateList=function(t,e,n){for(var i=e?[]:t,r=this.first,o=n,a=null,s=null;r!==this.successTerminal&&r!==this.failureTerminal;)if(o>=t.length)r=r.failure;else{var u=t[o],l=u;if(r.isSpecial()){var h=!0;r.isStartGroup()?(a?a.push(s):a=[s],s=[]):r.isEndGroup()?s=a.length>0?a.pop():null:r.isEndAlternate()?s[r.getAlternate()]="taken":h=null==s[r.getAlternate()],r=h?r.success:r.failure}else{if(0==o&&!e&&r.validator instanceof _l&&this instanceof _l){if(l=new qe(t).visit(r.validator)){o=t.length,r=r.success;continue}}else if(0==o&&!e&&r.validator instanceof Ml&&this instanceof _l){if(l=new Qe(t).visit(r.validator)){o=t.length,r=r.success;continue}}else l=u.visit(r.validator);if(!l){r=r.failure;continue}if(l!==u&&t===i){i=[];for(var c=0;c<o;c++)i[c]=t[c]}t!==i&&(i[o-n]=l),o++,r=r.success}}return r===this.successTerminal&&(e?i.length>0:o==t.length)?i:null},n.validateSingle=function(t){for(var e=null,n=this.first;n!==this.successTerminal&&n!==this.failureTerminal;)t?n.isSpecial()?n=n.success:(e=t.visit(n.validator))?(t=null,n=n.success):n=n.failure:n=n.failure;return n===this.successTerminal?e:null},n.visitEmpty=function(t){return this.validateSingle(t)},n.visitSlash=function(t){return this.validateSingle(t)},n.visitStr=function(t){return this.validateSingle(t)},n.visitIdent=function(t){return this.validateSingle(t)},n.visitNumeric=function(t){return this.validateSingle(t)},n.visitNum=function(t){return this.validateSingle(t)},n.visitInt=function(t){return this.validateSingle(t)},n.visitColor=function(t){return this.validateSingle(t)},n.visitURL=function(t){return this.validateSingle(t)},n.visitURange=function(t){return this.validateSingle(t)},n.visitSpaceList=function(t){return null},n.visitCommaList=function(t){return null},n.visitFunc=function(t){return this.validateSingle(t)},n.visitExpr=function(t){return null},e}(Rl),_l=function(t){function e(e){return t.call(this,e)||this}x(e,t);var n=e.prototype;return n.visitSpaceList=function(t){var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new qe(e):null},n.visitCommaList=function(t){for(var e=this.first,n=!1;e;){if(e.validator instanceof Ml){n=!0;break}e=e.failure}if(n){var i=this.validateList(t.values,!1,0);return i===t.values?t:i?new Qe(i):null}return null},n.validateForShorthand=function(t,e){return this.validateList(t,!0,e)},e}(Bl),Ml=function(t){function e(e){return t.call(this,e)||this}x(e,t);var n=e.prototype;return n.visitSpaceList=function(t){return this.validateSingle(t)},n.visitCommaList=function(t){var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new Qe(e):null},n.validateForShorthand=function(t,e){for(var n,i=this.first;i!==this.failureTerminal;){if(n=i.validator.validateForShorthand(t,e))return n;i=i.failure}return null},e}(Bl),Ul=function(t){function e(e,n){var i;return(i=t.call(this,n)||this).name=void 0,i.name=e,i}x(e,t);var n=e.prototype;return n.validateSingle=function(t){return null},n.visitFunc=function(t){if(t.name.toLowerCase()!=this.name)return null;var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new $e(t.name,e):null},e}(Bl),Vl=function(){function t(){}var e=t.prototype;return e.tryParse=function(t,e,n){return e},e.success=function(t,e){},t}(),Hl=function(t){function e(e,n){var i;return(i=t.call(this)||this).name=void 0,i.validator=void 0,i.name=n,i.validator=e.validators[i.name],i}x(e,t);var n=e.prototype;return n.tryParse=function(t,e,n){if(n.values[this.name])return e;var i=this.validator.validateForShorthand(t,e);if(i){var r=i.length,o=r>1?new qe(i):i[0];return this.success(o,n),e+r}return e},n.success=function(t,e){e.values[this.name]=t},e}(Vl),zl=function(t){function e(e,n){var i;return(i=t.call(this,e,n[0])||this).names=void 0,i.names=n,i}return x(e,t),e.prototype.success=function(t,e){for(var n=0;n<this.names.length;n++)e.values[this.names[n]]=t},e}(Hl),Gl=function(t){function e(e,n){var i;return(i=t.call(this)||this).nodes=void 0,i.slash=void 0,i.nodes=e,i.slash=n,i}return x(e,t),e.prototype.tryParse=function(t,e,n){var i=e;if(this.slash){if(t[e]!=_e)return i;if(++e==t.length)return i}var r=this.nodes[0].tryParse(t,e,n);if(r==e)return i;e=r;for(var o=1;o<this.nodes.length&&e<t.length&&(r=this.nodes[o].tryParse(t,e,n))!=e;o++)e=r;return e},e}(Vl),Xl=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).syntax=null,e.propList=null,e.error=!1,e.values={},e.validatorSet=null,e}x(e,t);var n=e.prototype;return n.setOwner=function(t){this.validatorSet=t},n.syntaxNodeForProperty=function(t){return new Hl(this.validatorSet,t)},n.clone=function(){var t=new this.constructor;return t.syntax=this.syntax,t.propList=this.propList,t.validatorSet=this.validatorSet,t},n.init=function(t,e){this.syntax=t,this.propList=e},n.finish=function(t,e){if(!this.error){for(var n,i=B(this.propList);!(n=i()).done;){var r=n.value;e.simpleProperty(r,this.values[r]||this.validatorSet.defaultValues[r],t)}return!0}return!1},n.propagateInherit=function(t,e){for(var n,i=B(this.propList);!(n=i()).done;)e.simpleProperty(n.value,en.inherit,t)},n.validateList=function(t){return this.error=!0,0},n.validateSingle=function(t){return this.validateList([t]),null},n.visitEmpty=function(t){return this.validateSingle(t)},n.visitStr=function(t){return this.validateSingle(t)},n.visitIdent=function(t){return this.validateSingle(t)},n.visitNumeric=function(t){return this.validateSingle(t)},n.visitNum=function(t){return this.validateSingle(t)},n.visitInt=function(t){return this.validateSingle(t)},n.visitColor=function(t){return this.validateSingle(t)},n.visitURL=function(t){return this.validateSingle(t)},n.visitSpaceList=function(t){return this.validateList(t.values),null},n.visitCommaList=function(t){return this.error=!0,null},n.visitFunc=function(t){return this.validateSingle(t)},n.visitExpr=function(t){return this.error=!0,null},e}(Pe),Wl=function(t){function e(){return t.call(this)||this}return x(e,t),e.prototype.validateList=function(t){for(var e=0,n=0;e<t.length;){var i=this.syntax[n].tryParse(t,e,this);if(i>e)e=i,n=0;else if(++n==this.syntax.length){this.error=!0;break}}return e},e}(Xl),jl=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.validateList=function(t){if(t.length>this.syntax.length||0==t.length)return this.error=!0,0;for(var e=0;e<this.syntax.length;e++){for(var n=e;n>=t.length;)n=1==n?0:n-2;if(this.syntax[e].tryParse(t,n,this)!=n+1)return this.error=!0,0}return t.length},n.createSyntaxNode=function(){return new zl(this.validatorSet,this.propList)},e}(Xl),Kl=function(t){function e(){return t.call(this)||this}return x(e,t),e.prototype.validateList=function(t){for(var e=t.length,n=0;n<t.length;n++)if(t[n]===_e){e=n;break}if(e>this.syntax.length||0==t.length)return this.error=!0,0;for(var i=0;i<this.syntax.length;i++){for(var r=i;r>=e;)r=1==r?0:r-2;var o=void 0;if(e+1<t.length)for(o=e+i+1;o>=t.length;)o-=o==e+2?1:2;else o=r;if(2!=this.syntax[i].tryParse([t[r],t[o]],0,this))return this.error=!0,0}return t.length},e}(Xl),Yl=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.mergeIn=function(t,e){for(var n,i=B(this.propList);!(n=i()).done;){var r=n.value,o=e[r]||this.validatorSet.defaultValues[r],a=t[r];a||(t[r]=a=[]),a.push(o)}},n.visitCommaList=function(t){for(var e={},n=0;n<t.values.length;n++)if(this.values={},t.values[n]instanceof Qe?this.error=!0:(t.values[n].visit(this),this.mergeIn(e,this.values),this.values["background-color"]&&n!=t.values.length-1&&(this.error=!0)),this.error)return null;for(var i in this.values={},e)this.values[i]="background-color"==i?e[i].pop():new Qe(e[i]);return null},e}(Wl),ql=function(t){function e(){return t.call(this)||this}x(e,t);var n=e.prototype;return n.init=function(e,n){t.prototype.init.call(this,e,n),this.propList.push("font-family","line-height","font-size","font-stretch","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian")},n.validateList=function(e){var n=t.prototype.validateList.call(this,e),i=this.values["font-variant_css2"];i&&(delete this.values["font-variant_css2"],this.values["font-variant-caps"]=i);var r=this.values["font-stretch_css3"];if(r&&(delete this.values["font-stretch_css3"],this.values["font-stretch"]=r),n+2>e.length)return this.error=!0,n;this.error=!1;var o=this.validatorSet.validators;if(!e[n].visit(o["font-size"]))return this.error=!0,n;if(this.values["font-size"]=e[n++],e[n]===_e){if(2+ ++n>e.length)return this.error=!0,n;if(!e[n].visit(o["line-height"]))return this.error=!0,n;this.values["line-height"]=e[n++]}var a=n==e.length-1?e[n]:new qe(e.slice(n,e.length));return a.visit(o["font-family"])?(this.values["font-family"]=a,e.length):(this.error=!0,n)},n.visitCommaList=function(t){if(t.values[0].visit(this),this.error)return null;for(var e=[this.values["font-family"]],n=1;n<t.values.length;n++)e.push(t.values[n]);var i=new Qe(e);return i.visit(this.validatorSet.validators["font-family"])?this.values["font-family"]=i:this.error=!0,null},n.visitIdent=function(t){var e=this.validatorSet.systemFonts[t.name];if(e)for(var n in e)this.values[n]=e[n];else this.error=!0;return null},e}(Wl),Ql={SIMPLE:Wl,INSETS:jl,INSETS_SLASH:Kl,COMMA:Yl,FONT:ql},$l=function(){function t(){this.validators={},this.prefixes={},this.defaultValues={},this.namedValidators={},this.systemFonts={},this.shorthands={},this.layoutProps={},this.backgroundProps={}}var e=t.prototype;return e.addReplacement=function(t,e){var n;if(e.type==Vn.NUMERIC)n=new ze(e.num,e.text);else if(e.type==Vn.HASH)n=ir(e.text);else{if(e.type!=Vn.IDENT)throw new Error("unexpected replacement");n=He(e.text)}if(t.isPrimitive()){var i=t.nodes[0].validator.idents;for(var r in i)i[r]=n;return t}throw new Error("unexpected replacement")},e.newGroup=function(t,e){var n,i=new Pl;if("||"==t){for(var r=0;r<e.length;r++){var o=new Pl;o.startClause(r),o.addGroup(e[r],wl.FOLLOW),o.endClause(r),i.addGroup(o,0==r?wl.FOLLOW:wl.ALTERNATE)}var a=new Pl;return a.startSpecialGroup(),a.addGroup(i,wl.REPEATED),a.endSpecialGroup(),a}switch(t){case" ":n=wl.FOLLOW;break;case"|":case"||":n=wl.ALTERNATE;break;default:throw new Error("unexpected op")}for(var s=0;s<e.length;s++)i.addGroup(e[s],0==s?wl.FOLLOW:n);return i},e.addCounts=function(t,e,n){for(var i=new Pl,r=0;r<e;r++)i.addGroup(t.clone(),wl.FOLLOW);if(n==Number.POSITIVE_INFINITY)i.addGroup(t,wl.REPEATED);else for(var o=e;o<n;o++)i.addGroup(t.clone(),wl.OPTIONAL);return i},e.primitive=function(t){var e=new Pl;return e.addPrimitive(t),e},e.newFunc=function(t,e){var n;switch(t){case"COMMA":n=new Ml(e);break;case"SPACE":n=new _l(e);break;default:n=new Ul(t.toLowerCase(),e)}return this.primitive(n)},e.initBuiltInValidators=function(){this.namedValidators.HASHCOLOR=this.primitive(new Ll(64,Ol,Ol)),this.namedValidators.POS_INT=this.primitive(new Ll(32,Ol,Ol)),this.namedValidators.POS_NUM=this.primitive(new Ll(16,Ol,Ol)),this.namedValidators.POS_PERCENTAGE=this.primitive(new Ll(8,Ol,{"%":ke})),this.namedValidators.NEGATIVE=this.primitive(new Ll(256,Ol,Ol)),this.namedValidators.ZERO=this.primitive(new Ll(512,Ol,Ol)),this.namedValidators.ZERO_PERCENTAGE=this.primitive(new Ll(1024,Ol,Ol)),this.namedValidators.POS_LENGTH=this.primitive(new Ll(8,Ol,{em:ke,ex:ke,ch:ke,rem:ke,vw:ke,vh:ke,vi:ke,vb:ke,vmin:ke,vmax:ke,pvw:ke,pvh:ke,pvi:ke,pvb:ke,pvmin:ke,pvmax:ke,cm:ke,mm:ke,in:ke,px:ke,pt:ke,pc:ke,q:ke})),this.namedValidators.POS_ANGLE=this.primitive(new Ll(8,Ol,{deg:ke,grad:ke,rad:ke,turn:ke})),this.namedValidators.POS_TIME=this.primitive(new Ll(8,Ol,{s:ke,ms:ke})),this.namedValidators.FREQUENCY=this.primitive(new Ll(8,Ol,{Hz:ke,kHz:ke})),this.namedValidators.RESOLUTION=this.primitive(new Ll(8,Ol,{dpi:ke,dpcm:ke,dppx:ke})),this.namedValidators.URI=this.primitive(new Ll(128,Ol,Ol)),this.namedValidators.URANGE=this.primitive(new Ll(4096,Ol,Ol)),this.namedValidators.IDENT=this.primitive(new Ll(4,Ol,Ol)),this.namedValidators.STRING=this.primitive(new Ll(2,Ol,Ol)),this.namedValidators.SLASH=this.primitive(new Ll(2048,Ol,Ol));var t={"font-family":He("sans-serif")};this.systemFonts.caption=t,this.systemFonts.icon=t,this.systemFonts.menu=t,this.systemFonts["message-box"]=t,this.systemFonts["small-caption"]=t,this.systemFonts["status-bar"]=t},e.isBuiltIn=function(t){return!!t.match(/^[A-Z_0-9]+$/)},e.readNameAndPrefixes=function(t,e){var n=t.token();if(n.type==Vn.EOF)return null;var i={"":!0};if(n.type==Vn.O_BRK){do{if(t.consume(),(n=t.token()).type!=Vn.IDENT)throw new Error("Prefix name expected");i[n.text]=!0,t.consume(),n=t.token()}while(n.type==Vn.COMMA);if(n.type!=Vn.C_BRK)throw new Error("']' expected");t.consume(),n=t.token()}if(n.type!=Vn.IDENT)throw new Error("Property name expected");if(2==e?"SHORTHANDS"==n.text:"DEFAULTS"==n.text)return t.consume(),null;var r=n.text;if(t.consume(),2!=e){if(t.token().type!=Vn.EQ)throw new Error("'=' expected");this.isBuiltIn(r)||(this.prefixes[r]=i)}else if(t.token().type!=Vn.COLON)throw new Error("':' expected");return r},e.parseValidators=function(t){for(var e=this,n=function(){var n=e.readNameAndPrefixes(t,1);if(!n)return{v:void 0};for(var i=[],r=[],o="",a=void 0,s=!0,u=function(){if(0==i.length)throw new Error("No values");return 1==i.length?i[0]:e.newGroup(o,i)},l=function(t){if(s)throw new Error("'"+t+"': unexpected");if(o&&o!=t)throw new Error("mixed operators: '"+t+"' and '"+o+"'");o=t,s=!0},h=null;!h;){t.consume();var c=t.token();switch(c.type){case Vn.IDENT:if(s||l(" "),e.isBuiltIn(c.text)){var d=e.namedValidators[c.text];if(!d)throw new Error("'"+c.text+"' unexpected");i.push(d.clone())}else{var f={};f[c.text.toLowerCase()]=He(c.text),i.push(e.primitive(new Ll(0,f,Ol)))}s=!1;break;case Vn.INT:var p={};p[""+c.num]=new Xe(c.num),i.push(e.primitive(new Ll(0,p,Ol))),s=!1;break;case Vn.BAR:l("|");break;case Vn.BAR_BAR:l("||");break;case Vn.O_BRK:s||l(" "),r.push({vals:i,op:o,b:"["}),o="",i=[],s=!0;break;case Vn.FUNC:s||l(" "),r.push({vals:i,op:o,b:"(",fn:c.text}),o="",i=[],s=!0;break;case Vn.C_BRK:a=u();var g=r.pop();if("["!=g.b)throw new Error("']' unexpected");(i=g.vals).push(a),o=g.op,s=!1;break;case Vn.C_PAR:a=u();var v=r.pop();if("("!=v.b)throw new Error("')' unexpected");(i=v.vals).push(e.newFunc(v.fn,a)),o=v.op,s=!1;break;case Vn.COLON:if(s)throw new Error("':' unexpected");t.consume(),i.push(e.addReplacement(i.pop(),t.token()));break;case Vn.QMARK:if(s)throw new Error("'?' unexpected");i.push(e.addCounts(i.pop(),0,1));break;case Vn.STAR:if(s)throw new Error("'*' unexpected");i.push(e.addCounts(i.pop(),0,Number.POSITIVE_INFINITY));break;case Vn.PLUS:if(s)throw new Error("'+' unexpected");i.push(e.addCounts(i.pop(),1,Number.POSITIVE_INFINITY));break;case Vn.O_BRC:if(t.consume(),(c=t.token()).type!=Vn.INT)throw new Error("<int> expected");var m=c.num,E=m;if(t.consume(),(c=t.token()).type==Vn.COMMA){if(t.consume(),(c=t.token()).type!=Vn.INT)throw new Error("<int> expected");E=c.num,t.consume(),c=t.token()}if(c.type!=Vn.C_BRC)throw new Error("'}' expected");i.push(e.addCounts(i.pop(),m,E));break;case Vn.SEMICOL:if(h=u(),r.length>0)throw new Error("unclosed '"+r.pop().b+"'");break;default:throw new Error("unexpected token")}}t.consume(),e.isBuiltIn(n)?e.namedValidators[n]=h:e.validators[n]=h.isSimple()?h.nodes[0].validator:new _l(h)};;){var i=n();if("object"==typeof i)return i.v}},e.parseDefaults=function(t){for(;;){var e=this.readNameAndPrefixes(t,2);if(!e)return;for(var n=[];;){t.consume();var i=t.token();if(i.type==Vn.SEMICOL){t.consume();break}switch(i.type){case Vn.IDENT:n.push(He(i.text));break;case Vn.NUM:n.push(new Ge(i.num));break;case Vn.INT:n.push(new Xe(i.num));break;case Vn.NUMERIC:n.push(new ze(i.num,i.text));break;default:throw new Error("unexpected token")}}this.defaultValues[e]=n.length>1?new qe(n):n[0]}},e.parseShorthands=function(t){for(;;){var e=this.readNameAndPrefixes(t,3);if(!e)return;var n=t.nthToken(1),i=void 0;n.type==Vn.IDENT&&Ql[n.text]?(i=new Ql[n.text],t.consume()):i=new Wl,i.setOwner(this);for(var r=!1,o=[],a=!1,s=[],u=[];!r;)switch(t.consume(),(n=t.token()).type){case Vn.IDENT:if(this.validators[n.text])o.push(i.syntaxNodeForProperty(n.text)),n.text.includes("_")||u.push(n.text);else{if(!(this.shorthands[n.text]instanceof jl))throw new Error("'"+n.text+"' is neither a simple property nor an inset shorthand");var l=this.shorthands[n.text];o.push(l.createSyntaxNode()),u.push.apply(u,l.propList)}break;case Vn.SLASH:if(o.length>0||a)throw new Error("unexpected slash");a=!0;break;case Vn.O_BRK:s.push({slash:a,syntax:o}),o=[],a=!1;break;case Vn.C_BRK:var h=new Gl(o,a),c=s.pop();a=c.slash,(o=c.syntax).push(h);break;case Vn.SEMICOL:r=!0,t.consume();break;default:throw new Error("unexpected token")}i.init(o,u),this.shorthands[e]=i}},e.parse=function(t){var e=new Ti(t,null);this.parseValidators(e),this.parseDefaults(e),this.parseShorthands(e),this.backgroundProps=this.makePropSet(["background"]),this.layoutProps=this.makePropSet(["margin","border","padding","columns","column-gap","column-rule","column-fill"])},e.makePropSet=function(t){for(var e,n={},i=B(t);!(e=i()).done;)for(var r,o=e.value,a=this.shorthands[o],s=B(a?a.propList:[o]);!(r=s()).done;){var u=r.value,l=this.defaultValues[u];l?n[u]=l:c.warn("Unknown property in makePropSet:",u)}return n},e.validatePropertyAndHandleShorthand=function(t,e,n,i){var r="",o=t,a=(t=t.toLowerCase()).match(/^-([a-z]+)-([-a-z0-9]+)$/);a&&(r=a[1],t=a[2]);var s=this.prefixes[t];if(s&&s[r]){var u=this.validators[t];if(u){var l=e===en.inherit||e.isExpr()?e:e.visit(u);l?i.simpleProperty(t,l,n):i.invalidPropertyValue(o,e)}else{var h=this.shorthands[t].clone();e===en.inherit?h.propagateInherit(n,i):(e.visit(h),h.finish(n,i)||i.invalidPropertyValue(o,e))}}else i.unknownProperty(o,e)},t}();function Zl(){var t=new $l;return t.initBuiltInValidators(),t.parse(Yi),t}var Jl={"font-style":en.normal,"font-stretch":en.normal,"font-weight":en.normal,"unicode-range":sn},th="OTTO"+(new Date).valueOf(),eh=1;function nh(t,e){var n={};for(var i in t)n[i]=Uo(t,i).evaluate(e,i);return function(t){for(var e in Jl)t[e]||(t[e]=Jl[e])}(n),n}var ih=function(){function t(t){this.properties=void 0,this.fontTraitKey=void 0,this.src=void 0,this.blobURLs=[],this.blobs=[],this.family=void 0,this.properties=t,this.fontTraitKey=function(t){var e=new it;for(var n in Jl)e.append(" "),e.append(t[n].toString());return e.toString()}(this.properties),this.src=this.properties.src?this.properties.src.toString():null;var e=this.properties["font-family"];this.family=e?e.stringValue():null}var e=t.prototype;return e.traitsEqual=function(t){return this.fontTraitKey==t.fontTraitKey},e.makeAtRule=function(t,e){var n=new it;for(var i in n.append("@font-face {\n font-family: "),n.append(this.family),n.append(";\n "),Jl)n.append(i),n.append(": "),this.properties[i].appendTo(n,!0),n.append(";\n ");if(e){n.append('src: url("');var r=(window.URL||window.webkitURL).createObjectURL(e);n.append(r),this.blobURLs.push(r),this.blobs.push(e),n.append('")')}else n.append("src: "),n.append(t);return n.append(";\n}\n"),n.toString()},t}(),rh=function(){function t(t){this.deobfuscator=void 0,this.familyMap={},this.deobfuscator=t}var e=t.prototype;return e.registerFamily=function(t,e){var n=t.family,i=this.familyMap[n],r=e.family;if(i){if(i!=r)throw new Error("E_FONT_FAMILY_INCONSISTENT "+t.family)}else this.familyMap[n]=r},e.filterFontFamily=function(t){if(t instanceof Qe){for(var e,n=[],i=B(t.values);!(e=i()).done;){var r=e.value,o=this.familyMap[r.stringValue()];o&&n.push(He(o)),n.push(r)}return new Qe(n)}var a=this.familyMap[t.stringValue()];return a?new Qe([He(a),t]):t},t}(),oh=function(){function t(t,e,n){this.head=void 0,this.body=void 0,this.srcURLMap={},this.familyPrefix=void 0,this.familyCounter=0,this.head=t,this.body=e,this.familyPrefix=n||"Fnt_"}var e=t.prototype;return e.getViewFontFamily=function(t,e){var n=t.family,i=e.familyMap[n];return i||(i=this.familyPrefix+ ++this.familyCounter,e.familyMap[n]=i,i)},e.initFont=function(t,e,n){var i=this,r=Pi("initFont"),o=t.src,a={};for(var s in Jl)a[s]=t.properties[s];var u=this.getViewFontFamily(t,n);a["font-family"]=He(u);var l=new ih(a),h=this.body.ownerDocument.createElement("span");h.textContent="M";var d=(new Date).valueOf()+1e3,f=this.head.ownerDocument.createElement("style"),p=th+eh++;f.textContent=l.makeAtRule("",Ji([p])),this.head.appendChild(f);var g=this.body.ownerDocument.createElement("span");for(var v in g.style.width="0",g.style.height="0",g.style.overflow="hidden",g.appendChild(h),this.body.appendChild(g),h.style.visibility="hidden",h.style.fontFamily=u,Jl)tt(h,v,a[v].toString());var m=h.getBoundingClientRect(),E=m.right-m.left,C=m.bottom-m.top;f.textContent=l.makeAtRule(o,e),c.info("Starting to load font:",o);var D=!1;return r.loop((function(){var t=h.getBoundingClientRect();return E!=t.right-t.left||C!=t.bottom-t.top?(D=!0,Ri(!1)):(new Date).valueOf()>d?Ri(!1):r.sleep(10)})).then((function(){D?c.info("Loaded font:",o):c.warn("Failed to load font:",o),i.body.removeChild(g),r.finish(l)})),r.result()},e.loadFont=function(t,e){var n=this,i=t.src,r=this.srcURLMap[i];return r?r.piggyback((function(n){var r=n;r.traitsEqual(t)?(e.registerFamily(t,r),c.warn("Found already-loaded font:",i)):c.warn("E_FONT_FACE_INCOMPATIBLE",t.src)})):(r=new zi((function(){var r=Pi("loadFont"),o=e.deobfuscator?e.deobfuscator(i):null;return o?Zi(i,Wi.BLOB).then((function(i){i.responseBlob?o(i.responseBlob).then((function(i){n.initFont(t,i,e).thenFinish(r)})):r.finish(null)})):n.initFont(t,null,e).thenFinish(r),r.result()}),"loadFont "+i),this.srcURLMap[i]=r,r.start()),r},e.findOrLoadFonts=function(t,e){for(var n,i=[],r=B(t);!(n=r()).done;){var o=n.value;o.src&&o.family?i.push(this.loadFont(o,e)):c.warn("E_FONT_FACE_INVALID")}return Gi(i)},t}(),ah=1,sh=function(){function t(t,e,n,i,r){this.name=void 0,this.pseudoName=void 0,this.classes=void 0,this.parent=void 0,this.specified={},this.children=[],this.pageMaster=null,this.index=0,this.key=void 0,this._scope=void 0,this.name=e,this.pseudoName=n,this.classes=i,this.parent=r,this._scope=t,this.key="p"+ah++,r&&(this.index=r.children.length,r.children.push(this))}var e=t.prototype;return e.createInstance=function(t){throw new Error("E_UNEXPECTED_CALL")},e.clone=function(t){throw new Error("E_UNEXPECTED_CALL")},e.copySpecified=function(t){var e=this.specified,n=t.specified;for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])},e.cloneChildren=function(t){for(var e=0;e<this.children.length;e++)this.children[e].clone({parent:t})},T(t,[{key:"scope",get:function(){return this._scope}}]),t}(),uh=function(t){function e(e){var n;return(n=t.call(this,e,null,null,[],null)||this).specified.width=new Lo(rn,0),n.specified.height=new Lo(on,0),n}return x(e,t),e}(sh),lh=function(t){function e(e,n){var i;(i=t.call(this,e,(function(t,e){var n=t.match(/^([^.]+)\.([^.]+)$/);if(n){var i=r.pageMaster.keyMap[n[1]];if(i){var o=this.lookupInstance(i);if(o)return e?o.resolveFunc(n[2]):o.resolveName(n[2])}}return null}))||this).pageMaster=void 0,i.pageMaster=n;var r=O(i);return i}return x(e,t),e}(Ut),hh=function(t){function e(e,n,i,r,o,a,s){var u;return(u=t.call(this,e,n,i,r,o)||this).condition=void 0,u.specificity=void 0,u.keyMap={},u.condition=a,u.specificity=s,e instanceof lh||(u._scope=new lh(e,O(u))),u.pageMaster=O(u),u.specified.width=new Lo(rn,0),u.specified.height=new Lo(on,0),u.specified["wrap-flow"]=new Lo(en.auto,0),u.specified.position=new Lo(en.relative,0),u.specified.overflow=new Lo(en.visible,0),u}x(e,t);var n=e.prototype;return n.createInstance=function(t){return new Ah(t,this)},n.clone=function(t){var n=new e(this.scope,this.name,t.pseudoName||this.pseudoName,this.classes,this.parent,this.condition,this.specificity);return this.copySpecified(n),this.cloneChildren(n),n},n.resetScope=function(){this.scope.pageMaster=this},e}(sh),ch=function(t){function e(e,n,i,r,o){var a;return(a=t.call(this,e,n,i,r,o)||this).pageMaster=o.pageMaster,n&&(a.pageMaster.keyMap[n]=a.key),a.specified["wrap-flow"]=new Lo(en.auto,0),a}x(e,t);var n=e.prototype;return n.createInstance=function(t){return new Th(t,this)},n.clone=function(t){var n=new e(t.parent.scope,this.name,this.pseudoName,this.classes,t.parent);return this.copySpecified(n),this.cloneChildren(n),n},e}(sh),dh=function(t){function e(e,n,i,r,o){var a;return(a=t.call(this,e,n,i,r,o)||this).pageMaster=o.pageMaster,n&&(a.pageMaster.keyMap[n]=a.key),a}x(e,t);var n=e.prototype;return n.createInstance=function(t){return new xh(t,this)},n.clone=function(t){var n=new e(t.parent.scope,this.name,this.pseudoName,this.classes,t.parent);return this.copySpecified(n),this.cloneChildren(n),n},e}(sh);function fh(t,e,n){return e&&e!==en.auto?e.toExpr(t,n):null}function ph(t,e,n){return e&&e!==en.auto?e.toExpr(t,n):t.zero}function gh(t,e,n){return e?e===en.auto?null:e.toExpr(t,n):t.zero}function vh(t,e,n,i){return e&&n!==en.none?e.toExpr(t,i):t.zero}function mh(t,e,n){return e?e===en._true?t._true:e===en._false?t._false:e.toExpr(t,t.zero):n}var Eh=function(){function t(t,e){this.parentInstance=void 0,this.pageBox=void 0,this.cascaded={},this.style={},this.autoWidth=null,this.autoHeight=null,this.children=[],this.isAutoWidth=!1,this.isAutoHeight=!1,this.isTopDependentOnAutoHeight=!1,this.isRightDependentOnAutoWidth=!1,this.calculatedWidth=0,this.calculatedHeight=0,this.pageMasterInstance=null,this.namedValues={},this.namedFuncs={},this.vertical=!1,this.rtl=!1,this.suppressEmptyBoxGeneration=!1,this.parentInstance=t,this.pageBox=e,t&&t.children.push(this)}var e=t.prototype;return e.reset=function(){this.calculatedWidth=0,this.calculatedHeight=0},e.addNamedValues=function(t,e){var n=this.resolveName(t),i=this.resolveName(e);if(!n||!i)throw new Error("E_INTERNAL");return Te(this.pageBox.scope,n,i)},e.resolveName=function(t){var e=this.namedValues[t];if(e)return e;var n=this.style[t];switch(n&&(e=n.toExpr(this.pageBox.scope,this.pageBox.scope.zero)),t){case"margin-left-edge":e=this.resolveName("left");break;case"margin-top-edge":e=this.resolveName("top");break;case"margin-right-edge":e=this.addNamedValues("border-right-edge","margin-right");break;case"margin-bottom-edge":e=this.addNamedValues("border-bottom-edge","margin-bottom");break;case"border-left-edge":e=this.addNamedValues("margin-left-edge","margin-left");break;case"border-top-edge":e=this.addNamedValues("margin-top-edge","margin-top");break;case"border-right-edge":e=this.addNamedValues("padding-right-edge","border-right-width");break;case"border-bottom-edge":e=this.addNamedValues("padding-bottom-edge","border-bottom-width");break;case"padding-left-edge":e=this.addNamedValues("border-left-edge","border-left-width");break;case"padding-top-edge":e=this.addNamedValues("border-top-edge","border-top-width");break;case"padding-right-edge":e=this.addNamedValues("right-edge","padding-right");break;case"padding-bottom-edge":e=this.addNamedValues("bottom-edge","padding-bottom");break;case"left-edge":e=this.addNamedValues("padding-left-edge","padding-left");break;case"top-edge":e=this.addNamedValues("padding-top-edge","padding-top");break;case"right-edge":e=this.addNamedValues("left-edge","width");break;case"bottom-edge":e=this.addNamedValues("top-edge","height")}if(!e){var i;if("extent"==t)i=this.vertical?"width":"height";else if("measure"==t)i=this.vertical?"height":"width";else{var r=this.vertical?Io:Fo;for(var o in i=t,r)i=i.replace(o,r[o])}i!=t&&(e=this.resolveName(i))}return e&&(this.namedValues[t]=e),e},e.resolveFunc=function(t){var e=this.namedFuncs[t];if(e)return e;if("columns"===t){var n=this.pageBox.scope,i=new Se(n,0),r=this.resolveName("column-count"),o=this.resolveName("column-width"),a=this.resolveName("column-gap");e=xe(n,Ie(n,new De(n,"min",[i,r]),Te(n,o,a)),a)}return e&&(this.namedFuncs[t]=e),e},e.initEnabled=function(){var t=this.pageBox.scope,e=this.style,n=mh(t,e.enabled,t._true),i=fh(t,e.page,t.zero);if(i){var r=new me(t,"page-number");n=Ae(t,n,new le(t,i,r))}var o=fh(t,e["min-page-width"],t.zero);o&&(n=Ae(t,n,new ue(t,new me(t,"page-width"),o)));var a=fh(t,e["min-page-height"],t.zero);a&&(n=Ae(t,n,new ue(t,new me(t,"page-height"),a))),n=this.boxSpecificEnabled(n),e.enabled=new Ze(n)},e.boxSpecificEnabled=function(t){return t},e.initHorizontal=function(){var t=this.pageBox.scope,e=this.style,n=this.parentInstance?this.parentInstance.style.width.toExpr(t,null):null,i=fh(t,e.left,n),r=fh(t,e["margin-left"],n),o=vh(t,e["border-left-width"],e["border-left-style"],n),a=ph(t,e["padding-left"],n),s=fh(t,e.width,n),u=fh(t,e["max-width"],n),l=ph(t,e["padding-right"],n),h=vh(t,e["border-right-width"],e["border-right-style"],n),c=fh(t,e["margin-right"],n),d=fh(t,e.right,n),f=Te(t,o,a),p=Te(t,o,l);if(i&&d&&s){var g=xe(t,n,Te(t,s,Te(t,Te(t,i,f),p)));r?c?d=xe(t,g,c):c=xe(t,g,Te(t,d,r)):(g=xe(t,g,d),c?r=xe(t,g,c):c=r=Ie(t,g,new ye(t,.5)))}else{r||(r=t.zero),c||(c=t.zero),i||d||s||(i=t.zero),i||s?i||d?s||d||(s=this.autoWidth,this.isAutoWidth=!0):i=t.zero:(s=this.autoWidth,this.isAutoWidth=!0);var v=xe(t,n,Te(t,Te(t,r,f),Te(t,c,p)));this.isAutoWidth&&(u||(u=xe(t,v,i||d)),this.vertical||!fh(t,e["column-width"],null)&&!fh(t,e["column-count"],null)||(s=u,this.isAutoWidth=!1)),i?s?d||(d=xe(t,v,Te(t,i,s))):s=xe(t,v,Te(t,i,d)):i=xe(t,v,Te(t,d,s))}var m=ph(t,e["snap-width"]||(this.parentInstance?this.parentInstance.style["snap-width"]:null),n);e.left=new Ze(i),e["margin-left"]=new Ze(r),e["border-left-width"]=new Ze(o),e["padding-left"]=new Ze(a),e.width=new Ze(s),e["max-width"]=new Ze(u||s),e["padding-right"]=new Ze(l),e["border-right-width"]=new Ze(h),e["margin-right"]=new Ze(c),e.right=new Ze(d),e["snap-width"]=new Ze(m)},e.initVertical=function(){var t=this.pageBox.scope,e=this.style,n=this.parentInstance?this.parentInstance.style.width.toExpr(t,null):null,i=this.parentInstance?this.parentInstance.style.height.toExpr(t,null):null,r=fh(t,e.top,i),o=fh(t,e["margin-top"],n),a=vh(t,e["border-top-width"],e["border-top-style"],n),s=ph(t,e["padding-top"],n),u=fh(t,e.height,i),l=fh(t,e["max-height"],i),h=ph(t,e["padding-bottom"],n),c=vh(t,e["border-bottom-width"],e["border-bottom-style"],n),d=fh(t,e["margin-bottom"],n),f=fh(t,e.bottom,i),p=Te(t,a,s),g=Te(t,c,h);if(r&&f&&u){var v=xe(t,i,Te(t,u,Te(t,Te(t,r,p),g)));o?d?f=xe(t,v,o):d=xe(t,v,Te(t,f,o)):(v=xe(t,v,f),d?o=xe(t,v,d):d=o=Ie(t,v,new ye(t,.5)))}else{o||(o=t.zero),d||(d=t.zero),r||f||u||(r=t.zero),r||u?r||f?u||f||(u=this.autoHeight,this.isAutoHeight=!0):r=t.zero:(u=this.autoHeight,this.isAutoHeight=!0);var m=xe(t,i,Te(t,Te(t,o,p),Te(t,d,g)));this.isAutoHeight&&(l||(l=xe(t,m,r||f)),this.vertical&&(fh(t,e["column-width"],null)||fh(t,e["column-count"],null))&&(u=l,this.isAutoHeight=!1)),r?u?f||(f=xe(t,m,Te(t,r,u))):u=xe(t,m,Te(t,f,r)):r=xe(t,m,Te(t,f,u))}var E=ph(t,e["snap-height"]||(this.parentInstance?this.parentInstance.style["snap-height"]:null),n);e.top=new Ze(r),e["margin-top"]=new Ze(o),e["border-top-width"]=new Ze(a),e["padding-top"]=new Ze(s),e.height=new Ze(u),e["max-height"]=new Ze(l||u),e["padding-bottom"]=new Ze(h),e["border-bottom-width"]=new Ze(c),e["margin-bottom"]=new Ze(d),e.bottom=new Ze(f),e["snap-height"]=new Ze(E)},e.initColumns=function(){var t=this.pageBox.scope,e=this.style,n=fh(t,e[this.vertical?"height":"width"],null),i=fh(t,e["column-width"],n),r=fh(t,e["column-count"],null),o=function(t,e,n){return e&&e!==en.normal?e.toExpr(t,null):null}(t,e["column-gap"]);o||(o=new ve(t,1,"em")),i&&!r&&(r=new De(t,"floor",[Fe(t,Te(t,n,o),Te(t,i,o))]),r=new De(t,"max",[t.one,r])),r||(r=t.one),i=xe(t,Fe(t,Te(t,n,o),r),o),e["column-width"]=new Ze(i),e["column-count"]=new Ze(r),e["column-gap"]=new Ze(o)},e.depends=function(t,e,n){return this.style[t].toExpr(this.pageBox.scope,null).depend(e,n)},e.init=function(t){var e=this;t.registerInstance(this.pageBox.key,this);var n=this.pageBox.scope,i=this.style,r=this.parentInstance?this.parentInstance.getActiveRegions(t):null,o=os(this.cascaded,t,r,!1);this.vertical=is(o,t,!!this.parentInstance&&this.parentInstance.vertical),this.rtl=rs(o,t,!!this.parentInstance&&this.parentInstance.rtl),us(o,i,this.vertical,this.rtl,(function(t,e){return e.value})),this.autoWidth=new Ce(n,(function(){return e.calculatedWidth}),"autoWidth"),this.autoHeight=new Ce(n,(function(){return e.calculatedHeight}),"autoHeight"),this.initHorizontal(),this.initVertical(),this.initColumns(),this.initEnabled()},e.getProp=function(t,e){var n=this.style[e];return n&&(n=Rr(t,n,e)),n},e.getPropAsNumber=function(t,e){var n=this.style[e];return n&&(n=Rr(t,n,e)),Je(n,t)},e.getSpecial=function(t,e){var n=Xo(this.cascaded,e);if(n){for(var i=[],r=0;r<n.length;r++){var o=n[r].evaluate(t,"");o&&o!==ke&&i.push(o)}if(i.length)return i}return null},e.getActiveRegions=function(t){var e=this.getSpecial(t,"region-id");if(e){for(var n=[],i=0;i<e.length;i++)n[i]=e[i].toString();return n}return null},e.propagateProperty=function(t,e,n,i){this.propagatePropertyToElement(t,e.element,n,i)},e.propagatePropertyToElement=function(t,e,n,i){var r=this.getProp(t,n);r&&(r.isNumeric()&&zt(r.unit)&&(r=tn(r,t)),"font-family"===n&&(r=i.filterFontFamily(r)),tt(e,n,r.toString()))},e.propagateDelayedProperty=function(t,e,n,i){var r=this.getProp(t,n);r&&i.push(new Yr(e.element,n,r))},e.assignLeftPosition=function(t,e){var n=this.getPropAsNumber(t,"left"),i=this.getPropAsNumber(t,"margin-left"),r=this.getPropAsNumber(t,"padding-left"),o=this.getPropAsNumber(t,"border-left-width"),a=this.getPropAsNumber(t,"width");e.setHorizontalPosition(n,a),tt(e.element,"margin-left",i+"px"),tt(e.element,"padding-left",r+"px"),tt(e.element,"border-left-width",o+"px"),e.marginLeft=i,e.borderLeft=o,e.paddingLeft=r},e.assignRightPosition=function(t,e){var n=this.getPropAsNumber(t,"right"),i=this.getPropAsNumber(t,"snap-height"),r=this.getPropAsNumber(t,"margin-right"),o=this.getPropAsNumber(t,"padding-right"),a=this.getPropAsNumber(t,"border-right-width");if(tt(e.element,"margin-right",r+"px"),tt(e.element,"padding-right",o+"px"),tt(e.element,"border-right-width",a+"px"),e.marginRight=r,e.borderRight=a,this.vertical&&i>0){var s=n+e.getInsetRight(),u=s-Math.floor(s/i)*i;u>0&&(e.snapOffsetX=i-u,o+=e.snapOffsetX)}e.paddingRight=o,e.snapWidth=i},e.assignTopPosition=function(t,e){var n=this.getPropAsNumber(t,"snap-height"),i=this.getPropAsNumber(t,"top"),r=this.getPropAsNumber(t,"margin-top"),o=this.getPropAsNumber(t,"padding-top"),a=this.getPropAsNumber(t,"border-top-width");if(e.top=i,e.marginTop=r,e.borderTop=a,e.snapHeight=n,!this.vertical&&n>0){var s=i+e.getInsetTop(),u=s-Math.floor(s/n)*n;u>0&&(e.snapOffsetY=n-u,o+=e.snapOffsetY)}e.paddingTop=o,tt(e.element,"top",i+"px"),tt(e.element,"margin-top",r+"px"),tt(e.element,"padding-top",o+"px"),tt(e.element,"border-top-width",a+"px")},e.assignBottomPosition=function(t,e){var n=this.getPropAsNumber(t,"margin-bottom"),i=this.getPropAsNumber(t,"padding-bottom"),r=this.getPropAsNumber(t,"border-bottom-width"),o=this.getPropAsNumber(t,"height")-e.snapOffsetY;tt(e.element,"height",o+"px"),tt(e.element,"margin-bottom",n+"px"),tt(e.element,"padding-bottom",i+"px"),tt(e.element,"border-bottom-width",r+"px"),e.height=o-e.snapOffsetY,e.marginBottom=n,e.borderBottom=r,e.paddingBottom=i},e.assignBeforePosition=function(t,e){this.vertical?this.assignRightPosition(t,e):this.assignTopPosition(t,e)},e.assignAfterPosition=function(t,e){this.vertical?this.assignLeftPosition(t,e):this.assignBottomPosition(t,e)},e.assignStartEndPosition=function(t,e){this.vertical?(this.assignTopPosition(t,e),this.assignBottomPosition(t,e)):(this.assignRightPosition(t,e),this.assignLeftPosition(t,e))},e.sizeWithMaxHeight=function(t,e){tt(e.element,"border-top-width","0px");var n=this.getPropAsNumber(t,"max-height");this.isTopDependentOnAutoHeight?e.setVerticalPosition(0,n):(this.assignTopPosition(t,e),e.height=n-=e.snapOffsetY,tt(e.element,"height",n+"px"))},e.sizeWithMaxWidth=function(t,e){tt(e.element,"border-left-width","0px");var n=this.getPropAsNumber(t,"max-width");if(this.isRightDependentOnAutoWidth)e.setHorizontalPosition(0,n);else{this.assignRightPosition(t,e),e.width=n-=e.snapOffsetX;var i=this.getPropAsNumber(t,"right");tt(e.element,"right",i+"px"),tt(e.element,"width",n+"px")}},e.prepareContainer=function(t,e,n,i,r){this.parentInstance&&this.vertical==this.parentInstance.vertical||tt(e.element,"writing-mode",this.vertical?"vertical-rl":"horizontal-tb"),(this.vertical?this.isAutoWidth:this.isAutoHeight)?this.vertical?this.sizeWithMaxWidth(t,e):this.sizeWithMaxHeight(t,e):(this.assignBeforePosition(t,e),this.assignAfterPosition(t,e)),(this.vertical?this.isAutoHeight:this.isAutoWidth)?this.vertical?this.sizeWithMaxHeight(t,e):this.sizeWithMaxWidth(t,e):this.assignStartEndPosition(t,e);for(var o=0;o<Ch.length;o++)this.propagateProperty(t,e,Ch[o],i)},e.transferContentProps=function(t,e,n,i){for(var r=0;r<wh.length;r++)this.propagateProperty(t,e,wh[r],i)},e.transferSinglUriContentProps=function(t,e,n){for(var i=0;i<yh.length;i++)this.propagatePropertyToElement(t,e,yh[i],n)},e.finishContainer=function(t,e,n,i,r,o,a){this.vertical?this.calculatedWidth=e.computedBlockSize+e.snapOffsetX:this.calculatedHeight=e.computedBlockSize+e.snapOffsetY;var s=(this.vertical||!i)&&this.isAutoHeight,u=(!this.vertical||!i)&&this.isAutoWidth,l=null;if((u||s)&&(u&&tt(e.element,"width","auto"),s&&tt(e.element,"height","auto"),l=o.getElementClientRect(i?i.element:e.element),u&&(this.calculatedWidth=Math.ceil(l.right-l.left-e.paddingLeft-e.borderLeft-e.paddingRight-e.borderRight),this.vertical&&(this.calculatedWidth+=e.snapOffsetX)),s&&(this.calculatedHeight=l.bottom-l.top-e.paddingTop-e.borderTop-e.paddingBottom-e.borderBottom,this.vertical||(this.calculatedHeight+=e.snapOffsetY))),(this.vertical?this.isAutoHeight:this.isAutoWidth)&&this.assignStartEndPosition(t,e),(this.vertical?this.isAutoWidth:this.isAutoHeight)&&((this.vertical?this.isRightDependentOnAutoWidth:this.isTopDependentOnAutoHeight)&&this.assignBeforePosition(t,e),this.assignAfterPosition(t,e)),r>1){var h=this.getPropAsNumber(t,"column-rule-width"),c=this.getProp(t,"column-rule-style"),d=this.getProp(t,"column-rule-color");if(h>0&&c&&c!=en.none&&d!=en.transparent)for(var f=this.getPropAsNumber(t,"column-gap"),p=this.vertical?e.height:e.width,g=this.vertical?"border-top":"border-left",v=1;v<r;v++){var m=(p+f)*v/r-f/2+e.paddingLeft-h/2,E=e.height+e.paddingTop+e.paddingBottom,C=e.element.ownerDocument.createElement("div");tt(C,"position","absolute"),tt(C,this.vertical?"left":"top","0px"),tt(C,this.vertical?"top":"left",m+"px"),tt(C,this.vertical?"height":"width","0px"),tt(C,this.vertical?"width":"height",E+"px"),tt(C,g,h+"px "+c.toString()+(d?" "+d.toString():"")),e.element.insertBefore(C,e.element.firstChild)}}for(var D=0;D<Dh.length;D++)this.propagateProperty(t,e,Dh[D],a);for(var w=0;w<Nh.length;w++)this.propagateDelayedProperty(t,e,Nh[w],n.delayedItems)},e.applyCascadeAndInit=function(t,e){var n=this.cascaded,i=this.pageBox.specified;for(var r in i)_o(r)&&Vo(n,r,Uo(i,r));if(this.pageBox.pseudoName==bh)for(var o in e)(o.match(/^background-/)||"writing-mode"==o)&&(n[o]=e[o]);if("layout-host"==this.pageBox.pseudoName)for(var a in e)a.match(/^background-/)||"writing-mode"==a||(n[a]=e[a]);t.pushRule(this.pageBox.classes,null,n),n.content&&(n.content=n.content.filterValue(new Ba(t,null,t.counterResolver))),this.init(t.context);for(var s,u=B(this.pageBox.children);!(s=u()).done;)s.value.createInstance(this).applyCascadeAndInit(t,e);t.popRule()},e.resolveAutoSizing=function(t){this.isAutoWidth&&(this.isRightDependentOnAutoWidth=this.depends("right",this.autoWidth,t)||this.depends("margin-right",this.autoWidth,t)||this.depends("border-right-width",this.autoWidth,t)||this.depends("padding-right",this.autoWidth,t)),this.isAutoHeight&&(this.isTopDependentOnAutoHeight=this.depends("top",this.autoHeight,t)||this.depends("margin-top",this.autoHeight,t)||this.depends("border-top-width",this.autoHeight,t)||this.depends("padding-top",this.autoHeight,t));for(var e,n=B(this.children);!(e=n()).done;)e.value.resolveAutoSizing(t)},t}(),Ch=["border-left-style","border-right-style","border-top-style","border-bottom-style","border-left-color","border-right-color","border-top-color","border-bottom-color","outline-style","outline-color","outline-width","overflow","visibility"],Dh=["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat","background-attachment","background-color","background-image","background-repeat","background-position","background-clip","background-origin","background-size","opacity","z-index","background-blend-mode","isolation","mix-blend-mode","filter"],wh=["color","font-family","font-size","font-style","font-weight","line-height","letter-spacing","text-align","text-decoration","text-indent","text-transform","white-space","word-spacing","font-feature-settings","font-kerning","font-size-adjust","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-stretch","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-shadow","text-underline-position"],yh=["width","height","image-resolution","object-fit","object-position"],Nh=["transform","transform-origin"],bh="background-host",Sh=function(t){function e(e){return t.call(this,null,e)||this}return x(e,t),e.prototype.applyCascadeAndInit=function(e,n){t.prototype.applyCascadeAndInit.call(this,e,n),this.children.sort((function(t,e){return e.pageBox.specificity-t.pageBox.specificity||t.pageBox.index-e.pageBox.index}))},e}(Eh),Ah=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).pageMasterInstance=O(i),i}x(e,t);var n=e.prototype;return n.boxSpecificEnabled=function(t){var e=this.pageBox.pageMaster;return e.condition&&(t=Ae(e.scope,t,e.condition)),t},n.adjustPageLayout=function(t,e,n){},e}(Eh),Th=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).pageMasterInstance=e.pageMasterInstance,i}return x(e,t),e}(Eh),xh=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).pageMasterInstance=e.pageMasterInstance,i}x(e,t);var n=e.prototype;return n.processPartitionList=function(t,e,n){var i=null;if(e instanceof Ve&&(i=[e]),e instanceof Qe&&(i=e.values),i)for(var r=this.pageBox.scope,o=0;o<i.length;o++)if(i[o]instanceof Ve){var a=_t(i[o].name,"enabled"),s=new me(r,a);n&&(s=new $t(r,s)),t=Ae(r,t,s)}return t},n.boxSpecificEnabled=function(t){var e=this.pageBox.scope,n=this.style,i=mh(e,n.required,e._false)!==e._false;if(i||this.isAutoHeight){var r=function(t,e,n){return e?e.toExpr(t,t.zero):new ye(t,"body")}(e,n["flow-from"]);t=Ae(e,t,new De(e,"has-content",[r]))}if(t=this.processPartitionList(t,n["required-partitions"],!1),t=this.processPartitionList(t,n["conflicting-partitions"],!0),i){var o=this.pageMasterInstance.style.enabled,a=o?o.toExpr(e,null):e._true;a=Ae(e,a,t),this.pageMasterInstance.style.enabled=new Ze(a)}return t},n.prepareContainer=function(e,n,i,r,o){tt(n.element,"overflow","hidden"),t.prototype.prepareContainer.call(this,e,n,i,r,o)},e}(Eh),Ih=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,n,!1)||this).target=void 0,o.validatorSet=void 0,o.target=i,o.validatorSet=r,o}x(e,t);var n=e.prototype;return n.property=function(t,e,n){this.validatorSet.validatePropertyAndHandleShorthand(t,e,n,this)},n.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},n.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},n.simpleProperty=function(t,e,n){this.target.specified[t]=new Lo(e,n?50331648:67108864)},e}(ur),Fh=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return x(e,t),e}(Ih),Ph=function(t){function e(e,n,i,r){var o;return o=t.call(this,e,n,i,r)||this,i.specified.width=new Lo(nn,0),i.specified.height=new Lo(nn,0),o}x(e,t);var n=e.prototype;return n.startPartitionRule=function(t,e,n){var i=new dh(this.scope,t,e,n,this.target),r=new Fh(this.scope,this.owner,i,this.validatorSet);this.owner.pushHandler(r)},n.startPartitionGroupRule=function(t,n,i){var r=new ch(this.scope,t,n,i,this.target),o=new e(this.scope,this.owner,r,this.validatorSet);this.owner.pushHandler(o)},e}(Ih),Rh=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}x(e,t);var n=e.prototype;return n.startPartitionRule=function(t,e,n){var i=new dh(this.scope,t,e,n,this.target),r=new Fh(this.scope,this.owner,i,this.validatorSet);this.owner.pushHandler(r)},n.startPartitionGroupRule=function(t,e,n){var i=new ch(this.scope,t,e,n,this.target),r=new Ph(this.scope,this.owner,i,this.validatorSet);this.owner.pushHandler(r)},e}(Ih);function Lh(t){var n=t["writing-mode"],i=t.direction;return i=i&&i.value,(n=n&&n.value)===en.vertical_lr||n!==en.vertical_rl&&i!==en.rtl?e.PageProgression.LTR:e.PageProgression.RTL}var Oh,kh,Bh={a10:{width:new ze(26,"mm"),height:new ze(37,"mm")},a9:{width:new ze(37,"mm"),height:new ze(52,"mm")},a8:{width:new ze(52,"mm"),height:new ze(74,"mm")},a7:{width:new ze(74,"mm"),height:new ze(105,"mm")},a6:{width:new ze(105,"mm"),height:new ze(148,"mm")},a5:{width:new ze(148,"mm"),height:new ze(210,"mm")},a4:{width:new ze(210,"mm"),height:new ze(297,"mm")},a3:{width:new ze(297,"mm"),height:new ze(420,"mm")},a2:{width:new ze(420,"mm"),height:new ze(594,"mm")},a1:{width:new ze(594,"mm"),height:new ze(841,"mm")},a0:{width:new ze(841,"mm"),height:new ze(1189,"mm")},b10:{width:new ze(31,"mm"),height:new ze(44,"mm")},b9:{width:new ze(44,"mm"),height:new ze(62,"mm")},b8:{width:new ze(62,"mm"),height:new ze(88,"mm")},b7:{width:new ze(88,"mm"),height:new ze(125,"mm")},b6:{width:new ze(125,"mm"),height:new ze(176,"mm")},b5:{width:new ze(176,"mm"),height:new ze(250,"mm")},b4:{width:new ze(250,"mm"),height:new ze(353,"mm")},b3:{width:new ze(353,"mm"),height:new ze(500,"mm")},b2:{width:new ze(500,"mm"),height:new ze(707,"mm")},b1:{width:new ze(707,"mm"),height:new ze(1e3,"mm")},b0:{width:new ze(1e3,"mm"),height:new ze(1414,"mm")},c10:{width:new ze(28,"mm"),height:new ze(40,"mm")},c9:{width:new ze(40,"mm"),height:new ze(57,"mm")},c8:{width:new ze(57,"mm"),height:new ze(81,"mm")},c7:{width:new ze(81,"mm"),height:new ze(114,"mm")},c6:{width:new ze(114,"mm"),height:new ze(162,"mm")},c5:{width:new ze(162,"mm"),height:new ze(229,"mm")},c4:{width:new ze(229,"mm"),height:new ze(324,"mm")},c3:{width:new ze(324,"mm"),height:new ze(458,"mm")},c2:{width:new ze(458,"mm"),height:new ze(648,"mm")},c1:{width:new ze(648,"mm"),height:new ze(917,"mm")},c0:{width:new ze(917,"mm"),height:new ze(1297,"mm")},"jis-b10":{width:new ze(32,"mm"),height:new ze(45,"mm")},"jis-b9":{width:new ze(45,"mm"),height:new ze(64,"mm")},"jis-b8":{width:new ze(64,"mm"),height:new ze(91,"mm")},"jis-b7":{width:new ze(91,"mm"),height:new ze(128,"mm")},"jis-b6":{width:new ze(128,"mm"),height:new ze(182,"mm")},"jis-b5":{width:new ze(182,"mm"),height:new ze(257,"mm")},"jis-b4":{width:new ze(257,"mm"),height:new ze(364,"mm")},"jis-b3":{width:new ze(364,"mm"),height:new ze(515,"mm")},"jis-b2":{width:new ze(515,"mm"),height:new ze(728,"mm")},"jis-b1":{width:new ze(728,"mm"),height:new ze(1030,"mm")},"jis-b0":{width:new ze(1030,"mm"),height:new ze(1456,"mm")},letter:{width:new ze(8.5,"in"),height:new ze(11,"in")},legal:{width:new ze(8.5,"in"),height:new ze(14,"in")},ledger:{width:new ze(11,"in"),height:new ze(17,"in")}},_h=new ze(.24,"pt"),Mh=new ze(3,"mm"),Uh=new ze(10,"mm"),Vh=new ze(13,"mm");function Hh(t){var e={width:rn,height:on,bleed:an,bleedOffset:an},n=t.size;if(n&&n.value!==en.auto){var i,r,o=n.value;if(o.isSpaceList()?(i=o.values[0],r=o.values[1]):(i=o,r=null),i.isNumeric())e.width=i,e.height=r||i;else{var a=i.name&&Bh[i.name.toLowerCase()];a&&(r&&r===en.landscape?(e.width=a.height,e.height=a.width):(e.width=a.width,e.height=a.height))}}var s=t.marks;s&&s.value!==en.none&&(e.bleedOffset=Vh);var u=t.bleed;return u&&u.value!==en.auto?u.value&&u.value.isNumeric()&&(e.bleed=u.value):s&&(s.value.isSpaceList()?s.value.values.some((function(t){return t===en.crop})):s.value===en.crop)&&(e.bleed=new ze(6,"pt")),e}function zh(t,e){var n={},i=t.bleed.num*e.queryUnitSize(t.bleed.unit,!1),r=t.bleedOffset.num*e.queryUnitSize(t.bleedOffset.unit,!1),o=i+r,a=t.width;n.pageWidth=a===rn?e.pref.defaultPaperSize?e.pref.defaultPaperSize.width*e.queryUnitSize("px",!1):(e.pref.spreadView?Math.floor(e.viewportWidth/2)-e.pref.pageBorder:e.viewportWidth)-2*o:a.num*e.queryUnitSize(a.unit,!1);var s=t.height;return n.pageHeight=s===on?e.pref.defaultPaperSize?e.pref.defaultPaperSize.height*e.queryUnitSize("px",!1):e.viewportHeight-2*o:s.num*e.queryUnitSize(s.unit,!1),n.bleed=i,n.bleedOffset=r,n.cropOffset=o,n}function Gh(t,e,n){var i=t.createElementNS(G.SVG,"svg");return i.setAttribute("width",e),i.setAttribute("height",n),i.style.position="absolute",i}function Xh(t,e,n){var i=t.createElementNS(G.SVG,n=n||"polyline");return i.setAttribute("stroke","black"),i.setAttribute("stroke-width",e),i.setAttribute("fill","none"),i}!function(t){t.TOP_LEFT="top left",t.TOP_RIGHT="top right",t.BOTTOM_LEFT="bottom left",t.BOTTOM_RIGHT="bottom right"}(Oh||(Oh={})),function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(kh||(kh={}));var Wh,jh,Kh=(Wh={width:!0,height:!0,"block-size":!0,"inline-size":!0,margin:!0,padding:!0,border:!0,outline:!0,"outline-width":!0,"outline-style":!0,"outline-color":!0},["left","right","top","bottom","before","after","start","end","block-start","block-end","inline-start","inline-end"].forEach((function(t){Wh["margin-"+t]=!0,Wh["padding-"+t]=!0,Wh["border-"+t+"-width"]=!0,Wh["border-"+t+"-style"]=!0,Wh["border-"+t+"-color"]=!0})),Wh);!function(t){t.START="start",t.CENTER="center",t.END="end"}(jh||(jh={}));var Yh,qh={"top-left-corner":{order:1,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!0,isInRightColumn:!0,positionAlongVariableDimension:null},"top-left":{order:2,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:jh.START},"top-center":{order:3,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:jh.CENTER},"top-right":{order:4,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:jh.END},"top-right-corner":{order:5,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:null},"right-top":{order:6,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:jh.START},"right-middle":{order:7,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:jh.CENTER},"right-bottom":{order:8,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:jh.END},"bottom-right-corner":{order:9,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:null},"bottom-right":{order:10,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:jh.END},"bottom-center":{order:11,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:jh.CENTER},"bottom-left":{order:12,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:jh.START},"bottom-left-corner":{order:13,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!0,isInRightColumn:!1,positionAlongVariableDimension:null},"left-bottom":{order:14,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!0,isInRightColumn:!1,positionAlongVariableDimension:jh.END},"left-middle":{order:15,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!0,isInRightColumn:!1,positionAlongVariableDimension:jh.CENTER},"left-top":{order:16,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!0,isInRightColumn:!1,positionAlongVariableDimension:jh.START}},Qh=(Yh=qh,Object.keys(Yh).sort((function(t,e){return Yh[t].order-Yh[e].order}))),$h=function(t){function e(e,n,i){var r;(r=t.call(this,e,null,"vivliostyle-page-rule-master",[],n,null,0)||this).bodyPartitionKey=void 0,r.pageMarginBoxes={};var o=Hh(i),a=new Zh(r.scope,O(r),i,o);return r.bodyPartitionKey=a.key,r.createPageMarginBoxes(i),r.applySpecified(i,o),r}x(e,t);var n=e.prototype;return n.createPageMarginBoxes=function(t){var e=this,n=t._marginBoxes;n&&Qh.forEach((function(i){n[i]&&(e.pageMarginBoxes[i]=new Jh(e.scope,e,i,t))}))},n.applySpecified=function(t,e){for(var n in this.specified.position=new Lo(en.relative,0),this.specified.width=new Lo(e.width,0),this.specified.height=new Lo(e.height,0),t)Kh[n]||"background-clip"===n||(this.specified[n]=t[n])},n.createInstance=function(t){return new tc(t,this)},e}(hh),Zh=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,null,null,[],n)||this).pageSize=void 0,o.pageSize=r,o.specified["z-index"]=new Lo(new Xe(0),0),o.applySpecified(i),o}x(e,t);var n=e.prototype;return n.applySpecified=function(t){for(var e in this.specified["flow-from"]=new Lo(He("body"),0),this.specified.position=new Lo(en.absolute,0),this.specified.overflow=new Lo(en.visible,0),Kh)Kh.hasOwnProperty(e)&&(this.specified[e]=t[e])},n.createInstance=function(t){return new rc(t,this)},e}(dh),Jh=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,null,null,[],n)||this).marginBoxName=void 0,o.marginBoxName=i,o.applySpecified(r),o}x(e,t);var n=e.prototype;return n.applySpecified=function(t){var e=t._marginBoxes[this.marginBoxName];for(var n in t){var i=e[n];(yo[n]||i&&i.value===en.inherit)&&(this.specified[n]=t[n])}for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=e[r];o&&o.value!==en.inherit&&(this.specified[r]=o)}},n.createInstance=function(t){return new oc(t,this)},e}(dh),tc=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).pageAreaDimension=null,i.pageMarginBoxInstances={},i}x(e,t);var n=e.prototype;return n.applyCascadeAndInit=function(e,n){var i=this.cascaded;for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r))switch(r){case"writing-mode":case"direction":i[r]=n[r]}t.prototype.applyCascadeAndInit.call(this,e,n)},n.initHorizontal=function(){var t=this.style;t.left=an,t["margin-left"]=an,t["border-left-width"]=an,t["padding-left"]=an,t["padding-right"]=an,t["border-right-width"]=an,t["margin-right"]=an,t.right=an},n.initVertical=function(){var t=this.style;t.top=an,t["margin-top"]=an,t["border-top-width"]=an,t["padding-top"]=an,t["padding-bottom"]=an,t["border-bottom-width"]=an,t["margin-bottom"]=an,t.bottom=an},n.setPageAreaDimension=function(t){this.pageAreaDimension=t;var e=this.style;e.width=new Ze(t.borderBoxWidth),e.height=new Ze(t.borderBoxHeight),e["padding-left"]=new Ze(t.marginLeft),e["padding-right"]=new Ze(t.marginRight),e["padding-top"]=new Ze(t.marginTop),e["padding-bottom"]=new Ze(t.marginBottom)},n.adjustPageLayout=function(t,e,n){var i=e.marginBoxes,r={start:this.pageAreaDimension.marginLeft,end:this.pageAreaDimension.marginRight,extent:this.pageAreaDimension.borderBoxWidth},o={start:this.pageAreaDimension.marginTop,end:this.pageAreaDimension.marginBottom,extent:this.pageAreaDimension.borderBoxHeight};this.sizeMarginBoxesAlongVariableDimension(i.top,!0,r,t,n),this.sizeMarginBoxesAlongVariableDimension(i.bottom,!0,r,t,n),this.sizeMarginBoxesAlongVariableDimension(i.left,!1,o,t,n),this.sizeMarginBoxesAlongVariableDimension(i.right,!1,o,t,n)},n.sizeMarginBoxesAlongVariableDimension=function(t,e,n,i,r){var o=jh.START,a=jh.CENTER,s=jh.END,u=this.pageBox.scope,l={},h={},c={};for(var d in t){var f=qh[d];if(f){var p=t[d],g=this.pageMarginBoxInstances[d],v=new ec(p,g.style,e,u,r);l[f.positionAlongVariableDimension]=p,h[f.positionAlongVariableDimension]=g,c[f.positionAlongVariableDimension]=v}}var m={start:n.start.evaluate(i),end:n.end.evaluate(i),extent:n.extent.evaluate(i)},E=this.getSizesOfMarginBoxesAlongVariableDimension(c,m.extent),C=!1,D={};Object.keys(l).forEach((function(t){var o=t,a=fh(u,h[o].style[e?"max-width":"max-height"],n.extent);if(a){var s=a.evaluate(i);if(E[o]>s){var d=c[o]=new ic(l[o],h[o].style,e,u,r,s);D[o]=d.getOuterSize(),C=!0}}})),C&&(E=this.getSizesOfMarginBoxesAlongVariableDimension(c,m.extent),C=!1,[o,a,s].forEach((function(t){E[t]=D[t]||E[t]})));var w={};Object.keys(l).forEach((function(t){var o=t,a=fh(u,h[o].style[e?"min-width":"min-height"],n.extent);if(a){var s=a.evaluate(i);if(E[o]<s){var d=c[o]=new ic(l[o],h[o].style,e,u,r,s);w[o]=d.getOuterSize(),C=!0}}})),C&&(E=this.getSizesOfMarginBoxesAlongVariableDimension(c,m.extent),[o,a,s].forEach((function(t){E[t]=w[t]||E[t]})));var y=m.start+m.extent,N=m.start+(m.start+m.extent);[o,a,s].forEach((function(t){var n=E[t];if(n){var i=l[t],r=0;switch(t){case o:r=e?i.left:i.top;break;case a:r=(N-n)/2;break;case s:r=y-n}e?i.setHorizontalPosition(r,n-i.getInsetLeft()-i.getInsetRight()):i.setVerticalPosition(r,n-i.getInsetTop()-i.getInsetBottom())}}))},n.getSizesOfMarginBoxesAlongVariableDimension=function(t,e){var n=t[jh.START],i=t[jh.CENTER],r=t[jh.END],o={};if(i){var a=[n,r].filter((function(t){return t})),s=a.length?new nc(a):null,u=this.distributeAutoMarginBoxSizes(i,s,e);u.xSize&&(o[jh.CENTER]=u.xSize);var l=(e-(u.xSize||i.getOuterSize()))/2;n&&n.hasAutoSize()&&(o[jh.START]=l),r&&r.hasAutoSize()&&(o[jh.END]=l)}else{var h=this.distributeAutoMarginBoxSizes(n,r,e);h.xSize&&(o[jh.START]=h.xSize),h.ySize&&(o[jh.END]=h.ySize)}return o},n.distributeAutoMarginBoxSizes=function(t,e,n){var i={xSize:null,ySize:null};if(t&&e)if(t.hasAutoSize()&&e.hasAutoSize()){var r=t.getOuterMaxContentSize(),o=e.getOuterMaxContentSize();if(r>0&&o>0){var a=r+o;if(a<n)i.xSize=n*r/a;else{var s=t.getOuterMinContentSize(),u=s+e.getOuterMinContentSize();u<n?i.xSize=s+(n-u)*(r-s)/(a-u):u>0&&(i.xSize=n*s/u)}i.xSize>0&&(i.ySize=n-i.xSize)}else r>0?i.xSize=n:o>0&&(i.ySize=n)}else t.hasAutoSize()?i.xSize=Math.max(n-e.getOuterSize(),0):e.hasAutoSize()&&(i.ySize=Math.max(n-t.getOuterSize(),0));else t?t.hasAutoSize()&&(i.xSize=n):e&&e.hasAutoSize()&&(i.ySize=n);return i},n.prepareContainer=function(e,n,i,r,o){t.prototype.prepareContainer.call(this,e,n,i,r,o),n.element.setAttribute("data-vivliostyle-page-box",!0)},e}(Ah),ec=function(){function t(t,e,n,i,r){this.container=void 0,this.isHorizontal=void 0,this.clientLayout=void 0,this.hasAutoSize_=void 0,this.size=null,this.container=t,this.isHorizontal=n,this.clientLayout=r,this.hasAutoSize_=!fh(i,e[n?"width":"height"],new ve(i,0,"px"))}var e=t.prototype;return e.hasAutoSize=function(){return this.hasAutoSize_},e.getSize=function(){return this.size||(this.size=Es(this.clientLayout,this.container.element,this.isHorizontal?[vs.MAX_CONTENT_WIDTH,vs.MIN_CONTENT_WIDTH]:[vs.MAX_CONTENT_HEIGHT,vs.MIN_CONTENT_HEIGHT])),this.size},e.getOuterMaxContentSize=function(){var t=this.getSize();return this.isHorizontal?this.container.getInsetLeft()+t[vs.MAX_CONTENT_WIDTH]+this.container.getInsetRight():this.container.getInsetTop()+t[vs.MAX_CONTENT_HEIGHT]+this.container.getInsetBottom()},e.getOuterMinContentSize=function(){var t=this.getSize();return this.isHorizontal?this.container.getInsetLeft()+t[vs.MIN_CONTENT_WIDTH]+this.container.getInsetRight():this.container.getInsetTop()+t[vs.MIN_CONTENT_HEIGHT]+this.container.getInsetBottom()},e.getOuterSize=function(){return this.isHorizontal?this.container.getInsetLeft()+this.container.width+this.container.getInsetRight():this.container.getInsetTop()+this.container.height+this.container.getInsetBottom()},t}(),nc=function(){function t(t){this.params=void 0,this.params=t}var e=t.prototype;return e.hasAutoSize=function(){return this.params.some((function(t){return t.hasAutoSize()}))},e.getOuterMaxContentSize=function(){var t=this.params.map((function(t){return t.getOuterMaxContentSize()}));return Math.max.apply(null,t)*t.length},e.getOuterMinContentSize=function(){var t=this.params.map((function(t){return t.getOuterMinContentSize()}));return Math.max.apply(null,t)*t.length},e.getOuterSize=function(){var t=this.params.map((function(t){return t.getOuterSize()}));return Math.max.apply(null,t)*t.length},t}(),ic=function(t){function e(e,n,i,r,o,a){var s;return(s=t.call(this,e,n,i,r,o)||this).fixedSize=void 0,s.fixedSize=a,s}x(e,t);var n=e.prototype;return n.hasAutoSize=function(){return!1},n.getOuterMaxContentSize=function(){return this.getOuterSize()},n.getOuterMinContentSize=function(){return this.getOuterSize()},n.getOuterSize=function(){return this.isHorizontal?this.container.getInsetLeft()+this.fixedSize+this.container.getInsetRight():this.container.getInsetTop()+this.fixedSize+this.container.getInsetBottom()},e}(ec),rc=function(t){function e(e,n){var i;return(i=t.call(this,e,n)||this).borderBoxWidth=null,i.borderBoxHeight=null,i.marginTop=null,i.marginRight=null,i.marginBottom=null,i.marginLeft=null,i}x(e,t);var n=e.prototype;return n.applyCascadeAndInit=function(e,n){var i=this.cascaded;for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(r.match(/^column.*$/)||r.match(/^background-/))&&(i[r]=n[r]);t.prototype.applyCascadeAndInit.call(this,e,n),this.parentInstance.setPageAreaDimension({borderBoxWidth:this.borderBoxWidth,borderBoxHeight:this.borderBoxHeight,marginTop:this.marginTop,marginRight:this.marginRight,marginBottom:this.marginBottom,marginLeft:this.marginLeft})},n.initHorizontal=function(){var t=this.resolvePageBoxDimensions({start:"left",end:"right",extent:"width"});this.borderBoxWidth=t.borderBoxExtent,this.marginLeft=t.marginStart,this.marginRight=t.marginEnd},n.initVertical=function(){var t=this.resolvePageBoxDimensions({start:"top",end:"bottom",extent:"height"});this.borderBoxHeight=t.borderBoxExtent,this.marginTop=t.marginStart,this.marginBottom=t.marginEnd},n.resolvePageBoxDimensions=function(t){var e=this.style,n=this.pageBox.scope,i=t.start,r=t.end,o=t.extent,a=this.pageBox.pageSize[o].toExpr(n,null),s=fh(n,e[o],a),u=fh(n,e["margin-"+i],a),l=fh(n,e["margin-"+r],a),h=ph(n,e["padding-"+i],a),c=ph(n,e["padding-"+r],a),d=vh(n,e["border-"+i+"-width"],e["border-"+i+"-style"],a),f=vh(n,e["border-"+r+"-width"],e["border-"+r+"-style"],a),p=xe(n,a,Te(n,Te(n,d,h),Te(n,f,c)));return s?(p=xe(n,p,s),u||l?u?l=xe(n,p,u):u=xe(n,p,l):l=u=Ie(n,p,new ye(n,.5))):(u||(u=n.zero),l||(l=n.zero),s=xe(n,p,Te(n,u,l))),e[i]=new Ze(u),e[r]=new Ze(l),e["margin-"+i]=an,e["margin-"+r]=an,e["padding-"+i]=new Ze(h),e["padding-"+r]=new Ze(c),e["border-"+i+"-width"]=new Ze(d),e["border-"+r+"-width"]=new Ze(f),e[o]=new Ze(s),e["max-"+o]=new Ze(s),{borderBoxExtent:xe(n,a,Te(n,u,l)),marginStart:u,marginEnd:l}},n.prepareContainer=function(e,n,i,r,o){t.prototype.prepareContainer.call(this,e,n,i,r,o),i.pageAreaElement=n.element,e.pageAreaWidth=parseFloat(i.pageAreaElement.style.width),e.pageAreaHeight=parseFloat(i.pageAreaElement.style.height)},e}(xh),oc=function(t){function e(e,n){var i;(i=t.call(this,e,n)||this).boxInfo=void 0,i.suppressEmptyBoxGeneration=!0;var r=n.marginBoxName;return i.boxInfo=qh[r],e.pageMarginBoxInstances[r]=O(i),i}x(e,t);var n=e.prototype;return n.prepareContainer=function(e,n,i,r,o){this.applyVerticalAlign(e,n.element),t.prototype.prepareContainer.call(this,e,n,i,r,o)},n.applyVerticalAlign=function(t,e){tt(e,"display","flex");var n=this.getProp(t,"vertical-align"),i=null;n===He("middle")?i="center":n===He("top")?i="flex-start":n===He("bottom")&&(i="flex-end"),i&&(tt(e,"flex-flow",this.vertical?"row":"column"),tt(e,"justify-content",i))},n.positionAlongVariableDimension=function(t,e){var n=this.style,i=this.pageBox.scope,r=t.start,o=t.end,a="left"===r,s=a?e.borderBoxWidth:e.borderBoxHeight,u=fh(i,n[t.extent],s),l=a?e.marginLeft:e.marginTop;if(this.boxInfo.positionAlongVariableDimension===jh.START)n[r]=new Ze(l);else if(u){var h=ph(i,n["margin-"+r],s),c=ph(i,n["margin-"+o],s),d=ph(i,n["padding-"+r],s),f=ph(i,n["padding-"+o],s),p=vh(i,n["border-"+r+"-width"],n["border-"+r+"-style"],s),g=vh(i,n["border-"+o+"-width"],n["border-"+o+"-style"],s),v=Te(i,u,Te(i,Te(i,d,f),Te(i,Te(i,p,g),Te(i,h,c))));switch(this.boxInfo.positionAlongVariableDimension){case jh.CENTER:n[r]=new Ze(Te(i,l,Fe(i,xe(i,s,v),new ye(i,2))));break;case jh.END:n[r]=new Ze(xe(i,Te(i,l,s),v))}}},n.positionAndSizeAlongFixedDimension=function(t,e){var n=this.style,i=this.pageBox.scope,r=t.inside,o=t.outside,a=t.extent,s=e["margin"+o.charAt(0).toUpperCase()+o.substring(1)],u=gh(i,n["margin-"+r],s),l=gh(i,n["margin-"+o],s),h=ph(i,n["padding-"+r],s),c=ph(i,n["padding-"+o],s),d=vh(i,n["border-"+r+"-width"],n["border-"+r+"-style"],s),f=vh(i,n["border-"+o+"-width"],n["border-"+o+"-style"],s),p=fh(i,n[a],s),g=null;function v(t){if(g)return g;g={extent:p?p.evaluate(t):null,marginInside:u?u.evaluate(t):null,marginOutside:l?l.evaluate(t):null};var e=s.evaluate(t),n=0;return[d,h,c,f].forEach((function(e){e&&(n+=e.evaluate(t))})),(null===g.marginInside||null===g.marginOutside)&&n+g.extent+g.marginInside+g.marginOutside>e&&(null===g.marginInside&&(g.marginInside=0),null===g.marginOutside&&(g.marginOutside=0)),null!==g.extent&&null!==g.marginInside&&null!==g.marginOutside&&(g.marginOutside=null),null===g.extent&&null!==g.marginInside&&null!==g.marginOutside?g.extent=e-n-g.marginInside-g.marginOutside:null!==g.extent&&null===g.marginInside&&null!==g.marginOutside?g.marginInside=e-n-g.extent-g.marginOutside:null!==g.extent&&null!==g.marginInside&&null===g.marginOutside?g.marginOutside=e-n-g.extent-g.marginInside:null===g.extent?(g.marginInside=g.marginOutside=0,g.extent=e-n):g.marginInside=g.marginOutside=(e-n-g.extent)/2,g}n[a]=new Ze(new Ce(i,(function(){var t=v(this).extent;return null===t?0:t}),a)),n["margin-"+r]=new Ze(new Ce(i,(function(){var t=v(this).marginInside;return null===t?0:t}),"margin-"+r)),n["margin-"+o]=new Ze(new Ce(i,(function(){var t=v(this).marginOutside;return null===t?0:t}),"margin-"+o)),"left"===r?n.left=new Ze(Te(i,e.marginLeft,e.borderBoxWidth)):"top"===r&&(n.top=new Ze(Te(i,e.marginTop,e.borderBoxHeight)))},n.initHorizontal=function(){var t=this.parentInstance.pageAreaDimension;this.boxInfo.isInLeftColumn?this.positionAndSizeAlongFixedDimension({inside:"right",outside:"left",extent:"width"},t):this.boxInfo.isInRightColumn?this.positionAndSizeAlongFixedDimension({inside:"left",outside:"right",extent:"width"},t):this.positionAlongVariableDimension({start:"left",end:"right",extent:"width"},t)},n.initVertical=function(){var t=this.parentInstance.pageAreaDimension;this.boxInfo.isInTopRow?this.positionAndSizeAlongFixedDimension({inside:"bottom",outside:"top",extent:"height"},t):this.boxInfo.isInBottomRow?this.positionAndSizeAlongFixedDimension({inside:"top",outside:"bottom",extent:"height"},t):this.positionAlongVariableDimension({start:"top",end:"bottom",extent:"height"},t)},n.finishContainer=function(e,n,i,r,o,a,s){t.prototype.finishContainer.call(this,e,n,i,r,o,a,s);var u=i.marginBoxes,l=this.pageBox.marginBoxName,h=this.boxInfo;h.isInLeftColumn||h.isInRightColumn?h.isInTopRow||h.isInBottomRow||(h.isInLeftColumn?u.left[l]=n:h.isInRightColumn&&(u.right[l]=n)):h.isInTopRow?u.top[l]=n:h.isInBottomRow&&(u.bottom[l]=n)},e}(xh),ac=function(){function t(t,e,n,i,r){this.cascadeInstance=void 0,this.pageScope=void 0,this.rootPageBoxInstance=void 0,this.context=void 0,this.docElementStyle=void 0,this.pageMasterCache={},this.cascadeInstance=t,this.pageScope=e,this.rootPageBoxInstance=n,this.context=i,this.docElementStyle=r,this.definePageProgression()}var n=t.prototype;return n.definePageProgression=function(){var t=this.pageScope,n=this.context,i=n.isVersoFirstPage,r=new me(t,"page-number"),o=new le(t,new ge(t,r,new ye(t,2)),i?t.one:t.zero);t.defineName("recto-page",new $t(t,o)),t.defineName("verso-page",o),(n.pageProgression||Lh(this.docElementStyle))===e.PageProgression.LTR?(t.defineName("left-page",o),t.defineName("right-page",new $t(t,o))):(t.defineName("left-page",new $t(t,o)),t.defineName("right-page",o))},n.getCascadedPageStyle=function(t){var e={};return this.cascadeInstance.pushRule([],t,e),this.cascadeInstance.popRule(),e},n.getPageRulePageMaster=function(t,e){var n=t.pageBox;if(0===Object.keys(e).length)return n.resetScope(),t;var i=this.makeCacheKey(e,n),r=this.pageMasterCache[i];return r||(r=n.pseudoName===bh?this.generatePageRuleMaster(e):this.generateCascadedPageMaster(e,n),this.pageMasterCache[i]=r),r.pageBox.resetScope(),r},n.makeCacheKey=function(t,e){var n=this.makeCascadeValueObjectKey(t);return e.key+"^"+n},n.makeCascadeValueObjectKey=function(t){var e=[];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var i,r=t[n];i=r instanceof Lo?""+r.value:this.makeCascadeValueObjectKey(r),e.push(n+i+(r.priority||""))}return e.sort().join("^")},n.generatePageRuleMaster=function(t){var e=new $h(this.pageScope,this.rootPageBoxInstance.pageBox,t).createInstance(this.rootPageBoxInstance);return e.applyCascadeAndInit(this.cascadeInstance,this.docElementStyle),e.resolveAutoSizing(this.context),e},n.generateCascadedPageMaster=function(t,e){var n=e.clone({pseudoName:"vivliostyle-page-rule-master"}),i=n.specified,r=t.size;if(r){var o=Hh(t),a=r.priority;i.width=ko(this.context,i.width,new Lo(o.width,a)),i.height=ko(this.context,i.height,new Lo(o.height,a))}["counter-reset","counter-increment"].forEach((function(e){i[e]&&(t[e]=i[e])}));var s=n.createInstance(this.rootPageBoxInstance);return s.applyCascadeAndInit(this.cascadeInstance,this.docElementStyle),s.resolveAutoSizing(this.context),s},t}(),sc=function(t){function e(e){var n;return(n=t.call(this)||this).pageType=void 0,n.pageType=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){t.currentPageType===this.pageType&&this.chained.apply(t)},n.getPriority=function(){return 3},n.makePrimary=function(t){return this.chained&&t.insertInTable(t.pagetypes,this.pageType,this.chained),!0},e}(ta),uc=function(t){function e(e){var n;return(n=t.call(this)||this).scope=void 0,n.scope=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){1===new me(this.scope,"page-number").evaluate(t.context)&&this.chained.apply(t)},n.getPriority=function(){return 2},e}(ta),lc=function(t){function e(e){var n;return(n=t.call(this)||this).scope=void 0,n.scope=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){new me(this.scope,"blank-page").evaluate(t.context)&&this.chained.apply(t)},n.getPriority=function(){return 2},e}(ta),hc=function(t){function e(e){var n;return(n=t.call(this)||this).scope=void 0,n.scope=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){new me(this.scope,"left-page").evaluate(t.context)&&this.chained.apply(t)},n.getPriority=function(){return 1},e}(ta),cc=function(t){function e(e){var n;return(n=t.call(this)||this).scope=void 0,n.scope=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){new me(this.scope,"right-page").evaluate(t.context)&&this.chained.apply(t)},n.getPriority=function(){return 1},e}(ta),dc=function(t){function e(e){var n;return(n=t.call(this)||this).scope=void 0,n.scope=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){new me(this.scope,"recto-page").evaluate(t.context)&&this.chained.apply(t)},n.getPriority=function(){return 1},e}(ta),fc=function(t){function e(e){var n;return(n=t.call(this)||this).scope=void 0,n.scope=e,n}x(e,t);var n=e.prototype;return n.apply=function(t){new me(this.scope,"verso-page").evaluate(t.context)&&this.chained.apply(t)},n.getPriority=function(){return 1},e}(ta),pc=function(t){function e(e,n,i){var r;return(r=t.call(this,n,i)||this).scope=void 0,r.a=void 0,r.b=void 0,r.scope=e,r.a=n,r.b=i,r}x(e,t);var n=e.prototype;return n.apply=function(t){var e=t.context,n=e.layoutPositionAtPageStart.page;e.blankPageAtStart&&n--,n&&this.matchANPlusB(n)&&this.chained.apply(t)},n.getPriority=function(){return 2},e}(pa),gc=function(t){function e(e,n){return t.call(this,e,n,null,null,null)||this}return x(e,t),e.prototype.apply=function(t){!function(t,e,n,i,r){jo(t,e,n,i,null,null,null);var o=n._marginBoxes;if(o){var a=zo(e,"_marginBoxes");for(var s in o)if(o.hasOwnProperty(s)){var u=a[s];u||(a[s]=u={}),jo(t,u,o[s],i,null,null,null)}}}(t.context,t.currentStyle,this.style,this.specificity)},e}(Jo),vc=function(t){function e(e,n,i,r,o){var a;return(a=t.call(this,e,n,null==i?void 0:i.condition,i,null,r,!1)||this).pageProps=void 0,a.currentPageSelectors=[],a.currentNamedPageSelector="",a.currentPseudoPageClassSelectors=[],a.pageProps=o,a}x(e,t);var n=e.prototype;return n.startPageRule=function(){this.startSelectorRule()},n.tagSelector=function(t,e){this.currentNamedPageSelector=e,e&&(this.chain.push(new sc(e)),this.specificity+=65536)},n.pseudoclassSelector=function(t,e){if(t=t.toLowerCase(),e)if("nth"===t){var n=e[0],i=e[1];this.currentPseudoPageClassSelectors.push(":"+t+"("+n+"n"+(i<0?i:"+"+i)+")"),this.chain.push(new pc(this.scope,n,i)),this.specificity+=256}else this.reportAndSkip("E_INVALID_PAGE_SELECTOR :"+t+"("+e.join("")+")");else switch(this.currentPseudoPageClassSelectors.push(":"+t),t){case"first":this.chain.push(new uc(this.scope)),this.specificity+=256;break;case"blank":this.chain.push(new lc(this.scope)),this.specificity+=256;break;case"left":this.chain.push(new hc(this.scope)),this.specificity+=1;break;case"right":this.chain.push(new cc(this.scope)),this.specificity+=1;break;case"recto":this.chain.push(new dc(this.scope)),this.specificity+=1;break;case"verso":this.chain.push(new fc(this.scope)),this.specificity+=1;break;default:this.reportAndSkip("E_INVALID_PAGE_SELECTOR :"+t)}},n.finishSelector=function(){var t;t=this.currentNamedPageSelector||this.currentPseudoPageClassSelectors.length?[this.currentNamedPageSelector].concat(this.currentPseudoPageClassSelectors.sort()):null,this.currentPageSelectors.push({selectors:t,specificity:this.specificity}),this.currentNamedPageSelector="",this.currentPseudoPageClassSelectors=[]},n.nextSelector=function(){this.finishSelector(),t.prototype.nextSelector.call(this)},n.startRuleBody=function(){this.finishSelector(),t.prototype.startRuleBody.call(this)},n.simpleProperty=function(e,n,i){if("bleed"!==e&&"marks"!==e||this.currentPageSelectors.some((function(t){return null===t.selectors}))){t.prototype.simpleProperty.call(this,e,n,i);var r=Uo(this.elementStyle,e),o=this.pageProps;if("bleed"===e||"marks"===e)o[""]||(o[""]={}),Object.keys(o).forEach((function(t){Vo(o[t],e,r)}));else if("size"===e){var a=o[""];this.currentPageSelectors.forEach((function(t){var n=new Lo(r.value,r.priority+t.specificity),i=t.selectors?t.selectors.join(""):"",s=o[i];if(s){var u=Uo(s,e);n=u?ko(null,n,u):n,Vo(s,e,n)}else Vo(s=o[i]={},e,n),a&&["bleed","marks"].forEach((function(t){a[t]&&Vo(s,t,a[t])}))}))}}},n.insertNonPrimary=function(t){this.cascade.insertInTable(this.cascade.pagetypes,"*",t)},n.makeApplyRuleAction=function(t){return new gc(this.elementStyle,t)},n.startPageMarginBoxRule=function(t){var e=zo(this.elementStyle,"_marginBoxes"),n=e[t];n||(e[t]=n={});var i=new mc(this.scope,this.owner,this.validatorSet,n);this.owner.pushHandler(i)},e}(Ya),mc=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,n,!1)||this).validatorSet=void 0,o.boxStyle=void 0,o.validatorSet=i,o.boxStyle=r,o}x(e,t);var n=e.prototype;return n.property=function(t,e,n){this.validatorSet.validatePropertyAndHandleShorthand(t,e,n,this)},n.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},n.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},n.simpleProperty=function(t,e,n){var i=n?this.getImportantSpecificity():this.getBaseSpecificity(),r=new Lo(e,i);Vo(this.boxStyle,t,r)},e}(ur),Ec=function(t,e,n){return t.replace(/[uU][rR][lL]\(\s*"((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^"\r\n])+)"/gm,(function(t,i){return'url("'+n.transformURL(i,e)+'"'})).replace(/[uU][rR][lL]\(\s*'((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^'\r\n])+)'/gm,(function(t,i){return"url('"+n.transformURL(i,e)+"'"})).replace(/[uU][rR][lL]\(\s*((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^"'\r\n\)\s])+)/gm,(function(t,i){return"url("+n.transformURL(i,e)}))},Cc={},Dc={"text-indent":"0px","margin-top":"0px","padding-top":"0px","border-top-width":"0px","border-top-style":"none","border-top-color":"transparent","border-top-left-radius":"0px","border-top-right-radius":"0px"},wc={"text-indent":"0px","margin-right":"0px","padding-right":"0px","border-right-width":"0px","border-right-style":"none","border-right-color":"transparent","border-top-right-radius":"0px","border-bottom-right-radius":"0px"},yc={"margin-top":"0px"},Nc={"margin-right":"0px"},bc=function(t){function n(e,n,i,r,o,a,s,u,l,h,c,d,f){var p;return(p=t.call(this)||this).flowName=void 0,p.context=void 0,p.viewport=void 0,p.styler=void 0,p.regionIds=void 0,p.xmldoc=void 0,p.docFaces=void 0,p.footnoteStyle=void 0,p.stylerProducer=void 0,p.page=void 0,p.customRenderer=void 0,p.fallbackMap=void 0,p.documentURLTransformer=void 0,p.document=void 0,p.exprContentListener=void 0,p.nodeContext=null,p.viewRoot=null,p.isFootnote=!1,p.sourceNode=null,p.offsetInNode=0,p.viewNode=null,p.flowName=e,p.context=n,p.viewport=i,p.styler=r,p.regionIds=o,p.xmldoc=a,p.docFaces=s,p.footnoteStyle=u,p.stylerProducer=l,p.page=h,p.customRenderer=c,p.fallbackMap=d,p.documentURLTransformer=f,p.document=i.document,p.exprContentListener=r.counterListener.getExprContentListener(),p}x(n,t);var i=n.prototype;return i.clone=function(){return new n(this.flowName,this.context,this.viewport,this.styler,this.regionIds,this.xmldoc,this.docFaces,this.footnoteStyle,this.stylerProducer,this.page,this.customRenderer,this.fallbackMap,this.documentURLTransformer)},i.createPseudoelementShadow=function(t,e,n,i,r,o,a,s){var u=this.getPseudoMap(n,this.regionIds,this.isFootnote,this.nodeContext,o);if(!u)return s;for(var l,h=[],c=cu.createElementNS(G.SHADOW,"root"),d=c,f=B(du);!(l=f()).done;){var p=l.value,g=void 0;if(p){if(!u[p])continue;if(!("footnote-marker"!=p||e&&this.isFootnote))continue;if(p.match(/^first-/)){var v=i.display;if(!v||v===en.inline)continue}if("before"===p||"after"===p){var m=u[p].content;if(!m||m===en.normal||m===en.none)continue}h.push(p),pu(g=cu.createElementNS(G.XHTML,"span"),p)}else g=cu.createElementNS(G.SHADOW,"content");d.appendChild(g),p.match(/^first-/)&&(d=g)}if(!h.length)return s;var E=new gu(t,n,r,o,this.exprContentListener);return new ho(t,c,null,a,s,lo.ROOTLESS,E)},i.getPseudoMap=function(t,e,n,i,r){var o=Ho(t,"_pseudos");if(!o)return null;var a={},s=function(t){var i=a[t]={};ss(i,o[t],r),ns(i,r,o[t]),as(o[t],e,n,(function(t,e){ss(i,e,r),es(e,(function(t){ss(i,t,r)}))}))};for(var u in o)s(u);return a},i.createRefShadow=function(t,e,n,i,r){var o=this,a=Pi("createRefShadow");return this.xmldoc.store.load(t).then((function(s){var u=s;if(u){var l=u.getElement(t);if(l){var h=o.stylerProducer.getStylerForDoc(u);r=new ho(n,l,u,i,r,e,h)}}a.finish(r)})),a.result()},i.createShadows=function(t,e,n,i,r,o,a){var s=this,u=Pi("createShadows"),l=i.template;return(l instanceof je?this.createRefShadow(l.url,lo.ROOTLESS,t,a,null):Ri(null)).then((function(l){var h=null;if(t.namespaceURI==G.SHADOW&&"include"==t.localName){var c=t.getAttribute("href"),d=null;c?d=a?a.xmldoc:s.xmldoc:a&&(c=a.owner.namespaceURI==G.XHTML?a.owner.getAttribute("href"):a.owner.getAttributeNS(G.XLINK,"href"),d=a.parentShadow?a.parentShadow.xmldoc:s.xmldoc),c&&(c=j(c,d.url),h=s.createRefShadow(c,lo.ROOTED,t,a,l))}null==h&&(h=Ri(l));var f=null;h.then((function(e){if(i.display===en.table_cell){var n=j("user-agent.xml#table-cell",X);f=s.createRefShadow(n,lo.ROOTLESS,t,a,e)}else f=Ri(e)})),f.then((function(l){l=s.createPseudoelementShadow(t,e,n,i,r,o,a,l),u.finish(l)}))})),u.result()},i.setViewRoot=function(t,e){this.viewRoot=t,this.isFootnote=e},i.computeStyle=function(t,e,n,i){var r=this,o=this.context,a=os(n,o,this.regionIds,this.isFootnote);t=is(a,o,t),e=rs(a,o,e),us(a,i,t,e,(function(t,e){var n=e.evaluate(o,t);return"font-family"==t&&(n=r.docFaces.filterFontFamily(n)),n}));var s=Zs(i.display||en.inline,i.position,i.float,this.sourceNode===this.xmldoc.root);return["display","position","float"].forEach((function(t){s[t]&&(i[t]=s[t])})),t},i.inheritFromSourceParent=function(t){for(var e=this.nodeContext.sourceNode,n=[],i=null,r=this.nodeContext.shadowContext,o=-1;e&&1==e.nodeType;){var a=r&&r.root==e;if(!a||r.type==lo.ROOTLESS){var s=(r?r.styler:this.styler).getStyle(e,!1);n.push(s),i=i||nt(e)}a?(e=r.owner,r=r.parentShadow):(e=e.parentNode,o++)}for(var u=this.context.isRelativeRootFontSize?this.context.initialFontSize:this.context.queryUnitSize("em",0===o),l={"font-size":new Lo(new ze(u,"px"),0)},h=new Yo(l,this.context),c=n.length-1;c>=0;--c){var d=n[c],f=[];for(var p in d)Mo(p)&&f.push(p);f.sort(ln);for(var g=0,v=f;g<v.length;g++){var m=v[g];h.setPropName(m);var E=Uo(d,m);E.value!==en.inherit&&(l[m]=E.filterValue(h))}}for(var C in t)Mo(C)||(l[C]=t[C]);return{lang:i,elementStyle:l}},i.resolveURL=function(t){return t=j(t,this.xmldoc.url),this.fallbackMap[t]||t},i.inheritLangAttribute=function(){this.nodeContext.lang=nt(this.nodeContext.sourceNode)||this.nodeContext.parent&&this.nodeContext.parent.lang||this.nodeContext.lang},i.transferPolyfilledInheritedProps=function(t){var n=v(e.HOOKS.POLYFILLED_INHERITED_PROPS).reduce((function(t,e){return t.concat(e())}),[].concat(No)).filter((function(e){return t[e]}));if(n.length){var i=this.nodeContext.inheritedProps;if(this.nodeContext.parent)for(var r in i=this.nodeContext.inheritedProps={},this.nodeContext.parent.inheritedProps)i[r]=this.nodeContext.parent.inheritedProps[r];n.forEach((function(e){var n=t[e];if(n){if(n instanceof Xe)i[e]=n.num;else if(n instanceof Ve)i[e]=n.name;else if(n instanceof ze){var r=n;switch(r.unit){case"dpi":case"dpcm":case"dppx":i[e]=r.num*Ht[r.unit]}}else i[e]=n;delete t[e]}}))}},i.resolveFormattingContext=function(t,n,i,r,o,a){for(var s=v(e.HOOKS.RESOLVE_FORMATTING_CONTEXT),u=0;u<s.length;u++){var l=s[u](t,n,i,r,o,a);if(l)return void(t.formattingContext=l)}},i.createElementView=function(t,e){var n=this,i=!0,r=Pi("createElementView"),o=this.sourceNode,a=this.nodeContext.shadowContext?this.nodeContext.shadowContext.styler:this.styler,s=a.getStyle(o,!1);if(!this.nodeContext.shadowContext){var u=this.xmldoc.getElementOffset(o);Br.registerFragmentIndex(u,this.nodeContext.fragmentIndex,0)}var l={};if(!this.nodeContext.parent){var h=this.inheritFromSourceParent(s);s=h.elementStyle,this.nodeContext.lang=h.lang}var d=s["float-reference"]&&function(t){switch(t){case"inline":return Cs.INLINE;case"column":return Cs.COLUMN;case"region":return Cs.REGION;case"page":return Cs.PAGE;default:throw new Error("Unknown float-reference: "+t)}}(s["float-reference"].value.toString());if(this.nodeContext.parent&&d&&Ds(d)){var f=this.inheritFromSourceParent(s);s=f.elementStyle,this.nodeContext.lang=f.lang}this.nodeContext.vertical=this.computeStyle(this.nodeContext.vertical,"rtl"===this.nodeContext.direction,s,l),a.processContent(o,l),this.transferPolyfilledInheritedProps(l),this.inheritLangAttribute(),l.direction&&(this.nodeContext.direction=l.direction.toString());var p=l["flow-into"];if(p&&p.toString()!=this.flowName)return r.finish(!1),r.result();var g=l.display;if(g===en.none)return r.finish(!1),r.result();var v=null==this.nodeContext.parent;return this.nodeContext.flexContainer=g===en.flex,this.createShadows(o,v,s,l,a,this.context,this.nodeContext.shadowContext).then((function(u){n.nodeContext.nodeShadow=u;var h=l.position,f=l.float,p=l.clear,m=n.nodeContext.vertical?en.vertical_rl:en.horizontal_tb,E=n.nodeContext.parent?n.nodeContext.parent.vertical?en.vertical_rl:en.horizontal_tb:m,C=function(t){return"true"===t.getAttribute("data-vivliostyle-flow-root")}(o);n.nodeContext.establishesBFC=function(t,e,n,i,r,o,a){return r=r||o||en.horizontal_tb,!!a||!!n&&n!==en.none||$s(e)||t===en.inline_block||t===en.table_cell||t===en.table_caption||t==en.flex||(t===en.block||t===en.list_item)&&!!i&&i!==en.visible||!!o&&r!==o}(g,h,f,l.overflow,m,E,C),n.nodeContext.containingBlockForAbsolute=function(t){return t===en.relative||t===en.absolute||t===en.fixed}(h),!n.nodeContext.isInsideBFC()||f===en.footnote||d&&Ds(d)||(f=null,p=null);var D=f===en.left||f===en.right||f===en.top||f===en.bottom||f===en.inline_start||f===en.inline_end||f===en.block_start||f===en.block_end||f===en.snap_block||f===en.footnote;f&&(delete l.float,f===en.footnote&&(n.isFootnote?(D=!1,l.display=en.block):l.display=en.inline)),p&&(p===en.inherit&&n.nodeContext.parent&&n.nodeContext.parent.clearSide&&(p=He(n.nodeContext.parent.clearSide)),p!==en.left&&p!==en.right&&p!==en.top&&p!==en.bottom&&p!==en.both&&p!==en.all&&p!==en.same||(delete l.clear,l.display&&l.display!=en.inline&&(n.nodeContext.clearSide=p.toString())));var w=g===en.list_item&&l["ua-list-item-count"];if((D||l["break-inside"]&&l["break-inside"]!==en.auto)&&n.nodeContext.breakPenalty++,g&&g!==en.inline&&tu(g)&&n.nodeContext.breakPenalty++,n.nodeContext.inline=!D&&!g||tu(g)||function(t){switch(t.toString()){case"ruby-base":case"ruby-text":case"ruby-base-container":case"ruby-text-container":return!0;default:return!1}}(g),n.nodeContext.display=g?g.toString():"inline",n.nodeContext.floatSide=D?f.toString():null,n.nodeContext.floatReference=d||Cs.INLINE,n.nodeContext.floatMinWrapBlock=l["float-min-wrap-block"]||null,n.nodeContext.columnSpan=l["column-span"],!n.nodeContext.inline){var y,N=l["break-after"];N&&(n.nodeContext.breakAfter=N.toString());var b=l["break-before"];b&&(n.nodeContext.breakBefore=b.toString());var S=(null==(y=l.page)?void 0:y.toString())||null;S&&"auto"!==S.toLowerCase()?n.nodeContext.pageType=S:S=n.nodeContext.pageType,n.styler.cascade.currentPageType!==S&&(n.isAtForcedBreak()||(n.nodeContext.breakBefore="page"),n.styler.cascade.previousPageType=n.styler.cascade.currentPageType,n.styler.cascade.currentPageType=S)}n.nodeContext.verticalAlign=l["vertical-align"]&&l["vertical-align"].toString()||"baseline",n.nodeContext.captionSide=l["caption-side"]&&l["caption-side"].toString()||"top";var A=l["border-collapse"];if(!A||A===He("separate")){var T,x,I=l["border-spacing"];I&&(I.isSpaceList()?(T=I.values[0],x=I.values[1]):T=x=I,T.isNumeric()&&(n.nodeContext.inlineBorderSpacing=Je(T,n.context)),x.isNumeric()&&(n.nodeContext.blockBorderSpacing=Je(x,n.context)))}n.nodeContext.footnotePolicy=l["footnote-policy"];var F=l["x-first-pseudo"];F&&(n.nodeContext.firstPseudo=new fo(n.nodeContext.parent?n.nodeContext.parent.firstPseudo:null,F.num)),n.nodeContext.inline||n.processAfterIfcontinues(o,s,a,n.context);var P=l["white-space"];if(P){var R=Jr(P.toString());null!==R&&(n.nodeContext.whitespace=R)}var L=l["hyphenate-character"];L&&L!==en.auto&&(n.nodeContext.hyphenateCharacter=L.str);var O=l["overflow-wrap"];n.nodeContext.breakWord=l["word-break"]===en.break_all||l["line-break"]===en.anywhere||O===en.break_word||O===en.anywhere,n.resolveFormattingContext(n.nodeContext,t,g,h,f,v),n.nodeContext.parent&&n.nodeContext.parent.formattingContext&&(t=n.nodeContext.parent.formattingContext.isFirstTime(n.nodeContext,t)),n.nodeContext.inline||(n.nodeContext.repeatOnBreak=n.processRepeatOnBreak(l),n.findAndProcessRepeatingElements(o,a));var k=!1,B=[],_=o.namespaceURI,M=o.localName;if(_==G.XHTML)"html"==M||"body"==M||"script"==M||"link"==M||"meta"==M?M="div":"vide_"==M?M="video":"audi_"==M?M="audio":"object"==M&&(k=!!n.customRenderer),o.getAttribute("data-adapt-pseudo")&&s.content&&s.content.value&&s.content.value.url&&(M="img");else if(_==G.epub)M="span",_=G.XHTML;else if(_==G.NCX)if(_=G.XHTML,"ncx"==M||"navPoint"==M)M="div";else if("navLabel"==M){M="span";var U=o.parentNode;if(U){for(var V=null,H=U.firstChild;H;H=H.nextSibling)if(1==H.nodeType&&H.namespaceURI==G.NCX&&"content"==H.localName){V=H.getAttribute("src");break}V&&(M="a",(o=o.ownerDocument.createElementNS(_,"a")).setAttribute("href",V))}}else M="span";else _==G.SHADOW?(_=G.XHTML,M=n.nodeContext.inline?"span":"div"):k=!!n.customRenderer;if(w)t?M="li":(M="div",l.display=g=en.block);else if("body"==M||"li"==M)M="div";else if("q"==M)M="span";else if("a"==M){var z=l["hyperlink-processing"];z&&"normal"!=z.toString()&&(M="span")}l.behavior&&"none"!=l.behavior.toString()&&n.customRenderer&&(k=!0),o.dataset&&"true"===o.getAttribute("data-math-typeset")&&(k=!0),(k?n.customRenderer(o,n.nodeContext.parent?n.nodeContext.parent.viewNode:null,l):Ri(null)).then((function(a){var s;a?k&&(i="true"==a.getAttribute("data-adapt-process-children")):a=n.createElement(_,M),"a"==M&&a.addEventListener("click",n.page.hrefHandler,!1),"iframe"==a.localName&&a.namespaceURI==G.XHTML&&(s=a).addEventListener("load",(function(){s.contentWindow.navigator.epubReadingSystem={name:"adapt",version:"0.1",layoutStyle:"paginated",hasFeature:function(t,e){return"mouse-events"===t}}}),!1);for(var u=n.nodeContext.inheritedProps["image-resolution"],h=[],d=l.width,f=l.height,p=o.getAttribute("width"),g=o.getAttribute("height"),v=d===en.auto||!d&&!p,m=f===en.auto||!f&&!g,E=o.attributes,C=E.length,D=null,y=0;y<C;y++){var N=E[y],b=N.namespaceURI,S=N.localName,A=N.nodeValue;if(b){if("http://www.w3.org/2000/xmlns/"==b)continue;b==G.XLINK&&"href"==S&&(A=n.resolveURL(A))}else{if(S.match(/^on/))continue;if("style"==S)continue;if(("id"==S||"name"==S)&&t){A=n.documentURLTransformer.transformFragment(A,n.xmldoc.url),a.setAttribute(S,A),n.page.registerElementWithId(a,A);continue}if("src"==S||"href"==S||"poster"==S?(A=n.resolveURL(A),"href"===S&&(A=n.documentURLTransformer.transformURL(A,n.xmldoc.url))):"srcset"==S&&(A=A.split(",").map((function(t){return n.resolveURL(t.trim())})).join(",")),"poster"===S&&"video"===M&&_===G.XHTML&&v&&m){var T=new Image,x=Xi(T,A);B.push(x),h.push({image:T,element:a,fetcher:x})}}if(_==G.SVG&&/^[A-Z\-]+$/.test(S)&&(S=S.toLowerCase()),n.isSVGUrlAttribute(S)&&(A=Ec(A,n.xmldoc.url,n.documentURLTransformer)),b){var I=Cc[b];I&&(S=I+":"+S)}if("src"!=S||b||"img"!=M&&"input"!=M||_!=G.XHTML)if("href"==S&&"image"==M&&_==G.SVG&&b==G.XLINK)n.page.fetchers.push(Xi(a,A));else if(b)a.setAttributeNS(b,S,A);else try{a.setAttribute(S,A)}catch(t){c.warn(t)}else D=A}if(D){var F="input"===M?new Image:a,P=Xi(F,D);F!==a&&(a.src=D),v||m?(v&&m&&u&&1!==u&&h.push({image:F,element:a,fetcher:P}),B.push(P)):n.page.fetchers.push(P)}delete l.content;var R=l["list-style-image"];if(R&&R instanceof je){var L=R.url;B.push(Xi(new Image,L))}if(n.preprocessElementStyle(l),n.applyComputedStyles(a,l),!n.nodeContext.inline){var O=null;if(t?e&&!n.isAtForcedBreak()&&(O=n.nodeContext.vertical?Nc:yc):O="clone"!==n.nodeContext.inheritedProps["box-decoration-break"]?n.nodeContext.vertical?wc:Dc:n.nodeContext.vertical?Nc:yc,O)for(var U in O)("text-indent"!==U||n.isParagraph(o))&&tt(a,U,O[U])}w&&a.setAttribute("value",l["ua-list-item-count"].stringValue()),n.viewNode=a,B.length?Gi(B).then((function(){u>0&&n.modifyElemDimensionWithImageResolution(h,u,l,n.nodeContext.vertical),r.finish(i)})):r.timeSlice().then((function(){r.finish(i)}))}))})),r.result()},i.isParagraph=function(t){switch(t.localName){case"p":return!0;case"html":case"body":case"main":case"article":case"section":return!1}for(var e={a:!0,abbr:!0,b:!0,bdi:!0,bdo:!0,cite:!0,code:!0,data:!0,del:!0,dfn:!0,em:!0,i:!0,ins:!0,kbd:!0,mark:!0,q:!0,ruby:!0,s:!0,samp:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0,time:!0,u:!0,var:!0},n=t.firstChild;n;n=n.nextSibling)switch(n.nodeType){case Node.TEXT_NODE:if(n.nodeValue.trim().length>0)return!0;break;case Node.ELEMENT_NODE:if(e[n.localName])return!0}return!1},i.isAtForcedBreak=function(){for(var t=this.nodeContext;t&&!t.after;t=t.parent){if(Ls(t.breakBefore))return!0;if(t.parent&&t.parent.sourceNode.firstElementChild!==t.sourceNode)break}return!1},i.processAfterIfcontinues=function(t,e,n,i){var r=this.getPseudoMap(e,this.regionIds,this.isFootnote,this.nodeContext,i);if(r&&r["after-if-continues"]&&r["after-if-continues"].content){var o=new gu(t,e,n,i,this.exprContentListener);this.nodeContext.afterIfContinues=new mu(t,o)}},i.isSVGUrlAttribute=function(t){return n.SVG_URL_ATTRIBUTES.includes(t.toLowerCase())},i.modifyElemDimensionWithImageResolution=function(t,e,n,i){var r=this;t.forEach((function(t){if("load"===t.fetcher.get().get()){var o=t.image,a=o.width/e,s=o.height/e,u=t.element;if(a>0&&s>0)if(n["box-sizing"]===en.border_box&&(n["border-left-style"]!==en.none&&(a+=Je(n["border-left-width"],r.context)),n["border-right-style"]!==en.none&&(a+=Je(n["border-right-width"],r.context)),n["border-top-style"]!==en.none&&(s+=Je(n["border-top-width"],r.context)),n["border-bottom-style"]!==en.none&&(s+=Je(n["border-bottom-width"],r.context))),e>1){var l=n["max-width"]||en.none,h=n["max-height"]||en.none;if(l===en.none&&h===en.none)tt(u,"max-width",a+"px");else if(l!==en.none&&h===en.none)tt(u,"width",a+"px");else if(l===en.none&&h!==en.none)tt(u,"height",s+"px");else{l.isNumeric(),h.isNumeric();var c=h;"%"!==l.unit?tt(u,"max-width",Math.min(a,Je(l,r.context))+"px"):"%"!==c.unit?tt(u,"max-height",Math.min(s,Je(c,r.context))+"px"):i?tt(u,"height",s+"px"):tt(u,"width",a+"px")}}else if(e<1){var d=n["min-width"]||an,f=n["min-height"]||an;d.isNumeric(),d.isNumeric();var p=d,g=f;0===p.num&&0===g.num?tt(u,"min-width",a+"px"):0!==p.num&&0===g.num?tt(u,"width",a+"px"):0===p.num&&0!==g.num?tt(u,"height",s+"px"):"%"!==p.unit?tt(u,"min-width",Math.max(a,Je(p,r.context))+"px"):"%"!==g.unit?tt(u,"min-height",Math.max(s,Je(g,r.context))+"px"):i?tt(u,"height",s+"px"):tt(u,"width",a+"px")}}}))},i.preprocessElementStyle=function(t){var n=this;v(e.HOOKS.PREPROCESS_ELEMENT_STYLE).forEach((function(e){e(n.nodeContext,t)}))},i.findAndProcessRepeatingElements=function(t,e){for(var n=t.firstChild;n;n=n.nextSibling)if(1===n.nodeType){var i={},r=e.getStyle(n,!1);if(this.computeStyle(this.nodeContext.vertical,"rtl"===this.nodeContext.direction,r,i),this.processRepeatOnBreak(i)){if(this.nodeContext.formattingContext instanceof Lu&&!this.nodeContext.belongsTo(this.nodeContext.formattingContext))return;var o=this.nodeContext.parent;return this.nodeContext.formattingContext=new Lu(o&&o.formattingContext,this.nodeContext.sourceNode),void this.nodeContext.formattingContext.initializeRepetitiveElements(this.nodeContext.vertical)}}},i.processRepeatOnBreak=function(t){var e=t["repeat-on-break"];return e!==en.none&&(e===en.auto&&(e=t.display===en.table_header_group?en.header:t.display===en.table_footer_group?en.footer:en.none),e&&e!==en.none)?e.toString():null},i.createTextNodeView=function(){var t=this,e=Pi("createTextNodeView");return this.preprocessTextContent().then((function(){var n=t.offsetInNode||0,i=Xr(t.nodeContext.preprocessedTextContent).substr(n);t.viewNode=document.createTextNode(i),e.finish(!0)})),e.result()},i.preprocessTextContent=function(){var t,n=this;if(null!=this.nodeContext.preprocessedTextContent)return Ri(!0);var i=t=this.sourceNode.textContent,r=Pi("preprocessTextContent"),a=v(e.HOOKS.PREPROCESS_TEXT_CONTENT),s=0;return r.loop((function(){return s>=a.length?Ri(!1):a[s++](n.nodeContext,i).thenAsync((function(t){return i=t,Ri(!0)}))})).then((function(){n.nodeContext.preprocessedTextContent=o.default(t,i,0),r.finish(!0)})),r.result()},i.createNodeView=function(t,e){var n,i=this,r=Pi("createNodeView"),o=!0;return 1==this.sourceNode.nodeType?n=this.createElementView(t,e):8==this.sourceNode.nodeType?(this.viewNode=null,n=Ri(!0)):n=this.createTextNodeView(),n.then((function(t){if(o=t,i.nodeContext.viewNode=i.viewNode,i.viewNode){var e=i.nodeContext.parent?i.nodeContext.parent.viewNode:i.viewRoot;e&&e.appendChild(i.viewNode)}r.finish(o)})),r.result()},i.setCurrent=function(t,e,n){return this.nodeContext=t,t?(this.sourceNode=t.sourceNode,this.offsetInNode=t.offsetInNode):(this.sourceNode=null,this.offsetInNode=-1),this.viewNode=null,this.nodeContext?this.createNodeView(e,!!n):Ri(!0)},i.processShadowContent=function(t){if(null==t.shadowContext||"content"!=t.sourceNode.localName||t.sourceNode.namespaceURI!=G.SHADOW)return t;var e,n,i=t.boxOffset,r=t.shadowContext,o=t.parent,a=r.subShadow||r.parentShadow;r.subShadow?(e=r.root,(n=r.type)==lo.ROOTLESS&&(e=e.firstChild)):(e=r.owner.firstChild,n=lo.ROOTLESS);var s=t.sourceNode.nextSibling;if(s?(t.sourceNode=s,t.resetView()):t.shadowSibling?t=t.shadowSibling:e?t=null:(t=t.parent.modify()).after=!0,e){var u=new po(e,o,i);return u.shadowContext=a,u.shadowType=n,u.shadowSibling=t,u}return t.boxOffset=i,t},i.nextPositionInTree=function(t){var e=t.boxOffset+1;if(t.after){if(!t.parent)return null;if(t.shadowType!=lo.ROOTED){var n=t.sourceNode.nextSibling;if(n)return(t=t.modify()).boxOffset=e,t.sourceNode=n,t.resetView(),this.processShadowContent(t)}return t.shadowSibling?((t=t.shadowSibling.modify()).boxOffset=e,t):((t=t.parent.modify()).boxOffset=e,t.after=!0,t)}if(t.nodeShadow){var i=t.nodeShadow.root;if(t.nodeShadow.type==lo.ROOTLESS&&(i=i.firstChild),i){var r=new po(i,t,e);return r.shadowContext=t.nodeShadow,r.shadowType=t.nodeShadow.type,this.processShadowContent(r)}}var o=t.sourceNode.firstChild;return o?this.processShadowContent(new po(o,t,e)):(1!=t.sourceNode.nodeType&&(e+=Xr(t.preprocessedTextContent).length-1-t.offsetInNode),(t=t.modify()).boxOffset=e,t.after=!0,t)},i.isTransclusion=function(t,e,n){var i=Uo(e,"hyperlink-processing");if(!i)return!1;var r=i.evaluate(this.context,"hyperlink-processing");return!!r&&r.toString()==n},i.nextInTree=function(t,e){var n=this,i=this.nextPositionInTree(t);if(!i||i.after)return Ri(i);var r=Pi("nextInTree");return this.setCurrent(i,!0,e).then((function(t){i.viewNode&&t||((i=i.modify()).after=!0,i.viewNode||(i.inline=!0)),n.dispatchEvent({type:"nextInTree",nodeContext:i}),r.finish(i)})),r.result()},i.addImageFetchers=function(t){if(t instanceof Qe)for(var e=t.values,n=0;n<e.length;n++)this.addImageFetchers(e[n]);else if(t instanceof je){var i=t.url;this.page.fetchers.push(Xi(new Image,i))}},i.applyComputedStyles=function(t,e){var n,i,r,o=e["background-image"];o&&this.addImageFetchers(o);var a=e.position===en.relative,s=null===(null==(n=this.nodeContext)?void 0:n.parent)&&null===(null==(i=this.sourceNode)?void 0:i.parentElement)&&!(null==(r=this.viewRoot)||!r.parentElement);for(var u in e)if(!Ac[u]){var l=e[u];l&&l!==ke&&((l=l.visit(new Mn(this.xmldoc.url,this.documentURLTransformer))).isNumeric()&&zt(l.unit)&&(l=tn(l,this.context)),jr[u]||a&&Kr[u]?this.page.delayedItems.push(new Yr(t,u,l)):"rt"===t.localName&&"font-size"===u&&this.fixRubyTextFontSize(t,l)||(s&&Mo(u)?tt(this.viewRoot.parentElement,u,l.toString()):tt(t,u,l.toString())))}},i.fixRubyTextFontSize=function(t,e){if(!/Chrome/.test(navigator.userAgent))return!1;if(!e.isNumeric())return!1;var n,i=e;if("%"===i.unit||"em"===i.unit){var r,o,a=null==(r=this.nodeContext)||null==(o=r.parent)?void 0:o.viewNode;n=(a&&parseFloat(window.getComputedStyle(a).fontSize))*i.num/("%"===i.unit?100:1)}else n=tn(i,this.context).num;if(!n)return!1;if(n>=10)return!1;if(!(t instanceof HTMLElement&&"zoom"in t.style))return!1;var s=n/10;return tt(t,"font-size","10px"),tt(t,"zoom",""+s),!0},i.applyPseudoelementStyle=function(t,e,n){if(!t.after){var i=(t.shadowContext?t.shadowContext.styler:this.styler).getStyle(this.sourceNode,!1),r=Ho(i,"_pseudos");if(r&&(i=r[e])){var o={};t.vertical=this.computeStyle(t.vertical,"rtl"===t.direction,i,o);var a=o.content;wo(a)&&(a.visit(new Do(n,this.context,a,this.exprContentListener)),delete o.content),this.applyComputedStyles(n,o)}}},i.peelOff=function(t,e){var n=this,i=Pi("peelOff"),r=t.firstPseudo,o=t.offsetInNode,a=t.after;if(e>0)t.viewNode.textContent=t.viewNode.textContent.substr(0,e),o+=e;else if(!a&&t.viewNode&&0==o){var s=t.viewNode.parentNode;s&&s.removeChild(t.viewNode)}for(var u=t.boxOffset+e,l=[];t.firstPseudo===r;)l.push(t),t=t.parent;var h=l.pop(),c=h.shadowSibling;return i.loop((function(){for(;l.length>0;){h=l.pop(),t=new po(h.sourceNode,t,u),0==l.length&&(t.offsetInNode=o,t.after=a),t.shadowType=h.shadowType,t.shadowContext=h.shadowContext,t.nodeShadow=h.nodeShadow,t.shadowSibling=h.shadowSibling?h.shadowSibling:c,c=null;var e=n.setCurrent(t,!1);if(e.isPending())return e}return Ri(!1)})).then((function(){i.finish(t)})),i.result()},i.createElement=function(t,e){return t==G.XHTML?this.document.createElement(e):this.document.createElementNS(t,e)},i.applyFootnoteStyle=function(t,e,n){var i={},r=Ho(this.footnoteStyle,"_pseudos");if(t=this.computeStyle(t,e,this.footnoteStyle,i),r&&r.before){var o={},a=this.createElement(G.XHTML,"span");pu(a,"before"),n.appendChild(a),this.computeStyle(t,e,r.before,o),delete o.content,this.applyComputedStyles(a,o)}return delete i.content,this.applyComputedStyles(n,i),t},i.processFragmentedBlockEdge=function(t){t&&t.walkUpBlocks((function(t){var e=t.inheritedProps["box-decoration-break"];if(!e||"slice"===e){var n=t.viewNode;t.vertical?(tt(n,"padding-left","0"),tt(n,"border-left","none"),tt(n,"border-top-left-radius","0"),tt(n,"border-bottom-left-radius","0")):(tt(n,"padding-bottom","0"),tt(n,"border-bottom","none"),tt(n,"border-bottom-left-radius","0"),tt(n,"border-bottom-right-radius","0"))}}))},i.convertLengthToPx=function(t,e,n){var i=t.num,r=t.unit;if(function(t){switch(t.toLowerCase()){case"em":case"ex":case"rem":return!0;default:return!1}}(r)){for(var o=e;o&&1!==o.nodeType;)o=o.parentNode;return qo(t,parseFloat(n.getElementComputedStyle(o)["font-size"]),this.context).num}var a=this.context.queryUnitSize(r,!1);return a?i*a:t},i.isSameNodePositionStep=function(t,e){if(t.shadowContext){if(!e.shadowContext)return!1;var n=1===e.node.nodeType?e.node:e.node.parentElement;return t.shadowContext.owner===e.shadowContext.owner&&fu(1===t.node.nodeType?t.node:t.node.parentElement)===fu(n)}return t.node===e.node},i.isSameNodePosition=function(t,e){var n=this;return t.offsetInNode===e.offsetInNode&&t.after==e.after&&t.steps.length===e.steps.length&&t.steps.every((function(t,i){return n.isSameNodePositionStep(t,e.steps[i])}))},i.isPseudoelement=function(t){return!!fu(t)},n}(gt);bc.SVG_URL_ATTRIBUTES=["color-profile","clip-path","cursor","filter","marker","marker-start","marker-end","marker-mid","fill","stroke","mask"];var Sc,Ac={"box-decoration-break":!0,"float-min-wrap-block":!0,"float-reference":!0,"flow-into":!0,"flow-linger":!0,"flow-options":!0,"flow-priority":!0,"footnote-policy":!0,page:!0},Tc=function(){function t(t){this.layoutBox=void 0,this.window=void 0,this.layoutBox=t.layoutBox,this.window=t.window}var e=t.prototype;return e.subtractOffsets=function(t,e){var n=e.left,i=e.top;return{left:t.left-n,top:t.top-i,right:t.right-n,bottom:t.bottom-i,width:t.width,height:t.height}},e.getRangeClientRects=function(t){var e=this,n=t.getClientRects(),i=this.layoutBox.getBoundingClientRect();return Array.from(n).map((function(t){return e.subtractOffsets(t,i)}))},e.getElementClientRect=function(t){var e=t.getBoundingClientRect(),n=this.layoutBox.getBoundingClientRect();return this.subtractOffsets(e,n)},e.getElementComputedStyle=function(t){return this.window.getComputedStyle(t,null)},t}(),xc=function(){function t(t,e,n,i,r){this.window=void 0,this.fontSize=void 0,this.document=void 0,this.root=void 0,this.outerZoomBox=void 0,this.contentContainer=void 0,this.layoutBox=void 0,this.width=void 0,this.height=void 0,this.window=t,this.fontSize=e,this.document=t.document,this.root=n||this.document.body;var o=this.root.firstElementChild;o||((o=this.document.createElement("div")).setAttribute("data-vivliostyle-outer-zoom-box","true"),this.root.appendChild(o));var a=o.firstElementChild;a||((a=this.document.createElement("div")).setAttribute("data-vivliostyle-spread-container","true"),o.appendChild(a));var s=o.nextElementSibling;s||((s=this.document.createElement("div")).setAttribute("data-vivliostyle-layout-box","true"),this.root.appendChild(s)),this.outerZoomBox=o,this.contentContainer=a,this.layoutBox=s;var u=new Tc(this).getElementComputedStyle(this.root);this.width=i||parseFloat(u.width)||t.innerWidth,this.height=r||parseFloat(u.height)||t.innerHeight}var e=t.prototype;return e.resetZoom=function(){tt(this.outerZoomBox,"width",""),tt(this.outerZoomBox,"height",""),tt(this.contentContainer,"width",""),tt(this.contentContainer,"height",""),tt(this.contentContainer,"transform","")},e.zoom=function(t,e,n){tt(this.outerZoomBox,"width",t*n+"px"),tt(this.outerZoomBox,"height",e*n+"px"),tt(this.contentContainer,"width",t+"px"),tt(this.contentContainer,"height",e+"px"),tt(this.contentContainer,"transform","scale("+n+")")},e.clear=function(){for(var t=this.root;t.lastChild;)t.removeChild(t.lastChild)},t}(),Ic=function(){function t(t,e,n){this.store=void 0,this.url=void 0,this.document=void 0,this.lang=null,this.totalOffset=-1,this.root=void 0,this.body=void 0,this.head=void 0,this.last=void 0,this.lastOffset=1,this.idMap=void 0,this.store=t,this.url=e,this.document=n,this.root=n.documentElement;var i=null,r=null;if(this.root.namespaceURI==G.XHTML){for(var o=this.root.firstChild;o;o=o.nextSibling)if(1==o.nodeType){var a=o;if(a.namespaceURI==G.XHTML)switch(a.localName){case"head":r=a;break;case"body":i=a}}this.lang=this.root.getAttribute("lang")}this.body=i,this.head=r,this.last=this.root,this.last.setAttribute("data-adapt-eloff","0")}var e=t.prototype;return e.doc=function(){return new Lc([this.document])},e.getElementOffset=function(t){var e=t.getAttribute("data-adapt-eloff");if(e)return parseInt(e,10);for(var n=this.lastOffset,i=this.last;i!=t;){var r=i.firstChild;if(!r)for(;!(r=i.nextSibling);)if(null==(i=i.parentNode))throw new Error("Internal error");i=r,1==r.nodeType?(r.setAttribute("data-adapt-eloff",n.toString()),++n):n+=r.textContent.length}return this.lastOffset=n,this.last=t,n-1},e.getNodeOffset=function(t,e,n){var i=0,r=t,o=null;if(1==r.nodeType){if(!n)return this.getElementOffset(r)}else{if(i=e,!(o=r.previousSibling))return i+=1,this.getElementOffset(r=r.parentNode)+i;r=o}for(;;){for(;r.lastChild;)r=r.lastChild;if(1==r.nodeType)break;if(i+=r.textContent.length,!(o=r.previousSibling)){r=r.parentNode;break}r=o}return i+=1,this.getElementOffset(r)+i},e.getTotalOffset=function(){return this.totalOffset<0&&(this.totalOffset=this.getNodeOffset(this.root,0,!0)),this.totalOffset},e.getNodeByOffset=function(t){for(var e,n=this,i=this.root,r=function(){if((e=n.getElementOffset(i))>=t)return{v:i};var r=i.children;if(!r)return"break";var o=ct(r.length,(function(e){return n.getElementOffset(r[e])>t}));if(0==o)return"break";i=r[o-1]};;){var o=r();if("break"===o)break;if("object"==typeof o)return o.v}for(var a=e+1,s=i,u=s.firstChild||s.nextSibling,l=null;;){if(u){if(1==u.nodeType)break;if(l=s=u,(a+=u.textContent.length)>t&&!/^\s*$/.test(u.textContent))break}else if(!(s=s.parentNode))break;u=s.nextSibling}return u&&l&&/^\s*$/.test(l.textContent)&&(l=u),l||i},e.buildIdMap=function(t){var e=t.getAttribute("id");e&&!this.idMap[e]&&(this.idMap[e]=t);var n=t.getAttributeNS(G.XML,"id");n&&!this.idMap[n]&&(this.idMap[n]=t);for(var i=t.firstElementChild;i;i=i.nextElementSibling)this.buildIdMap(i)},e.getElement=function(t){var e=t.match(/([^#]*)#(.+)$/);if(!e||e[1]&&e[1]!=this.url)return null;var n=e[2],i=this.document.getElementById(n);return!i&&this.document.getElementsByName&&(i=this.document.getElementsByName(n)[0]),i||(this.idMap||(this.idMap={},this.buildIdMap(this.document.documentElement)),i=this.idMap[n]),i},t}();function Fc(t,e,n){var i,r=n||new DOMParser;try{i=r.parseFromString(t,e)}catch(t){}if(!i)return null;var o=i.documentElement,a="parsererror";if(o.localName===a)return null;for(var s=o.firstElementChild;s;s=s.nextElementSibling)if(s.localName===a)return null;return i}function Pc(t,e){var n=t.responseXML;if(!n){var i=new DOMParser,r=t.responseText;if(r){var o=function(t){var e=t.contentType;if(e){for(var n=Object.keys(Sc),i=0;i<n.length;i++)if(Sc[n[i]]===e)return e;if(e.match(/\+xml$/))return Sc.APPLICATION_XML}var r=t.url.match(/\.([^./]+)$/);if(r)switch(r[1]){case"html":case"htm":return Sc.TEXT_HTML;case"xhtml":case"xht":return Sc.APPLICATION_XHTML_XML;case"svg":case"svgz":return Sc.IMAGE_SVG_XML;case"opf":case"xml":return Sc.APPLICATION_XML}return null}(t);if((n=Fc(r,o||Sc.APPLICATION_XML,i))&&!o){var a=n.documentElement;"html"!==a.localName.toLowerCase()||a.namespaceURI?"svg"===a.localName.toLowerCase()&&n.contentType!==Sc.IMAGE_SVG_XML&&(n=Fc(r,Sc.IMAGE_SVG_XML,i)):n=Fc(r,Sc.TEXT_HTML,i)}n||(n=Fc(r,Sc.TEXT_HTML,i))}}return Ri(n?new Ic(e,t.url,n):null)}!function(t){t.TEXT_HTML="text/html",t.TEXT_XML="text/xml",t.APPLICATION_XML="application/xml",t.APPLICATION_XHTML_XML="application/xhtml+xml",t.IMAGE_SVG_XML="image/svg+xml"}(Sc||(Sc={}));var Rc=new(function(){function t(t){this.fn=void 0,this.fn=t}var e=t.prototype;return e.check=function(t){return this.fn(t)},e.withAttribute=function(e,n){var i=this;return new t((function(t){return i.check(t)&&1==t.nodeType&&t.getAttribute(e)==n}))},e.withChild=function(e,n){var i=this;return new t((function(t){if(!i.check(t))return!1;var r=new Lc([t]);return r=r.child(e),n&&(r=r.predicate(n)),r.size()>0}))},t}())((function(t){return!0})),Lc=function(){function t(t){this.nodes=void 0,this.nodes=t}var e=t.prototype;return e.asArray=function(){return this.nodes},e.size=function(){return this.nodes.length},e.predicate=function(e){for(var n,i=[],r=B(this.nodes);!(n=r()).done;){var o=n.value;e.check(o)&&i.push(o)}return new t(i)},e.forEachNode=function(e){for(var n=[],i=function(t){n.push(t)},r=0;r<this.nodes.length;r++)e(this.nodes[r],i);return new t(n)},e.forEach=function(t){for(var e=[],n=0;n<this.nodes.length;n++)e.push(t(this.nodes[n]));return e},e.forEachNonNull=function(t){for(var e=[],n=0;n<this.nodes.length;n++){var i=t(this.nodes[n]);null!=i&&e.push(i)}return e},e.child=function(t){return this.forEachNode((function(e,n){for(var i=e.firstChild;i;i=i.nextSibling)1==i.nodeType&&i.localName==t&&n(i)}))},e.childElements=function(){return this.forEachNode((function(t,e){for(var n=t.firstChild;n;n=n.nextSibling)1==n.nodeType&&e(n)}))},e.attribute=function(t){return this.forEachNonNull((function(e){return 1==e.nodeType?e.getAttribute(t):null}))},e.textContent=function(){return this.forEach((function(t){return t.textContent}))},t}(),Oc=new zi((function(){var t=Pi("uaStylesheetBase"),e=Zl(),n=j("user-agent-base.css",X),i=new Ya(null,null,null,null,null,e,!0);return i.startStylesheet(tr.USER_AGENT),Ka=i.cascade,xr($i,i,n,null,null).thenFinish(t),t.result()}),"uaStylesheetBaseFetcher"),kc=function(){function t(t,e,n,i,r,o,a,s,u,l){this.store=void 0,this.rootScope=void 0,this.pageScope=void 0,this.cascade=void 0,this.rootBox=void 0,this.fontFaces=void 0,this.footnoteProps=void 0,this.flowProps=void 0,this.viewportProps=void 0,this.pageProps=void 0,this.fontDeobfuscator=void 0,this.validatorSet=void 0,this.store=t,this.rootScope=e,this.pageScope=n,this.cascade=i,this.rootBox=r,this.fontFaces=o,this.footnoteProps=a,this.flowProps=s,this.viewportProps=u,this.pageProps=l,this.fontDeobfuscator=t.fontDeobfuscator,this.validatorSet=t.validatorSet,this.pageScope.defineBuiltIn("has-content",(function(t){var e=this,n=e.currentLayoutPosition,i=n.firstFlowChunkOfFlow(t=t);return e.matchPageSide(n.startSideOfFlow(t))&&n.hasContent(t,e.lookupOffset)&&!!i&&!e.flowChunkIsAfterParentFlowForcedBreak(i)})),this.pageScope.defineName("page-number",new Ce(this.pageScope,(function(){return this.pageNumberOffset+this.currentLayoutPosition.page}),"page-number")),this.pageScope.defineName("blank-page",new Ce(this.pageScope,(function(){var t=this.currentLayoutPosition;return null==t?void 0:t.isBlankPage}),"blank-page"))}return t.prototype.sizeViewport=function(t,e,n,i){if(this.viewportProps.length){var r=new Gt(this.rootScope,t,e,n),o=function(t,e){for(var n={},i=0;i<e.length;i++)jo(t,n,e[i],0,null,null,null);return n}(r,this.viewportProps),a=o.width,s=o.height,u=o["text-zoom"],l=1;if(a&&s||u){var h=Ht.em;if((u?u.evaluate(r,"text-zoom"):null)===en.scale&&(l=h/n,n=h,t*=l,e*=l),a&&s){var c=Je(a.evaluate(r,"width"),r),d=Je(s.evaluate(r,"height"),r);if(c>0&&d>0)return{width:i&&i.spreadView?2*(c+i.pageBorder):c,height:d,fontSize:n}}}}return{width:t,height:e,fontSize:n}},t}(),Bc=function(t){function n(e,n,i,r,o,a,s,u,l,h,c,d,f){var p;for(var g in(p=t.call(this,e.rootScope,r.width,r.height,r.fontSize)||this).style=void 0,p.xmldoc=void 0,p.viewport=void 0,p.clientLayout=void 0,p.fontMapper=void 0,p.customRenderer=void 0,p.fallbackMap=void 0,p.pageNumberOffset=void 0,p.documentURLTransformer=void 0,p.counterStore=void 0,p.lang=void 0,p.primaryFlows={body:!0},p.rootPageBoxInstance=null,p.styler=null,p.stylerMap=null,p.currentLayoutPosition=null,p.layoutPositionAtPageStart=null,p.lookupOffset=0,p.faces=void 0,p.pageBoxInstances={},p.pageManager=null,p.rootPageFloatLayoutContext=void 0,p.pageBreaks={},p.pageProgression=null,p.isVersoFirstPage=!1,p.blankPageAtStart=!1,p.pageSheetSize={},p.pageSheetHeight=0,p.pageSheetWidth=0,p.style=e,p.xmldoc=n,p.viewport=r,p.clientLayout=o,p.fontMapper=a,p.customRenderer=s,p.fallbackMap=u,p.pageNumberOffset=l,p.documentURLTransformer=h,p.counterStore=c,p.lang=n.lang||i,p.faces=new rh(p.style.fontDeobfuscator),p.rootPageFloatLayoutContext=new Ss(null,null,null,null,null,null,null),p.pageProgression=d||null,p.isVersoFirstPage=!!f,e.flowProps){var v=Uo(e.flowProps[g],"flow-consume");v&&(v.evaluate(O(p),"flow-consume")==en.all?p.primaryFlows[g]=!0:delete p.primaryFlows[g])}return p}x(n,t);var i=n.prototype;return i.init=function(){var t=this,e=Pi("StyleInstance.init"),n=this.counterStore.createCounterListener(this.xmldoc.url),i=this.counterStore.createCounterResolver(this.xmldoc.url,this.style.rootScope,this.style.pageScope);this.styler=new Tl(this.xmldoc,this.style.cascade,this.style.rootScope,this,this.primaryFlows,this.style.validatorSet,n,i),i.setStyler(this.styler),this.styler.resetFlowChunkStream(this),this.stylerMap={},this.stylerMap[this.xmldoc.url]=this.styler;var r=this.styler.getTopContainerStyle();this.pageProgression||(this.pageProgression=Lh(r)),this.matchStartPageSide(this.styler.breakBeforeValues[0])||(0===this.pageNumberOffset?this.isVersoFirstPage=!0:this.blankPageAtStart=!0),this.rootPageBoxInstance=new Sh(this.style.rootBox);var o=this.style.cascade.createInstance(this,n,i,this.lang);this.styler.cascade.currentPageType=this.styler.cascade.firstPageType,this.rootPageBoxInstance.applyCascadeAndInit(o,r),this.rootPageBoxInstance.resolveAutoSizing(this),this.pageManager=new ac(o,this.style.pageScope,this.rootPageBoxInstance,this,r);for(var a,s=[],u=B(this.style.fontFaces);!(a=u()).done;){var l=a.value;if(!l.condition||l.condition.evaluate(this)){var h=nh(l.properties,this),c=new ih(h);s.push(c)}}this.fontMapper.findOrLoadFonts(s,this.faces).thenFinish(e);var d=this.style.pageProps;return Object.keys(d).forEach((function(e){var n=zh(Hh(d[e]),t);t.pageSheetSize[e]={width:n.pageWidth+2*n.cropOffset,height:n.pageHeight+2*n.cropOffset}})),e.result()},i.matchStartPageSide=function(t){var n=this.pageNumberOffset%2==(this.isVersoFirstPage?1:0),i=this.pageProgression==e.PageProgression.LTR;switch(t){case"left":return n!==i;case"right":return n===i;case"recto":return n;case"verso":return!n;default:return!0}},i.getStylerForDoc=function(t){var e=this.stylerMap[t.url];if(!e){var n=this.style.store.getStyleForDoc(t),i=new Gt(n.rootScope,this.pageWidth(),this.pageHeight(),this.initialFontSize),r=this.counterStore.createCounterListener(t.url),o=this.counterStore.createCounterResolver(t.url,n.rootScope,n.pageScope);e=new Tl(t,n.cascade,n.rootScope,i,this.primaryFlows,n.validatorSet,r,o),this.stylerMap[t.url]=e}return e},i.registerInstance=function(t,e){this.pageBoxInstances[t]=e},i.lookupInstance=function(t){return this.pageBoxInstances[t]},i.encounteredFlowChunk=function(t,e){var n=this.currentLayoutPosition;if(n){n.flows[t.flowName]?e=n.flows[t.flowName]:n.flows[t.flowName]=e;var i=n.flowPositions[t.flowName];i||(i=new mo,n.flowPositions[t.flowName]=i);var r=new go({steps:[{node:t.element,shadowType:lo.NONE,shadowContext:null,nodeShadow:null,shadowSibling:null,formattingContext:null,fragmentIndex:0}],offsetInNode:0,after:!1,preprocessedTextContent:null}),o=new vo(r,t);i.positions.push(o)}},i.evalSupportsTest=function(t,e,n){if(n)return!1;if(!t)return!1;var i=!0,r=new(function(){function t(){}var e=t.prototype;return e.unknownProperty=function(t,e){i=!1},e.invalidPropertyValue=function(t,e){i=!1},e.simpleProperty=function(t,e,n){},t}()),o=Fr(this.style.rootScope,new Ti(e,null),"");return!!o&&(this.xmldoc.store.validatorSet.validatePropertyAndHandleShorthand(t,o,!1,r),i)},i.getConsumedOffset=function(t){for(var e=Number.POSITIVE_INFINITY,n=0;n<t.positions.length;n++){for(var i=t.positions[n].chunkPosition.primary,r=i.steps[0].node,o=i.offsetInNode,a=i.after,s=0;r.ownerDocument!=this.xmldoc.document;)s++,r=i.steps[s].node,a=!1,o=0;var u=this.xmldoc.getNodeOffset(r,o,a);u<e&&(e=u)}return e},i.getPosition=function(t,e){if(!t)return 0;var n=Number.POSITIVE_INFINITY;for(var i in this.primaryFlows){var r=t.flowPositions[i];if(e||r&&0!=r.positions.length||!this.currentLayoutPosition||(this.styler.styleUntilFlowIsReached(i),r=this.currentLayoutPosition.flowPositions[i],t!=this.currentLayoutPosition&&r&&(r=r.clone(),t.flowPositions[i]=r)),r){var o=this.getConsumedOffset(r);o<n&&(n=o)}}return n},i.dumpLocation=function(t){for(var e in c.debug("Location - page",this.currentLayoutPosition.page),c.debug(" current:",t),c.debug(" lookup:",this.lookupOffset),this.currentLayoutPosition.flowPositions)for(var n,i=B(this.currentLayoutPosition.flowPositions[e].positions);!(n=i()).done;)c.debug(" Chunk",e+":",n.value.flowChunk.startOffset)},i.matchPageSide=function(t){switch(t){case"left":case"right":case"recto":case"verso":return new me(this.style.pageScope,t+"-page").evaluate(this);default:return!0}},i.updateStartSide=function(t){for(var e in t.flowPositions){var n=t.flowPositions[e];if(n&&n.positions.length>0){var i=n.positions[0].flowChunk;if(this.getConsumedOffset(n)===i.startOffset){var r=n.positions[0].flowChunk.breakBefore,o=Vs(n.startSide);n.startSide=Us(Ms(o,r))}}}},i.selectPageMaster=function(t){var e=this.currentLayoutPosition,n=this.getPosition(e);if(n==Number.POSITIVE_INFINITY)return null;for(var i,r=this.rootPageBoxInstance.children,o=0;o<r.length;o++)if("vivliostyle-page-rule-master"!==(i=r[o]).pageBox.pseudoName){var a=1,s=i.getProp(this,"utilization");s&&s.isNum()&&(a=s.num);var u=this.queryUnitSize("em",!1),l=this.pageWidth()*this.pageHeight(),h=Math.ceil(a*l/(u*u));this.lookupOffset=this.styler.styleUntil(n,h),this.updateStartSide(e),this.layoutPositionAtPageStart=e.clone(),this.initLingering(),this.clearScope(this.style.pageScope);var c=i.getProp(this,"enabled");if(!c||c===en._true){if(1===e.page&&this.blankPageAtStart){i.style={};var d=t.size;t={},d&&(t.size=d)}return this.pageManager.getPageRulePageMaster(i,t)}}throw new Error("No enabled page masters")},i.flowChunkIsAfterParentFlowForcedBreak=function(t){var e=this.layoutPositionAtPageStart.flows,n=e[t.flowName].parentFlowName;if(n){var i=t.startOffset,r=e[n].forcedBreakOffsets;if(!r.length||i<r[0])return!1;var o=ct(r.length,(function(t){return r[t]>i}))-1,a=r[o],s=this.layoutPositionAtPageStart.flowPositions[n],u=this.getConsumedOffset(s);return!(a<u)&&(u<a||!this.matchPageSide(s.startSide))}return!1},i.setFormattingContextToColumn=function(t,e){var n=this.currentLayoutPosition.flows[e];n.formattingContext||(n.formattingContext=new iu(null)),t.flowRootFormattingContext=n.formattingContext},i.layoutDeferredPageFloats=function(t){var e=t.pageFloatLayoutContext,n=e.getDeferredPageFloatContinuations();if(n.length&&"page"===n[0].float.floatReference){var i=n[0].float.nodePosition.steps[0].node,r=i&&this.xmldoc.getNodeOffset(i,0,!1),o=this.layoutPositionAtPageStart.flowPositions.body,a=o&&this.getConsumedOffset(o);if(null!=r&&null!=a&&r>a)return Ri(!0)}var s=Pi("layoutDeferredPageFloats"),u=!1,l=0;return s.loopWithFrame((function(i){if(l!==n.length){var r=n[l++],o=r.float,a=(new Ts).findByFloat(o),s=a.findPageFloatFragment(o,e);if(!s||!s.hasFloat(o))return e.isForbidden(o)||e.hasPrecedingFloatsDeferredToNext(o)?(e.deferPageFloat(r),void i.breakLoop()):void t.layoutPageFloatInner(r,a,null,s).then((function(t){if(t){var n=e.parent.isInvalidated();n?i.breakLoop():(e.isInvalidated()&&!n&&(u=!0,e.validate()),i.continueLoop())}else i.breakLoop()}));i.continueLoop()}else i.breakLoop()})).then((function(){u&&e.invalidate(),s.finish(!0)})),s.result()},i.getLastAfterPositionIfDeferredFloatsExists=function(t,e){var n;return t.pageFloatLayoutContext.getPageFloatContinuationsDeferredToNext().length>0&&t.lastAfterPosition?(e?(n=e.clone()).primary=t.lastAfterPosition:n=new go(t.lastAfterPosition),n):null},i.layoutColumn=function(t,e){var n=this,i=this.currentLayoutPosition.flowPositions[e];if(!i||!this.matchPageSide(i.startSide))return Ri(!0);i.startSide="any",this.setFormattingContextToColumn(t,e),t.init(),this.primaryFlows[e]&&t.bands.length>0&&(t.forceNonfitting=!1);var r=Pi("layoutColumn");return this.layoutDeferredPageFloats(t).then((function(){if(t.pageFloatLayoutContext.isInvalidated())r.finish(!0);else{var o=[],a=[],s=!0;r.loopWithFrame((function(r){if(t.pageFloatLayoutContext.hasContinuingFloatFragmentsInFlow(e))r.breakLoop();else{for(var u=function(){for(var e=0;a.includes(e);)e++;var u=i.positions[e];if(u.flowChunk.startOffset>n.lookupOffset||n.flowChunkIsAfterParentFlowForcedBreak(u.flowChunk))return"break";for(var l=e+1;l<i.positions.length;l++)if(!a.includes(l)){var h=i.positions[l];if(h.flowChunk.startOffset>n.lookupOffset||n.flowChunkIsAfterParentFlowForcedBreak(h.flowChunk))break;h.flowChunk.isBetter(u.flowChunk)&&(u=h,e=l)}var c=u.flowChunk,d=!0;return t.layout(u.chunkPosition,s,i.breakAfter).then((function(l){if(t.pageFloatLayoutContext.isInvalidated())r.breakLoop();else{if(s=!1,u.flowChunk.repeated&&(null===l||c.exclusive)&&o.push(e),c.exclusive)return a.push(e),void r.breakLoop();var h=!!l||!!t.pageBreakType,f=n.getLastAfterPositionIfDeferredFloatsExists(t,l);t.pageBreakType&&f?(u.chunkPosition=f,i.breakAfter=t.pageBreakType,t.pageBreakType=null):(a.push(e),(l||f)&&(u.chunkPosition=l||f,o.push(e)),t.pageBreakType&&(i.startSide=Us(t.pageBreakType))),h?r.breakLoop():(t.forceNonfitting=!1,d?d=!1:r.continueLoop())}})),d?(d=!1,{v:void 0}):void 0};i.positions.length-a.length>0;){var l=u();if("break"===l)break;if("object"==typeof l)return l.v}r.breakLoop()}})).then((function(){if(!t.pageFloatLayoutContext.isInvalidated()){i.positions=i.positions.filter((function(t,e){return o.includes(e)||!a.includes(e)})),"column"===i.breakAfter&&(i.breakAfter=null),t.saveDistanceToBlockEndFloats();var e=t.pageFloatLayoutContext.getMaxReachedAfterEdge();t.updateMaxReachedAfterEdge(e)}r.finish(!0)}))}})),r.result()},i.createLayoutConstraint=function(t){var e=this.counterStore.createLayoutConstraint(this.currentLayoutPosition.page-1);return new Nu([e].concat(t.getLayoutConstraints()))},i.createAndLayoutColumn=function(t,e,n,i,r,o,a,s,u,l,h,c,d,f){var p,g=this,v=t.vertical?t.isAutoWidth&&t.isRightDependentOnAutoWidth:t.isAutoHeight&&t.isTopDependentOnAutoHeight,m=r.element,E=new Ss(s,Cs.COLUMN,null,a,null,null,null),C=this.currentLayoutPosition.clone(),D=Pi("createAndLayoutColumn");return D.loopWithFrame((function(t){var D=g.createLayoutConstraint(E);if(u>1){var w=g.viewport.document.createElement("div");if(tt(w,"position","absolute"),m.appendChild(w),(p=new Au(w,d,g.clientLayout,D,E)).forceNonfitting=f,p.vertical=r.vertical,p.snapHeight=r.snapHeight,p.snapWidth=r.snapWidth,r.vertical){var y=o*(h+l)+r.paddingTop,N=parseFloat(m.style.width);p.setHorizontalPosition(r.paddingLeft+N-r.width,r.width),p.setVerticalPosition(y,h)}else{var b=o*(h+l)+r.paddingLeft;p.setVerticalPosition(r.paddingTop,r.height),p.setHorizontalPosition(b,h)}p.originX=e,p.originY=n}else(p=new Au(m,d,g.clientLayout,D,E)).copyFrom(r);p.exclusions=v?[]:i.concat(),p.innerShape=c,E.setContainer(p),p.width>=0?g.layoutColumn(p,a).then((function(){E.isInvalidated()||E.finish(),p.pageFloatLayoutContext.isInvalidated()&&!s.isInvalidated()?(p.pageFloatLayoutContext.validate(),g.currentLayoutPosition=C.clone(),p.element!==m&&m.removeChild(p.element),t.continueLoop()):t.breakLoop()})):(E.finish(),t.breakLoop())})).then((function(){D.finish(p)})),D.result()},i.setPagePageFloatLayoutContextContainer=function(t,e,n){(e instanceof rc||e instanceof Ah&&!(e instanceof tc))&&t.setContainer(n)},i.getRegionPageFloatLayoutContext=function(t,e,n,i){var r=e.getProp(this,"writing-mode")||null,o=e.getProp(this,"direction")||null;return new Ss(t,Cs.REGION,n,i,null,r,o)},i.layoutFlowColumnsWithBalancing=function(t,e,n,i,r,o,a,s,u){var l=this,h=this.currentLayoutPosition.clone(),c=this.getRegionPageFloatLayoutContext(o,e,a,s),d=!0,f=function(){return l.currentLayoutPosition=h.clone(),l.layoutFlowColumns(t,e,n,i,r,o,c,a,s,u,d).thenAsync((function(t){return Ri(t?{columns:t,position:l.currentLayoutPosition}:null)}))};return f().thenAsync((function(t){if(!t)return Ri(null);if(u<=1)return Ri(t.columns);var n=e.getProp(l,"column-fill")||en.balance,i=function(t,e,n,i,r,o,a){if(e===en.auto)return null;var s=o[o.length-1];return 0===a.positions.length||s&&s.pageBreakType?new Cl(n,i,r,t):e===en.balance_all?new yl(n,i,r):null}(u,n,f,c,a,t.columns,l.currentLayoutPosition.flowPositions[s]);return i?(d=!1,o.lock(),c.lock(),i.balanceColumns(t).thenAsync((function(t){return o.unlock(),o.validate(),c.unlock(),l.currentLayoutPosition=t.position,Ri(t.columns)}))):Ri(t.columns)}))},i.layoutFlowColumns=function(t,e,n,i,r,o,a,s,u,l,h){var c=this,d=Pi("layoutFlowColumns"),f=this.currentLayoutPosition.clone(),p=e.getPropAsNumber(this,"column-gap"),g=l>1?e.getPropAsNumber(this,"column-width"):s.width,v=e.getActiveRegions(this),m=kn(e.getProp(this,"shape-inside"),0,0,s.width,s.height,this),E=new bc(u,this,this.viewport,this.styler,v,this.xmldoc,this.faces,this.style.footnoteProps,this,t,this.customRenderer,this.fallbackMap,this.documentURLTransformer),C=0,D=null,w=[];return d.loopWithFrame((function(t){c.createAndLayoutColumn(e,n,i,r,s,C++,u,a,l,p,g,m,E,h).then((function(e){return o.isInvalidated()?(w=null,void t.breakLoop()):(!(e.pageBreakType&&"column"!==e.pageBreakType)&&C!==l||a.isInvalidated()||a.finish(),a.isInvalidated()?(C=0,c.currentLayoutPosition=f.clone(),a.validate(),void(a.isLocked()?(w=null,t.breakLoop()):t.continueLoop())):(w[C-1]=D=e,D.pageBreakType&&"column"!=D.pageBreakType&&(C=l,"region"!=D.pageBreakType&&(c.pageBreaks[u]=!0)),void(C<l?t.continueLoop():t.breakLoop())))}))})).then((function(){d.finish(w)})),d.result()},i.layoutContainer=function(t,e,n,i,r,o,a){var s=this;e.reset();var u=e.getProp(this,"enabled");if(u&&u!==en._true)return Ri(!0);var l=Pi("layoutContainer"),h=e.getProp(this,"wrap-flow")===en.auto,c=e.getProp(this,"flow-from"),d=this.viewport.document.createElement("div"),f=e.getProp(this,"position");tt(d,"position",f?f.name:"absolute");var p=e instanceof tc;e instanceof xh?n.appendChild(d):n.insertBefore(d,n.firstChild);var g,v=new Co(d);v.vertical=e.vertical,v.exclusions=o,e.prepareContainer(this,v,t,this.faces,this.clientLayout),v.originX=i,v.originY=r,i+=v.left+v.marginLeft+v.borderLeft,r+=v.top+v.marginTop+v.borderTop,this.setPagePageFloatLayoutContextContainer(a,e,v);var m=!1;if(c&&c.isIdent())if(this.pageBreaks[c.toString()])a.isInvalidated()||e.finishContainer(this,v,t,null,1,this.clientLayout,this.faces),g=Ri(!0);else{var E=Pi("layoutContainer.inner"),C=c.toString(),D=e.getPropAsNumber(this,"column-count");this.layoutFlowColumnsWithBalancing(t,e,i,r,o,a,v,C,D).then((function(n){if(!a.isInvalidated()){var i=n[0];i.element===d&&(v=i),v.computedBlockSize=Math.max.apply(null,n.map((function(t){return t.computedBlockSize}))),e.finishContainer(s,v,t,i,D,s.clientLayout,s.faces);var r=s.currentLayoutPosition.flowPositions[C];r&&"region"===r.breakAfter&&(r.breakAfter=null)}E.finish(!0)})),g=E.result()}else{var w=e.getProp(this,"content");if(w&&wo(w)){var y="span";w.url&&(y="img");var N=this.viewport.document.createElement(y);w.visit(new Do(N,this,w,this.counterStore.getExprContentListener())),d.appendChild(N),"img"==y&&e.transferSinglUriContentProps(this,N,this.faces),e.transferContentProps(this,v,t,this.faces)}else e.suppressEmptyBoxGeneration&&(n.removeChild(d),m=!0);m||e.finishContainer(this,v,t,null,1,this.clientLayout,this.faces),g=Ri(!0)}return g.then((function(){if(a.isInvalidated())l.finish(!0);else{if(!e.isAutoHeight||Math.floor(v.computedBlockSize)>0){if(!m&&!h){var u=e.getProp(s,"shape-outside"),c=v.getOuterShape(u,s);o.push(c)}}else if(0==e.children.length)return n.removeChild(d),void l.finish(!0);var f=p?0:e.children.length-1;l.loop((function(){for(;f>=0&&f<e.children.length;){var n=e.children[p?f++:f--],u=s.layoutContainer(t,n,d,i,r,o,a);if(u.isPending())return u.thenAsync((function(){return Ri(!a.isInvalidated())}));if(a.isInvalidated())break}return Ri(!1)})).then((function(){l.finish(!0)}))}})),l.result()},i.processLinger=function(){var t=this.currentLayoutPosition.page;for(var e in this.currentLayoutPosition.flowPositions)for(var n=this.currentLayoutPosition.flowPositions[e],i=n.positions.length-1;i>=0;i--){var r=n.positions[i];r.flowChunk.startPage>=0&&r.flowChunk.startPage+r.flowChunk.linger-1<=t&&n.positions.splice(i,1)}},i.initLingering=function(){var t=this.currentLayoutPosition.page;for(var e in this.currentLayoutPosition.flowPositions)for(var n=this.currentLayoutPosition.flowPositions[e],i=n.positions.length-1;i>=0;i--){var r=n.positions[i];r.flowChunk.startPage<0&&r.flowChunk.startOffset<this.lookupOffset&&(r.flowChunk.startPage=t)}},i.noMorePrimaryFlows=function(t){for(var e in this.primaryFlows){var n=t.flowPositions[e];if(n&&n.positions.length>0)return!1}return!0},i.layoutNextPage=function(t,n){var i,r,o=this,a=t.container===t.bleedBox;this.pageBreaks={},n?(this.currentLayoutPosition=n.clone(),this.styler.replayFlowElementsFromOffset(n.highestSeenOffset)):(this.currentLayoutPosition=new Eo,this.styler.replayFlowElementsFromOffset(-1)),this.lang&&t.bleedBox.setAttribute("lang",this.lang),(n=this.currentLayoutPosition).page++;var s=null==(i=n.flowPositions.body)?void 0:i.startSide;n.isBlankPage=s&&"any"!==s&&this.matchPageSide(s),t.isBlankPage=n.isBlankPage,this.clearScope(this.style.pageScope),this.layoutPositionAtPageStart=n.clone();var u=a?{}:this.pageManager.getCascadedPageStyle(null!=(r=t.isBlankPage?this.styler.cascade.previousPageType:this.styler.cascade.currentPageType)?r:""),l=this.selectPageMaster(u);if(!l)return Ri(null);var h=0;if(!a){t.setAutoPageWidth(l.pageBox.specified.width.value===rn),t.setAutoPageHeight(l.pageBox.specified.height.value===on),this.counterStore.setCurrentPage(t),this.counterStore.updatePageCounters(u,this);var c=zh(Hh(u),this);this.setPageSizeAndBleed(c,t),function(t,e,n,i){var r=!1,o=!1,a=t.marks;if(a){var s=a.value;s.isSpaceList()?s.values.forEach((function(t){t===en.crop?r=!0:t===en.cross&&(o=!0)})):s===en.crop?r=!0:s===en.cross&&(o=!0)}if(r||o){var u=n.container,l=u.ownerDocument,h=e.bleed,c=Je(_h,i),d=Je(Mh,i),f=Je(Uh,i);if(h){var p=t["background-color"];p&&p.value&&(n.bleedBox.style.backgroundColor=p.value.stringValue())}r&&Object.keys(Oh).forEach((function(t){var e=function(t,e,n,i,r,o){var a=i;a<=r+2*Ht.mm&&(a=r+i/2);var s=Math.max(i,a),u=r+s+n/2,l=Gh(t,u,u),h=[[0,r+i],[i,r+i],[i,r+i-a]],c=h.map((function(t){return[t[1],t[0]]}));e!==Oh.TOP_RIGHT&&e!==Oh.BOTTOM_RIGHT||(h=h.map((function(t){return[r+s-t[0],t[1]]})),c=c.map((function(t){return[r+s-t[0],t[1]]}))),e!==Oh.BOTTOM_LEFT&&e!==Oh.BOTTOM_RIGHT||(h=h.map((function(t){return[t[0],r+s-t[1]]})),c=c.map((function(t){return[t[0],r+s-t[1]]})));var d=Xh(t,n);d.setAttribute("points",h.map((function(t){return t.join(",")})).join(" ")),l.appendChild(d);var f=Xh(t,n);return f.setAttribute("points",c.map((function(t){return t.join(",")})).join(" ")),l.appendChild(f),e.split(" ").forEach((function(t){l.style[t]=o+"px"})),l}(l,Oh[t],c,f,h,d);u.appendChild(e)})),o&&Object.keys(kh).forEach((function(t){var e=function(t,e,n,i,r){var o,a,s=2*i;e===kh.TOP||e===kh.BOTTOM?(o=s,a=i):(o=i,a=s);var u=Gh(t,o,a),l=Xh(t,n);l.setAttribute("points","0,"+a/2+" "+o+","+a/2),u.appendChild(l);var h=Xh(t,n);h.setAttribute("points",o/2+",0 "+o/2+","+a),u.appendChild(h);var c,d=Xh(t,n,"circle");switch(d.setAttribute("cx",o/2),d.setAttribute("cy",a/2),d.setAttribute("r",i/4),u.appendChild(d),e){case kh.TOP:c=kh.BOTTOM;break;case kh.BOTTOM:c=kh.TOP;break;case kh.LEFT:c=kh.RIGHT;break;case kh.RIGHT:c=kh.LEFT}return Object.keys(kh).forEach((function(t){var n=kh[t];n===e?u.style[n]=r+"px":n!==c&&(u.style[n]="0",u.style["margin-"+n]="auto")})),u}(l,kh[t],c,f,d);u.appendChild(e)}))}}(u,c,t,this),h=c.bleedOffset+c.bleed}var d=!a&&l.getProp(this,"writing-mode")||en.horizontal_tb;this.pageVertical=d!=en.horizontal_tb;var f=l.getProp(this,"direction")||en.ltr,p=new Ss(this.rootPageFloatLayoutContext,Cs.PAGE,null,null,null,d,f),g=Pi("layoutNextPage");return g.loopWithFrame((function(e){o.layoutContainer(t,l,t.bleedBox,h,h,[],p).then((function(){p.isInvalidated()||p.finish(),p.isInvalidated()?(o.currentLayoutPosition=o.layoutPositionAtPageStart.clone(),p.validate(),e.continueLoop()):e.breakLoop()}))})).then((function(){if(l.adjustPageLayout(o,t,o.clientLayout),!a){var i=new me(l.pageBox.scope,"left-page");t.side=i.evaluate(o)?e.PageSide.LEFT:e.PageSide.RIGHT,o.processLinger(),n=o.currentLayoutPosition,Object.keys(n.flowPositions).forEach((function(t){var e=n.flowPositions[t],i=e.breakAfter;!i||"page"!==i&&o.matchPageSide(i)||(e.breakAfter=null)}))}o.currentLayoutPosition=o.layoutPositionAtPageStart=null,n.highestSeenOffset=o.styler.getReachedOffset();var r=o.style.store.getTriggersForDoc(o.xmldoc);t.finish(r,o.clientLayout),o.noMorePrimaryFlows(n)&&(n=null),g.finish(n)})),g.result()},i.setPageSizeAndBleed=function(t,e){this.actualPageWidth=t.pageWidth,this.actualPageHeight=t.pageHeight,this.pageSheetWidth=t.pageWidth+2*t.cropOffset,this.pageSheetHeight=t.pageHeight+2*t.cropOffset,e.container.style.width=this.pageSheetWidth+"px",e.container.style.height=this.pageSheetHeight+"px",e.bleedBox.style.left=t.bleedOffset+"px",e.bleedBox.style.right=t.bleedOffset+"px",e.bleedBox.style.top=t.bleedOffset+"px",e.bleedBox.style.bottom=t.bleedOffset+"px",e.bleedBox.style.padding=t.bleed+"px",e.bleedBox.style.paddingTop=t.bleed+.01+"px"},n}(Gt),_c=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e.rootScope,e,n,i,r,e.validatorSet,!i)||this).masterHandler=void 0,o.insideRegion=!1,o.masterHandler=e,o}x(e,t);var n=e.prototype;return n.startPageTemplateRule=function(){},n.startPageMasterRule=function(t,e,n){var i=new hh(this.masterHandler.pageScope,t,e,n,this.masterHandler.rootBox,this.condition,this.owner.getBaseSpecificity());this.masterHandler.pushHandler(new Rh(i.scope,this.masterHandler,i,this.validatorSet))},n.startWhenRule=function(t){var n=t.expr;null!=this.condition&&(n=Ae(this.scope,this.condition,n)),this.masterHandler.pushHandler(new e(this.masterHandler,n,this,this.regionId))},n.startDefineRule=function(){this.masterHandler.pushHandler(new Za(this.scope,this.owner))},n.startFontFaceRule=function(){var t={};this.masterHandler.fontFaces.push({properties:t,condition:this.condition}),this.masterHandler.pushHandler(new Ja(this.scope,this.owner,null,t,this.masterHandler.validatorSet))},n.startFlowRule=function(t){var e=this.masterHandler.flowProps[t];e||(this.masterHandler.flowProps[t]=e={}),this.masterHandler.pushHandler(new Ja(this.scope,this.owner,null,e,this.masterHandler.validatorSet))},n.startViewportRule=function(){var t={};this.masterHandler.viewportProps.push(t),this.masterHandler.pushHandler(new Ja(this.scope,this.owner,this.condition,t,this.masterHandler.validatorSet))},n.startFootnoteRule=function(t){var e=this.masterHandler.footnoteProps;if(t){var n=zo(e,"_pseudos");(e=n[t])||(n[t]=e={})}this.masterHandler.pushHandler(new Ja(this.scope,this.owner,null,e,this.masterHandler.validatorSet))},n.startRegionRule=function(){this.insideRegion=!0,this.startSelectorRule()},n.startPageRule=function(){var t=new vc(this.masterHandler.pageScope,this.masterHandler,this,this.validatorSet,this.masterHandler.pageProps);this.masterHandler.pushHandler(t),t.startPageRule()},n.startRuleBody=function(){if(Ya.prototype.startRuleBody.call(this),this.insideRegion){this.insideRegion=!1;var t="R"+this.masterHandler.regionCount++;this.special("region-id",He(t)),this.endRule();var n=new e(this.masterHandler,this.condition,this,t);this.masterHandler.pushHandler(n),n.startRuleBody()}},e}(Ya);function Mc(t){var e=t.getAttribute("content");if(!e)return"";for(var n,i={};null!=(n=e.match(/^,?\s*([-A-Za-z_.][-A-Za-z_0-9.]*)\s*=\s*([-+A-Za-z_0-9.]*)\s*/));)e=e.substr(n[0].length),i[n[1]]=n[2];var r=i.width-0,o=i.height-0;return r&&o?"@-epubx-viewport{width:"+r+"px;height:"+o+"px;}":""}var Uc=function(t){function e(e){var n;return(n=t.call(this)||this).validatorSet=void 0,n.rootScope=void 0,n.pageScope=void 0,n.rootBox=void 0,n.cascadeParserHandler=void 0,n.regionCount=0,n.fontFaces=[],n.footnoteProps={},n.flowProps={},n.viewportProps=[],n.pageProps={},n.validatorSet=e,n.rootScope=new Ut(null),n.pageScope=new Ut(n.rootScope),n.rootBox=new uh(n.rootScope),n.cascadeParserHandler=new _c(O(n),null,null,null),n.slave=n.cascadeParserHandler,n}return x(e,t),e.prototype.error=function(t,e){c.warn("CSS parser:",t)},e}(ar);function Vc(t,e){return e.parseOPSResource(t)}var Hc=function(t){function n(e){var n;return(n=t.call(this,Vc,Wi.DOCUMENT)||this).fontDeobfuscator=void 0,n.styleByKey={},n.styleFetcherByKey={},n.styleByDocURL={},n.triggersByDocURL={},n.validatorSet=null,n.styleSheets=[],n.triggerSingleDocumentPreprocessing=!1,n.fontDeobfuscator=e,n}x(n,t);var i=n.prototype;return i.init=function(t,e){var n=this;this.setStyleSheets(t,e);var i=j("user-agent.xml",X),r=Pi("OPSDocStore.init");return this.validatorSet=Zl(),Oc.get().then((function(){n.load(i).then((function(){n.triggerSingleDocumentPreprocessing=!0,r.finish(!0)}))})),r.result()},i.getStyleForDoc=function(t){return this.styleByDocURL[t.url]},i.getTriggersForDoc=function(t){return this.triggersByDocURL[t.url]},i.setStyleSheets=function(t,e){this.clearStyleSheets(),t&&t.forEach(this.addAuthorStyleSheet,this),e&&e.forEach(this.addUserStyleSheet,this)},i.clearStyleSheets=function(){this.styleSheets.splice(0)},i.addAuthorStyleSheet=function(t){var e=t.url;e&&(e=j(K(e),H)),this.styleSheets.push({url:e,text:t.text,flavor:tr.AUTHOR,classes:null,media:null})},i.addUserStyleSheet=function(t){var e=t.url;e&&(e=j(K(e),H)),this.styleSheets.push({url:e,text:t.text,flavor:tr.USER,classes:null,media:null})},i.parseOPSResource=function(t){var n=this,i=Pi("OPSDocStore.load"),r=t.url,o=r.endsWith("?viv-toc-box");return Pc(t,this).then((function(t){if(t){if(n.triggerSingleDocumentPreprocessing)for(var a=v(e.HOOKS.PREPROCESS_SINGLE_DOCUMENT),s=0;s<a.length;s++)try{a[s](t.document)}catch(t){c.warn("Error during single document preprocessing:",t)}for(var u=[],l=t.document.getElementsByTagNameNS(G.epub,"trigger"),h=0;h<l.length;h++){var d=l[h],f=d.getAttributeNS(G.EV,"observer"),p=d.getAttributeNS(G.EV,"event"),g=d.getAttribute("action"),m=d.getAttribute("ref");f&&p&&g&&m&&u.push({observer:f,event:p,action:g,ref:m})}n.triggersByDocURL[r]=u;var E=[],C=j("user-agent-page.css",X);if(E.push({url:C,text:Qi,flavor:tr.USER_AGENT,classes:null,media:null}),!o){for(var D,w=B(t.document.querySelectorAll("style, link, meta"));!(D=w()).done;){var y=D.value,N=y.localName;if(y.namespaceURI==G.XHTML)if("style"==N){var b=y.getAttribute("class"),S=y.getAttribute("media"),A=y.getAttribute("title");E.push({url:r,text:y.textContent,flavor:tr.AUTHOR,classes:A?b:null,media:S})}else if("link"==N){var T=y.getAttribute("rel"),x=y.getAttribute("class"),I=y.getAttribute("media");if("stylesheet"==T||"alternate stylesheet"==T&&x){var F=y.getAttribute("href");F=j(F,r);var P=y.getAttribute("title");E.push({url:F,text:null,classes:P?x:null,media:I,flavor:tr.AUTHOR})}}else"meta"==N&&"viewport"==y.getAttribute("name")&&E.push({url:r,text:Mc(y),flavor:tr.AUTHOR,classes:null,media:null})}for(var R=0;R<n.styleSheets.length;R++)E.push(n.styleSheets[R])}for(var L="",O=0;O<E.length;O++)L+=E[O].url,L+="^",E[O].text&&(L+=E[O].text),L+="^";var k=n.styleByKey[L];if(k)return n.styleByDocURL[r]=k,void i.finish(t);var _=n.styleFetcherByKey[L];_||(_=new zi((function(){var t=Pi("fetchStylesheet"),e=0,i=new Uc(n.validatorSet);return t.loop((function(){if(e<E.length){var t=E[e++];return i.startStylesheet(t.flavor),null!==t.text?xr(t.text,i,t.url,t.classes,t.media).thenReturn(!0):Ir(t.url,i,t.classes,t.media)}return Ri(!1)})).then((function(){var e=i.cascadeParserHandler.finish();k=new kc(n,i.rootScope,i.pageScope,e,i.rootBox,i.fontFaces,i.footnoteProps,i.flowProps,i.viewportProps,i.pageProps),n.styleByKey[L]=k,delete n.styleFetcherByKey[L],t.finish(k)})),t.result()}),"FetchStylesheet "+r),n.styleFetcherByKey[L]=_,_.start()),_.get().then((function(e){n.styleByDocURL[r]=e,i.finish(t)}))}else i.finish(null)})),i.result()},n}(er);function zc(t){return String.fromCharCode(t>>>24&255,t>>>16&255,t>>>8&255,255&t)}function Gc(t){return(255&t.charCodeAt(0))<<24|(255&t.charCodeAt(1))<<16|(255&t.charCodeAt(2))<<8|255&t.charCodeAt(3)}function Xc(t){var e=new it;e.append(t);var n=55-t.length&63;for(e.append("€");n>0;)n--,e.append("\0");e.append("\0\0\0\0"),e.append(zc(8*t.length)),t=e.toString();for(var i,r=[1732584193,4023233417,2562383102,271733878,3285377520],o=[],a=0;a<t.length;a+=64){for(i=0;i<16;i++)o[i]=Gc(t.substr(a+4*i,4));for(;i<80;i++){var s=o[i-3]^o[i-8]^o[i-14]^o[i-16];o[i]=s<<1|s>>>31}var u=r[0],l=r[1],h=r[2],c=r[3],d=r[4],f=void 0;for(i=0;i<80;i++)f=i<20?1518500249+(l&h|~l&c):i<40?1859775393+(l^h^c):i<60?2400959708+(l&h|l&c|h&c):3395469782+(l^h^c),f+=(u<<5|u>>>27)+d+o[i],d=c,c=h,h=l<<30|l>>>2,l=u,u=f;r[0]=r[0]+u|0,r[1]=r[1]+l|0,r[2]=r[2]+h|0,r[3]=r[3]+c|0,r[4]=r[4]+d|0}return r}var Wc=function(){function t(t,e,n,i,r,o,a,s,u,l){this.store=void 0,this.url=void 0,this.lang=void 0,this.clientLayout=void 0,this.fontMapper=void 0,this.rendererFactory=void 0,this.fallbackMap=void 0,this.documentURLTransformer=void 0,this.counterStore=void 0,this.pref=void 0,this.page=null,this.instance=null,this.store=t,this.url=e,this.lang=n,this.clientLayout=i,this.fontMapper=r,this.rendererFactory=a,this.fallbackMap=s,this.documentURLTransformer=u,this.counterStore=l,this.pref=Pt(o),this.pref.spreadView=!1}var e=t.prototype;return e.setAutoHeight=function(t,e){if(0!=e--)for(var n=t.firstChild;n;n=n.nextSibling)if(1==n.nodeType){var i=n;"auto"!=et(i,"height","auto")&&(tt(i,"height","auto"),this.setAutoHeight(i,e)),"absolute"==et(i,"position","static")&&(tt(i,"position","relative"),this.setAutoHeight(i,e))}},e.makeCustomRenderer=function(t){var e=this.rendererFactory.makeCustomRenderer(t);return function(t,n,i){var r=i.behavior;if(r)switch(r.toString()){case"body-child":t.querySelector("[role=doc-toc], [role=directory], nav li a, .toc, #toc")||(i.display=en.none);break;case"toc-node-anchor":i.color=en.inherit,i["text-decoration"]=en.none;break;case"toc-node":i.display=en.block,i.margin=an,i.padding=an,i["padding-inline-start"]=new ze(1.25,"em");break;case"toc-node-first-child":i.display=en.inline_block,i.margin=new ze(.2,"em"),i["vertical-align"]=en.top,i.color=en.inherit,i["text-decoration"]=en.none}if(!r||"toc-node"!=r.toString()&&"toc-container"!=r.toString())return e(t,n,i);var o=t.firstChild;o&&1!==o.nodeType&&""===o.textContent.trim()&&t.replaceChild(t.ownerDocument.createComment(o.textContent),o);var a=n.getAttribute("data-adapt-class");if("toc-node"==a){var s=n.firstChild;"▸"!=s.textContent&&(s.textContent="▸",tt(s,"cursor","pointer"),s.addEventListener("click",jc,!1),s.setAttribute("role","button"),s.setAttribute("aria-expanded","false"),n.setAttribute("aria-expanded","false"),"0px"!==n.style.height&&(s.tabIndex=0))}var u=n.ownerDocument.createElement("div");if(u.setAttribute("data-adapt-process-children","true"),"toc-node"==r.toString()){var l=n.ownerDocument.createElement("div");if(l.textContent="▹",tt(l,"margin","0.2em 0 0 -1em"),tt(l,"margin-inline-start","-1em"),tt(l,"margin-inline-end","0"),tt(l,"display","inline-block"),tt(l,"width","1em"),tt(l,"text-align","center"),tt(l,"vertical-align","top"),tt(l,"cursor","default"),tt(l,"font-family","Menlo,sans-serif"),u.appendChild(l),tt(u,"overflow","hidden"),u.setAttribute("data-adapt-class","toc-node"),u.setAttribute("role","treeitem"),"toc-node"==a||"toc-container"==a){tt(u,"height","0px");var h=t.firstElementChild;h&&"a"===h.localName&&(h.tabIndex=-1)}else n.setAttribute("role","tree")}else"toc-node"==a&&(u.setAttribute("data-adapt-class","toc-container"),u.setAttribute("role","group"),u.setAttribute("aria-hidden","true"));return Ri(u)}},e.showTOC=function(t,e,n,i,r){var o=this;if(this.page)return Ri(this.page);var a=Pi("showTOC"),s=new $r(t,t);return this.page=s,this.store.load(this.url+"?viv-toc-box").then((function(i){for(var u,l=B(i.document.querySelectorAll("[role=doc-toc], [role=directory], nav, .toc, #toc"));!(u=l()).done;){var h=u.value;h.hasAttribute("hidden")&&h.removeAttribute("hidden")}var c=o.store.getStyleForDoc(i),d=c.sizeViewport(n,1e5,r);e=new xc(e.window,d.fontSize,e.root,d.width,d.height);var f=o.makeCustomRenderer(i),p=new Bc(c,i,o.lang,e,o.clientLayout,o.fontMapper,f,o.fallbackMap,0,o.documentURLTransformer,o.counterStore);o.instance=p,p.pref=o.pref,p.init().then((function(){p.layoutNextPage(s,null).then((function(){Array.from(s.container.querySelectorAll("[data-vivliostyle-toc-box]>*>*>*>*>*[style*='display: none']")).forEach((function(t){t.setAttribute("aria-hidden","true"),t.setAttribute("hidden","hidden")})),o.setAutoHeight(t,2),a.finish(s)}))}))})),a.result()},e.hideTOC=function(){this.page&&(this.page.container.style.visibility="hidden",this.page.container.setAttribute("aria-hidden","true"))},e.isTOCVisible=function(){return!!this.page&&"visible"===this.page.container.style.visibility},e.getTOC=function(){if(!this.page)return[];function t(t){if(!t)return[];var n=t.querySelectorAll(":scope > [role=treeitem] > a[href]");return Array.from(n).map(e)}function e(e){return{id:new URL(e.href).hash.match(/^#?(.*)$/)[1],title:e.innerText,children:t(e.parentElement.querySelector("[role=group]"))}}return t(this.page.container.querySelector("[role=tree]"))},t}();function jc(t){var e=t.target,n="▸"==e.textContent;e.textContent=n?"▾":"▸";var i=e.parentNode;e.setAttribute("aria-expanded",n?"true":"false"),i.setAttribute("aria-expanded",n?"true":"false");for(var r=i.firstChild;r;){if(1===r.nodeType){var o=r,a=o.getAttribute("data-adapt-class");if("toc-container"===a){if(o.setAttribute("aria-hidden",n?"false":"true"),o.firstChild){r=o.firstChild;continue}}else if("toc-node"===a&&(o.style.height=n?"auto":"0px",o.children.length>=2&&(o.children[1].tabIndex=n?0:-1),o.children.length>=3&&(o.children[0].tabIndex=n?0:-1,!n))){var s=o.children[0];if("▾"==s.textContent){s.textContent="▸",s.setAttribute("aria-expanded","false"),o.setAttribute("aria-expanded","false"),r=o.children[2];continue}}}for(;!r.nextSibling&&r.parentNode!==i;)r=r.parentNode;r=r.nextSibling}t.stopPropagation()}var Kc=function(t){function e(){var e;return(e=t.call(this,null)||this).plainXMLStore=void 0,e.jsonStore=void 0,e.opfByURL={},e.primaryOPFByEPubURL={},e.deobfuscators={},e.documents={},e.fontDeobfuscator=e.makeDeobfuscatorFactory(),e.plainXMLStore=new er(Pc,Wi.DOCUMENT),e.jsonStore=new er(nr,Wi.TEXT),e}x(e,t);var n=e.prototype;return n.makeDeobfuscatorFactory=function(){var t=this;return function(e){return t.deobfuscators[e]}},n.loadAsPlainXML=function(t,e,n){return this.plainXMLStore.load(t,e,n)},n.startLoadingAsPlainXML=function(t){this.plainXMLStore.fetch(t)},n.loadAsJSON=function(t,e,n){return this.jsonStore.load(t,e,n)},n.startLoadingAsJSON=function(t){this.jsonStore.fetch(t)},n.loadPubDoc=function(t,e){var n=this,i=Pi("loadPubDoc");return Zi(t,null,"HEAD").then((function(r){if(r.status>=400)n.loadEPUBDoc(t,e).then((function(e){e?i.finish(e):(c.error("Failed to fetch a source document from "+t+" ("+r.status+(r.statusText?" "+r.statusText:"")+")"),i.finish(null))}));else if(r.status||r.responseXML||r.responseText||r.responseBlob||r.contentType||/\/[^/.]+(?:[#?]|$)/.test(t)&&(t=t.replace(/([#?]|$)/,"/$1")),"application/oebps-package+xml"==r.contentType||/\.opf(?:[#?]|$)/.test(t)){var o=t.match(/^((?:.*\/)?)([^/]*)$/);n.loadOPF(o[1],o[2],e).thenFinish(i)}else"application/ld+json"==r.contentType||"application/webpub+json"==r.contentType||"application/audiobook+json"==r.contentType||"application/json"==r.contentType||/\.json(?:ld)?(?:[#?]|$)/.test(t)?n.loadAsJSON(t,!0).then((function(e){if(!e)return n.reportLoadError(t),void i.finish(null);var r=new id(n,t);r.initWithWebPubManifest(e,void 0,t).then((function(){i.finish(r)}))})):n.loadWebPub(t).then((function(r){r?i.finish(r):n.loadEPUBDoc(t,e).then((function(e){e?i.finish(e):(c.error("Failed to load "+t+"."),i.finish(null))}))}))})),i.result()},n.loadEPUBDoc=function(t,e){var n=this,i=Pi("loadEPUBDoc");return t.endsWith("/")||(t+="/"),e&&this.startLoadingAsJSON(t+"?r=list"),this.startLoadingAsPlainXML(t+"META-INF/encryption.xml"),this.loadAsPlainXML(t+"META-INF/container.xml").then((function(r){if(r)for(var o,a=B(r.doc().child("container").child("rootfiles").child("rootfile").attribute("full-path"));!(o=a()).done;){var s=o.value;if(s)return void n.loadOPF(t,s,e).thenFinish(i)}i.finish(null)})),i.result()},n.loadOPF=function(t,e,n){var i=this,r=t+e,o=this.opfByURL[r];if(o)return Ri(o);var a=Pi("loadOPF");return this.loadAsPlainXML(r,!0,"Failed to fetch EPUB OPF "+r).then((function(e){e?i.loadAsPlainXML(t+"META-INF/encryption.xml").then((function(s){(n?i.loadAsJSON(t+"?r=list"):Ri(null)).then((function(n){(o=new id(i,t)).initWithXMLDoc(e,s,n,t+"?r=manifest").then((function(){i.opfByURL[r]=o,i.primaryOPFByEPubURL[t]=o,a.finish(o)}))}))})):i.reportLoadError(r)})),a.result()},n.loadWebPub=function(t){var e=this,n=Pi("loadWebPub");return this.load(t).then((function(i){if(i)if(i.document.querySelector("a[href='META-INF/'],a[href$='/META-INF/']"))n.finish(null);else{var r=i.document,o=new id(e,t);r.body&&r.body.setAttribute("data-vivliostyle-primary-entry",!0);var a=r.querySelector("link[rel='publication'],link[rel='manifest'][type='application/webpub+json']");if(a){var s=a.getAttribute("href");if(/^#/.test(s)){var u=U(r.getElementById(s.substr(1)).textContent);o.initWithWebPubManifest(u,r).then((function(){n.finish(o)}))}else{var l=j(a.getAttribute("href"),t);e.loadAsJSON(l).then((function(t){o.initWithWebPubManifest(t,r,l).then((function(){n.finish(o)}))}))}}else o.initWithWebPubManifest({},r).then((function(){o.xhtmlToc&&o.xhtmlToc.src===i.url&&(r.querySelector("[role=doc-toc], [role=directory], nav, .toc, #toc")||(o.xhtmlToc=null)),n.finish(o)}))}else e.reportLoadError(t)})),n.result()},n.addDocument=function(t,e){var n=Pi("EPUBDocStore.load"),i=V(t);return(this.documents[i]=this.parseOPSResource({status:200,statusText:"",url:i,contentType:e.contentType,responseText:null,responseXML:e,responseBlob:null})).thenFinish(n),n.result()},n.reportLoadError=function(t){var e,n=this,i=function(t){return t.replace(/([^:/?#]|^)[/?#].*/,"$1")};t.startsWith("data:")?c.error("Failed to load "+t+". Invalid data."):t.startsWith("http:")&&H.startsWith("https:")?c.error("Failed to load "+t+'. Mixed Content ("http:" content on "https:" context) is not allowed.'):(e=i(t))===i(H)||Object.keys(n.resources).find((function(t){return n.resources[t]&&i(t)===e}))||/\.(xhtml|xht|xml|opf)$/i.test(t)?c.error("Failed to load "+t+". The target resource is invalid."):c.error("Failed to load "+t+". This may be caused by the server not allowing cross-origin resource sharing (CORS).")},n.load=function(e){var n=this,i=V(e),r=this.documents[i];if(r)return r.isPending()?r:Ri(r.get());var o=Pi("EPUBDocStore.load");return(r=t.prototype.load.call(this,i,!0,"Failed to fetch a source document from "+i)).then((function(t){t?o.finish(t):n.reportLoadError(i)})),o.result()},e}(Hc),Yc=function(){function t(){this.id=null,this.src="",this.mediaType=null,this.title=null,this.itemRefElement=null,this.spineIndex=-1,this.compressedSize=0,this.compressed=null,this.epage=0,this.epageCount=0,this.startPage=null,this.skipPagesBefore=null,this.itemProperties=void 0,this.itemProperties=M}var e=t.prototype;return e.initWithElement=function(t,e){this.id=t.getAttribute("id"),this.src=j(t.getAttribute("href"),e),this.mediaType=t.getAttribute("media-type");var n=t.getAttribute("properties");n&&(this.itemProperties=function(t){for(var e={},n=0;n<t.length;n++)e[t[n]]=!0;return e}(n.split(/\s+/)))},e.initWithParam=function(t){this.spineIndex=t.index,this.id="item"+(t.index+1),this.src=t.url,this.startPage=t.startPage,this.skipPagesBefore=t.skipPagesBefore},t}();function qc(t){return t.id}var Qc={dcterms:"http://purl.org/dc/terms/",marc:"http://id.loc.gov/vocabulary/",media:"http://www.idpf.org/epub/vocab/overlays/#",rendition:"http://www.idpf.org/vocab/rendition/#",onix:"http://www.editeur.org/ONIX/book/codelists/current.html#",xsd:"http://www.w3.org/2001/XMLSchema#",opf:"http://www.idpf.org/2007/opf"},$c="http://idpf.org/epub/vocab/package/meta/#",Zc={language:Qc.dcterms+"language",title:Qc.dcterms+"title",creator:Qc.dcterms+"creator",layout:Qc.rendition+"layout",titleType:$c+"title-type",displaySeq:$c+"display-seq",alternateScript:$c+"alternate-script",role:$c+"role"};function Jc(t,e){var n={};return function(i,r){var o,a,s,u,l,h=i.r||n,c=r.r||n;if(t==Zc.title&&(s="main"==(null==(u=h[Zc.titleType])?void 0:u[0].v))!=("main"==(null==(l=c[Zc.titleType])?void 0:l[0].v)))return s?-1:1;var d=parseInt(null==(o=h[Zc.displaySeq])?void 0:o[0].v,10);isNaN(d)&&(d=Number.MAX_VALUE);var f,p,g=parseInt(null==(a=c[Zc.displaySeq])?void 0:a[0].v,10);return isNaN(g)&&(g=Number.MAX_VALUE),d!=g?d-g:t!=Zc.language&&e&&(s=(null==(f=h[Zc.language]||h[Zc.alternateScript])?void 0:f[0].v)==e)!=((null==(p=c[Zc.language]||c[Zc.alternateScript])?void 0:p[0].v)==e)?s?-1:1:i.o-r.o}}function td(){var t=window.MathJax;return t?t.Hub:null}var ed,nd={"application/xhtml+xml":!0,"image/jpeg":!0,"image/png":!0,"image/svg+xml":!0,"image/gif":!0,"audio/mp3":!0},id=function(){function t(t,e){this.store=void 0,this.pubURL=void 0,this.opfXML=null,this.encXML=null,this.items=null,this.spine=null,this.itemMap=null,this.itemMapByPath=null,this.uid=null,this.bindings={},this.lang=null,this.epageCount=0,this.prePaginated=!1,this.epageIsRenderedPage=!0,this.epageCountCallback=null,this.metadata={},this.ncxToc=null,this.xhtmlToc=null,this.cover=null,this.fallbackMap={},this.pageProgression=null,this.documentURLTransformer=void 0,this.store=t,this.pubURL=e,this.documentURLTransformer=this.createDocumentURLTransformer(),td()&&(bo[G.MATHML]=!0)}var e=t.prototype;return e.createDocumentURLTransformer=function(){var t=this,e=function(){function e(){}var n=e.prototype;return n.transformFragment=function(t,e){return"viv-id-"+lt(e+(t?"#"+t:""),":")},n.transformURL=function(e,n){var i=e.match(/^([^#]*)#?(.*)$/);if(i){var r=i[1]||n,o=decodeURIComponent(i[2]);if(r&&t.items.some((function(t){return t.src===r})))return"#"+this.transformFragment(o,r)}return e},n.restoreURL=function(t){"#"===t.charAt(0)&&(t=t.substring(1)),0===t.indexOf("viv-id-")&&(t=t.substring("viv-id-".length));var e=function(t,e){e="string"==typeof e?e:"\\u";var n=new RegExp(ht(e)+"[0-9a-fA-F]{4}","g");return t.replace(n,(function(t){return function(t,e){return 0===t.indexOf(e="string"==typeof e?e:"\\u")?String.fromCharCode(parseInt(t.substring(e.length),16)):t}(t,e)}))}(t,":").match(/^([^#]*)#?(.*)$/);return e?[e[1],e[2]]:[]},e}();return new e},e.getMetadata=function(){return this.metadata},e.getPathFromURL=function(t){if(t.startsWith("data:"))return t===this.pubURL?"":t;if(this.pubURL){var e=j("",this.pubURL);return t===e||t+"/"===e?"":("/"!=e.charAt(e.length-1)&&(e+="/"),t.substr(0,e.length)==e?decodeURIComponent(t.substr(e.length)):null)}return t},e.initWithXMLDoc=function(t,e,n,i){var r=this;this.opfXML=t,this.encXML=e;var o=t.doc().child("package"),a=o.attribute("unique-identifier")[0];if(a){var u=t.getElement(t.url+"#"+a);u&&(this.uid=u.textContent.replace(/[ \n\r\t]/g,""))}var l={};for(var h in this.items=o.child("manifest").child("item").asArray().map((function(e){var n=new Yc,i=e;n.initWithElement(i,t.url);var o=i.getAttribute("fallback");return o&&!nd[n.mediaType]&&(l[n.src]=o),!r.xhtmlToc&&n.itemProperties.nav&&(r.xhtmlToc=n),!r.cover&&n.itemProperties["cover-image"]&&(r.cover=n),n})),this.itemMap=ft(this.items,qc),this.itemMapByPath=ft(this.items,(function(t){return r.getPathFromURL(t.src)})),l)for(var c=h;;){var d=this.itemMap[l[c]];if(!d)break;if(nd[d.mediaType]){this.fallbackMap[h]=d.src;break}c=d.src}this.spine=o.child("spine").child("itemref").asArray().map((function(t,e){var n=t,i=n.getAttribute("idref"),o=r.itemMap[i];return o&&(o.itemRefElement=n,o.spineIndex=e),o}));var f=o.child("spine").attribute("toc")[0];f&&(this.ncxToc=this.itemMap[f]);var p=o.child("spine").attribute("page-progression-direction")[0];p&&(this.pageProgression=s(p));for(var g=e?e.doc().child("encryption").child("EncryptedData").predicate(Rc.withChild("EncryptionMethod",Rc.withAttribute("Algorithm","http://www.idpf.org/2008/embedding"))).child("CipherData").child("CipherReference").attribute("URI"):[],v=o.child("bindings").child("mediaType").asArray(),m=0;m<v.length;m++){var E=v[m].getAttribute("handler"),C=v[m].getAttribute("media-type");C&&E&&this.itemMap[E]&&(this.bindings[C]=this.itemMap[E].src)}if(this.metadata=function(t,e){var n;if(e){for(var i in n={},Qc)n[i]=Qc[i];for(var r;null!=(r=e.match(/^\s*([A-Z_a-z\u007F-\uFFFF][-.A-Z_a-z0-9\u007F-\uFFFF]*):\s*(\S+)/));)e=e.substr(r[0].length),n[r[1]]=r[2]}else n=Qc;var o=function(t){if(t){var e=t.match(/^\s*(([^:]*):)?(\S+)\s*$/);if(e){var i=e[2]?n[e[2]]:$c;if(i)return i+e[3]}}return null},a=1,s=t.childElements().forEachNonNull((function(t){if("meta"==t.localName){var e=o(t.getAttribute("property"));if(e)return{name:e,value:t.textContent,id:t.getAttribute("id"),order:a++,refines:t.getAttribute("refines"),lang:null,scheme:o(t.getAttribute("scheme")),role:null}}else if(t.namespaceURI==G.DC)return{name:Qc.dcterms+t.localName,order:a++,lang:t.getAttribute("xml:lang"),value:t.textContent,id:t.getAttribute("id"),refines:null,scheme:null,role:t.getAttribute("role")||t.getAttribute("opf:role")};return null})),u=pt(s,(function(t){return t.refines})),l=function t(e){return function(e,n){var i={};for(var r in e)i[r]=e[r].map((function(e){var n={v:e.value,o:e.order};e.scheme&&(n.s=e.scheme);var i=u["#"+e.id]||[];if(i.length||e.lang||e.role){e.lang&&i.push({name:Zc.language,value:e.lang,lang:null,id:null,refines:e.id,scheme:null,order:e.order,role:null}),e.role&&i.push({name:Zc.role,value:e.role,lang:null,id:null,refines:e.id,scheme:null,order:e.order,role:null});var r=pt(i,(function(t){return t.name}));n.r=t(r)}return n}));return i}(e)}(pt(s,(function(t){return t.refines?null:t.name}))),h=null;return l[Zc.language]&&(h=l[Zc.language][0].v),function t(e){for(var n in e){var i=e[n];i.sort(Jc(n,h));for(var r=0;r<i.length;r++){var o=i[r].r;o&&t(o)}}}(l),l}(o.child("metadata"),o.attribute("prefix")[0]),this.metadata[Zc.language]&&(this.lang=this.metadata[Zc.language][0].v),this.metadata[Zc.layout]&&(this.prePaginated="pre-paginated"===this.metadata[Zc.layout][0].v),!n){if(g.length>0&&this.uid)for(var D=function(t){var e=function(t){for(var e,n=[],i=B(Xc(t));!(e=i()).done;){var r=e.value;n.push(r>>>24&255,r>>>16&255,r>>>8&255,255&r)}return n}(t);return function(t){var n,i,r=Pi("deobfuscator");return t.slice?(n=t.slice(0,1040),i=t.slice(1040,t.size)):(n=t.webkitSlice(0,1040),i=t.webkitSlice(1040,t.size-1040)),function(t){var e=Pi("readBlob"),n=new FileReader,i=e.suspend(n);return n.addEventListener("load",(function(){i.schedule(n.result)}),!1),n.readAsArrayBuffer(t),e.result()}(n).then((function(t){for(var n=new DataView(t),o=0;o<n.byteLength;o++){var a=n.getUint8(o);n.setUint8(o,a^=e[o%20])}r.finish(Ji([n,i]))})),r.result()}}(this.uid),w=0;w<g.length;w++)this.store.deobfuscators[this.pubURL+g[w]]=D;return this.prePaginated&&this.assignAutoPages(),Ri(!0)}var y=new it,N={};if(g.length>0&&this.uid)for(var b="1040:"+function(t){for(var e=function(t){for(var e=Xc(t),n=new it,i=0;i<e.length;i++)n.append(zc(e[i]));return n.toString()}(t),n=new it,i=0;i<e.length;i++)n.append((256|e.charCodeAt(i)).toString(16).substr(1));return n.toString()}(this.uid),S=0;S<g.length;S++)N[g[S]]=b;for(var A=0;A<n.length;A++){var T=n[A],x=T.n;if(x){var I=decodeURIComponent(x),F=this.itemMapByPath[I],P=null;F&&(F.compressed=0!=T.m,F.compressedSize=T.c,F.mediaType&&(P=F.mediaType.replace(/\s+/g,"")));var R=N[I];(P||R)&&(y.append(x),y.append(" "),y.append(P||"application/octet-stream"),R&&(y.append(" "),y.append(R)),y.append("\n"))}}return this.assignAutoPages(),Zi(i,Wi.DEFAULT,"POST",y.toString(),"text/plain")},e.assignAutoPages=function(){for(var t,e=0,n=B(this.spine);!(t=n()).done;){var i=t.value,r=this.prePaginated?1:Math.ceil(i.compressedSize/1024);i.epage=e,i.epageCount=r,e+=r}this.epageCount=e,this.epageCountCallback&&this.epageCountCallback(this.epageCount)},e.setEPageCountMode=function(t){this.epageIsRenderedPage=t||this.prePaginated},e.countEPages=function(t){var e=this;if(this.epageCountCallback=t,this.epageIsRenderedPage)return this.prePaginated&&0==this.epageCount&&this.assignAutoPages(),Ri(!0);var n=0,i=0,r=Pi("countEPages");return r.loopWithFrame((function(t){if(i!==e.spine.length){var r=e.spine[i++];r.epage=n,e.store.load(r.src).then((function(i){var o=1800,a=i.lang||e.lang;a&&a.match(/^(ja|ko|zh)/)&&(o/=3),r.epageCount=Math.ceil(i.getTotalOffset()/o),e.epageCount=n+=r.epageCount,e.epageCountCallback&&e.epageCountCallback(e.epageCount),t.continueLoop()}))}else t.breakLoop()})).thenFinish(r),r.result()},e.initWithChapters=function(t,e){var n=this;this.itemMap={},this.itemMapByPath={},this.items=[],this.spine=this.items;var i=this.opfXML=new Ic(null,"",(new DOMParser).parseFromString("<spine></spine>","text/xml"));return t.forEach((function(t){var e=new Yc;e.initWithParam(t);var r=i.document.createElement("itemref");r.setAttribute("idref",e.id),i.root.appendChild(r),e.itemRefElement=r,n.itemMap[e.id]=e;var o=n.getPathFromURL(t.url);null==o&&(o=t.url),n.itemMapByPath[o]=e,n.items.push(e)})),e?this.store.addDocument(t[0].url,e):Ri(null)},e.initWithWebPubManifest=function(t,e,n){var i=this;t.readingProgression&&(this.pageProgression=t.readingProgression),void 0===this.metadata&&(this.metadata={});var r=e&&e.title||t.name||t.metadata&&t.metadata.title;r&&(this.metadata[Zc.title]=[{v:r}]);var o=this.getPathFromURL(this.pubURL);if(!t.readingOrder&&e&&null!==o){t.readingOrder=[encodeURI(o)];for(var a,s=B(e.querySelectorAll("[role=doc-toc] a[href],[role=directory] a[href],nav li a[href],.toc a[href],#toc a[href]"));!(a=s()).done;){var u=a.value.getAttribute("href");if(!/^(https?:)?\/\//.test(u)){var l=V(j(u,this.pubURL)),h=this.getPathFromURL(l),c=null!==h?encodeURI(h):l;-1==t.readingOrder.indexOf(c)&&t.readingOrder.push(c)}}}var d=[],f=0,p=-1;[t.readingOrder,t.resources].forEach((function(e){e instanceof Array&&e.forEach((function(e){var r=t.readingOrder.includes(e),o="string"==typeof e?e:e.url||e.href,a="string"==typeof e?"":e.encodingFormat||e.href&&e.type||"";if(r||"text/html"===a||"application/xhtml+xml"===a||/(^|\/)([^/]+\.(x?html|htm|xht)|[^/.]*)([#?]|$)/.test(o)){var s=n?n.replace(/\/[^/]+$/,"/"):i.pubURL,u={url:j(K(o),s),index:f++,startPage:null,skipPagesBefore:null};"contents"===e.rel&&-1===p&&(p=u.index),d.push(u)}}))}));var g=Pi("initWithWebPubManifest");return this.initWithChapters(d).then((function(){var t;-1!==p&&(i.xhtmlToc=i.items[p]),i.xhtmlToc||(i.xhtmlToc=n?null==(t=i.items)?void 0:t[0]:i.itemMapByPath[o]),g.finish(!0)})),g.result()},e.getCFI=function(t,e){var n=this.spine[t],i=Pi("getCFI");return this.store.load(n.src).then((function(t){var r=t.getNodeByOffset(e),o=null;if(r){var a=t.getNodeOffset(r,0,!1),s=e-a,u=new Ft;u.prependPathFromNode(r,s,!1,null),n.itemRefElement&&u.prependPathFromNode(n.itemRefElement,0,!1,null),o=u.toString()}i.finish(o)})),i.result()},e.resolveFragment=function(t){var e=this;return Li("resolveFragment",(function(n){if(t){var i,r=new Ft;if(r.fromString(t),e.opfXML){var o=r.navigate(e.opfXML.document);if(1!=o.node.nodeType||o.after||!o.ref)return void n.finish(null);var a=o.node,s=a.getAttribute("idref");if("itemref"!=a.localName||!s||!e.itemMap[s])return void n.finish(null);i=e.itemMap[s],r=o.ref}else i=e.spine[0];e.store.load(i.src).then((function(t){var e=r.navigate(t.document),o=t.getNodeOffset(e.node,e.offset,e.after);n.finish({spineIndex:i.spineIndex,offsetInItem:o,pageIndex:-1})}))}else n.finish(null)}),(function(e,n){c.warn(n,"Cannot resolve fragment:",t),e.finish(null)}))},e.resolveEPage=function(t){var e=this;return Li("resolveEPage",(function(n){if(t<=0)n.finish({spineIndex:0,offsetInItem:0,pageIndex:-1});else if(e.epageIsRenderedPage){var i=e.spine.findIndex((function(e){return 0==e.epage&&0==e.epageCount||e.epage<=t&&e.epage+e.epageCount>t}));-1==i&&(i=e.spine.length-1);var r=e.spine[i];r&&0!=r.epageCount||(r=e.spine[--i]);var o=Math.floor(t-r.epage);n.finish({spineIndex:i,offsetInItem:-1,pageIndex:o})}else{var a=ct(e.spine.length,(function(n){var i=e.spine[n];return i.epage+i.epageCount>t}));a==e.spine.length&&a--;var s=e.spine[a];e.store.load(s.src).then((function(e){(t-=s.epage)>s.epageCount&&(t=s.epageCount);var i=0;if(t>0){var r=e.getTotalOffset();(i=Math.round(r*t/s.epageCount))==r&&i--}n.finish({spineIndex:a,offsetInItem:i,pageIndex:-1})}))}}),(function(e,n){c.warn(n,"Cannot resolve epage:",t),e.finish(null)}))},e.getEPageFromPosition=function(t){var e=this.spine[t.spineIndex];if(this.epageIsRenderedPage)return Ri(e.epage+t.pageIndex);if(t.offsetInItem<=0)return Ri(e.epage);var n=Pi("getEPage");return this.store.load(e.src).then((function(i){var r=i.getTotalOffset(),o=Math.min(r,t.offsetInItem);n.finish(e.epage+o*e.epageCount/r)})),n.result()},t}(),rd=function(t,e){return{page:t,position:{spineIndex:t.spineIndex,pageIndex:e,offsetInItem:t.offset}}},od=function(){function t(t,e,n,i,r){this.opf=void 0,this.viewport=void 0,this.fontMapper=void 0,this.pageSheetSizeReporter=void 0,this.spineItems=[],this.spineItemLoadingContinuations=[],this.pref=void 0,this.clientLayout=void 0,this.counterStore=void 0,this.tocAutohide=!1,this.tocView=void 0,this.opf=t,this.viewport=e,this.fontMapper=n,this.pageSheetSizeReporter=r,this.pref=Pt(i),this.clientLayout=new Tc(e),this.counterStore=new Xn(t.documentURLTransformer)}var n=t.prototype;return n.getPage=function(t){var e=this.spineItems[t.spineIndex];return e?e.pages[t.pageIndex]:null},n.getCurrentPageProgression=function(t){if(this.opf.pageProgression)return this.opf.pageProgression;var e=this.spineItems[t?t.spineIndex:0];return e?e.instance.pageProgression:null},n.finishPageContainer=function(t,e,n){e.container.style.display="none",e.container.style.visibility="visible",e.container.style.position="",e.container.style.top="",e.container.style.left="",e.container.setAttribute("data-vivliostyle-page-side",e.side);var i=t.pages[n];if(e.isFirstPage=0==t.item.spineIndex&&0==n,t.pages[n]=e,this.opf.epageIsRenderedPage){if(0==n&&t.item.spineIndex>0){var r=this.opf.spine[t.item.spineIndex-1];t.item.epage=r.epage+r.epageCount}t.item.epageCount=t.pages.length,this.opf.epageCount=this.opf.spine.reduce((function(t,e){return t+e.epageCount}),0),this.opf.epageCountCallback&&this.opf.epageCountCallback(this.opf.epageCount)}if(i)t.instance.viewport.contentContainer.replaceChild(e.container,i.container),i.dispatchEvent({type:"replaced",target:null,currentTarget:null,preventDefault:null,newPage:e});else{var o=null;if(n>0)o=t.pages[n-1].container.nextElementSibling;else for(var a=t.item.spineIndex+1;a<this.spineItems.length;a++){var s=this.spineItems[a];if(s&&s.pages[0]){o=s.pages[0].container;break}}t.instance.viewport.contentContainer.insertBefore(e.container,o)}this.pageSheetSizeReporter({width:t.instance.pageSheetWidth,height:t.instance.pageSheetHeight},t.instance.pageSheetSize,t.item.spineIndex,t.instance.pageNumberOffset+n)},n.renderSinglePage=function(t,e){var n=this,i=Pi("renderSinglePage"),r=this.makePage(t,e);return t.instance.layoutNextPage(r,e).then((function(o){var a=(e=o)?e.page-1:t.layoutPositions.length-1;n.finishPageContainer(t,r,a),n.counterStore.finishPage(r.spineIndex,a);var s=null;if(e){var u=t.layoutPositions[e.page];t.layoutPositions[e.page]=e,u&&t.pages[e.page]&&(e.isSamePosition(u)||(s=n.renderSinglePage(t,e)))}s||(s=Ri(!0)),s.then((function(){var o=n.counterStore.getUnresolvedRefsToPage(r),s=0;i.loopWithFrame((function(t){if(++s>o.length)t.breakLoop();else{var e=o[s-1];e.refs=e.refs.filter((function(t){return!t.isResolved()})),0!==e.refs.length?n.getPageViewItem(e.spineIndex).then((function(i){i?(n.counterStore.pushPageCounters(e.pageCounters),n.counterStore.pushReferencesToSolve(e.refs),n.renderSinglePage(i,i.layoutPositions[e.pageIndex]).then((function(e){n.counterStore.popPageCounters(),n.counterStore.popReferencesToSolve();var i=e.pageAndPosition.position;i.spineIndex===r.spineIndex&&i.pageIndex===a&&(r=e.pageAndPosition.page),t.continueLoop()}))):t.continueLoop()})):t.continueLoop()}})).then((function(){r.container.parentElement||(r=t.pages[a]),r.isLastPage=!e&&t.item.spineIndex===n.opf.spine.length-1,r.isLastPage&&n.counterStore.finishLastPage(n.viewport),i.finish({pageAndPosition:rd(r,a),nextLayoutPosition:e})}))}))})),i.result()},n.normalizeSeekPosition=function(t,e){var n=t.pageIndex,i=-1;if(n<0){i=t.offsetInItem;var r=ct(e.layoutPositions.length,(function(t){return e.instance.getPosition(e.layoutPositions[t],!0)>i}));n=r===e.layoutPositions.length?e.complete?e.layoutPositions.length-1:Number.POSITIVE_INFINITY:r-1}else n===Number.POSITIVE_INFINITY&&-1!==t.offsetInItem&&(i=t.offsetInItem);return{spineIndex:t.spineIndex,pageIndex:n,offsetInItem:i}},n.findPage=function(t,e){var n=this,i=Pi("findPage");return this.getPageViewItem(t.spineIndex).then((function(r){if(r){var o,a=null;i.loopWithFrame((function(s){var u=n.normalizeSeekPosition(t,r);(a=r.pages[o=u.pageIndex])?s.breakLoop():r.complete?(a=r.pages[o=r.layoutPositions.length-1],s.breakLoop()):e?n.renderPage(u).then((function(t){t&&(a=t.page,o=t.position.pageIndex),s.breakLoop()})):i.sleep(100).then((function(){s.continueLoop()}))})).then((function(){i.finish(rd(a,o))}))}else i.finish(null)})),i.result()},n.renderPage=function(t){var e=this,n=Pi("renderPage");return this.getPageViewItem(t.spineIndex).then((function(i){if(i){var r=e.normalizeSeekPosition(t,i),o=r.pageIndex,a=r.offsetInItem,s=i.pages[o];s?n.finish(rd(s,o)):n.loopWithFrame((function(t){if(o<i.layoutPositions.length)t.breakLoop();else{if(i.complete)return o=i.layoutPositions.length-1,void t.breakLoop();var n=i.layoutPositions[i.layoutPositions.length-1];e.renderSinglePage(i,n).then((function(e){var r=e.pageAndPosition.page;if(n=e.nextLayoutPosition){if(a>=0&&i.instance.getPosition(n)>a)return s=r,o=i.layoutPositions.length-2,void t.breakLoop();t.continueLoop()}else s=r,o=e.pageAndPosition.position.pageIndex,i.complete=!0,t.breakLoop()}))}})).then((function(){var t=i.layoutPositions[o];(s=s||i.pages[o])?n.finish(rd(s,o)):e.renderSinglePage(i,t).then((function(t){t.nextLayoutPosition||(i.complete=!0),n.finish(t.pageAndPosition)}))}))}else n.finish(null)})),n.result()},n.renderAllPages=function(){return this.renderPagesUpto({spineIndex:this.opf.spine.length-1,pageIndex:Number.POSITIVE_INFINITY,offsetInItem:-1},!1)},n.renderPagesUpto=function(t,e){var n=this,i=Pi("renderPagesUpto");t||(t={spineIndex:0,pageIndex:0,offsetInItem:0});var r,o=t.spineIndex,a=t.pageIndex,s=0;return e&&(s=o),i.loopWithFrame((function(e){n.renderPage({spineIndex:s,pageIndex:s===o?a:Number.POSITIVE_INFINITY,offsetInItem:s===o?t.offsetInItem:-1}).then((function(t){r=t,++s>o?e.breakLoop():e.continueLoop()}))})).then((function(){i.finish(r)})),i.result()},n.firstPage=function(t,e){return this.findPage({spineIndex:0,pageIndex:0,offsetInItem:-1},e)},n.lastPage=function(t,e){return this.findPage({spineIndex:this.opf.spine.length-1,pageIndex:Number.POSITIVE_INFINITY,offsetInItem:-1},e)},n.nextPage=function(t,e){var n=this,i=t.spineIndex,r=t.pageIndex,o=Pi("nextPage");return this.getPageViewItem(i).then((function(t){if(t){if(t.complete&&r==t.layoutPositions.length-1){if(i>=n.opf.spine.length-1)return void o.finish(null);i++,r=0;var a=n.spineItems[i],s=a&&a.pages[0],u=t.pages[t.pages.length-1];s&&u&&s.side==u.side&&(a.pages.forEach((function(t){t.container&&t.container.remove()})),n.spineItems[i]=null,n.spineItemLoadingContinuations[i]=null)}else r++;n.findPage({spineIndex:i,pageIndex:r,offsetInItem:-1},e).thenFinish(o)}else o.finish(null)})),o.result()},n.previousPage=function(t,e){var n=t.spineIndex,i=t.pageIndex;if(0==i){if(0==n)return Ri(null);n--,i=Number.POSITIVE_INFINITY}else i--;return this.findPage({spineIndex:n,pageIndex:i,offsetInItem:-1},e)},n.isRectoPage=function(t,n){var i=t.side===e.PageSide.LEFT,r=this.getCurrentPageProgression(n)===e.PageProgression.LTR;return!i&&r||i&&!r},n.getSpread=function(t,n){var i=this,r=Pi("getCurrentSpread"),o=this.getPage(t);if(!o)return Ri({left:null,right:null});var a=o.side===e.PageSide.LEFT;return(this.isRectoPage(o,t)?this.previousPage(t,n):this.nextPage(t,n)).then((function(e){var n=i.getPage(t),o=e&&e.page;o&&o.side===n.side&&(o=null),r.finish(a?{left:n,right:o}:{left:o,right:n})})),r.result()},n.nextSpread=function(t,e){var n=this,i=this.getPage(t);if(!i)return Ri(null);var r=this.isRectoPage(i,t),o=this.nextPage(t,e);return r?o:o.thenAsync((function(t){if(t){if(t.page.side===i.side)return o;var r=n.nextPage(t.position,e);return r.thenAsync((function(t){return t?r:o}))}return Ri(null)}))},n.previousSpread=function(t,e){var n=this,i=this.getPage(t);if(!i)return Ri(null);var r=this.isRectoPage(i,t),o=this.previousPage(t,e),a=i.container.previousElementSibling;return r?o.thenAsync((function(t){return t?t.page.side===i.side||t.page.container!==a?o:n.previousPage(t.position,e):Ri(null)})):o},n.navigateToEPage=function(t,e,n){var i=this,r=Pi("navigateToEPage");return this.opf.resolveEPage(t).then((function(t){t?i.findPage(t,n).thenFinish(r):r.finish(null)})),r.result()},n.navigateToFragment=function(t,e,n){var i=this,r=Pi("navigateToCFI");return this.opf.resolveFragment(t).then((function(t){t?i.findPage(t,n).thenFinish(r):r.finish(null)})),r.result()},n.navigateTo=function(t,e,n){var i=this;c.debug("Navigate to",t);var r=this.opf.getPathFromURL(V(t));if(!r){if(this.opf.opfXML&&t.match(/^#epubcfi\(/))r=this.opf.getPathFromURL(this.opf.opfXML.url);else if("#"===t.charAt(0)){var o=this.opf.documentURLTransformer.restoreURL(t);this.opf.opfXML?null==(r=this.opf.getPathFromURL(o[0]))&&(r=o[0]):r=o[0],t=o[0]+(o[1]?"#"+o[1]:"")}if(null==r)return Ri(null)}var a=this.opf.itemMapByPath[r];if(!a){if(this.opf.opfXML&&r==this.opf.getPathFromURL(this.opf.opfXML.url)){var s=t.indexOf("#");if(s>=0)return this.navigateToFragment(t.substr(s+1),e,n)}return Ri(null)}var u=Pi("navigateTo");return this.getPageViewItem(a.spineIndex).then((function(e){if(e){var r=e.xmldoc.getElement(t);i.findPage({spineIndex:a.spineIndex,pageIndex:-1,offsetInItem:r?e.xmldoc.getElementOffset(r):0},n).thenFinish(u)}else u.finish(null)})),u.result()},n.makePage=function(t,n){var i=t.instance.viewport,r=i.document.createElement("div");r.setAttribute("data-vivliostyle-page-container","true"),r.setAttribute("role","region"),r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.columnCount="1",r.style.height="99999999px",e.isDebug||(r.style.visibility="hidden",r.setAttribute("aria-hidden","true")),i.layoutBox.appendChild(r);var o=i.document.createElement("div");o.setAttribute("data-vivliostyle-bleed-box","true"),r.appendChild(o);var a=new $r(r,o);if(a.spineIndex=t.item.spineIndex,a.position=n,a.offset=t.instance.getPosition(n),0===a.offset){var s=this.opf.documentURLTransformer.transformFragment("",t.item.src);o.setAttribute("id",s),a.registerElementWithId(o,s)}if(i!==this.viewport){var u=Ot(this.viewport.width,this.viewport.height,i.width,i.height),l=Fr(null,new Ti(u,null),"");a.delayedItems.push(new Yr(r,"transform",l))}return a},n.makeObjectView=function(t,e,n,i){var r=e.getAttribute("data"),o=null;if(r){r=j(r,t.url);var a=e.getAttribute("media-type");if(!a){var s=this.opf.getPathFromURL(r);if(s){var u=this.opf.itemMapByPath[s];u&&(a=u.mediaType)}}if(a){var l=this.opf.bindings[a];if(l){(o=this.viewport.document.createElement("iframe")).style.border="none";var h=st(r),c=st(a),d=new it;d.append(l),d.append("?src="),d.append(h),d.append("&type="),d.append(c);for(var f=e.firstChild;f;f=f.nextSibling)if(1==f.nodeType){var p=f;if("param"==p.localName&&p.namespaceURI==G.XHTML){var g=p.getAttribute("name"),v=p.getAttribute("value");g&&v&&(d.append("&"),d.append(encodeURIComponent(g)),d.append("="),d.append(encodeURIComponent(v)))}}o.setAttribute("src",d.toString());var m=e.getAttribute("width");m&&o.setAttribute("width",m);var E=e.getAttribute("height");E&&o.setAttribute("height",E)}}}return o||(o=this.viewport.document.createElement("span")).setAttribute("data-adapt-process-children","true"),Ri(o)},n.makeMathJaxView=function(t,e,n,i){var r=td();if(r){var o=n.ownerDocument,a=o.createElement("span");n.appendChild(a);var s=o.importNode(e,!0);this.resolveURLsInMathML(s,t),a.appendChild(s);var u=r.queue;u.Push(["Typeset",r,a]);var l=Pi("makeMathJaxView"),h=l.suspend();return u.Push((function(){h.schedule(a)})),l.result()}return Ri(null)},n.resolveURLsInMathML=function(t,e){if(null!=t){if(1===t.nodeType&&"mglyph"===t.tagName)for(var n=0,i=Array.from(t.attributes);n<i.length;n++){var r=i[n];if("src"===r.name){var o=j(r.nodeValue,e.url);r.namespaceURI?t.setAttributeNS(r.namespaceURI,r.name,o):t.setAttribute(r.name,o)}}t.firstChild&&this.resolveURLsInMathML(t.firstChild,e),t.nextSibling&&this.resolveURLsInMathML(t.nextSibling,e)}},n.makeCustomRenderer=function(t){var e=this;return function(n,i,r){return"object"==n.localName&&n.namespaceURI==G.XHTML?e.makeObjectView(t,n,i,r):n.namespaceURI==G.MATHML||n.dataset&&"true"==n.dataset.mathTypeset?e.makeMathJaxView(t,n,i,r):Ri(null)}},n.getPageViewItem=function(t){var e=this;if(-1===t||t>=this.opf.spine.length)return Ri(null);var n=this.spineItems[t];if(n)return Ri(n);var i=Pi("getPageViewItem"),r=this.spineItemLoadingContinuations[t];if(r){var o=i.suspend();return r.push(o),i.result()}r=this.spineItemLoadingContinuations[t]=[];var a=this.opf.spine[t],s=this.opf.store;return s.load(a.src).then((function(o){var u,l=a.itemRefElement.getAttribute("properties");l&&o.root.setAttribute("data-vivliostyle-epub-spine-properties",l),a.title=o.document.title;var h=s.getStyleForDoc(o),c=e.makeCustomRenderer(o),d=e.viewport,f=h.sizeViewport(d.width,d.height,d.fontSize,e.pref);f.width==d.width&&f.height==d.height&&f.fontSize==d.fontSize||(d=new xc(d.window,f.fontSize,d.root,f.width,f.height));var p,g,v=null==(u=e.spineItems[0])?void 0:u.instance.isVersoFirstPage,m=e.spineItems[t-1];if(null!==a.startPage)g=p=a.startPage-1;else{if(!(t>0)||m&&m.complete){p=m?m.instance.pageNumberOffset+m.pages.length:0;var E=e.counterStore.currentPageCounters.page;g=E&&E.length?E[E.length-1]:p}else p=a.epage||t,e.opf.prePaginated||p%2!=(v?1:0)||p++,g=p;null!==a.skipPagesBefore&&(p+=a.skipPagesBefore,g+=a.skipPagesBefore)}e.counterStore.forceSetPageCounter(g);var C=new Bc(h,o,e.opf.lang,d,e.clientLayout,e.fontMapper,c,e.opf.fallbackMap,p,e.opf.documentURLTransformer,e.counterStore,e.opf.pageProgression,v);C.pref=e.pref;var D=e.opf.metadata&&e.opf.metadata[Zc.title];C.pubTitle=D&&D[0]&&D[0].v||"",C.docTitle=a.title||"",C.init().then((function(){e.spineItems[t]=n={item:a,xmldoc:o,instance:C,layoutPositions:[null],pages:[],complete:!1},i.finish(n),r.forEach((function(t){t.schedule(n)}))}))})),i.result()},n.removeRenderedPages=function(){for(var t,e=B(this.spineItems);!(t=e()).done;){var n=t.value;n&&n.pages.splice(0)}this.viewport.clear()},n.hasAutoSizedPages=function(){for(var t,e=B(this.spineItems);!(t=e()).done;){var n=t.value;if(n)for(var i,r=B(n.pages);!(i=r()).done;){var o=i.value;if(o.isAutoPageWidth&&o.isAutoPageHeight)return!0}}return!1},n.hasPages=function(){return this.spineItems.some((function(t){return t&&t.pages.length>0}))},n.showTOC=function(t){var e=this.opf,n=e.xhtmlToc||e.ncxToc;if(this.tocAutohide=t,!n)return Ri(null);if(this.tocView&&this.tocView.page)return this.tocView.page.container.style.visibility="visible",this.tocView.page.container.setAttribute("aria-hidden","false"),Ri(this.tocView.page);var i=Pi("showTOC");this.tocView||(this.tocView=new Wc(e.store,n.src,e.lang,this.clientLayout,this.fontMapper,this.pref,this,e.fallbackMap,e.documentURLTransformer,this.counterStore));var r=this.viewport,o=Math.min(350,Math.round(.67*r.width)-16),a=r.height-6,s=r.document.createElement("div");return r.root.appendChild(s),s.style.visibility="hidden",s.style.width=o+10+"px",s.style.maxHeight=a+"px",s.setAttribute("data-vivliostyle-toc-box","true"),s.setAttribute("role","navigation"),this.tocView.showTOC(s,r,o,a,this.viewport.fontSize).then((function(t){s.style.visibility="visible",s.setAttribute("aria-hidden","false"),i.finish(t)})),i.result()},n.hideTOC=function(){this.tocView&&this.tocView.hideTOC()},n.isTOCVisible=function(){return!!this.tocView&&this.tocView.isTOCVisible()},t}();!function(t){t.SINGLE_PAGE="singlePage",t.SPREAD="spread",t.AUTO_SPREAD="autoSpread"}(ed||(ed={}));var ad,sd=function(){function t(t,n,i,r){var o=this;this.window=void 0,this.viewportElement=void 0,this.instanceId=void 0,this.callbackFn=void 0,this.fontMapper=void 0,this.kick=void 0,this.sendCommand=void 0,this.resizeListener=void 0,this.hyperlinkListener=void 0,this.pageRuleStyleElement=void 0,this.pageSheetSizeAlreadySet=!1,this.renderTask=null,this.actions=void 0,this.readyState=void 0,this.packageURL=void 0,this.opf=void 0,this.haveZipMetadata=void 0,this.touchActive=void 0,this.touchX=void 0,this.touchY=void 0,this.needResize=void 0,this.needRefresh=void 0,this.viewportSize=void 0,this.currentPage=void 0,this.currentSpread=void 0,this.pagePosition=void 0,this.fontSize=void 0,this.zoom=void 0,this.fitToScreen=void 0,this.pageViewMode=void 0,this.waitForLoading=void 0,this.renderAllPages=void 0,this.pref=void 0,this.pageSizes=void 0,this.viewport=void 0,this.opfView=void 0,this.window=t,this.viewportElement=n,this.instanceId=i,this.callbackFn=r,n.setAttribute("data-vivliostyle-viewer-viewport",!0),e.isDebug&&n.setAttribute("data-vivliostyle-debug",!0),n.setAttribute("data-vivliostyle-viewer-status","loading");var a=t.document;this.fontMapper=new oh(a.head,n),this.init(),this.kick=function(){},this.sendCommand=function(){},this.resizeListener=function(){o.needResize=!0,o.kick()},this.pageReplacedListener=this.pageReplacedListener.bind(this),this.hyperlinkListener=function(t){},this.pageRuleStyleElement=a.getElementById("vivliostyle-page-rules"),this.actions={loadPublication:this.loadPublication,loadXML:this.loadXML,configure:this.configure,moveTo:this.moveTo,toc:this.showTOC},this.addLogListeners()}var n=t.prototype;return n.init=function(){this.readyState=e.ReadyState.LOADING,this.packageURL=[],this.opf=null,this.haveZipMetadata=!1,this.touchActive=!1,this.touchX=0,this.touchY=0,this.needResize=!1,this.needRefresh=!1,this.viewportSize=null,this.currentPage=null,this.currentSpread=null,this.pagePosition=null,this.fontSize=16,this.zoom=1,this.fitToScreen=!1,this.pageViewMode=ed.SINGLE_PAGE,this.waitForLoading=!1,this.renderAllPages=!0,this.pref={fontFamily:"serif",lineHeight:1.25,margin:8,hyphenate:!1,columnWidth:25,horizontal:!1,nightMode:!1,spreadView:!1,pageBorder:1,enabledMediaTypes:{vivliostyle:!0,print:!0},defaultPaperSize:void 0},this.pageSizes=[]},n.addLogListeners=function(){var t=this,e=r;c.addListener(e.DEBUG,(function(e){t.callback({t:"debug",content:e})})),c.addListener(e.INFO,(function(e){t.callback({t:"info",content:e})})),c.addListener(e.WARN,(function(e){t.callback({t:"warn",content:e})})),c.addListener(e.ERROR,(function(e){t.callback({t:"error",content:e})}))},n.callback=function(t){t.i=this.instanceId,this.callbackFn(t)},n.setReadyState=function(t){this.readyState!==t&&(this.readyState=t,this.viewportElement.setAttribute("data-vivliostyle-viewer-status",t),this.callback({t:"readystatechange"}))},n.loadPublication=function(t){var n=this;b.registerStartTiming("beforeRender"),this.setReadyState(e.ReadyState.LOADING);var i=t.url,r=t.fragment,o=!!t.zipmeta,a=t.authorStyleSheet,s=t.userStyleSheet;this.viewport=null;var u=Pi("loadPublication");return this.configure(t).then((function(){var t=new Kc;t.init(a,s).then((function(){var e=j(K(i),n.window.location.href);n.packageURL=[e],t.loadPubDoc(e,o).then((function(t){t?(n.opf=t,n.render(r).then((function(){u.finish(!0)}))):u.finish(!1)}))}))})),u.result()},n.loadXML=function(t){var n=this;b.registerStartTiming("beforeRender"),this.setReadyState(e.ReadyState.LOADING);var i=t.url,r=t.document,o=t.fragment,a=t.authorStyleSheet,s=t.userStyleSheet;this.viewport=null;var u=Pi("loadXML");return this.configure(t).then((function(){var t=new Kc;t.init(a,s).then((function(){var e=i.map((function(t,e){return{url:j(K(t.url),n.window.location.href),index:e,startPage:t.startPage,skipPagesBefore:t.skipPagesBefore}}));n.packageURL=e.map((function(t){return t.url})),n.opf=new id(t,""),n.opf.initWithChapters(e,r).then((function(){n.render(o).then((function(){u.finish(!0)}))}))}))})),u.result()},n.render=function(t){var e=this;return this.cancelRenderingTask(),(t?this.opf.resolveFragment(t).thenAsync((function(t){return e.pagePosition=t,Ri(!0)})):Ri(!0)).thenAsync((function(){return b.registerEndTiming("beforeRender"),e.resize()}))},n.resolveLength=function(t){var e,n=parseFloat(t);if("string"==typeof t&&(e=t.match(/[a-z]+$/))){var i=e[0];if("em"===i||"rem"===i)return n*this.fontSize;if("ex"===i)return n*Ht.ex*this.fontSize/Ht.em;var r=Ht[i];if(r)return n*r}return n},n.configure=function(t){if("boolean"==typeof t.autoresize&&(t.autoresize?(this.viewportSize=null,this.window.addEventListener("resize",this.resizeListener,!1),this.needResize=!0):this.window.removeEventListener("resize",this.resizeListener,!1)),"number"==typeof t.fontSize){var e=t.fontSize;e>=5&&e<=72&&this.fontSize!=e&&(this.fontSize=e,this.needResize=!0)}if("object"==typeof t.viewport&&t.viewport){var n=t.viewport,i={marginLeft:this.resolveLength(n["margin-left"])||0,marginRight:this.resolveLength(n["margin-right"])||0,marginTop:this.resolveLength(n["margin-top"])||0,marginBottom:this.resolveLength(n["margin-bottom"])||0,width:this.resolveLength(n.width)||0,height:this.resolveLength(n.height)||0};(i.width>=200||i.height>=200)&&(this.window.removeEventListener("resize",this.resizeListener,!1),this.viewportSize=i,this.needResize=!0)}return"boolean"==typeof t.hyphenate&&(this.pref.hyphenate=t.hyphenate,this.needResize=!0),"boolean"==typeof t.horizontal&&(this.pref.horizontal=t.horizontal,this.needResize=!0),"boolean"==typeof t.nightMode&&(this.pref.nightMode=t.nightMode,this.needResize=!0),"number"==typeof t.lineHeight&&(this.pref.lineHeight=t.lineHeight,this.needResize=!0),"number"==typeof t.columnWidth&&(this.pref.columnWidth=t.columnWidth,this.needResize=!0),"string"==typeof t.fontFamily&&(this.pref.fontFamily=t.fontFamily,this.needResize=!0),"boolean"==typeof t.load&&(this.waitForLoading=t.load),"boolean"==typeof t.renderAllPages&&(this.renderAllPages=t.renderAllPages),"string"==typeof t.userAgentRootURL&&(z(t.userAgentRootURL.replace(/resources\/?$/,"")),W(t.userAgentRootURL)),"string"==typeof t.rootURL&&(z(t.rootURL),W(H+"resources/")),"string"==typeof t.pageViewMode&&t.pageViewMode!==this.pageViewMode&&(this.pageViewMode=t.pageViewMode,this.needResize=!0),"number"==typeof t.pageBorder&&t.pageBorder!==this.pref.pageBorder&&(this.viewport=null,this.pref.pageBorder=t.pageBorder,this.needResize=!0),"number"==typeof t.zoom&&t.zoom!==this.zoom&&(this.zoom=t.zoom,this.needRefresh=!0),"boolean"==typeof t.fitToScreen&&t.fitToScreen!==this.fitToScreen&&(this.fitToScreen=t.fitToScreen,this.needRefresh=!0),"object"==typeof t.defaultPaperSize&&"number"==typeof t.defaultPaperSize.width&&"number"==typeof t.defaultPaperSize.height&&(this.viewport=null,this.pref.defaultPaperSize=t.defaultPaperSize,this.needResize=!0),this.configurePlugins(t),Ri(!0)},n.configurePlugins=function(t){var n=this;v(e.HOOKS.CONFIGURATION).forEach((function(e){var i=e(t);n.needResize=i.needResize||n.needResize,n.needRefresh=i.needRefresh||n.needRefresh}))},n.pageReplacedListener=function(t){var e=this.currentPage,n=this.currentSpread,i=t.target;n?n.left!==i&&n.right!==i||this.showCurrent(t.newPage):e===t.target&&this.showCurrent(t.newPage)},n.forCurrentPages=function(t){var e=[];this.currentPage&&e.push(this.currentPage),this.currentSpread&&(e.push(this.currentSpread.left),e.push(this.currentSpread.right)),e.forEach((function(e){e&&t(e)}))},n.removePageListeners=function(){var t=this;this.forCurrentPages((function(e){e.removeEventListener("hyperlink",t.hyperlinkListener,!1),e.removeEventListener("replaced",t.pageReplacedListener,!1)}))},n.hidePages=function(){this.removePageListeners(),this.forCurrentPages((function(t){tt(t.container,"display","none"),t.container.setAttribute("aria-hidden","true")})),this.currentPage=null,this.currentSpread=null},n.showSinglePage=function(t){t.addEventListener("hyperlink",this.hyperlinkListener,!1),t.addEventListener("replaced",this.pageReplacedListener,!1),tt(t.container,"visibility","visible"),tt(t.container,"display","block"),t.container.setAttribute("aria-hidden","false")},n.showPage=function(t){this.hidePages(),this.currentPage=t,t.container.style.marginLeft="",t.container.style.marginRight="",this.showSinglePage(t)},n.showSpread=function(t){if(this.hidePages(),this.currentSpread=t,t.left&&t.right){var e=parseFloat(t.left.container.style.width),n=parseFloat(t.right.container.style.width);e&&n&&e!==n&&(e<n?t.left.container.style.marginLeft=n-e+"px":t.right.container.style.marginRight=e-n+"px")}t.left&&(this.showSinglePage(t.left),t.right?t.left.container.removeAttribute("data-vivliostyle-unpaired-page"):t.left.container.setAttribute("data-vivliostyle-unpaired-page",!0)),t.right&&(this.showSinglePage(t.right),t.left?t.right.container.removeAttribute("data-vivliostyle-unpaired-page"):t.right.container.setAttribute("data-vivliostyle-unpaired-page",!0))},n.reportPosition=function(){var t=this,e=Pi("reportPosition");return this.opf.getCFI(this.pagePosition.spineIndex,this.pagePosition.offsetInItem).then((function(n){var i=t.currentPage;(t.waitForLoading&&i.fetchers.length>0?Gi(i.fetchers):Ri(!0)).then((function(){t.sendLocationNotification(i,n).thenFinish(e)}))})),e.result()},n.createViewport=function(){var t=this.viewportElement;if(this.viewportSize){var e=this.viewportSize;return t.style.marginLeft=e.marginLeft+"px",t.style.marginRight=e.marginRight+"px",t.style.marginTop=e.marginTop+"px",t.style.marginBottom=e.marginBottom+"px",new xc(this.window,this.fontSize,t,e.width,e.height)}return new xc(this.window,this.fontSize,t)},n.resolveSpreadView=function(t){switch(this.pageViewMode){case ed.SINGLE_PAGE:return!1;case ed.SPREAD:return!0;default:return t.width/t.height>=1.45&&t.width>800}},n.updateSpreadView=function(t){this.pref.spreadView=t,this.viewportElement.setAttribute("data-vivliostyle-spread-view",t.toString())},n.sizeIsGood=function(){var t=this.createViewport(),e=this.resolveSpreadView(t),n=this.pref.spreadView!==e;return this.updateSpreadView(e),!(this.viewportSize||!this.viewport||this.viewport.fontSize!=this.fontSize||(n||t.width!=this.viewport.width||t.height!=this.viewport.height)&&(n||t.width!=this.viewport.width||t.height==this.viewport.height||!/Android|iPhone|iPad|iPod/.test(navigator.userAgent))&&(!this.opfView||!this.opfView.hasPages()||this.opfView.hasAutoSizedPages()||(this.viewport.width=t.width,this.viewport.height=t.height,this.needRefresh=!0,0)))},n.setPageSize=function(t,e,n,i){this.pageSizes[i]=t,this.setPageSizePageRules(e,n,i)},n.setPageSizePageRules=function(t,e,n){if(!this.pageSheetSizeAlreadySet&&this.pageRuleStyleElement){var i="";Object.keys(t).forEach((function(e){i+="@page "+e+"{margin:0;size:";var n=t[e];i+=n.width+"px "+n.height+"px;}"})),this.pageRuleStyleElement.textContent=i,this.pageSheetSizeAlreadySet=!0}},n.removePageSizePageRules=function(){this.pageRuleStyleElement&&(this.pageRuleStyleElement.textContent="",this.pageSheetSizeAlreadySet=!1)},n.reset=function(){var t=!1,e=!1;this.opfView&&(t=this.opfView.isTOCVisible(),e=this.opfView.tocAutohide,this.opfView.hideTOC(),this.opfView.removeRenderedPages()),this.removePageSizePageRules(),this.viewport=this.createViewport(),this.viewport.resetZoom(),this.opfView=new od(this.opf,this.viewport,this.fontMapper,this.pref,this.setPageSize.bind(this)),t&&this.sendCommand({a:"toc",v:"show",autohide:e})},n.showCurrent=function(t,n){var i=this;return this.needRefresh=!1,this.removePageListeners(),this.pref.spreadView?this.opfView.getSpread(this.pagePosition,n).thenAsync((function(n){return i.showSpread(n),i.setSpreadZoom(n),i.currentPage=t.side===e.PageSide.LEFT?n.left:n.right,Ri(null)})):(this.showPage(t),this.setPageZoom(t),this.currentPage=t,Ri(null))},n.setPageZoom=function(t){var e=this.getAdjustedZoomFactor(t.dimensions);this.viewport.zoom(t.dimensions.width,t.dimensions.height,e)},n.setSpreadZoom=function(t){var e=this.getSpreadDimensions(t);this.viewport.zoom(e.width,e.height,this.getAdjustedZoomFactor(e))},n.getAdjustedZoomFactor=function(t){return this.fitToScreen?this.calculateZoomFactorToFitInsideViewPort(t):this.zoom},n.getSpreadDimensions=function(t){var e=0,n=0;return t.left&&(e+=t.left.dimensions.width,n=t.left.dimensions.height),t.right&&(e+=t.right.dimensions.width,n=Math.max(n,t.right.dimensions.height)),t.left&&t.right&&(e+=2*this.pref.pageBorder,e+=Math.abs(t.left.dimensions.width-t.right.dimensions.width)),{width:e,height:n}},n.queryZoomFactor=function(t){if(!this.currentPage)throw new Error("no page exists.");var e;if(t===ad.FIT_INSIDE_VIEWPORT)return e=this.pref.spreadView?this.getSpreadDimensions(this.currentSpread):this.currentPage.dimensions,this.calculateZoomFactorToFitInsideViewPort(e);throw new Error("unknown zoom type: "+t)},n.calculateZoomFactorToFitInsideViewPort=function(t){return Math.min(this.viewport.width/t.width,this.viewport.height/t.height)},n.cancelRenderingTask=function(){this.renderTask&&this.renderTask.interrupt(new ud),this.renderTask=null},n.resize=function(){var t=this;if(this.needResize=!1,this.needRefresh=!1,this.sizeIsGood())return Ri(!0);this.setReadyState(e.ReadyState.LOADING),this.cancelRenderingTask();var n=Fi().getScheduler().run((function(){return Li("resize",(function(i){t.opf?(t.renderTask=n,b.registerStartTiming("render (resize)"),t.reset(),t.pagePosition&&(0==t.pagePosition.pageIndex&&0==t.pagePosition.offsetInItem||(t.pagePosition.pageIndex=-1)),t.opf.setEPageCountMode(t.renderAllPages),t.opfView.renderPagesUpto(t.pagePosition,!t.renderAllPages).then((function(r){r?(t.pagePosition=r.position,t.showCurrent(r.page,!0).then((function(){t.setReadyState(e.ReadyState.INTERACTIVE),t.opf.countEPages((function(e){var n={t:"nav",epageCount:e,first:t.currentPage.isFirstPage,last:t.currentPage.isLastPage,metadata:t.opf.metadata,docTitle:t.opf.spine[t.pagePosition.spineIndex].title};(t.currentPage.isFirstPage||0==t.pagePosition.pageIndex&&t.opf.spine[t.pagePosition.spineIndex].epage)&&(n.epage=t.opf.spine[t.pagePosition.spineIndex].epage),t.callback(n)})).then((function(){t.reportPosition().then((function(r){(t.renderAllPages?t.opfView.renderAllPages():Ri(null)).then((function(){t.renderTask===n&&(t.renderTask=null),b.registerEndTiming("render (resize)"),t.renderAllPages&&t.setReadyState(e.ReadyState.COMPLETE),t.callback({t:"loaded"}),i.finish(r)}))}))}))}))):i.finish(!1)}))):i.finish(!1)}),(function(t,e){if(!(e instanceof ud))throw e;b.registerEndTiming("render (resize)"),c.debug(e.message)}))}));return Ri(!0)},n.sendLocationNotification=function(t,e){var n=this,i=Pi("sendLocationNotification"),r={t:"nav",first:t.isFirstPage,last:t.isLastPage,metadata:this.opf.metadata,docTitle:this.opf.spine[t.spineIndex].title};return this.opf.getEPageFromPosition(this.pagePosition).then((function(t){r.epage=t,r.epageCount=n.opf.epageCount,e&&(r.cfi=e),n.callback(r),i.finish(!0)})),i.result()},n.getCurrentPageProgression=function(){return this.opfView?this.opfView.getCurrentPageProgression(this.pagePosition):null},n.moveTo=function(t){var n,i=this;if(this.readyState!==e.ReadyState.COMPLETE&&"next"!==t.where&&this.setReadyState(e.ReadyState.LOADING),"string"==typeof t.where){var r;switch(t.where){case"next":r=this.pref.spreadView?this.opfView.nextSpread:this.opfView.nextPage;break;case"previous":r=this.pref.spreadView?this.opfView.previousSpread:this.opfView.previousPage;break;case"last":r=this.opfView.lastPage;break;case"first":r=this.opfView.firstPage;break;default:return Ri(!0)}r&&(n=function(){return r.call(i.opfView,i.pagePosition,!i.renderAllPages)})}else if("number"==typeof t.epage){var o=t.epage;n=function(){return i.opfView.navigateToEPage(o,i.pagePosition,!i.renderAllPages)}}else{if("string"!=typeof t.url)return Ri(!0);var a=t.url;n=function(){return i.opfView.navigateTo(a,i.pagePosition,!i.renderAllPages)}}var s=Pi("moveTo");return n.call(this.opfView).then((function(t){var n;if(t){i.pagePosition=t.position;var r=Pi("moveTo.showCurrent");n=r.result(),i.showCurrent(t.page,!i.renderAllPages).then((function(){i.reportPosition().thenFinish(r)}))}else n=Ri(!0);n.then((function(t){i.readyState===e.ReadyState.LOADING&&i.setReadyState(e.ReadyState.INTERACTIVE),s.finish(t)}))})),s.result()},n.showTOC=function(t){var e=this,n=!!t.autohide,i=t.v,r=this.opfView.isTOCVisible(),o=n!=this.opfView.tocAutohide&&"hide"!=i;if(r){if("show"==i&&!o)return Ri(!0)}else if("hide"==i)return Ri(!0);if(r&&"show"!=i)return this.opfView.hideTOC(),Ri(!0);var a=Pi("showTOC");return this.opfView.showTOC(n).then((function(t){t&&(o&&(t.listeners={}),n&&t.addEventListener("hyperlink",(function(){e.opfView.hideTOC()}),!1),t.addEventListener("hyperlink",e.hyperlinkListener,!1)),a.finish(!0)})),a.result()},n.runCommand=function(t){var e=this,n=t.a||"";return Li("runCommand",(function(i){var r=e.actions[n];r?r.call(e,t).then((function(){e.callback({t:"done",a:n}),i.finish(!0)})):(c.error("No such action:",n),i.finish(!0))}),(function(t,e){c.error(e,"Error during action:",n),t.finish(!0)}))},n.initEmbed=function(t){var e,n=this,i=ld(t),r=null,o=this;e=function(){var t=Pi("commandLoop"),e=Fi().getScheduler();return o.hyperlinkListener=function(t){var n=t,i="#"===n.href.charAt(0)||o.packageURL.some((function(t){return n.href.substr(0,t.length)==t}));if(i){t.preventDefault();var r={t:"hyperlink",href:n.href,internal:i};e.run((function(){return o.callback(r),Ri(!0)}))}},t.loopWithFrame((function(t){if(o.needResize)o.resize().then((function(){t.continueLoop()}));else if(o.needRefresh)o.currentPage&&o.showCurrent(o.currentPage,!0).then((function(){t.continueLoop()}));else if(i){var e=i;i=null,o.runCommand(e).then((function(){t.continueLoop()}))}else{var a=Pi("waitForCommand");r=a.suspend(n),a.result().then((function(){t.continueLoop()}))}})).thenFinish(t),t.result()},(xi?xi.getScheduler():Ii||new ki(new Oi)).run(e,void 0),o.kick=function(){var t=r;t&&(r=null,t.schedule(!0))},o.sendCommand=function(t){return!i&&(i=ld(t),o.kick(),!0)},this.window.adapt_command=o.sendCommand},t}();(ad||(ad={})).FIT_INSIDE_VIEWPORT="fit inside viewport";var ud=function(t){function e(){var n;return(n=t.call(this)||this).name="RenderingCanceledError",n.message="Page rendering has been canceled",n.stack=void 0,Object.setPrototypeOf(O(n),e.prototype),n.stack=(new Error).stack,n}return x(e,t),e}(L(Error));function ld(t){return"string"==typeof t?U(t):t}var hd=e.PageProgression;function cd(t){var e={};return Object.keys(t).forEach((function(n){var i=t[n];switch(n){case"autoResize":e.autoresize=i;break;case"pageBorderWidth":e.pageBorder=i;break;default:e[n]=i}})),e}var dd,fd=function(){function t(t,e){this.settings=void 0,this.initialized=!1,this.adaptViewer_=void 0,this.options=void 0,this.eventTarget=void 0,this.readyState=void 0,this.settings=t,a(t.debug),this.adaptViewer_=new sd(t.window||window,t.viewportElement,"main",this.dispatcher.bind(this)),this.options={autoResize:!0,fontSize:16,pageBorderWidth:1,renderAllPages:!0,pageViewMode:ed.AUTO_SPREAD,zoom:1,fitToScreen:!1,defaultPaperSize:void 0},e&&this.setOptions(e),this.eventTarget=new gt,Object.defineProperty(this,"readyState",{get:function(){return this.adaptViewer_.readyState}})}var n=t.prototype;return n.setOptions=function(t){var e=Object.assign({a:"configure"},cd(t));this.adaptViewer_.sendCommand(e),Object.assign(this.options,t)},n.dispatcher=function(t){var e={type:t.t},n=t;Object.keys(n).forEach((function(t){"t"!==t&&(e[t]=n[t])})),this.eventTarget.dispatchEvent(e)},n.addListener=function(t,e){this.eventTarget.addEventListener(t,e,!1)},n.removeListener=function(t,e){this.eventTarget.removeEventListener(t,e,!1)},n.loadDocument=function(t,e,n){t||this.eventTarget.dispatchEvent({type:"error",content:"No URL specified"}),this.loadDocumentOrPublication(t,null,e,n)},n.loadPublication=function(t,e,n){t||this.eventTarget.dispatchEvent({type:"error",content:"No URL specified"}),this.loadDocumentOrPublication(null,t,e,n)},n.loadDocumentOrPublication=function(t,e,n,i){var r=n||{};function o(t){return t?t.map((function(t){return{url:t.url||null,text:t.text||null}})):void 0}var a=o(r.authorStyleSheet),s=o(r.userStyleSheet);i&&Object.assign(this.options,i);var u=Object.assign({a:t?"loadXML":"loadPublication",userAgentRootURL:this.settings.userAgentRootURL,url:pd(t)||e,document:r.documentObject,fragment:r.fragment,authorStyleSheet:a,userStyleSheet:s},cd(this.options));this.initialized?this.adaptViewer_.sendCommand(u):(this.initialized=!0,this.adaptViewer_.initEmbed(u))},n.getCurrentPageProgression=function(){return this.adaptViewer_.getCurrentPageProgression()},n.resolveNavigation=function(t){switch(t){case e.Navigation.LEFT:return this.getCurrentPageProgression()===hd.LTR?e.Navigation.PREVIOUS:e.Navigation.NEXT;case e.Navigation.RIGHT:return this.getCurrentPageProgression()===hd.LTR?e.Navigation.NEXT:e.Navigation.PREVIOUS;default:return t}},n.navigateToPage=function(t,n){t===e.Navigation.EPAGE?this.adaptViewer_.sendCommand({a:"moveTo",epage:n}):this.adaptViewer_.sendCommand({a:"moveTo",where:this.resolveNavigation(t)})},n.navigateToInternalUrl=function(t){this.adaptViewer_.sendCommand({a:"moveTo",url:t})},n.isTOCVisible=function(){return this.adaptViewer_.opfView&&this.adaptViewer_.opfView.opf&&(this.adaptViewer_.opfView.opf.xhtmlToc||this.adaptViewer_.opfView.opf.ncxToc)?!!this.adaptViewer_.opfView.isTOCVisible():null},n.showTOC=function(t,e){this.adaptViewer_.sendCommand({a:"toc",v:null==t?"toggle":t?"show":"hide",autohide:e})},n.queryZoomFactor=function(t){return this.adaptViewer_.queryZoomFactor(t)},n.getPageSizes=function(){return this.adaptViewer_.pageSizes},n.getTOC=function(){var t,e;return null==(t=this.adaptViewer_.opfView)||null==(e=t.tocView)?void 0:e.getTOC()},n.getMetadata=function(){return this.adaptViewer_.opf.getMetadata()},n.getCover=function(){return this.adaptViewer_.opf.cover},t}();function pd(t){function e(t){return"number"==typeof t?t:null}function n(t){return"string"==typeof t?{url:t,startPage:null,skipPagesBefore:null}:{url:t.url,startPage:e(t.startPage),skipPagesBefore:e(t.skipPagesBefore)}}return Array.isArray(t)?t.map(n):t?[n(t)]:null}e.Navigation=void 0,(dd=e.Navigation||(e.Navigation={})).PREVIOUS="previous",dd.NEXT="next",dd.LEFT="left",dd.RIGHT="right",dd.FIRST="first",dd.LAST="last",dd.EPAGE="epage";var gd=ad,vd=ed;b.forceRegisterEndTiming("load_vivliostyle");var md=function(){function t(t,e){var n=e.title,i=void 0===n?"":n,r=e.printCallback,o=void 0===r?function(t){return t.print()}:r,a=e.hideIframe,s=void 0===a||a,u=e.removeIframe,l=void 0===u||u;this.htmlDoc=void 0,this.title=void 0,this.printCallback=void 0,this.hideIframe=void 0,this.removeIframe=void 0,this.iframe=void 0,this.iframeWin=void 0,this.window=void 0,this.htmlDoc=t,this.title=i,this.printCallback=o,this.hideIframe=s,this.removeIframe=l}var e=t.prototype;return e.init=function(){this.iframe=document.createElement("iframe"),this.hideIframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this.iframe.style.borderWidth="0"),this.window=window,this.window.printInstance=this,this.iframe.srcdoc="\n <!DOCTYPE html>\n <html data-vivliostyle-paginated=\"true\">\n <head>\n <meta charset='utf-8'/>\n <meta name='viewport' content='width=device-width, initial-scale=1.0'/>\n <title>"+this.title+"</title>\n <style>"+Ki+"</style>\n <style>"+ji+"</style>\n <style>\n html[data-vivliostyle-paginated] {\n width: 100%;\n height: 100%;\n }\n html[data-vivliostyle-paginated] body,\n html[data-vivliostyle-paginated] [data-vivliostyle-viewer-viewport] {\n width: 100% !important;\n height: 100% !important;\n }\n html[data-vivliostyle-paginated],\n html[data-vivliostyle-paginated] body {\n margin: 0;\n padding: 0;\n }\n </style>\n <style id='vivliostyle-page-rules'></style>\n </head>\n <body onload='parent.printInstance.runInIframe(window)'>\n <div id=\"vivliostyle-viewer-viewport\"></div>\n </body>\n </html>",document.body.appendChild(this.iframe)},e.runInIframe=function(t){var e=this;return this.iframeWin=t,this.preparePrint().then((function(){return e.browserPrint()})).then((function(){return e.cleanUp()}))},e.preparePrint=function(){this.iframeWin.document.title=this.title;var t=new Blob([this.htmlDoc],{type:"text/html"}),e=URL.createObjectURL(t),n=new fd({viewportElement:this.iframeWin.document.body.firstElementChild,window:this.iframeWin,debug:!0},{defaultPaperSize:{width:794,height:1122}});return new Promise((function(t){n.addListener("readystatechange",(function(){"complete"===n.readyState&&t()})),n.loadDocument({url:e})}))},e.browserPrint=function(){this.printCallback(this.iframeWin)},e.cleanUp=function(){delete this.window.printInstance,this.removeIframe&&this.iframe.parentElement.removeChild(this.iframe)},t}();e.CoreViewer=fd,e.PageViewMode=vd,e.Profiler=E,e.UserAgentBaseCss=$i,e.UserAgentPageCss=Qi,e.UserAgentXml=qi,e.ValidationTxt=Yi,e.VivliostyleViewportCss=Ki,e.VivliostyleViewportScreenCss=ji,e.ZoomType=gd,e.getHooksForName=v,e.pageProgressionOf=s,e.plugin=m,e.printHTML=function(t,e){new md(t,e).init()},e.profile=S,e.profiler=b,e.registerHook=p,e.removeHook=g,e.setDebug=a},c(d={exports:{}},d.exports),d.exports);p.isDebug,p.PageProgression,p.PageSide,p.ReadyState,p.HOOKS,p.Navigation,p.CoreViewer,p.PageViewMode,p.Profiler,p.UserAgentBaseCss,p.UserAgentPageCss,p.UserAgentXml,p.ValidationTxt,p.VivliostyleViewportCss,p.VivliostyleViewportScreenCss,p.ZoomType,p.getHooksForName,p.pageProgressionOf,p.plugin;var g=p.printHTML;p.profile,p.profiler,p.registerHook,p.removeHook,p.setDebug;export{g as printHTML};
9
+ function t(r,o,a,s){if(r===o)return r?[[0,r]]:[];if(null!=a){var D=function(t,e,u){var n="number"==typeof u?{index:u,length:0}:u.oldRange,i="number"==typeof u?null:u.newRange,r=t.length,o=e.length;if(0===n.length&&(null===i||0===i.length)){var a=n.index,s=t.slice(0,a),D=t.slice(a),h=i?i.index:null,c=a+o-r;if((null===h||h===c)&&!(c<0||c>o)){var d=e.slice(0,c);if((E=e.slice(c))===D){var f=Math.min(a,c);if((F=s.slice(0,f))===(g=d.slice(0,f)))return l(F,s.slice(f),d.slice(f),D)}}if(null===h||h===a){var p=a,E=(d=e.slice(0,p),e.slice(p));if(d===s){var C=Math.min(r-p,o-p);if((A=D.slice(D.length-C))===(v=E.slice(E.length-C)))return l(s,D.slice(0,D.length-C),E.slice(0,E.length-C),A)}}}if(n.length>0&&i&&0===i.length){var F=t.slice(0,n.index),A=t.slice(n.index+n.length);if(!(o<(f=F.length)+(C=A.length))){var g=e.slice(0,f),v=e.slice(o-C);if(F===g&&A===v)return l(F,t.slice(f,r-C),e.slice(f,o-C),A)}}return null}(r,o,a);if(D)return D}var h=u(r,o),c=r.substring(0,h);h=n(r=r.substring(h),o=o.substring(h));var d=r.substring(r.length-h),f=function(i,r){var o;if(!i)return[[1,r]];if(!r)return[[-1,i]];var a=i.length>r.length?i:r,s=i.length>r.length?r:i,l=a.indexOf(s);if(-1!==l)return o=[[1,a.substring(0,l)],[0,s],[1,a.substring(l+s.length)]],i.length>r.length&&(o[0][0]=o[2][0]=-1),o;if(1===s.length)return[[-1,i],[1,r]];var D=function(t,e){var i=t.length>e.length?t:e,r=t.length>e.length?e:t;if(i.length<4||2*r.length<i.length)return null;function o(t,e,i){for(var r,o,a,s,l=t.substring(i,i+Math.floor(t.length/4)),D=-1,h="";-1!==(D=e.indexOf(l,D+1));){var c=u(t.substring(i),e.substring(D)),d=n(t.substring(0,i),e.substring(0,D));h.length<d+c&&(h=e.substring(D-d,D)+e.substring(D,D+c),r=t.substring(0,i-d),o=t.substring(i+c),a=e.substring(0,D-d),s=e.substring(D+c))}return 2*h.length>=t.length?[r,o,a,s,h]:null}var a,s,l,D,h,c=o(i,r,Math.ceil(i.length/4)),d=o(i,r,Math.ceil(i.length/2));if(!c&&!d)return null;a=d?c&&c[4].length>d[4].length?c:d:c;t.length>e.length?(s=a[0],l=a[1],D=a[2],h=a[3]):(D=a[0],h=a[1],s=a[2],l=a[3]);var f=a[4];return[s,l,D,h,f]}(i,r);if(D){var h=D[0],c=D[1],d=D[2],f=D[3],p=D[4],E=t(h,d),C=t(c,f);return E.concat([[0,p]],C)}return function(t,u){for(var n=t.length,i=u.length,r=Math.ceil((n+i)/2),o=r,a=2*r,s=new Array(a),l=new Array(a),D=0;D<a;D++)s[D]=-1,l[D]=-1;s[o+1]=0,l[o+1]=0;for(var h=n-i,c=h%2!=0,d=0,f=0,p=0,E=0,C=0;C<r;C++){for(var F=-C+d;F<=C-f;F+=2){for(var A=o+F,g=(y=F===-C||F!==C&&s[A-1]<s[A+1]?s[A+1]:s[A-1]+1)-F;y<n&&g<i&&t.charAt(y)===u.charAt(g);)y++,g++;if(s[A]=y,y>n)f+=2;else if(g>i)d+=2;else if(c){if((B=o+h-F)>=0&&B<a&&-1!==l[B])if(y>=(m=n-l[B]))return e(t,u,y,g)}}for(var v=-C+p;v<=C-E;v+=2){for(var m,B=o+v,w=(m=v===-C||v!==C&&l[B-1]<l[B+1]?l[B+1]:l[B-1]+1)-v;m<n&&w<i&&t.charAt(n-m-1)===u.charAt(i-w-1);)m++,w++;if(l[B]=m,m>n)E+=2;else if(w>i)p+=2;else if(!c){if((A=o+h-v)>=0&&A<a&&-1!==s[A]){var y;g=o+(y=s[A])-A;if(y>=(m=n-m))return e(t,u,y,g)}}}}return[[-1,t],[1,u]]}(i,r)}(r=r.substring(0,r.length-h),o=o.substring(0,o.length-h));return c&&f.unshift([0,c]),d&&f.push([0,d]),i(f,s),f}function e(e,u,n,i){var r=e.substring(0,n),o=u.substring(0,i),a=e.substring(n),s=u.substring(i),l=t(r,o),D=t(a,s);return l.concat(D)}function u(t,e){if(!t||!e||t.charAt(0)!==e.charAt(0))return 0;for(var u=0,n=Math.min(t.length,e.length),i=n,o=0;u<i;)t.substring(o,i)==e.substring(o,i)?o=u=i:n=i,i=Math.floor((n-u)/2+u);return r(t.charCodeAt(i-1))&&i--,i}function n(t,e){if(!t||!e||t.slice(-1)!==e.slice(-1))return 0;for(var u=0,n=Math.min(t.length,e.length),i=n,r=0;u<i;)t.substring(t.length-i,t.length-r)==e.substring(e.length-i,e.length-r)?r=u=i:n=i,i=Math.floor((n-u)/2+u);return o(t.charCodeAt(t.length-i))&&i--,i}function i(t,e){t.push([0,""]);for(var r,o=0,l=0,D=0,h="",c="";o<t.length;)if(o<t.length-1&&!t[o][1])t.splice(o,1);else switch(t[o][0]){case 1:D++,c+=t[o][1],o++;break;case-1:l++,h+=t[o][1],o++;break;case 0:var d=o-D-l-1;if(e){if(d>=0&&s(t[d][1])){var f=t[d][1].slice(-1);if(t[d][1]=t[d][1].slice(0,-1),h=f+h,c=f+c,!t[d][1]){t.splice(d,1),o--;var p=d-1;t[p]&&1===t[p][0]&&(D++,c=t[p][1]+c,p--),t[p]&&-1===t[p][0]&&(l++,h=t[p][1]+h,p--),d=p}}if(a(t[o][1])){f=t[o][1].charAt(0);t[o][1]=t[o][1].slice(1),h+=f,c+=f}}if(o<t.length-1&&!t[o][1]){t.splice(o,1);break}if(h.length>0||c.length>0){h.length>0&&c.length>0&&(0!==(r=u(c,h))&&(d>=0?t[d][1]+=c.substring(0,r):(t.splice(0,0,[0,c.substring(0,r)]),o++),c=c.substring(r),h=h.substring(r)),0!==(r=n(c,h))&&(t[o][1]=c.substring(c.length-r)+t[o][1],c=c.substring(0,c.length-r),h=h.substring(0,h.length-r)));var E=D+l;0===h.length&&0===c.length?(t.splice(o-E,E),o-=E):0===h.length?(t.splice(o-E,E,[1,c]),o=o-E+1):0===c.length?(t.splice(o-E,E,[-1,h]),o=o-E+1):(t.splice(o-E,E,[-1,h],[1,c]),o=o-E+2)}0!==o&&0===t[o-1][0]?(t[o-1][1]+=t[o][1],t.splice(o,1)):o++,D=0,l=0,h="",c=""}""===t[t.length-1][1]&&t.pop();var C=!1;for(o=1;o<t.length-1;)0===t[o-1][0]&&0===t[o+1][0]&&(t[o][1].substring(t[o][1].length-t[o-1][1].length)===t[o-1][1]?(t[o][1]=t[o-1][1]+t[o][1].substring(0,t[o][1].length-t[o-1][1].length),t[o+1][1]=t[o-1][1]+t[o+1][1],t.splice(o-1,1),C=!0):t[o][1].substring(0,t[o+1][1].length)==t[o+1][1]&&(t[o-1][1]+=t[o+1][1],t[o][1]=t[o][1].substring(t[o+1][1].length)+t[o+1][1],t.splice(o+1,1),C=!0)),o++;C&&i(t,e)}function r(t){return t>=55296&&t<=56319}function o(t){return t>=56320&&t<=57343}function a(t){return o(t.charCodeAt(0))}function s(t){return r(t.charCodeAt(t.length-1))}function l(t,e,u,n){return s(t)||a(n)?null:function(t){for(var e=[],u=0;u<t.length;u++)t[u][1].length>0&&e.push(t[u]);return e}([[0,t],[-1,e],[1,u],[0,n]])}function D(e,u,n){return t(e,u,n,!0)}D.INSERT=1,D.DELETE=-1,D.EQUAL=0;var h,c,d=D,f=(h=function(t,e){function u(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n,i,r,o=u(d);function a(t){e.isDebug=t}function s(t){switch(t){case"ltr":return e.PageProgression.LTR;case"rtl":return e.PageProgression.RTL;default:throw new Error("unknown PageProgression: "+t)}}function l(t){var e=Array.from(t),u=null;return e[0]instanceof Error&&(u=e.shift()),{error:u,messages:e}}function D(t){var e=t.error,u=e&&(e.frameTrace||e.stack),n=[].concat(t.messages);return e&&(n.length>0&&(n=n.concat(["\n"])),n=n.concat([e.toString()]),u&&(n=n.concat(["\n"]).concat(u))),n}e.isDebug=!1,e.PageProgression=void 0,function(t){t.LTR="ltr",t.RTL="rtl"}(e.PageProgression||(e.PageProgression={})),e.PageSide=void 0,(n=e.PageSide||(e.PageSide={})).LEFT="left",n.RIGHT="right",e.ReadyState=void 0,(i=e.ReadyState||(e.ReadyState={})).LOADING="loading",i.INTERACTIVE="interactive",i.COMPLETE="complete",function(t){t[t.DEBUG=1]="DEBUG",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR"}(r||(r={}));var h,c=new(function(){function t(t){this.opt_console=void 0,this.listeners={},this.opt_console=t}var e=t.prototype;return e.consoleDebug=function(t){var e,u,n;this.opt_console?this.opt_console.debug?(e=this.opt_console).debug.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).debug.apply(n,t)},e.consoleInfo=function(t){var e,u,n;this.opt_console?this.opt_console.info?(e=this.opt_console).info.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).info.apply(n,t)},e.consoleWarn=function(t){var e,u,n;this.opt_console?this.opt_console.warn?(e=this.opt_console).warn.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).warn.apply(n,t)},e.consoleError=function(t){var e,u,n;this.opt_console?this.opt_console.error?(e=this.opt_console).error.apply(e,t):(u=this.opt_console).log.apply(u,t):(n=console).error.apply(n,t)},e.triggerListeners=function(t,e){var u=this.listeners[t];u&&u.forEach((function(t){t(e)}))},e.addListener=function(t,e){var u=this.listeners[t];u||(u=this.listeners[t]=[]),u.push(e)},e.debug=function(){var t=l(arguments);this.consoleDebug(D(t)),this.triggerListeners(r.DEBUG,t)},e.info=function(){var t=l(arguments);this.consoleInfo(D(t)),this.triggerListeners(r.INFO,t)},e.warn=function(){var t=l(arguments);this.consoleWarn(D(t)),this.triggerListeners(r.WARN,t)},e.error=function(){var t=l(arguments);this.consoleError(D(t)),this.triggerListeners(r.ERROR,t)},t}());e.HOOKS=void 0,(h=e.HOOKS||(e.HOOKS={})).SIMPLE_PROPERTY="SIMPLE_PROPERTY",h.PREPROCESS_SINGLE_DOCUMENT="PREPROCESS_SINGLE_DOCUMENT",h.PREPROCESS_TEXT_CONTENT="PREPROCESS_TEXT_CONTENT",h.PREPROCESS_ELEMENT_STYLE="PREPROCESS_ELEMENT_STYLE",h.POLYFILLED_INHERITED_PROPS="POLYFILLED_INHERITED_PROPS",h.CONFIGURATION="CONFIGURATION",h.RESOLVE_TEXT_NODE_BREAKER="RESOLVE_TEXT_NODE_BREAKER",h.RESOLVE_FORMATTING_CONTEXT="RESOLVE_FORMATTING_CONTEXT",h.RESOLVE_LAYOUT_PROCESSOR="RESOLVE_LAYOUT_PROCESSOR",h.POST_LAYOUT_BLOCK="POST_LAYOUT_BLOCK";var f={};function p(t,u){if(e.HOOKS[t]){var n=f[t];n||(n=f[t]=[]),n.push(u)}else c.warn(new Error("Skipping unknown plugin hook '"+t+"'."))}function E(t,u){if(e.HOOKS[t]){var n=f[t];if(n){var i=n.indexOf(u);i>=0&&n.splice(i,1)}}else c.warn(new Error("Ignoring unknown plugin hook '"+t+"'."))}function C(t){return f[t]||[]}var F={registerHook:p,removeHook:E},A=function(){function t(t){this.performanceInstance=void 0,this.timestamps={},this.registerTiming=void 0,this.registerStartTiming=void 0,this.registerEndTiming=void 0,this.performanceInstance=t,this.registerTiming=g,this.registerStartTiming=this.registerStartTiming=g,this.registerEndTiming=this.registerEndTiming=g}var e=t.prototype;return e.forceRegisterStartTiming=function(t,e){v.call(this,t,"start",e)},e.forceRegisterEndTiming=function(t,e){v.call(this,t,"end",e)},e.printTimings=function(){var t=this.timestamps,e="";Object.keys(t).forEach((function(u){for(var n=t[u],i=n.length,r=0;r<i;r++){var o=n[r];e+=u,i>1&&(e+="("+r+")"),e+=" => start: "+o.start+", end: "+o.end+", duration: "+(o.end-o.start)+"\n"}})),c.info(e)},e.disable=function(){this.registerTiming=g,this.registerStartTiming=this.registerStartTiming=g,this.registerEndTiming=this.registerEndTiming=g},e.enable=function(){this.registerTiming=v,this.registerStartTiming=this.registerStartTiming=m,this.registerEndTiming=this.registerEndTiming=B},e.isEnabled=function(){return this.registerStartTiming===m},t}();function g(){}function v(t,e,u){u||(u=this.performanceInstance.now());var n,i=this.timestamps[t];i||(i=this.timestamps[t]=[]);for(var r=i.length-1;r>=0&&(!(n=i[r])||n[e]);r--)n=null;n||i.push(n={}),n[e]=u}function m(t,e){this.registerTiming(t,"start",e)}function B(t,e){this.registerTiming(t,"end",e)}var w={now:Date.now},y=new A(window&&window.performance||w);y.forceRegisterStartTiming("load_vivliostyle");var N={profiler:{registerStartTiming:y.registerStartTiming,registerEndTiming:y.registerEndTiming,printTimings:y.printTimings,disable:y.disable,enable:y.enable}};function b(t,e){for(var u=0;u<e.length;u++){var n=e[u];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function S(t,e,u){return e&&b(t.prototype,e),u&&b(t,u),Object.defineProperty(t,"prototype",{writable:!1}),t}function T(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,I(t,e)}function x(t){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},x(t)}function I(t,e){return I=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},I(t,e)}function P(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function R(t,e,u){return R=P()?Reflect.construct:function(t,e,u){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return u&&I(i,u.prototype),i},R.apply(null,arguments)}function L(t){var e="function"==typeof Map?new Map:void 0;return L=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,u)}function u(){return R(t,arguments,x(this).constructor)}return u.prototype=Object.create(t.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),I(u,t)},L(t)}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var u=0,n=new Array(e);u<e;u++)n[u]=t[u];return n}function _(t,e){var u="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(u)return(u=u.call(t)).next.bind(u);if(Array.isArray(t)||(u=function(t,e){if(t){if("string"==typeof t)return k(t,e);var u=Object.prototype.toString.call(t).slice(8,-1);return"Object"===u&&t.constructor&&(u=t.constructor.name),"Map"===u||"Set"===u?Array.from(t):"Arguments"===u||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?k(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){u&&(t=u);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var M=/^(?:[\t-\r -#%-\*,-\/:;\?@\[-\]_\{\}\xA0\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u0300-\u036F\u037E\u0387\u0483-\u0487\u055A-\u055F\u0589\u058A\u0591-\u05C7\u05F3\u05F4\u0609\u060A\u060C\u060D\u0610-\u061B\u061D-\u061F\u064B-\u065F\u066A-\u066D\u0670\u06D4\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0700-\u070D\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F7-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0830-\u083E\u0859-\u085B\u085E\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962-\u0965\u0970\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FD\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A76\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF0\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C77\u0C81\u0C84\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0DF4\u0E31\u0E34-\u0E3A\u0E47-\u0E4F\u0E5A\u0E5B\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F04-\u0F12\u0F14\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u0FD0-\u0FD4\u0FD9\u0FDA\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u104A-\u104F\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u10FB\u135D-\u1368\u1400\u166E\u1680\u169B\u169C\u16EB-\u16ED\u1712-\u1714\u1732\u1733\u1735\u1736\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D6\u17D8-\u17DA\u17DD\u1800-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1944\u1945\u1A17\u1A18\u1A1B\u1A1E\u1A1F\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B5A-\u1B60\u1B6B-\u1B73\u1B7D\u1B7E\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1BFC-\u1BFF\u1C2C-\u1C33\u1C36\u1C37\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD0-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u2000-\u200A\u2010-\u2029\u202F-\u2043\u2045-\u2051\u2053-\u205F\u207D\u207E\u208D\u208E\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CEF-\u2CF1\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2D7F\u2DE0-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3000-\u3003\u3008-\u3011\u3014-\u301F\u302A-\u302D\u3030\u303D\u3099\u309A\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA66F\uA673-\uA67E\uA69E\uA69F\uA6F0-\uA6F7\uA802\uA806\uA80B\uA825\uA826\uA82C\uA874-\uA877\uA8C4\uA8C5\uA8CE\uA8CF\uA8E0-\uA8F1\uA8F8-\uA8FA\uA8FC\uA8FF\uA926-\uA92F\uA947-\uA951\uA95F\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9C1-\uA9CD\uA9DE\uA9DF\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA5C-\uAA5F\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAADE\uAADF\uAAEC\uAAED\uAAF0\uAAF1\uAAF6\uABE5\uABE8\uABEB\uABED\uFB1E\uFD3E\uFD3F\uFE00-\uFE19\uFE20-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFEFF\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDDFD\uDEE0\uDF76-\uDF7A\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDE50-\uDE58\uDE7F\uDEE5\uDEE6\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD24-\uDD27\uDEAB-\uDEAD\uDF46-\uDF50\uDF55-\uDF59\uDF82-\uDF89]|\uD804[\uDC01\uDC38-\uDC4D\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9-\uDCBC\uDCBE-\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD40-\uDD43\uDD73-\uDD75\uDD80\uDD81\uDDB6-\uDDBE\uDDC5-\uDDCD\uDDCF\uDDDB\uDDDD-\uDDDF\uDE2F-\uDE31\uDE34\uDE36-\uDE3E\uDEA9\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDCC6\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF-\uDDD7\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F-\uDE43\uDE60-\uDE6C\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDEB9\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B\uDF3C-\uDF3E]|\uD806[\uDC2F-\uDC37\uDC39-\uDC3B\uDD3B\uDD3C\uDD3E\uDD43-\uDD46\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDDE2\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC41-\uDC45\uDC70\uDC71\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF0-\uDEF5\uDF30-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDF4F\uDF8F-\uDF92\uDFE2\uDFE4]|\uD82F[\uDC9D-\uDC9F]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE87-\uDE8B\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A\uDD5E\uDD5F]|\uDB40[\uDD00-\uDDEF])*(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])(?:[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*(?:[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F])(?:[\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC01\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC81\uDCB3-\uDCB6\uDCB9\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD2B\uDD2D-\uDD34\uDD73\uDD80\uDD81\uDDB6-\uDDBE\uDDC9-\uDDCC\uDDCF\uDE2F-\uDE31\uDE34\uDE36\uDE37\uDE3E\uDEDF\uDEE3-\uDEEA\uDF00\uDF01\uDF3B\uDF3C\uDF40\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC38-\uDC3F\uDC42-\uDC44\uDC46\uDC5E\uDCB3-\uDCB8\uDCBA\uDCBF\uDCC0\uDCC2\uDCC3\uDDB2-\uDDB5\uDDBC\uDDBD\uDDBF\uDDC0\uDDDC\uDDDD\uDE33-\uDE3A\uDE3D\uDE3F\uDE40\uDEAB\uDEAD\uDEB0-\uDEB5\uDEB7\uDF1D-\uDF1F\uDF22-\uDF25\uDF27-\uDF2B]|\uD806[\uDC2F-\uDC37\uDC39\uDC3A\uDD3B\uDD3C\uDD3E\uDD43\uDDD4-\uDDD7\uDDDA\uDDDB\uDDE0\uDE01-\uDE0A\uDE33-\uDE38\uDE3B-\uDE3E\uDE47\uDE51-\uDE56\uDE59-\uDE5B\uDE8A-\uDE96\uDE98\uDE99]|\uD807[\uDC30-\uDC36\uDC38-\uDC3D\uDC3F\uDC92-\uDCA7\uDCAA-\uDCB0\uDCB2\uDCB3\uDCB5\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD90\uDD91\uDD95\uDD97\uDEF3\uDEF4]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF8F-\uDF92\uDFE4]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD67-\uDD69\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*)*/,U={};function V(t){return JSON.parse(t)}function H(t){var e=t.match(/^([^#]*)/);return e?e[1]:t}var z=window.location.href;function G(t){z=t}var X,W=window.location.href;function j(t){W=t}function K(t,e){if(/^data:/i.test(e))return t||e;if(!e||t.match(/^\w{2,}:/))return t.toLowerCase().match("^javascript:")?"#":(t.match(/^\w{2,}:\/\/[^\/]+$/)&&(t+="/"),t);var u;if(e.match(/^\w{2,}:\/\/[^\/]+$/)&&(e+="/"),t.match(/^\/\//))return(u=e.match(/^(\w{2,}:)\/\//))?u[1]+t:t;if(t.match(/^\//))return(u=e.match(/^(\w{2,}:\/\/[^\/]+)\//))?u[1]+t:t;if(t.match(/^\.(\/|$)/)&&(t=t.substr(2)),e=function(t){var e=t.match(/^([^#?]*)/);return e?e[1]:t}(e),t.match(/^#/))return e+t;var n=e.lastIndexOf("/");if(n<0)return t;if(n<e.length-1&&e.lastIndexOf(".")<n){if(""==t)return e;n=(e+="/").length-1}var i=e.substr(0,n+1)+t,r="";for((u=i.match(/^([^?#]*)([?#].*)$/))&&(i=u[1],r=u[2]);!((n=i.indexOf("/../"))<=0);){var o=i.lastIndexOf("/",n-1);if(o<=0)break;i=i.substr(0,o)+i.substr(n+3)}return i.replace(/\/(\.\/)+/g,"/")+r}function Y(t){var e;return(e=/^(https?:)\/\/github\.com\/([^/]+\/[^/]+)\/(blob\/|tree\/|raw\/)?(.*)$/.exec(t))?t=e[1]+"//raw.githubusercontent.com/"+e[2]+"/"+(e[3]?"":"master/")+e[4]:(e=/^(https?:)\/\/www\.aozora\.gr\.jp\/(cards\/[^/]+\/files\/[^/.]+\.html)$/.exec(t))?t=e[1]+"//raw.githubusercontent.com/aozorabunko/aozorabunko/master/"+e[2]:(e=/^(https?:)\/\/gist\.github\.com\/([^/]+\/\w+)(\/|$)(raw(\/|$))?(.*)$/.exec(t))?t=e[1]+"//gist.githubusercontent.com/"+e[2]+"/raw/"+e[6]:(e=/^(https?:)\/\/(?:[^/.]+\.)?jsbin\.com\/(?!(?:blog|help)\b)(\w+)((\/\d+)?).*$/.exec(t))&&(t=e[1]+"//output.jsbin.com/"+e[2]+e[3]+"/"),t}function q(t){return null==t?t:t.toString()}!function(t){t.epub="http://www.idpf.org/2007/ops",t.EV="http://www.w3.org/2001/xml-events",t.MATHML="http://www.w3.org/1998/Math/MathML",t.XML="http://www.w3.org/XML/1998/namespace",t.XHTML="http://www.w3.org/1999/xhtml",t.XLINK="http://www.w3.org/1999/xlink",t.SHADOW="http://www.pyroxy.com/ns/shadow",t.SVG="http://www.w3.org/2000/svg",t.DC="http://purl.org/dc/elements/1.1/",t.NCX="http://www.daisy.org/z3986/2005/ncx/"}(X||(X={}));var $=function(){function t(){this.queue=[null]}var e=t.prototype;return e.length=function(){return this.queue.length-1},e.add=function(t){for(var e=this.queue.length;e>1;){var u=Math.floor(e/2),n=this.queue[u];if(n.compare(t)>0)return void(this.queue[e]=t);this.queue[e]=n,e=u}this.queue[1]=t},e.peek=function(){return this.queue[1]},e.remove=function(){var t=this.queue[1],e=this.queue.pop(),u=this.queue.length;if(u>1){for(var n=1;;){var i=2*n;if(i>=u)break;if(this.queue[i].compare(e)>0)i+1<u&&this.queue[i+1].compare(this.queue[i])>0&&i++;else{if(!(i+1<u&&this.queue[i+1].compare(e)>0))break;i++}this.queue[n]=this.queue[i],n=i}this.queue[n]=e}return t},t}(),Q=["","-webkit-","-moz-"],Z={};function J(t,e){return"string"==typeof document.documentElement.style[function(t,e){return t&&(e="-"+e,"moz"===(t=t.replace(/-/g,""))&&(t="Moz")),t+e.replace(/-[a-z]/g,(function(t){return t.substr(1).toUpperCase()}))}(t,e)]}function tt(t){var e=Z[t];if(e||null===e)return e;switch(t){case"behavior":return Z[t]=null,null;case"text-combine-upright":if(J("-webkit-","text-combine")&&!J("","text-combine-upright"))return Z[t]=["-webkit-text-combine"],["-webkit-text-combine"];break;case"filter":if(J("-webkit-","filter"))return Z[t]=["-webkit-filter"],["-webkit-filter"];break;case"clip-path":if(J("-webkit-","clip-path"))return Z[t]=["-webkit-clip-path","clip-path"];break;case"margin-inline-start":if(J("-webkit-","margin-start"))return Z[t]=["-webkit-margin-start"],["-webkit-margin-start"];break;case"margin-inline-end":if(J("-webkit-","margin-end"))return Z[t]=["-webkit-margin-end"],["-webkit-margin-end"];break;case"padding-inline-start":if(J("-webkit-","padding-start"))return Z[t]=["-webkit-padding-start"],["-webkit-padding-start"];break;case"padding-inline-end":if(J("-webkit-","padding-end"))return Z[t]=["-webkit-padding-end"],["-webkit-padding-end"]}for(var u,n=_(Q);!(u=n()).done;){var i=u.value;if(J(i,t))return Z[t]=[e=i+t],[e]}return c.warn("Property not supported by the browser: ",t),Z[t]=null,null}function et(t,e,u){try{var n=tt(e);if(!n)return;var i=null==t?void 0:t.style;if(!i)return;n.forEach((function(t){switch(t){case"-webkit-text-combine":"all"===u&&(u="horizontal");break;case"text-combine-upright":"all"===u&&i.setProperty("text-indent","0")}i.setProperty(t,u)}))}catch(t){c.warn(t)}}function ut(t,e,u){try{var n=Z[e];return t.style.getPropertyValue(n?n[0]:e)}catch(t){}return u||""}function nt(t){var e=t.getAttributeNS(X.XML,"lang");return e||t.namespaceURI!=X.XHTML||(e=t.getAttribute("lang")),e}var it=function(){function t(){this.list=[]}var e=t.prototype;return e.append=function(t){return this.list.push(t),this},e.clear=function(){this.list=[]},e.toString=function(){var t=this.list.join("");return this.list=[t],t},t}();function rt(t){return"\\"+t.charCodeAt(0).toString(16)+" "}function ot(t){return t.replace(/[^-_a-zA-Z0-9\u0080-\uFFFF]/g,rt)}function at(t){return t.replace(/[\u0000-\u001F"\\]/g,rt)}function st(t){return t.replace(/[\s+&?=#\u007F-\uFFFF]+/g,encodeURIComponent)}function lt(t){return!!t.match(/^[a-zA-Z\u009E\u009F\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u024F\u037B-\u037D\u0386\u0388-\u0482\u048A-\u0527]$/)}function Dt(t,e){return t.replace(/[^-a-zA-Z0-9_]/g,(function(t){return function(t,e){return(e="string"==typeof e?e:"\\u")+(65536|t.charCodeAt(0)).toString(16).substr(1)}(t,e)}))}function ht(t){return Dt(t)}function ct(t,e){for(var u=0,n=t;;){if(0==u||e(u-1),n==t||e(n),u==n)return u;var i=u+n>>1;e(i)?n=i:u=i+1}}function dt(t,e){return t-e}function ft(t,e){for(var u,n={},i=_(t);!(u=i()).done;){var r=u.value,o=e(r);o&&!n[o]&&(n[o]=r)}return n}function pt(t,e){for(var u,n={},i=_(t);!(u=i()).done;){var r=u.value,o=e(r);o&&(n[o]?n[o].push(r):n[o]=[r])}return n}var Et=function(){function t(){this.listeners={}}var e=t.prototype;return e.dispatchEvent=function(t){var e=this.listeners[t.type];if(e){t.target=this,t.currentTarget=this;for(var u=0;u<e.length;u++)e[u](t)}},e.addEventListener=function(t,e,u){if(!u){var n=this.listeners[t];n?n.push(e):this.listeners[t]=[e]}},e.removeEventListener=function(t,e,u){if(!u){var n=this.listeners[t];if(n){var i=n.indexOf(e);i>=0&&n.splice(i,1)}}},t}(),Ct=null,Ft=null,At=null,gt=null;function vt(t){if(1==t.nodeType){var e=t.getAttribute("id");if(e)return e}return null}function mt(t){return"^"+t}function Bt(t){return t.replace(/[\[\]\(\),=;^]/g,mt)}function wt(t){return t.substr(1)}function yt(t){return t?t.replace(/\^[\[\]\(\),=;^]/g,wt):t}function Nt(t){var e=[];do{var u=t.match(/^(\^,|[^,])*/),n=yt(u[0]);if(!(t=t.substr(u[0].length+1))&&!e.length)return n;e.push(n)}while(t);return e}function bt(t){for(var e={};t;){var u=t.match(/^;([^;=]+)=(([^;]|\^;)*)/);if(!u)return e;e[u[1]]=Nt(u[2]),t=t.substr(u[0].length)}return e}var St=function(){function t(){}var e=t.prototype;return e.appendTo=function(t){t.append("!")},e.applyTo=function(t){return!1},t}(),Tt=function(){function t(t,e,u){this.index=void 0,this.id=void 0,this.sideBias=void 0,this.index=t,this.id=e,this.sideBias=u}var e=t.prototype;return e.appendTo=function(t){t.append("/"),t.append(this.index.toString()),(this.id||this.sideBias)&&(t.append("["),this.id&&t.append(this.id),this.sideBias&&(t.append(";s="),t.append(this.sideBias)),t.append("]"))},e.applyTo=function(t){if(1!=t.node.nodeType)throw new Error("E_CFI_NOT_ELEMENT");var e,u=t.node,n=u.children,i=n.length,r=Math.floor(this.index/2)-1;if(r<0||0==i)t.node=(e=u.firstChild)||u;else{if(e=n[Math.min(r,i-1)],1&this.index){var o=e.nextSibling;o&&1!=o.nodeType?e=o:t.after=!0}t.node=e}if(this.id&&(t.after||this.id!=vt(t.node))){var a=u.ownerDocument.getElementById(this.id);a?t.node=a:c.warn("E_CFI_ID_MISMATCH:",this.id)}return t.sideBias=this.sideBias,!0},t}(),xt=function(){function t(t,e,u,n){this.offset=void 0,this.textBefore=void 0,this.textAfter=void 0,this.sideBias=void 0,this.offset=t,this.textBefore=e,this.textAfter=u,this.sideBias=n}var e=t.prototype;return e.applyTo=function(t){if(this.offset>0&&!t.after){for(var e=this.offset,u=t.node;;){var n=u.nodeType;if(1==n)break;var i=u.nextSibling;if(3<=n&&n<=5){var r=u.textContent.length;if(e<=r)break;if(!i){e=r;break}e-=r}if(!i){e=0;break}u=i}t.node=u,t.offset=e}return t.sideBias=this.sideBias,!0},e.appendTo=function(t){t.append(":"),t.append(this.offset.toString()),(this.textBefore||this.textAfter||this.sideBias)&&(t.append("["),(this.textBefore||this.textAfter)&&(this.textBefore&&t.append(Bt(this.textBefore)),t.append(","),this.textAfter&&t.append(Bt(this.textAfter))),this.sideBias&&(t.append(";s="),t.append(this.sideBias)),t.append("]"))},t}(),It=function(){function t(){this.steps=null}var e=t.prototype;return e.fromString=function(t){var e=t.match(/^#?epubcfi\((.*)\)$/);if(!e)throw new Error("E_CFI_NOT_CFI");for(var u=decodeURIComponent(e[1]),n=0,i=[];;){var r=void 0;switch(u.charAt(n)){case"/":if(n++,!(e=u.substr(n).match(/^(0|[1-9][0-9]*)(\[(.*?)(;([^\]]|\^\])*)?\])?/)))throw new Error("E_CFI_NUMBER_EXPECTED");n+=e[0].length;var o=parseInt(e[1],10),a=e[3];r=bt(e[4]),i.push(new Tt(o,a,q(r.s)));break;case":":if(n++,!(e=u.substr(n).match(/^(0|[1-9][0-9]*)(\[((([^\];,]|\^[\];,])*)(,(([^\];,]|\^[\];,])*))?)(;([^]]|\^\])*)?\])?/)))throw new Error("E_CFI_NUMBER_EXPECTED");n+=e[0].length;var s=parseInt(e[1],10),l=e[4];l&&(l=yt(l));var D=e[7];D&&(D=yt(D)),r=bt(e[10]),i.push(new xt(s,l,D,q(r.s)));break;case"!":n++,i.push(new St);break;case"~":case"@":case"":return void(this.steps=i);default:throw new Error("E_CFI_PARSE_ERROR")}}},e.navigate=function(e){for(var u={node:e.documentElement,offset:0,after:!1,sideBias:null,ref:null},n=0;n<this.steps.length;n++)if(!this.steps[n].applyTo(u)){u.ref=new t,u.ref.steps=this.steps.slice(n+1);break}return u},e.trim=function(t,e){return t.replace(/\s+/g," ").match(e?/^[ -\uD7FF\uE000-\uFFFF]{0,8}/:/[ -\uD7FF\uE000-\uFFFF]{0,8}$/)[0].replace(/^\s/,"").replace(/\s$/,"")},e.prependPathFromNode=function(t,e,u,n){for(var i=[],r=t.parentNode,o="",a="";t;){switch(t.nodeType){case 3:case 4:case 5:var s=t.textContent,l=s.length;u?(e+=l,o||(o=s)):(e>l&&(e=l),u=!0,o=s.substr(0,e),a=s.substr(e)),t=t.previousSibling;continue;case 8:t=t.previousSibling;continue}break}for((e>0||o||a)&&(o=this.trim(o,!1),a=this.trim(a,!0),i.push(new xt(e,o,a,n)),n=null);r&&r&&9!=r.nodeType;){for(var D=u?null:vt(t),h=u?1:0;t;)1==t.nodeType&&(h+=2),t=t.previousSibling;i.push(new Tt(h,D,n)),n=null,t=r,r=r.parentNode,u=!1}i.reverse(),this.steps?(i.push(new St),this.steps=i.concat(this.steps)):this.steps=i},e.toString=function(){if(!this.steps)return"";var t=new it;t.append("epubcfi(");for(var e=0;e<this.steps.length;e++)this.steps[e].appendTo(t);return t.append(")"),t.toString().replace(/%/g,"%25")},t}();function Pt(t){return{fontFamily:t.fontFamily,lineHeight:t.lineHeight,margin:t.margin,hyphenate:t.hyphenate,columnWidth:t.columnWidth,horizontal:t.horizontal,nightMode:t.nightMode,spreadView:t.spreadView,pageBorder:t.pageBorder,enabledMediaTypes:Object.assign({},t.enabledMediaTypes),defaultPaperSize:t.defaultPaperSize?Object.assign({},t.defaultPaperSize):void 0}}var Rt={fontFamily:"serif",lineHeight:1.25,margin:8,hyphenate:!1,columnWidth:25,horizontal:!1,nightMode:!1,spreadView:!1,pageBorder:1,enabledMediaTypes:{vivliostyle:!0,print:!0},defaultPaperSize:void 0},Lt={};function Ot(t,e,u,n){var i=Math.min((t-0)/u,(e-0)/n);return"matrix("+i+",0,0,"+i+",0,0)"}function kt(t){return'"'+at(""+t)+'"'}function _t(t){return ot(""+t)}function Mt(t,e){return t?ot(t)+"."+ot(e):ot(e)}var Ut=0,Vt=function(){function t(t,e){if(this.parent=void 0,this.resolver=void 0,this.scopeKey=void 0,this.children=[],this.zero=void 0,this.one=void 0,this._true=void 0,this._false=void 0,this.values={},this.funcs={},this.builtIns={},this.parent=t,this.resolver=e,this.scopeKey="S"+Ut++,this.zero=new Be(this,0),this.one=new Be(this,1),this._true=new Be(this,!0),this._false=new Be(this,!1),t&&t.children.push(this),!t){var u=this.builtIns;u.floor=Math.floor,u.ceil=Math.ceil,u.round=Math.round,u.sqrt=Math.sqrt,u.min=Math.min,u.max=Math.max,u.letterbox=Ot,u["css-string"]=kt,u["css-name"]=_t,u.typeof=function(t){return typeof t},this.defineBuiltInName("page-width",(function(){return this.pageWidth()})),this.defineBuiltInName("page-height",(function(){return this.pageHeight()})),this.defineBuiltInName("pref-font-family",(function(){return this.pref.fontFamily})),this.defineBuiltInName("pref-night-mode",(function(){return this.pref.nightMode})),this.defineBuiltInName("pref-hyphenate",(function(){return this.pref.hyphenate})),this.defineBuiltInName("pref-margin",(function(){return this.pref.margin})),this.defineBuiltInName("pref-line-height",(function(){return this.pref.lineHeight})),this.defineBuiltInName("pref-column-width",(function(){return this.pref.columnWidth*this.fontSize})),this.defineBuiltInName("pref-horizontal",(function(){return this.pref.horizontal})),this.defineBuiltInName("pref-spread-view",(function(){return this.pref.spreadView})),this.defineBuiltInName("pub-title",(function(){return kt(this.pubTitle?this.pubTitle:"")})),this.defineBuiltInName("doc-title",(function(){return kt(this.docTitle?this.docTitle:"")}))}}var e=t.prototype;return e.defineBuiltInName=function(t,e){this.values[t]=new ge(this,e,t)},e.defineName=function(t,e){this.values[t]=e},e.defineFunc=function(t,e){this.funcs[t]=e},e.defineBuiltIn=function(t,e){this.builtIns[t]=e},t}();function Ht(t){switch(t.toLowerCase()){case"vw":case"vh":case"vi":case"vb":case"vmin":case"vmax":case"pvw":case"pvh":case"pvi":case"pvb":case"pvmin":case"pvmax":return!0;default:return!1}}var zt={px:1,in:96,pt:4/3,pc:16,cm:96/2.54,mm:96/25.4,q:96/2.54/40,em:16,rem:16,ex:8,dppx:1,dpi:1/96,dpcm:2.54/96};function Gt(t){switch(t){case"q":case"rem":return!0;default:return!1}}var Xt=function(){function t(t,e,u,n){this.rootScope=void 0,this.viewportWidth=void 0,this.viewportHeight=void 0,this.actualPageWidth=null,this.pageWidth=void 0,this.actualPageHeight=null,this.pageHeight=void 0,this.initialFontSize=void 0,this.rootFontSize=null,this.isRelativeRootFontSize=null,this.fontSize=void 0,this.pref=void 0,this.scopes={},this.pageAreaWidth=null,this.pageAreaHeight=null,this.pageVertical=null,this.pubTitle=null,this.docTitle=null,this.rootScope=t,this.viewportWidth=e,this.viewportHeight=u,this.pageWidth=function(){return this.actualPageWidth?this.actualPageWidth:this.pref.spreadView?Math.floor(e/2)-this.pref.pageBorder:e},this.pageHeight=function(){return this.actualPageHeight?this.actualPageHeight:u},this.initialFontSize=n,this.fontSize=function(){return this.rootFontSize?this.rootFontSize:n},this.pref=Rt}var e=t.prototype;return e.getScopeContext=function(t){var e=this.scopes[t.scopeKey];return e||(this.scopes[t.scopeKey]=e={}),e},e.clearScope=function(t){this.scopes[t.scopeKey]={};for(var e=0;e<t.children.length;e++)this.clearScope(t.children[e])},e.queryUnitSize=function(t,e){if(Ht(t)){var u=this.pageWidth()/100,n=this.pageHeight()/100,i=null!=this.pageAreaWidth?this.pageAreaWidth/100:u,r=null!=this.pageAreaHeight?this.pageAreaHeight/100:n;switch(t){case"vw":return i;case"vh":return r;case"vi":return this.pageVertical?r:i;case"vb":return this.pageVertical?i:r;case"vmin":return i<r?i:r;case"vmax":return i>r?i:r;case"pvw":return u;case"pvh":return n;case"pvi":return this.pageVertical?n:u;case"pvb":return this.pageVertical?u:n;case"pvmin":return u<n?u:n;case"pvmax":return u>n?u:n}}return"em"==t||"rem"==t?e?this.initialFontSize:this.fontSize():"ex"==t?zt.ex*(e?this.initialFontSize:this.fontSize())/zt.em:zt[t]},e.evalName=function(t,e){do{var u=t.values[e];if(u)return u;if(t.resolver&&(u=t.resolver.call(this,e,!1)))return u;t=t.parent}while(t);throw new Error("Name '"+e+"' is undefined")},e.evalCall=function(t,e,u,n){do{var i=t.funcs[e];if(i)return i;if(t.resolver&&(i=t.resolver.call(this,e,!0)))return i;var r=t.builtIns[e];if(r){if(n)return t.zero;for(var o=Array(u.length),a=0;a<u.length;a++)o[a]=u[a].evaluate(this);return new Be(t,r.apply(this,o))}t=t.parent}while(t);throw new Error("Function '"+e+"' is undefined")},e.evalMediaName=function(t,e){var u="all"===t||!!this.pref.enabledMediaTypes[t];return e?!u:u},e.evalMediaTest=function(t,e){var u="",n=t.match(/^(min|max)-(.*)$/);n&&(u=n[1],t=n[2]);var i=null,r=null;switch(t){case"width":case"height":case"device-width":case"device-height":case"color":e&&(i=e.evaluate(this))}switch(t){case"width":r=this.pageWidth();break;case"height":r=this.pageHeight();break;case"device-width":r=window.screen.availWidth;break;case"device-height":r=window.screen.availHeight;break;case"color":r=window.screen.pixelDepth}if(null!=r&&null!=i)switch(u){case"min":return r>=i;case"max":return r<=i;default:return r==i}else if(null!=r&&null==e)return 0!==r;return!1},e.evalSupportsTest=function(t,e,u){return!1},e.queryVal=function(t,e){var u=this.scopes[t.scopeKey];return u?u[e]:void 0},e.storeVal=function(t,e,u){this.getScopeContext(t)[e]=u},t}(),Wt=function(){function t(t){this.scope=void 0,this.key=void 0,this.scope=t,this.scope=t,this.key="_"+Ut++}var e=t.prototype;return e.toString=function(){var t=new it;return this.appendTo(t,0),t.toString()},e.appendTo=function(t,e){throw new Error("F_ABSTRACT")},e.evaluateCore=function(t){throw new Error("F_ABSTRACT")},e.expand=function(t,e){return this},e.dependCore=function(t,e,u){return t===this},e.dependOuter=function(t,e,u){var n=u[this.key];if(null!=n)return n!==Lt&&n;u[this.key]=Lt;var i=this.dependCore(t,e,u);return u[this.key]=i,i},e.depend=function(t,e){return this.dependOuter(t,e,{})},e.evaluate=function(t){var e=t.queryVal(this.scope,this.key);return void 0!==e||(e=this.evaluateCore(t),t.storeVal(this.scope,this.key,e)),e},e.isMediaName=function(){return!1},t}(),jt=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).val=void 0,n.val=u,n}T(e,t);var u=e.prototype;return u.getOp=function(){throw new Error("F_ABSTRACT")},u.evalPrefix=function(t){throw new Error("F_ABSTRACT")},u.evaluateCore=function(t){var e=this.val.evaluate(t);return this.evalPrefix(e)},u.dependCore=function(t,e,u){return t===this||this.val.dependOuter(t,e,u)},u.appendTo=function(t,e){10<e&&t.append("("),t.append(this.getOp()),this.val.appendTo(t,10),10<e&&t.append(")")},u.expand=function(t,e){var u=this.val.expand(t,e);return u===this.val?this:new this.constructor(this.scope,u)},e}(Wt),Kt=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).lhs=void 0,i.rhs=void 0,i.lhs=u,i.rhs=n,i}T(e,t);var u=e.prototype;return u.getPriority=function(){throw new Error("F_ABSTRACT")},u.getOp=function(){throw new Error("F_ABSTRACT")},u.evalInfix=function(t,e){throw new Error("F_ABSTRACT")},u.evaluateCore=function(t){var e=this.lhs.evaluate(t),u=this.rhs.evaluate(t);return this.evalInfix(e,u)},u.dependCore=function(t,e,u){return t===this||this.lhs.dependOuter(t,e,u)||this.rhs.dependOuter(t,e,u)},u.appendTo=function(t,e){var u=this.getPriority();u<=e&&t.append("("),this.lhs.appendTo(t,u),t.append(this.getOp()),this.rhs.appendTo(t,u),u<=e&&t.append(")")},u.expand=function(t,e){var u=this.lhs.expand(t,e),n=this.rhs.expand(t,e);return u===this.lhs&&n===this.rhs?this:new this.constructor(this.scope,u,n)},e}(Wt),Yt=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}return T(e,t),e.prototype.getPriority=function(){return 1},e}(Kt),qt=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}return T(e,t),e.prototype.getPriority=function(){return 2},e}(Kt),$t=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}return T(e,t),e.prototype.getPriority=function(){return 3},e}(Kt),Qt=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}return T(e,t),e.prototype.getPriority=function(){return 4},e}(Kt),Zt=function(t){function e(e,u){return t.call(this,e,u)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"!"},u.evalPrefix=function(t){return!t},e}(jt),Jt=function(t){function e(e,u){return t.call(this,e,u)||this}return T(e,t),e.prototype.getOp=function(){return"not "},e}(Zt),te=function(t){function e(e,u){return t.call(this,e,u)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"-"},u.evalPrefix=function(t){return-t},e}(jt),ee=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"&&"},u.evaluateCore=function(t){return this.lhs.evaluate(t)&&this.rhs.evaluate(t)},e}(Yt),ue=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}return T(e,t),e.prototype.getOp=function(){return" and "},e}(ee),ne=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"||"},u.evaluateCore=function(t){return this.lhs.evaluate(t)||this.rhs.evaluate(t)},e}(Yt),ie=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}return T(e,t),e.prototype.getOp=function(){return", "},e}(ne),re=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}return T(e,t),e.prototype.getOp=function(){return" or "},e}(ne),oe=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"<"},u.evalInfix=function(t,e){return t<e},e}(qt),ae=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"<="},u.evalInfix=function(t,e){return t<=e},e}(qt),se=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return">"},u.evalInfix=function(t,e){return t>e},e}(qt),le=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return">="},u.evalInfix=function(t,e){return t>=e},e}(qt),De=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"=="},u.evalInfix=function(t,e){return t==e},e}(qt),he=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"!="},u.evalInfix=function(t,e){return t!=e},e}(qt),ce=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"+"},u.evalInfix=function(t,e){return t+e},e}($t),de=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return" - "},u.evalInfix=function(t,e){return t-e},e}($t),fe=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"*"},u.evalInfix=function(t,e){return t*e},e}(Qt),pe=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"/"},u.evalInfix=function(t,e){return t/e},e}(Qt),Ee=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.getOp=function(){return"%"},u.evalInfix=function(t,e){return t%e},e}(Qt),Ce=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).num=void 0,i.unit=void 0,i.num=u,i.unit=n.toLowerCase(),i}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.num.toString()),t.append(ot(this.unit))},u.evaluateCore=function(t){return this.num*t.queryUnitSize(this.unit,!1)},e}(Wt),Fe=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).qualifiedName=void 0,n.qualifiedName=u,n}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.qualifiedName)},u.evaluateCore=function(t){return t.evalName(this.scope,this.qualifiedName).evaluate(t)},u.dependCore=function(t,e,u){return t===this||e.evalName(this.scope,this.qualifiedName).dependOuter(t,e,u)},e}(Wt),Ae=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).not=void 0,i.name=void 0,i.not=u,i.name=n,i}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){this.not&&t.append("not "),t.append(ot(this.name))},u.evaluateCore=function(t){return t.evalMediaName(this.name,this.not)},u.isMediaName=function(){return!0},e}(Wt),ge=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).fn=void 0,i.str=void 0,i.fn=u,i.str=n,i}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.str)},u.evaluateCore=function(t){return this.fn.call(t)},e}(Wt),ve=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).qualifiedName=void 0,i.params=void 0,i.qualifiedName=u,i.params=n,i}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.qualifiedName),function(t,e){t.append("(");for(var u=0;u<e.length;u++)u&&t.append(","),e[u].appendTo(t,0);t.append(")")}(t,this.params)},u.evaluateCore=function(t){return t.evalCall(this.scope,this.qualifiedName,this.params,!1).expand(t,this.params).evaluate(t)},u.dependCore=function(t,e,u){if(t===this)return!0;for(var n=0;n<this.params.length;n++)if(this.params[n].dependOuter(t,e,u))return!0;return e.evalCall(this.scope,this.qualifiedName,this.params,!0).dependOuter(t,e,u)},u.expand=function(t,u){var n=function(t,e,u){for(var n=e,i=0;i<e.length;i++){var r=e[i].expand(t,u);if(e!==n)n[i]=r;else if(r!==e[i]){n=Array(e.length);for(var o=0;o<i;o++)n[o]=e[o];n[i]=r}}return n}(t,this.params,u);return n===this.params?this:new e(this.scope,this.qualifiedName,n)},e}(Wt),me=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e)||this).cond=void 0,r.ifTrue=void 0,r.ifFalse=void 0,r.cond=u,r.ifTrue=n,r.ifFalse=i,r}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){e>0&&t.append("("),this.cond.appendTo(t,0),t.append("?"),this.ifTrue.appendTo(t,0),t.append(":"),this.ifFalse.appendTo(t,0),e>0&&t.append(")")},u.evaluateCore=function(t){return this.cond.evaluate(t)?this.ifTrue.evaluate(t):this.ifFalse.evaluate(t)},u.dependCore=function(t,e,u){return t===this||this.cond.dependOuter(t,e,u)||this.ifTrue.dependOuter(t,e,u)||this.ifFalse.dependOuter(t,e,u)},u.expand=function(t,u){var n=this.cond.expand(t,u),i=this.ifTrue.expand(t,u),r=this.ifFalse.expand(t,u);return n===this.cond&&i===this.ifTrue&&r===this.ifFalse?this:new e(this.scope,n,i,r)},e}(Wt),Be=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).val=void 0,n.val=u,n}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){switch(typeof this.val){case"number":case"boolean":t.append(this.val.toString());break;case"string":t.append('"'),t.append(at(this.val)),t.append('"');break;default:throw new Error("F_UNEXPECTED_STATE")}},u.evaluateCore=function(t){return this.val},e}(Wt),we=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).name=void 0,i.value=void 0,i.name=u,i.value=n,i}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append("("),t.append(at(this.name.name)),t.append(":"),this.value.appendTo(t,0),t.append(")")},u.evaluateCore=function(t){return t.evalMediaTest(this.name.name,this.value)},u.dependCore=function(t,e,u){return t===this||this.value.dependOuter(t,e,u)},u.expand=function(t,u){var n=this.value.expand(t,u);return n===this.value?this:new e(this.scope,this.name,n)},e}(Wt),ye=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e)||this).name=void 0,r.value=void 0,r.isFunc=void 0,r.name=u,r.value=n,r.isFunc=i,r}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){this.isFunc&&t.append(this.name),t.append("("),!this.isFunc&&this.name&&(t.append(this.name),t.append(":")),t.append(this.value),t.append(")")},u.evaluateCore=function(t){return t.evalSupportsTest(this.name,this.value,this.isFunc)},e}(Wt),Ne=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).index=void 0,n.index=u,n}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append("$"),t.append(this.index.toString())},u.expand=function(t,e){var u=e[this.index];if(!u)throw new Error("Parameter missing: "+this.index);return u},e}(Wt);function be(t,e,u){return e===t._false||e===t.zero||u==t._false||u==t.zero?t._false:e===t._true||e===t.one?u:u===t._true||u===t.one?e:new ee(t,e,u)}function Se(t,e,u){return e===t.zero?u:u===t.zero?e:new ce(t,e,u)}function Te(t,e,u){return e===t.zero?new te(t,u):u===t.zero?e:new de(t,e,u)}function xe(t,e,u){return e===t.zero||u===t.zero?t.zero:e===t.one?u:u===t.one?e:new fe(t,e,u)}function Ie(t,e,u){return e===t.zero?t.zero:u===t.one?e:new pe(t,e,u)}var Pe=function(){function t(){}var e=t.prototype;return e.visitValues=function(t){for(var e=0;e<t.length;e++)t[e].visit(this)},e.visitEmpty=function(t){throw new Error("E_CSS_EMPTY_NOT_ALLOWED")},e.visitSlash=function(t){throw new Error("E_CSS_SLASH_NOT_ALLOWED")},e.visitStr=function(t){throw new Error("E_CSS_STR_NOT_ALLOWED")},e.visitIdent=function(t){throw new Error("E_CSS_IDENT_NOT_ALLOWED")},e.visitNumeric=function(t){throw new Error("E_CSS_NUMERIC_NOT_ALLOWED")},e.visitNum=function(t){throw new Error("E_CSS_NUM_NOT_ALLOWED")},e.visitInt=function(t){return this.visitNum(t)},e.visitColor=function(t){throw new Error("E_CSS_COLOR_NOT_ALLOWED")},e.visitURL=function(t){throw new Error("E_CSS_URL_NOT_ALLOWED")},e.visitURange=function(t){throw new Error("E_CSS_URANGE_NOT_ALLOWED")},e.visitSpaceList=function(t){throw new Error("E_CSS_LIST_NOT_ALLOWED")},e.visitCommaList=function(t){throw new Error("E_CSS_COMMA_NOT_ALLOWED")},e.visitFunc=function(t){throw new Error("E_CSS_FUNC_NOT_ALLOWED")},e.visitExpr=function(t){throw new Error("E_CSS_EXPR_NOT_ALLOWED")},t}(),Re=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.visitValues=function(t){for(var e=null,u=0;u<t.length;u++){var n=t[u],i=n.visit(this);if(e)e[u]=i;else if(n!==i){e=new Array(t.length);for(var r=0;r<u;r++)e[r]=t[r];e[u]=i}}return e||t},u.visitStr=function(t){return t},u.visitIdent=function(t){return t},u.visitSlash=function(t){return t},u.visitNumeric=function(t){return t},u.visitNum=function(t){return t},u.visitInt=function(t){return t},u.visitColor=function(t){return t},u.visitURL=function(t){return t},u.visitURange=function(t){return t},u.visitSpaceList=function(t){var e=this.visitValues(t.values);return e===t.values?t:new $e(e)},u.visitCommaList=function(t){var e=this.visitValues(t.values);return e===t.values?t:new Qe(e)},u.visitFunc=function(t){var e=this.visitValues(t.values);return e===t.values?t:new Ze(t.name,e)},u.visitExpr=function(t){return t},e}(Pe),Le=function(){function t(){}var e=t.prototype;return e.toString=function(){var t=new it;return this.appendTo(t,!0),t.toString()},e.stringValue=function(){var t=new it;return this.appendTo(t,!1),t.toString()},e.toExpr=function(t,e){throw new Error("F_ABSTRACT")},e.appendTo=function(t,e){t.append("[error]")},e.isExpr=function(){return!1},e.isNumeric=function(){return!1},e.isNum=function(){return!1},e.isIdent=function(){return!1},e.isSpaceList=function(){return!1},e.visit=function(t){throw new Error("F_ABSTRACT")},t}(),Oe=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.toExpr=function(t,e){return new Be(t,"")},u.appendTo=function(t,e){},u.visit=function(t){return t.visitEmpty(this)},S(e,null,[{key:"instance",get:function(){return this.empty||(this.empty=new e),this.empty}}]),e}(Le);Oe.empty=void 0;var ke=Oe.instance,_e=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.toExpr=function(t,e){return new Be(t,"/")},u.appendTo=function(t,e){t.append("/")},u.visit=function(t){return t.visitSlash(this)},S(e,null,[{key:"instance",get:function(){return this.slash||(this.slash=new e),this.slash}}]),e}(Le);_e.slash=void 0;var Me=_e.instance,Ue=function(t){function e(e){var u;return(u=t.call(this)||this).str=void 0,u.str=e,u}T(e,t);var u=e.prototype;return u.toExpr=function(t,e){return new Be(t,this.str)},u.appendTo=function(t,e){e?(t.append('"'),t.append(at(this.str)),t.append('"')):t.append(this.str)},u.visit=function(t){return t.visitStr(this)},e}(Le),Ve={},He=function(t){function e(e){var u;if((u=t.call(this)||this).name=void 0,u.name=e,Ve[e])throw new Error("E_INVALID_CALL");return Ve[e]=O(u),u}T(e,t);var u=e.prototype;return u.toExpr=function(t,e){return new Be(t,this.name)},u.appendTo=function(t,e){t.append(e?ot(this.name):this.name)},u.visit=function(t){return t.visitIdent(this)},u.isIdent=function(){return!0},e}(Le);function ze(t){var e=Ve[t];return e||(e=new He(t)),e}var Ge=function(t){function e(e,u){var n;return(n=t.call(this)||this).num=void 0,n.unit=void 0,n.num=e,n.unit=u.toLowerCase(),n}T(e,t);var u=e.prototype;return u.toExpr=function(t,e){return 0==this.num?t.zero:e&&"%"==this.unit?100==this.num?e:new fe(t,e,new Be(t,this.num/100)):new Ce(t,this.num,this.unit)},u.appendTo=function(t,e){t.append(this.num.toString()),t.append(this.unit)},u.visit=function(t){return t.visitNumeric(this)},u.isNumeric=function(){return!0},e}(Le),Xe=function(t){function e(e){var u;return(u=t.call(this)||this).num=void 0,u.num=e,u}T(e,t);var u=e.prototype;return u.toExpr=function(t,e){return 0==this.num?t.zero:1==this.num?t.one:new Be(t,this.num)},u.appendTo=function(t,e){t.append(this.num.toString())},u.visit=function(t){return t.visitNum(this)},u.isNum=function(){return!0},e}(Le),We=function(t){function e(e){return t.call(this,e)||this}return T(e,t),e.prototype.visit=function(t){return t.visitInt(this)},e}(Xe),je=function(t){function e(e){var u;return(u=t.call(this)||this).rgb=void 0,u.rgb=e,u}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append("#");var u=this.rgb.toString(16);t.append("000000".substr(u.length)),t.append(u)},u.visit=function(t){return t.visitColor(this)},e}(Le),Ke=function(t){function e(e){var u;return(u=t.call(this)||this).url=void 0,u.url=e,u}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append('url("'),t.append(at(this.url)),t.append('")')},u.visit=function(t){return t.visitURL(this)},e}(Le),Ye=function(t){function e(e){var u;return(u=t.call(this)||this).urangeText=void 0,u.urangeText=e,u}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(this.urangeText)},u.visit=function(t){return t.visitURange(this)},e}(Le);function qe(t,e,u,n){var i=e.length;if(i>0){e[0].appendTo(t,n);for(var r=1;r<i;r++)t.append(u),e[r].appendTo(t,n)}}var $e=function(t){function e(e){var u;return(u=t.call(this)||this).values=void 0,u.values=e,u}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){qe(t,this.values," ",e)},u.visit=function(t){return t.visitSpaceList(this)},u.isSpaceList=function(){return!0},e}(Le),Qe=function(t){function e(e){var u;return(u=t.call(this)||this).values=void 0,u.values=e,u}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){qe(t,this.values,",",e)},u.visit=function(t){return t.visitCommaList(this)},e}(Le),Ze=function(t){function e(e,u){var n;return(n=t.call(this)||this).name=void 0,n.values=void 0,n.name=e,n.values=u,n}T(e,t);var u=e.prototype;return u.appendTo=function(t,e){t.append(ot(this.name)),t.append("("),qe(t,this.values,",",e),t.append(")")},u.visit=function(t){return t.visitFunc(this)},e}(Le),Je=function(t){function e(e){var u;return(u=t.call(this)||this).expr=void 0,u.expr=e,u}T(e,t);var u=e.prototype;return u.toExpr=function(){return this.expr},u.appendTo=function(t,e){t.append("-epubx-expr("),this.expr.appendTo(t,0),t.append(")")},u.visit=function(t){return t.visitExpr(this)},u.isExpr=function(){return!0},e}(Le);function tu(t,e){if(t){if(t.isNumeric()){var u=t;return e.queryUnitSize(u.unit,!1)*u.num}if(t.isNum())return t.num}return 0}function eu(t,e){return new Ge(tu(t,e),"px")}var uu={absolute:ze("absolute"),all:ze("all"),always:ze("always"),anywhere:ze("anywhere"),auto:ze("auto"),avoid:ze("avoid"),balance:ze("balance"),balance_all:ze("balance-all"),block:ze("block"),block_end:ze("block-end"),block_start:ze("block-start"),both:ze("both"),bottom:ze("bottom"),border_box:ze("border-box"),break_all:ze("break-all"),break_word:ze("break-word"),crop:ze("crop"),cross:ze("cross"),column:ze("column"),exclusive:ze("exclusive"),_false:ze("false"),fixed:ze("fixed"),flex:ze("flex"),footnote:ze("footnote"),footer:ze("footer"),header:ze("header"),hidden:ze("hidden"),horizontal_tb:ze("horizontal-tb"),inherit:ze("inherit"),inline:ze("inline"),inline_block:ze("inline-block"),inline_end:ze("inline-end"),inline_start:ze("inline-start"),landscape:ze("landscape"),left:ze("left"),line:ze("line"),list_item:ze("list-item"),ltr:ze("ltr"),manual:ze("manual"),none:ze("none"),normal:ze("normal"),oeb_page_foot:ze("oeb-page-foot"),oeb_page_head:ze("oeb-page-head"),page:ze("page"),relative:ze("relative"),right:ze("right"),same:ze("same"),scale:ze("scale"),snap_block:ze("snap-block"),spread:ze("spread"),_static:ze("static"),rtl:ze("rtl"),table:ze("table"),table_caption:ze("table-caption"),table_cell:ze("table-cell"),table_footer_group:ze("table-footer-group"),table_header_group:ze("table-header-group"),table_row:ze("table-row"),top:ze("top"),transparent:ze("transparent"),vertical_lr:ze("vertical-lr"),vertical_rl:ze("vertical-rl"),visible:ze("visible"),_true:ze("true")},nu=new Ge(100,"%"),iu=new Ge(100,"pvw"),ru=new Ge(100,"pvh"),ou=new Ge(0,"px"),au=new Ye("U+0-10FFFF"),su={"font-size":1,color:2};function lu(t,e){return(su[t]||Number.MAX_VALUE)-(su[e]||Number.MAX_VALUE)}var Du=function(t,e,u,n){this.x1=void 0,this.y1=void 0,this.x2=void 0,this.y2=void 0,this.x1=t,this.y1=e,this.x2=u,this.y2=n},hu=function(t,e){this.x=void 0,this.y=void 0,this.x=t,this.y=e},cu=function(t,e,u,n){this.left=void 0,this.top=void 0,this.right=void 0,this.bottom=void 0,this.left=t,this.top=e,this.right=u,this.bottom=n},du=function(t,e,u,n){this.low=void 0,this.high=void 0,this.winding=void 0,this.shapeId=void 0,this.low=t,this.high=e,this.winding=u,this.shapeId=n},fu=function(t,e,u,n){this.y1=void 0,this.y2=void 0,this.x1=void 0,this.x2=void 0,this.left=null,this.right=null,this.y1=t,this.y2=e,this.x1=u,this.x2=n};function pu(t,e){return t.low.y-e.low.y||t.low.x-e.low.x}var Eu=function(){function t(t){this.points=void 0,this.points=t}var e=t.prototype;return e.addSegments=function(t,e){for(var u=this.points,n=u.length,i=u[n-1],r=0;r<n;r++){var o,a=u[r];o=i.y<a.y?new du(i,a,1,e):new du(a,i,-1,e),t.push(o),i=a}},e.withOffset=function(e,u){for(var n,i=[],r=_(this.points);!(n=r()).done;){var o=n.value;i.push(new hu(o.x+e,o.y+u))}return new t(i)},t}();function Cu(t,e,u,n){for(var i=[],r=0;r<20;r++){var o=2*r*Math.PI/20;i.push(new hu(t+u*Math.sin(o),e+n*Math.cos(o)))}return new Eu(i)}function Fu(t,e,u,n){return new Eu([new hu(t,e),new hu(u,e),new hu(u,n),new hu(t,n)])}var Au=function(t,e,u,n){this.x=void 0,this.winding=void 0,this.shapeId=void 0,this.lowOrHigh=void 0,this.x=t,this.winding=e,this.shapeId=u,this.lowOrHigh=n};function gu(t,e){var u=t.low.x+(t.high.x-t.low.x)*(e-t.low.y)/(t.high.y-t.low.y);if(isNaN(u))throw new Error("Bad intersection");return u}function vu(t,e,u,n){var i,r,o,a;e.high.y<u&&c.warn("Error: inconsistent segment (1)"),e.low.y<=u?(i=gu(e,u),r=e.winding):(i=e.low.x,r=0),e.high.y>=n?(o=gu(e,n),a=e.winding):(o=e.high.x,a=0),i<o?(t.push(new Au(i,r,e.shapeId,-1)),t.push(new Au(o,a,e.shapeId,1))):(t.push(new Au(o,a,e.shapeId,-1)),t.push(new Au(i,r,e.shapeId,1)))}function mu(t,e,u){var n,i=e+u,r=Array(i),o=Array(i);for(n=0;n<=i;n++)r[n]=0,o[n]=0;for(var a=[],s=!1,l=t.length,D=0;D<l;D++){var h=t[D];r[h.shapeId]+=h.winding,o[h.shapeId]+=h.lowOrHigh;var c=!1;for(n=0;n<e;n++)if(r[n]&&!o[n]){c=!0;break}if(c)for(n=e;n<=i;n++)if(r[n]||o[n]){c=!1;break}s!=c&&(a.push(h.x),s=c)}return a}function Bu(t,e){return e?Math.floor(t/e)*e:t}function wu(t){return new Du(t.y1,-t.x2,t.y2,-t.x1)}function yu(t){return new Du(-t.y2,t.x1,-t.y1,t.x2)}function Nu(t){return new Eu(t.points.map((function(t){return function(t){return new hu(t.y,-t.x)}(t)})))}function bu(t,e){for(var u=e.length-1,n=new fu(t.y2,t.y2,t.x1,t.x2);u>=0;){var i=n;((n=e[u]).y2-n.y1<1||n.x1==i.x1&&n.x2==i.x2)&&(i.y1=n.y1,e.splice(u,1),n=i),u--}}function Su(t,e){for(var u=0,n=t.length;u<n;){var i=Math.floor((u+n)/2);e>=t[i].y2?u=i+1:n=i}return u}function Tu(t,e){if(!t.length)return e;var u,n,i=e.y1;for(n=0;n<t.length&&!((u=t[n]).y2>e.y1&&u.x1-.1<=e.x1&&u.x2+.1>=e.x2);n++)i=Math.max(i,u.y2);for(var r=i;n<t.length&&!((u=t[n]).y1>=e.y2||u.x1-.1>e.x1||u.x2+.1<e.x2);n++)r=u.y2;return(r=n===t.length?e.y2:Math.min(r,e.y2))<=i?null:new Du(e.x1,i,e.x2,r)}function xu(t,e){if(!t.length)return e;var u,n,i=e.y2;for(n=t.length-1;n>=0&&(u=t[n],!(n===t.length-1&&u.y2<e.y2))&&!(u.y1<e.y2&&u.x1-.1<=e.x1&&u.x2+.1>=e.x2);n--)i=Math.min(i,u.y1);for(var r=Math.min(i,u.y2);n>=0&&!((u=t[n]).y2<=e.y1||u.x1-.1>e.x1||u.x2+.1<e.x2);n--)r=u.y1;return i<=(r=Math.max(r,e.y1))?null:new Du(e.x1,r,e.x2,i)}var Iu=function(t){function e(){var e;return(e=t.call(this)||this).propSet={},e}T(e,t);var u=e.prototype;return u.visitIdent=function(t){return this.propSet[t.name]=!0,t},u.visitSpaceList=function(t){return this.visitValues(t.values),t},e}(Pe),Pu=function(t){function e(e){var u;return(u=t.call(this)||this).value=void 0,u.value=e,u}return T(e,t),e.prototype.visitInt=function(t){return this.value=t.num,t},e}(Pe);function Ru(t,e){if(t){var u=new Pu(e);try{return t.visit(u),u.value}catch(t){c.warn(t,"toInt: ")}}return e}var Lu=function(t){function e(){var e;return(e=t.call(this)||this).collect=!1,e.coords=[],e.name=null,e}T(e,t);var u=e.prototype;return u.visitNumeric=function(t){return this.collect&&this.coords.push(t),null},u.visitNum=function(t){return this.collect&&0==t.num&&this.coords.push(new Ge(0,"px")),null},u.visitSpaceList=function(t){return this.visitValues(t.values),null},u.visitFunc=function(t){return this.collect||(this.collect=!0,this.visitValues(t.values),this.collect=!1,this.name=t.name.toLowerCase()),null},u.getShape=function(t,e,u,n,i){var r=this;if(this.coords.length>0){var o=[];switch(this.coords.forEach((function(t,e){if("%"==t.unit){var a=e%2==0?u:n;3==e&&"circle"==r.name&&(a=Math.sqrt((u*u+n*n)/2)),o.push(t.num*a/100)}else o.push(t.num*i.queryUnitSize(t.unit,!1))})),this.name){case"polygon":if(o.length%2==0){for(var a=[],s=0;s<o.length;s+=2)a.push(new hu(t+o[s],e+o[s+1]));return new Eu(a)}break;case"rectangle":if(4==o.length)return Fu(t+o[0],e+o[1],t+o[0]+o[2],e+o[1]+o[3]);break;case"ellipse":if(4==o.length)return Cu(t+o[0],e+o[1],o[2],o[3]);break;case"circle":if(3==o.length)return Cu(t+o[0],e+o[1],o[2],o[2])}}return null},e}(Pe);function Ou(t,e,u,n,i,r){if(t){var o=new Lu;try{return t.visit(o),o.getShape(e,u,n,i,r)}catch(t){c.warn(t,"toShape:")}}return Fu(e,u,e+n,u+i)}var ku=function(t){function e(e){var u;return(u=t.call(this)||this).reset=void 0,u.counters={},u.name=null,u.reset=e,u}T(e,t);var u=e.prototype;return u.visitIdent=function(t){return this.name=t.toString(),this.counters[this.name]=this.reset?0:(this.counters[this.name]||0)+1,t},u.visitInt=function(t){return this.name&&(this.counters[this.name]+=t.num-(this.reset?0:1)),t},u.visitSpaceList=function(t){return this.visitValues(t.values),t},e}(Pe);function _u(t,e){var u=new ku(e);try{t.visit(u)}catch(t){c.warn(t,"toCounters:")}return u.counters}var Mu=function(t){function e(e,u){var n;return(n=t.call(this)||this).baseUrl=void 0,n.transformer=void 0,n.baseUrl=e,n.transformer=u,n}return T(e,t),e.prototype.visitURL=function(t){return new Ke(this.transformer.transformURL(t.url,this.baseUrl))},e}(Re);function Uu(t){var e={};return Object.keys(t).forEach((function(u){e[u]=Array.from(t[u])})),e}var Vu,Hu=function(){function t(t,e){this.targetId=void 0,this.resolved=void 0,this.pageCounters=null,this.spineIndex=-1,this.pageIndex=-1,this.targetId=t,this.resolved=e}var e=t.prototype;return e.equals=function(t){return this===t||!!t&&this.targetId===t.targetId&&this.resolved===t.resolved&&this.spineIndex===t.spineIndex&&this.pageIndex===t.pageIndex},e.isResolved=function(){return this.resolved},e.resolve=function(){this.resolved=!0},e.unresolve=function(){this.resolved=!1},t}(),zu=function(){function t(t,e){this.counterStore=void 0,this.baseURL=void 0,this.counterStore=t,this.baseURL=e}var e=t.prototype;return e.countersOfId=function(t,e){t=this.counterStore.documentURLTransformer.transformFragment(t,this.baseURL),this.counterStore.countersById[t]=e},e.getExprContentListener=function(){return this.counterStore.getExprContentListener()},t}(),Gu=function(){function t(t,e,u,n){this.counterStore=void 0,this.baseURL=void 0,this.rootScope=void 0,this.pageScope=void 0,this.styler=null,this.namedStringValues={},this.counterStore=t,this.baseURL=e,this.rootScope=u,this.pageScope=n}var e=t.prototype;return e.setStyler=function(t){this.styler=t},e.getFragment=function(t){var e=t.match(/^[^#]*#(.*)$/);return e?e[1]:null},e.getTransformedId=function(t){var e=this.counterStore.documentURLTransformer.transformURL(K(t,this.baseURL),this.baseURL);return"#"===e.charAt(0)&&(e=e.substring(1)),e},e.getPageCounterVal=function(t,e){var u=this,n=new ge(this.pageScope,(function(){return e(function(){var e=u.counterStore.currentPageCounters[t];return e&&e.length?e[e.length-1]:null}())}),"page-counter-"+t);return this.counterStore.registerPageCounterExpr(t,(function(t){return e(t[0])}),n),n},e.getPageCountersVal=function(t,e){var u=this,n=new ge(this.pageScope,(function(){return e(u.counterStore.currentPageCounters[t]||[])}),"page-counters-"+t);return this.counterStore.registerPageCounterExpr(t,e,n),n},e.getTargetCounters=function(t,e,u){var n=this.counterStore.countersById[e];return!n&&u&&t&&(this.styler.styleUntilIdIsReached(t),n=this.counterStore.countersById[e]),n||null},e.getTargetPageCounters=function(t){return this.counterStore.currentPage.elementsById[t]?this.counterStore.currentPageCounters:this.counterStore.pageCountersById[t]||null},e.getTargetCounterVal=function(t,e,u){var n=this,i=this.getFragment(t),r=this.getTransformedId(t),o=this.getTargetCounters(i,r,!1);if(o&&o[e]){var a=o[e];return new Be(this.rootScope,u(a[a.length-1]||null))}return new ge(this.pageScope,(function(){if(o=n.getTargetCounters(i,r,!0)){if(o[e]){var t=o[e];return u(t[t.length-1]||null)}var a=n.getTargetPageCounters(r);if(a){if(n.counterStore.resolveReference(r),a[e]){var s=a[e];return u(s[s.length-1]||null)}return u(0)}return n.counterStore.saveReferenceOfCurrentPage(r,!1),"??"}return n.counterStore.saveReferenceOfCurrentPage(r,!1),"??"}),"target-counter-"+e+"-of-"+t)},e.getTargetCountersVal=function(t,e,u){var n=this,i=this.getFragment(t),r=this.getTransformedId(t);return new ge(this.pageScope,(function(){var t=n.getTargetPageCounters(r);if(t){n.counterStore.resolveReference(r);var o=t[e]||[],a=n.getTargetCounters(i,r,!0);return u(o.concat(a[e]||[]))}return n.counterStore.saveReferenceOfCurrentPage(r,!1),"??"}),"target-counters-"+e+"-of-"+t)},e.getNamedStringVal=function(t,e){var u=this;return new ge(this.pageScope,(function(){var n=u.namedStringValues[t];if(!n)return"";for(var i=Object.keys(n).map((function(t){return parseInt(t,10)})).sort(dt),r=u.counterStore.currentPage,o=r.isBlankPage?r.offset-1:r.offset,a=r.isBlankPage?o:Math.max.apply(Math,[o].concat(Array.from(r.container.querySelectorAll("[data-adapt-eloff]")).map((function(t){return parseInt(t.getAttribute("data-adapt-eloff"),10)})))),s=-1,l=-1,D=-1,h=-1,c=0;c<i.length;c++){var d=i[c],f=c>0?i[c-1]:-1,p=c<i.length-1?i[c+1]:-1;if(d>a)break;if(d>=o){if(s<0&&(s=d,h=-1),l<0)if(d===o)l=d;else{f<s&&(l=f);var E=r.container.querySelector('[data-adapt-eloff="'+d+'"]');if(E){var C=r.container.querySelector('[data-adapt-eloff="'+o+'"]');if(C||(C=r.container.querySelector('[data-adapt-eloff="0"]')),C)for(var F=C;F;F=F.firstElementChild)if(F===E){l=d;break}}else l<0&&(l=d)}D=d}else(p>a||p<0)&&(s=l=D=h=d)}return n[{first:s,start:l,last:D,"first-except":h}[e]]||""}),"named-string-"+e+"-"+t)},e.setNamedString=function(t,e,u){(this.namedStringValues[t]||(this.namedStringValues[t]={}))[u.currentElementOffset]=e},t}(),Xu=function(){function t(t){this.documentURLTransformer=void 0,this.countersById={},this.pageCountersById={},this.currentPageCounters={},this.previousPageCounters={},this.currentPageCountersStack=[],this.pageIndicesById={},this.currentPage=null,this.newReferencesOfCurrentPage=[],this.referencesToSolve=[],this.referencesToSolveStack=[],this.unresolvedReferences={},this.resolvedReferences={},this.pagesCounterExprs=[],this.documentURLTransformer=t,this.currentPageCounters.page=[0]}var e=t.prototype;return e.createCounterListener=function(t){return new zu(this,t)},e.createCounterResolver=function(t,e,u){return new Gu(this,t,e,u)},e.setCurrentPage=function(t){this.currentPage=t},e.definePageCounter=function(t,e){this.currentPageCounters[t]?this.currentPageCounters[t].push(e):this.currentPageCounters[t]=[e]},e.forceSetPageCounter=function(t){var e=this.currentPageCounters.page;e&&e.length?e[e.length-1]=t:this.currentPageCounters.page=[t]},e.updatePageCounters=function(t,e){var u;this.previousPageCounters=Uu(this.currentPageCounters);var n,i=t["counter-reset"];if(i){var r=i.evaluate(e);r&&(u=_u(r,!0))}if(u)for(var o in u)this.definePageCounter(o,u[o]);var a=t["counter-increment"];if(a){var s=a.evaluate(e);s&&(n=_u(s,!1))}for(var l in n?"page"in n||(n.page=1):(n={}).page=1,n){this.currentPageCounters[l]||this.definePageCounter(l,0);var D=this.currentPageCounters[l];D[D.length-1]+=n[l]}},e.pushPageCounters=function(t){this.currentPageCountersStack.push(this.currentPageCounters),this.currentPageCounters=Uu(t)},e.popPageCounters=function(){this.currentPageCounters=this.currentPageCountersStack.pop()},e.resolveReference=function(t){var e=this.unresolvedReferences[t],u=this.resolvedReferences[t];u||(u=this.resolvedReferences[t]=[]);for(var n=!1,i=0;i<this.referencesToSolve.length;){var r=this.referencesToSolve[i];if(r.targetId===t){if(r.resolve(),this.referencesToSolve.splice(i,1),e){var o=e.indexOf(r);o>=0&&e.splice(o,1)}u.push(r),n=!0}else i++}n||this.saveReferenceOfCurrentPage(t,!0)},e.saveReferenceOfCurrentPage=function(t,e){if(!this.newReferencesOfCurrentPage.some((function(e){return e.targetId===t}))){var u=new Hu(t,e);this.newReferencesOfCurrentPage.push(u)}},e.finishPage=function(t,e){var u=this,n=Object.keys(this.currentPage.elementsById);if(n.length>0){var i=Uu(this.currentPageCounters);n.forEach((function(n){u.pageCountersById[n]=i;var r=u.pageIndicesById[n];if(r&&r.pageIndex<e){var o=u.resolvedReferences[n];if(o){var a,s=u.unresolvedReferences[n];for(s||(s=u.unresolvedReferences[n]=[]);a=o.shift();)a.unresolve(),s.push(a)}}u.pageIndicesById[n]={spineIndex:t,pageIndex:e}}))}for(var r,o=this.previousPageCounters;r=this.newReferencesOfCurrentPage.shift();){r.pageCounters=o,r.spineIndex=t,r.pageIndex=e;var a=void 0;r.isResolved()?(a=this.resolvedReferences[r.targetId])||(a=this.resolvedReferences[r.targetId]=[]):(a=this.unresolvedReferences[r.targetId])||(a=this.unresolvedReferences[r.targetId]=[]),a.every((function(t){return!r.equals(t)}))&&a.push(r)}this.currentPage=null},e.getUnresolvedRefsToPage=function(t){var e=this,u=[];Object.keys(t.elementsById).forEach((function(t){var n=e.unresolvedReferences[t];n&&(u=u.concat(n))})),u.sort((function(t,e){return t.spineIndex-e.spineIndex||t.pageIndex-e.pageIndex}));var n=[],i=null;return u.forEach((function(t){i&&i.spineIndex===t.spineIndex&&i.pageIndex===t.pageIndex?i.refs.push(t):n.push(i={spineIndex:t.spineIndex,pageIndex:t.pageIndex,pageCounters:t.pageCounters,refs:[t]})})),n},e.pushReferencesToSolve=function(t){this.referencesToSolveStack.push(this.referencesToSolve),this.referencesToSolve=t},e.popReferencesToSolve=function(){this.referencesToSolve=this.referencesToSolveStack.pop()},e.registerPageCounterExpr=function(t,e,u){"pages"===t&&this.pagesCounterExprs.push({expr:u,format:e})},e.getExprContentListener=function(){return this.exprContentListener.bind(this)},e.exprContentListener=function(t,e,u){if(this.pagesCounterExprs.findIndex((function(e){return e.expr===t}))>=0){var n=u.createElement("span");return n.textContent=e,n.setAttribute(Wu,t.key),n}return null},e.finishLastPage=function(t){for(var e,u=this,n=t.root.querySelectorAll("["+Wu+"]"),i=this.currentPageCounters.page[0],r=function(){var t=e.value,n=t.getAttribute(Wu),r=u.pagesCounterExprs.findIndex((function(t){return t.expr.key===n}));t.textContent=u.pagesCounterExprs[r].format([i])},o=_(n);!(e=o()).done;)r()},e.createLayoutConstraint=function(t){return new ju(this,t)},t}(),Wu="data-vivliostyle-pages-counter",ju=function(){function t(t,e){this.counterStore=void 0,this.pageIndex=void 0,this.counterStore=t,this.pageIndex=e}return t.prototype.allowLayout=function(t){if(!t||t.after)return!0;var e=t.viewNode;if(!e||1!==e.nodeType)return!0;var u=e.getAttribute("data-vivliostyle-id")||e.getAttribute("id")||e.getAttribute("name");if(!u)return!0;if(!this.counterStore.resolvedReferences[u]&&!this.counterStore.unresolvedReferences[u])return!0;var n=this.counterStore.pageIndicesById[u];return!n||this.pageIndex>=n.pageIndex},t}();function Ku(t){if((t=t.substr(1)).match(/^[^0-9a-fA-F\n\r]$/))return t;var e=parseInt(t,16);return isNaN(e)?"":e<=65535?String.fromCharCode(e):e<=1114111?String.fromCharCode(55296|e>>10&1023,56320|1023&e):"�"}function Yu(t){return t.replace(/\\([0-9a-fA-F]{0,6}(\r\n|[ \n\r\t\f])?|[^0-9a-fA-F\n\r])/g,Ku)}!function(t){t[t.EOF=0]="EOF",t[t.IDENT=1]="IDENT",t[t.STR=2]="STR",t[t.NUMERIC=3]="NUMERIC",t[t.NUM=4]="NUM",t[t.INT=5]="INT",t[t.FUNC=6]="FUNC",t[t.HASH=7]="HASH",t[t.URL=8]="URL",t[t.CLASS=9]="CLASS",t[t.O_PAR=10]="O_PAR",t[t.C_PAR=11]="C_PAR",t[t.O_BRC=12]="O_BRC",t[t.C_BRC=13]="C_BRC",t[t.O_BRK=14]="O_BRK",t[t.C_BRK=15]="C_BRK",t[t.COMMA=16]="COMMA",t[t.SEMICOL=17]="SEMICOL",t[t.COLON=18]="COLON",t[t.SLASH=19]="SLASH",t[t.AT=20]="AT",t[t.PERCENT=21]="PERCENT",t[t.QMARK=22]="QMARK",t[t.PLUS=23]="PLUS",t[t.MINUS=24]="MINUS",t[t.BAR_BAR=25]="BAR_BAR",t[t.AMP_AMP=26]="AMP_AMP",t[t.URANGE=27]="URANGE",t[t.BANG=31]="BANG",t[t.DOLLAR=32]="DOLLAR",t[t.HAT=33]="HAT",t[t.BAR=34]="BAR",t[t.TILDE=35]="TILDE",t[t.STAR=36]="STAR",t[t.GT=37]="GT",t[t.LT=38]="LT",t[t.EQ=39]="EQ",t[t.BANG_EQ=41]="BANG_EQ",t[t.DOLLAR_EQ=42]="DOLLAR_EQ",t[t.HAT_EQ=43]="HAT_EQ",t[t.BAR_EQ=44]="BAR_EQ",t[t.TILDE_EQ=45]="TILDE_EQ",t[t.STAR_EQ=46]="STAR_EQ",t[t.GT_EQ=47]="GT_EQ",t[t.LT_EQ=48]="LT_EQ",t[t.EQ_EQ=49]="EQ_EQ",t[t.COL_COL=50]="COL_COL",t[t.INVALID=51]="INVALID",t[t.LAST=51]="LAST"}(Vu||(Vu={}));var qu,$u=function(){this.type=void 0,this.precededBySpace=!1,this.num=0,this.text="",this.position=0,this.type=Vu.EOF};function Qu(t,e){var u,n=Array(128);for(u=0;u<128;u++)n[u]=t;for(n.NaN=t==qu.END?qu.END:qu.INVALID,u=0;u<e.length;u+=2)n[e[u]]=e[u+1];return n}!function(t){t[t.SPACE=1]="SPACE",t[t.INT=2]="INT",t[t.IDENT=3]="IDENT",t[t.BANG=4]="BANG",t[t.HASH=6]="HASH",t[t.DOLLAR=7]="DOLLAR",t[t.PERCENT=8]="PERCENT",t[t.AMP=9]="AMP",t[t.O_PAR=10]="O_PAR",t[t.C_PAR=11]="C_PAR",t[t.STAR=12]="STAR",t[t.PLUS=13]="PLUS",t[t.COMMA=14]="COMMA",t[t.MINUS=15]="MINUS",t[t.DOT=16]="DOT",t[t.SLASH=17]="SLASH",t[t.COLON=18]="COLON",t[t.SEMICOL=19]="SEMICOL",t[t.LT=20]="LT",t[t.EQ=21]="EQ",t[t.GT=22]="GT",t[t.QMARK=23]="QMARK",t[t.AT=24]="AT",t[t.O_BRK=25]="O_BRK",t[t.C_BRK=26]="C_BRK",t[t.O_BRC=27]="O_BRC",t[t.C_BRC=28]="C_BRC",t[t.BSLASH=29]="BSLASH",t[t.HAT=30]="HAT",t[t.BAR=31]="BAR",t[t.TILDE=32]="TILDE",t[t.STR1=33]="STR1",t[t.STR2=34]="STR2",t[t.END=35]="END",t[t.EQTAIL=36]="EQTAIL",t[t.ENDINT=37]="ENDINT",t[t.ENDNUM=38]="ENDNUM",t[t.CONT=39]="CONT",t[t.UNIT=40]="UNIT",t[t.PCUNIT=41]="PCUNIT",t[t.NUMBER=42]="NUMBER",t[t.ENDIDNT=43]="ENDIDNT",t[t.IDNTESC=44]="IDNTESC",t[t.ENDIDES=45]="ENDIDES",t[t.ENDSTR=46]="ENDSTR",t[t.ENDESTR=47]="ENDESTR",t[t.STR1ESC=48]="STR1ESC",t[t.STR2ESC=49]="STR2ESC",t[t.BAR_BAR=50]="BAR_BAR",t[t.AMP_AMP=51]="AMP_AMP",t[t.FUNC=52]="FUNC",t[t.FUNCES=53]="FUNCES",t[t.COMMENT=54]="COMMENT",t[t.COMMST=55]="COMMST",t[t.ENDNOTK=56]="ENDNOTK",t[t.MINMIN=57]="MINMIN",t[t.TOINT=58]="TOINT",t[t.TONUM=59]="TONUM",t[t.TOIDENT=60]="TOIDENT",t[t.TOIDES=61]="TOIDES",t[t.KILL1=62]="KILL1",t[t.KILL2=63]="KILL2",t[t.URL=64]="URL",t[t.URL1=65]="URL1",t[t.URL2=66]="URL2",t[t.ENDURL=67]="ENDURL",t[t.TERMURL=68]="TERMURL",t[t.FINURL=69]="FINURL",t[t.LT_BG=70]="LT_BG",t[t.LT_BG_M=71]="LT_BG_M",t[t.INVALID=72]="INVALID",t[t.CHKPOSS=73]="CHKPOSS",t[t.CHKPOSN=74]="CHKPOSN",t[t.URLESC=75]="URLESC",t[t.IDESCH=76]="IDESCH",t[t.COL_COL=77]="COL_COL",t[t.TOCLASS=78]="TOCLASS",t[t.CHKSP=79]="CHKSP",t[t.EOF=80]="EOF"}(qu||(qu={}));var Zu=[qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.SPACE,qu.SPACE,qu.INVALID,qu.SPACE,qu.SPACE,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.SPACE,qu.BANG,qu.STR2,qu.HASH,qu.DOLLAR,qu.PERCENT,qu.AMP,qu.STR1,qu.O_PAR,qu.C_PAR,qu.STAR,qu.PLUS,qu.COMMA,qu.MINUS,qu.DOT,qu.SLASH,qu.INT,qu.INT,qu.INT,qu.INT,qu.INT,qu.INT,qu.INT,qu.INT,qu.INT,qu.INT,qu.COLON,qu.SEMICOL,qu.LT,qu.EQ,qu.GT,qu.QMARK,qu.AT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.O_BRK,qu.BSLASH,qu.C_BRK,qu.HAT,qu.IDENT,qu.INVALID,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.IDENT,qu.O_BRC,qu.BAR,qu.C_BRC,qu.TILDE,qu.INVALID];Zu.NaN=qu.EOF;var Ju=[qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.FUNC,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.CONT,qu.ENDIDNT,qu.ENDIDNT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.ENDIDNT,qu.IDNTESC,qu.ENDIDNT,qu.ENDIDNT,qu.CONT,qu.ENDIDNT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT,qu.ENDIDNT];Ju.NaN=qu.ENDIDNT;var tn=[qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.TOCLASS,qu.TONUM,qu.INVALID,qu.TONUM,qu.TONUM,qu.TONUM,qu.TONUM,qu.TONUM,qu.TONUM,qu.TONUM,qu.TONUM,qu.TONUM,qu.TONUM,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.INVALID,qu.TOIDES,qu.INVALID,qu.INVALID,qu.TOCLASS,qu.INVALID,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.TOCLASS,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID,qu.INVALID];Ju.NaN=qu.ENDIDNT;var en=[qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.MINMIN,qu.TONUM,qu.END,qu.TOINT,qu.TOINT,qu.TOINT,qu.TOINT,qu.TOINT,qu.TOINT,qu.TOINT,qu.TOINT,qu.TOINT,qu.TOINT,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.END,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.END,qu.TOIDES,qu.END,qu.END,qu.TOIDENT,qu.END,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.TOIDENT,qu.END,qu.END,qu.END,qu.END,qu.END];en.NaN=qu.END;var un=[qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.CHKPOSS,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.CHKPOSS,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.FUNCES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.ENDIDES,qu.IDNTESC,qu.ENDIDES,qu.ENDIDES,qu.CONT,qu.ENDIDES,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES,qu.ENDIDES];un.NaN=qu.ENDIDES;var nn=[qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.PCUNIT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.NUMBER,qu.ENDINT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.UNIT,qu.ENDINT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT,qu.ENDINT];nn.NaN=qu.ENDINT;var rn=[qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.PCUNIT,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.CONT,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.UNIT,qu.ENDNUM,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.UNIT,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM,qu.ENDNUM];rn.NaN=qu.ENDNUM;var on,an=Qu(qu.END,[61,qu.EQTAIL]),sn=Qu(qu.END,[58,qu.COL_COL]),ln=Qu(qu.END,[61,qu.EQTAIL,124,qu.BAR_BAR]),Dn=Qu(qu.END,[38,qu.AMP_AMP]),hn=Qu(qu.END,[42,qu.COMMENT]),cn=Qu(qu.CONT,[42,qu.COMMST]),dn=Qu(qu.COMMENT,[42,qu.COMMST,47,qu.ENDNOTK]),fn=Qu(qu.KILL1,[62,qu.ENDNOTK]),pn=Qu(qu.END,[61,qu.EQTAIL,33,qu.LT_BG]),En=Qu(qu.KILL1,[45,qu.LT_BG_M]),Cn=Qu(qu.KILL2,[45,qu.ENDNOTK]),Fn=Qu(qu.IDESCH,[9,qu.INVALID,10,qu.INVALID,13,qu.INVALID,32,qu.INVALID]),An=Qu(qu.CONT,[39,qu.ENDSTR,10,qu.INVALID,13,qu.INVALID,92,qu.STR1ESC]),gn=Qu(qu.CONT,[34,qu.ENDSTR,10,qu.INVALID,13,qu.INVALID,92,qu.STR2ESC]),vn=Qu(qu.CONT,[39,qu.ENDESTR,10,qu.CHKPOSN,13,qu.CHKPOSN,92,qu.STR1ESC]),mn=Qu(qu.CONT,[34,qu.ENDESTR,10,qu.CHKPOSN,13,qu.CHKPOSN,92,qu.STR2ESC]),Bn=Qu(qu.URL,[9,qu.CONT,32,qu.CONT,34,qu.URL2,39,qu.URL1,41,qu.INVALID,10,qu.CONT,13,qu.CONT]),wn=Qu(qu.CONT,[41,qu.ENDURL,9,qu.CHKSP,10,qu.CHKSP,13,qu.CHKSP,32,qu.CHKSP,92,qu.URLESC,40,qu.INVALID,91,qu.INVALID,93,qu.INVALID,123,qu.INVALID,125,qu.INVALID,NaN,qu.ENDURL]),yn=Qu(qu.CONT,[39,qu.TERMURL,10,qu.CHKPOSN,13,qu.CHKPOSN,92,qu.URLESC,NaN,qu.ENDURL]),Nn=Qu(qu.CONT,[34,qu.TERMURL,10,qu.CHKPOSN,13,qu.CHKPOSN,92,qu.URLESC,NaN,qu.ENDURL]),bn=Qu(qu.INVALID,[9,qu.CONT,10,qu.CONT,13,qu.CONT,32,qu.CONT,41,qu.FINURL]),Sn=function(){function t(t,e){this.input=void 0,this.handler=void 0,this.indexMask=void 0,this.buffer=void 0,this.head=-1,this.tail=0,this.curr=0,this.position=0,this.input=t,this.handler=e,this.indexMask=15,this.buffer=Array(this.indexMask+1);for(var u=0;u<=this.indexMask;u++)this.buffer[u]=new $u}var e=t.prototype;return e.token=function(){return this.tail==this.curr&&this.fillBuffer(),this.buffer[this.curr]},e.nthToken=function(t){return(this.tail-this.curr&this.indexMask)<=t&&this.fillBuffer(),this.buffer[this.curr+t&this.indexMask]},e.consume=function(){this.curr=this.curr+1&this.indexMask},e.mark=function(){if(this.head>=0)throw new Error("F_CSSTOK_BAD_CALL mark");this.head=this.curr},e.reset=function(){if(this.head<0)throw new Error("F_CSSTOK_BAD_CALL reset");this.curr=this.head,this.head=-1},e.unmark=function(){this.head=-1},e.hasMark=function(){return this.head>=0},e.reallocate=function(){for(var t=2*(this.indexMask+1)-1,e=Array(t+1),u=this.head,n=0;u!=this.tail;)e[n]=this.buffer[u],u=u+1&this.indexMask,n++;for(this.head=0,this.curr=n,this.tail=n,this.indexMask=t,this.buffer=e;n<=t;)e[n++]=new $u},e.error=function(t,e,u){this.handler&&this.handler.error(u,e)},e.fillBuffer=function(){var t=this.tail,e=this.head>=0?this.head:this.curr,u=this.indexMask;if(t>=e?e+=u:e--,e==t){if(this.head<0)throw new Error("F_CSSTOK_INTERNAL");this.reallocate(),t=this.tail,e=u=this.indexMask}for(var n=Zu,i=this.input,r=this.position,o=this.buffer,a=Vu.EOF,s=0,l="",D=0,h=!1,c=o[t],d=-9;;){var f=i.charCodeAt(r);switch(n[f]||n[65]){case qu.INVALID:a=Vu.INVALID,l=isNaN(f)?"E_CSS_UNEXPECTED_EOF":"E_CSS_UNEXPECTED_CHAR",n=Zu,r++;break;case qu.SPACE:r++,h=!0;continue;case qu.INT:s=r++,n=nn;continue;case qu.IDENT:a=Vu.IDENT,s=r++,n=Ju;continue;case qu.BANG:s=r++,a=Vu.BANG,n=an;continue;case qu.STR1:a=Vu.STR,s=++r,n=An;continue;case qu.STR2:a=Vu.STR,s=++r,n=gn;continue;case qu.HASH:s=++r,a=Vu.HASH,n=Ju;continue;case qu.DOLLAR:s=r++,a=Vu.DOLLAR,n=an;continue;case qu.PERCENT:s=r++,a=Vu.PERCENT;break;case qu.AMP:s=r++,a=Vu.DOLLAR,n=Dn;continue;case qu.O_PAR:s=r++,a=Vu.O_PAR;break;case qu.C_PAR:s=r++,a=Vu.C_PAR;break;case qu.STAR:s=r++,a=Vu.STAR,n=an;continue;case qu.PLUS:s=r++,a=Vu.PLUS;break;case qu.COMMA:s=r++,a=Vu.COMMA;break;case qu.MINUS:a=Vu.MINUS,s=r++,n=en;continue;case qu.DOT:s=r++,n=tn;continue;case qu.TOCLASS:s=r++,a=Vu.CLASS,n=Ju;continue;case qu.SLASH:s=r++,a=Vu.SLASH,n=hn;continue;case qu.COLON:s=r++,a=Vu.COLON,n=sn;continue;case qu.COL_COL:r++,a=Vu.COL_COL;break;case qu.SEMICOL:s=r++,a=Vu.SEMICOL;break;case qu.LT:s=r++,a=Vu.LT,n=pn;continue;case qu.EQ:s=r++,a=Vu.EQ,n=an;continue;case qu.GT:s=r++,a=Vu.GT,n=an;continue;case qu.QMARK:s=r++,a=Vu.QMARK;break;case qu.AT:s=++r,a=Vu.AT,n=Ju;continue;case qu.O_BRK:s=r++,a=Vu.O_BRK;break;case qu.C_BRK:s=r++,a=Vu.C_BRK;break;case qu.O_BRC:s=r++,a=Vu.O_BRC;break;case qu.C_BRC:s=r++,a=Vu.C_BRC;break;case qu.BSLASH:d=s=r++,a=Vu.IDENT,n=Fn;continue;case qu.HAT:s=r++,a=Vu.HAT,n=an;continue;case qu.BAR:s=r++,a=Vu.BAR,n=ln;continue;case qu.TILDE:s=r++,a=Vu.TILDE,n=an;continue;case qu.END:break;case qu.EQTAIL:r++,a=a+Vu.BANG_EQ-Vu.BANG;break;case qu.ENDINT:a=Vu.INT,D=parseInt(i.substring(s,r),10);break;case qu.ENDNUM:a=Vu.NUM,D=parseFloat(i.substring(s,r));break;case qu.CONT:r++;continue;case qu.UNIT:a=Vu.NUMERIC,D=parseFloat(i.substring(s,r)),s=r++,n=Ju;continue;case qu.PCUNIT:a=Vu.NUMERIC,D=parseFloat(i.substring(s,r)),l="%",s=r++;break;case qu.NUMBER:r++,n=rn;continue;case qu.ENDIDNT:if(l=i.substring(s,r),a===Vu.URANGE&&63===f||a===Vu.IDENT&&"u"===l.toLowerCase()&&/^(\bu\+[?0-9a-f]+(-[?0-9a-f]+)?|,|\s+|\/\*([^*]|\*[^/])*\*\/)+[;}]/i.test(i.substring(r-1))){a=Vu.URANGE,r++;continue}break;case qu.IDNTESC:d=r++,n=Fn;continue;case qu.ENDIDES:l=Yu(i.substring(s,r));break;case qu.ENDSTR:l=i.substring(s,r),r++;break;case qu.ENDESTR:l=Yu(i.substring(s,r)),r++;break;case qu.STR1ESC:d=r,r+=2,n=vn;continue;case qu.STR2ESC:d=r,r+=2,n=mn;continue;case qu.BAR_BAR:r++,a=Vu.BAR_BAR;break;case qu.AMP_AMP:r++,a=Vu.AMP_AMP;break;case qu.FUNC:if(l=i.substring(s,r),a==Vu.IDENT){if(r++,"url"==l.toLowerCase()){n=Bn;continue}a=Vu.FUNC}break;case qu.FUNCES:if(l=Yu(i.substring(s,r)),a==Vu.IDENT){if(r++,"url"==l.toLowerCase()){n=Bn;continue}a=Vu.FUNC}break;case qu.COMMENT:n=cn,r++;continue;case qu.COMMST:n=dn,r++;continue;case qu.ENDNOTK:n=Zu,r++;continue;case qu.MINMIN:n=fn,r++;continue;case qu.TOINT:a=Vu.INT,n=nn,r++;continue;case qu.TONUM:a=Vu.NUM,n=rn,r++;continue;case qu.TOIDENT:a=Vu.IDENT,n=Ju,r++;continue;case qu.TOIDES:a=Vu.IDENT,n=Fn,d=r++;continue;case qu.KILL1:r--;break;case qu.KILL2:r-=2;break;case qu.URL:s=r++,n=wn;continue;case qu.URL1:s=++r,n=yn;continue;case qu.URL2:s=++r,n=Nn;continue;case qu.ENDURL:a=Vu.URL,l=Yu(i.substring(s,r)),r++;break;case qu.FINURL:r++;break;case qu.LT_BG:n=En,r++;continue;case qu.LT_BG_M:n=Cn,r++;continue;case qu.CHKSP:if(r-d<8&&i.substring(d+1,r+1).match(/^[0-9a-fA-F]{0,6}(\r\n|[\n\r])|[ \t]$/)){r++;continue}case qu.TERMURL:a=Vu.URL,l=Yu(i.substring(s,r)),r++,n=bn;continue;case qu.CHKPOSN:if(++r-d<9&&i.substring(d+1,r).match(/^[0-9a-fA-F]{0,6}(\r\n|[\n\r])$/))continue;a=Vu.INVALID,l="E_CSS_UNEXPECTED_NEWLINE",n=Zu;break;case qu.CHKPOSS:if(r-d<9&&i.substring(d+1,r+1).match(/^[0-9a-fA-F]{0,6}[ \t]$/)){r++;continue}l=Yu(i.substring(s,r));break;case qu.URLESC:d=r++;continue;case qu.IDESCH:r++,n=un;continue;default:if(n!==Zu){a=Vu.INVALID,l="E_CSS_UNEXPECTED_STATE";break}s=r,a=Vu.EOF}if(c.type=a,c.precededBySpace=h,c.num=D,c.text=l,c.position=s,++t>=e)break;n=Zu,h=!1,c=o[t&u]}this.position=r,this.tail=t&u},t}(),Tn=null,xn=null;function In(){return Tn}function Pn(t){if(!Tn)throw new Error("E_TASK_NO_CONTEXT");Tn.name||(Tn.name=t);var e=Tn,u=new Hn(e,e.top,t);return e.top=u,u.state=on.ACTIVE,u}function Rn(t){return new Un(t)}function Ln(t,e,u){var n=Pn(t);n.handler=u;try{e(n)}catch(t){n.task.raise(t,n)}return n.result()}!function(t){t[t.INIT=0]="INIT",t[t.ACTIVE=1]="ACTIVE",t[t.FINISHED=2]="FINISHED",t[t.DEAD=3]="DEAD"}(on||(on={}));var On=function(){function t(){}var e=t.prototype;return e.currentTime=function(){return(new Date).valueOf()},e.setTimeout=function(t){function e(e,u){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t,e){return setTimeout(t,e)})),e.clearTimeout=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){clearTimeout(t)})),t}(),kn=function(){function t(t){this.timer=void 0,this.timeout=1,this.slice=25,this.sliceOverTime=0,this.queue=void 0,this.wakeupTime=null,this.timeoutToken=null,this.inTimeSlice=!1,this.order=0,this.timer=t,this.queue=new $,xn||(xn=this)}var e=t.prototype;return e.setSlice=function(t){this.slice=t},e.setTimeout=function(t){this.timeout=t},e.isTimeSliceOver=function(){return this.timer.currentTime()>=this.sliceOverTime},e.arm=function(){var t=this;if(!this.inTimeSlice){var e=this.queue.peek().scheduledTime,u=this.timer.currentTime();if(null!=this.timeoutToken){if(u+this.timeout>this.wakeupTime)return;this.timer.clearTimeout(this.timeoutToken)}var n=e-u;n<=this.timeout&&(n=this.timeout),this.wakeupTime=u+n,this.timeoutToken=this.timer.setTimeout((function(){t.timeoutToken=null,t.doTimeSlice()}),n)}},e.schedule=function(t,e){var u=t,n=this.timer.currentTime();u.order=this.order++,u.scheduledTime=n+(e||0),this.queue.add(u),this.arm()},e.doTimeSlice=function(){null!=this.timeoutToken&&(this.timer.clearTimeout(this.timeoutToken),this.timeoutToken=null),this.inTimeSlice=!0;try{var t=this.timer.currentTime();for(this.sliceOverTime=t+this.slice;this.queue.length();){var e=this.queue.peek();if(e.scheduledTime>t)break;if(this.queue.remove(),e.canceled||e.resumeInternal(),(t=this.timer.currentTime())>=this.sliceOverTime)break}}catch(t){c.error(t)}this.inTimeSlice=!1,this.queue.length()&&this.arm()},e.run=function(t,e){var u=new Mn(this,e||"");u.top=new Hn(u,null,"bootstrap"),u.top.state=on.ACTIVE,u.top.then((function(){var e=function(){u.running=!1;for(var t,e=_(u.callbacks);!(t=e()).done;){var n=t.value;try{n()}catch(t){c.error(t)}}};try{t().then((function(t){u.result=t,e()}))}catch(t){u.raise(t),e()}}));var n=Tn;return Tn=u,this.schedule(u.top.suspend("bootstrap")),Tn=n,u},t}(),_n=function(){function t(t){this.task=void 0,this.scheduledTime=0,this.order=0,this.result=null,this.canceled=!1,this.task=t}var e=t.prototype;return e.compare=function(t){return t.scheduledTime-this.scheduledTime||t.order-this.order},e.getTask=function(){return this.task},e.schedule=function(t,e){this.result=t,this.task.scheduler.schedule(this,e)},e.resumeInternal=function(){var t=this.task;if(this.task=null,t&&t.continuation==this){t.continuation=null;var e=Tn;return Tn=t,t.top.finish(this.result),Tn=e,!0}return!1},e.cancel=function(){this.canceled=!0},t}(),Mn=function(){function t(t,e){this.scheduler=void 0,this.name=void 0,this.callbacks=[],this.exception=null,this.running=!0,this.result=null,this.waitTarget=null,this.top=null,this.continuation=null,this.scheduler=t,this.name=e}var e=t.prototype;return e.getName=function(){return this.name},e.interrupt=function(t){if(this.raise(t||new Error("E_TASK_INTERRUPT")),this!==Tn&&this.continuation){this.continuation.cancel();var e=new _n(this);this.waitTarget="interrupt",this.continuation=e,this.scheduler.schedule(e)}},e.getScheduler=function(){return this.scheduler},e.isRunning=function(){return this.running},e.whenDone=function(t){this.callbacks.push(t)},e.join=function(){var t=this,e=Pn("Task.join");if(this.running){var u=e.suspend(this);this.whenDone((function(){u.schedule(t.result)}))}else e.finish(this.result);return e.result()},e.unwind=function(){for(;this.top&&!this.top.handler;)this.top=this.top.parent;if(this.top&&this.top.handler&&this.exception){var t=this.exception;this.exception=null,this.top.handler(this.top,t)}else this.exception&&c.error(this.exception,"Unhandled exception in task",this.name)},e.raise=function(t,e){if(this.fillStack(t),e){for(var u=this.top;u&&u!=e;)u=u.parent;u==e&&(this.top=u)}this.exception=t,this.unwind()},e.fillStack=function(t){var e=t.frameTrace;if(!e){e=t.stack?t.stack+"\n\t---- async ---\n":"";for(var u=this.top;u;u=u.parent)e+="\t",e+=u.getName(),e+="\n";t.frameTrace=e}},t}(),Un=function(){function t(t){this.value=void 0,this.value=t}var e=t.prototype;return e.then=function(t){t(this.value)},e.thenAsync=function(t){return t(this.value)},e.thenReturn=function(e){return new t(e)},e.thenFinish=function(t){t.finish(this.value)},e.isPending=function(){return!1},e.get=function(){return this.value},t}(),Vn=function(){function t(t){this.frame=void 0,this.frame=t}var e=t.prototype;return e.then=function(t){this.frame.then(t)},e.thenAsync=function(t){if(this.isPending()){var e=new Hn(this.frame.task,this.frame.parent,"AsyncResult.thenAsync");return e.state=on.ACTIVE,this.frame.parent=e,this.frame.then((function(u){t(u).then((function(t){e.finish(t)}))})),e.result()}return t(this.frame.res)},e.thenReturn=function(t){return this.isPending()?this.thenAsync((function(){return new Un(t)})):new Un(t)},e.thenFinish=function(t){this.isPending()?this.then((function(e){t.finish(e)})):t.finish(this.frame.res)},e.isPending=function(){return this.frame.state==on.ACTIVE},e.get=function(){if(this.isPending())throw new Error("Result is pending");return this.frame.res},t}(),Hn=function(){function t(t,e,u){this.task=void 0,this.parent=void 0,this.name=void 0,this.res=null,this.state=void 0,this.callback=null,this.handler=null,this.task=t,this.parent=e,this.name=u,this.state=on.INIT}var e=t.prototype;return e.checkEnvironment=function(){if(!Tn)throw new Error("F_TASK_NO_CONTEXT");if(this!==Tn.top)throw new Error("F_TASK_NOT_TOP_FRAME")},e.result=function(){return new Vn(this)},e.finish=function(t){this.checkEnvironment(),Tn&&!Tn.exception&&(this.res=t),this.state=on.FINISHED;var e=this.parent;if(Tn&&(Tn.top=e),this.callback){try{this.callback(t)}catch(t){this.task.raise(t,e)}this.state=on.DEAD}},e.getTask=function(){return this.task},e.getName=function(){return this.name},e.getScheduler=function(){return this.task.scheduler},e.then=function(t){switch(this.state){case on.ACTIVE:if(this.callback)throw new Error("F_TASK_FRAME_ALREADY_HAS_CALLBACK");this.callback=t;break;case on.FINISHED:var e=this.task,u=this.parent;try{t(this.res),this.state=on.DEAD}catch(t){this.state=on.DEAD,e.raise(t,u)}break;case on.DEAD:throw new Error("F_TASK_DEAD_FRAME");default:throw new Error("F_TASK_UNEXPECTED_FRAME_STATE "+this.state)}},e.timeSlice=function(){var t=Pn("Frame.timeSlice");return t.getScheduler().isTimeSliceOver()?(c.debug("-- time slice --"),t.suspend().schedule(!0)):t.finish(!0),t.result()},e.sleep=function(t){var e=Pn("Frame.sleep");return e.suspend().schedule(!0,t),e.result()},e.loop=function(t){var e=Pn("Frame.loop");return function u(n){try{for(;n;){var i=t();if(i.isPending())return void i.then(u);i.then((function(t){n=t}))}e.finish(!0)}catch(t){e.task.raise(t,e)}}(!0),e.result()},e.loopWithFrame=function(t){var e=Tn;if(!e)throw new Error("E_TASK_NO_CONTEXT");return this.loop((function(){var u;do{var n=new zn(e,e.top);e.top=n,n.state=on.ACTIVE,t(n),u=n.result()}while(!u.isPending()&&u.get());return u}))},e.suspend=function(t){if(this.checkEnvironment(),this.task.continuation)throw new Error("E_TASK_ALREADY_SUSPENDED");var e=new _n(this.task);return this.task.continuation=e,Tn=null,this.task.waitTarget=t||null,e},t}(),zn=function(t){function e(e,u){return t.call(this,e,u,"loop")||this}T(e,t);var u=e.prototype;return u.continueLoop=function(){this.finish(!0)},u.breakLoop=function(){this.finish(!1)},e}(Hn),Gn=function(){function t(t,e){this.fetch=void 0,this.name=void 0,this.arrived=!1,this.resource=null,this.task=null,this.piggybacks=[],this.fetch=t,this.name=e}var e=t.prototype;return e.start=function(){var t=this;this.task||(this.task=In().getScheduler().run((function(){var e=Pn("Fetcher.run");return t.fetch().then((function(u){var n=t.piggybacks;if(t.arrived=!0,t.resource=u,t.task=null,t.piggybacks=[],n)for(var i=0;i<n.length;i++)try{n[i](u)}catch(t){c.error(t,"Error:")}e.finish(u)})),e.result()}),this.name))},e.piggyback=function(t){this.arrived?t(this.resource):this.piggybacks.push(t)},e.get=function(){return this.arrived?Rn(this.resource):(this.start(),this.task.join())},e.hasArrived=function(){return this.arrived},t}(),Xn=function(t){if(0==t.length)return Rn(!0);if(1==t.length)return t[0].get().thenReturn(!0);var e=Pn("waitForFetches"),u=0;return e.loop((function(){for(;u<t.length;){var e=t[u++];if(!e.hasArrived())return e.get().thenReturn(!0)}return Rn(!1)})).then((function(){e.finish(!0)})),e.result()};function Wn(t,e){var u=new Gn((function(){var u=Pn("loadElement"),n=u.suspend(t),i=!1,r=function(t){i||(i=!0,n.schedule(t?t.type:"timeout"))};return t.addEventListener("load",r,!1),t.addEventListener("error",r,!1),t.addEventListener("abort",r,!1),t.namespaceURI==X.SVG?(e&&t.setAttributeNS(X.XLINK,"xlink:href",e),setTimeout(r,300)):"script"===t.localName?setTimeout(r,3e3):e&&(t.src=e),u.result()}),"loadElement "+(e||t.localName));return u.start(),u}var jn,Kn='\n@media screen {\n [data-vivliostyle-viewer-viewport] {\n background: #aaaaaa;\n }\n\n [data-vivliostyle-page-container] {\n background: white;\n z-index: 0;\n }\n\n [data-vivliostyle-viewer-viewport] {\n display: -webkit-flex;\n display: flex;\n overflow: auto;\n position: relative;\n }\n\n [data-vivliostyle-outer-zoom-box] {\n margin: auto;\n overflow: hidden;\n -webkit-flex: none;\n flex: none;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-spread-container] {\n display: -webkit-flex;\n display: flex;\n -webkit-flex: none;\n flex: none;\n -webkit-justify-content: center;\n justify-content: center;\n -moz-transform-origin: left top;\n -webkit-transform-origin: left top;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="ltr"]\n [data-vivliostyle-spread-container] {\n -webkit-flex-direction: row;\n flex-direction: row;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-page-progression="rtl"]\n [data-vivliostyle-spread-container] {\n -webkit-flex-direction: row-reverse;\n flex-direction: row-reverse;\n }\n\n [data-vivliostyle-viewer-viewport] [data-vivliostyle-page-container] {\n margin: 0 auto;\n -webkit-flex: none;\n flex: none;\n transform-origin: center top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="left"] {\n margin-right: 1px;\n transform-origin: right top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-page-side="right"] {\n margin-left: 1px;\n transform-origin: left top;\n }\n\n [data-vivliostyle-viewer-viewport][data-vivliostyle-spread-view="true"]\n [data-vivliostyle-page-container][data-vivliostyle-unpaired-page="true"] {\n margin-left: auto;\n margin-right: auto;\n transform-origin: center top;\n }\n}\n',Yn="\n[data-vivliostyle-layout-box] {\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n z-index: -1;\n}\n\n[data-vivliostyle-debug] [data-vivliostyle-layout-box] {\n right: auto;\n bottom: auto;\n overflow: visible;\n z-index: auto;\n}\n\n[data-vivliostyle-page-container] {\n position: relative;\n overflow: hidden;\n}\n\n[data-vivliostyle-bleed-box] {\n position: absolute;\n overflow: hidden;\n max-width: 100%;\n max-height: 100%;\n box-sizing: border-box;\n}\n\n[data-vivliostyle-page-box] ~ [data-vivliostyle-page-box] {\n display: none;\n}\n\n[data-vivliostyle-toc-box] {\n position: absolute;\n left: 3px;\n top: 3px;\n overflow: scroll;\n overflow-x: hidden;\n background: rgba(248, 248, 248, 0.9);\n border-radius: 2px;\n box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);\n}\n\n@media print {\n [data-vivliostyle-toc-box] {\n display: none;\n }\n\n [data-vivliostyle-outer-zoom-box],\n [data-vivliostyle-spread-container] {\n width: 100% !important;\n height: 100% !important;\n }\n\n [data-vivliostyle-spread-container],\n [data-vivliostyle-page-container] {\n -moz-transform: none !important;\n -webkit-transform: none !important;\n transform: none !important;\n }\n\n [data-vivliostyle-page-container] {\n display: block !important;\n max-width: 100%;\n height: 100% !important;\n max-height: 100%;\n }\n\n /* Workaround for Chrome printing problem */\n /* [data-vivliostyle-page-box] {\n padding-bottom: 0 !important;\n overflow: visible !important;\n } */\n [data-vivliostyle-bleed-box] > div > div::before {\n display: block;\n content: \"\";\n padding-top: 0.015625px;\n margin-bottom: -0.015625px;\n }\n\n /* Gecko-only hack, see https://bugzilla.mozilla.org/show_bug.cgi?id=267029#c17 */\n @-moz-document regexp('.*') {\n [data-vivliostyle-page-container]:nth-last-child(n + 2) {\n top: -1px;\n margin-top: 1px;\n margin-bottom: -1px;\n }\n }\n}\n",qn="\n/*\n * Copyright 2013 Google, Inc.\n * Copyright 2015 Trim-marks Inc.\n * Copyright 2019 Vivliostyle Foundation\n *\n * CSS property validation.\n */\nNUM = POS_NUM | ZERO | NEGATIVE;\nNNEG_NUM = POS_NUM | ZERO;\nINT = POS_INT | ZERO | NEGATIVE;\nNNEG_INT = POS_INT | ZERO;\nPERCENTAGE = POS_PERCENTAGE | ZERO | NEGATIVE;\nSTRICT_PERCENTAGE = POS_PERCENTAGE | ZERO_PERCENTAGE | NEGATIVE;\nNNEG_PERCENTAGE = POS_PERCENTAGE | ZERO;\nLENGTH = POS_LENGTH | ZERO | NEGATIVE;\nNNEG_LENGTH = POS_LENGTH | ZERO | NEGATIVE;\nPLENGTH = LENGTH | PERCENTAGE;\nPPLENGTH = POS_LENGTH | ZERO | POS_PERCENTAGE;\nALENGTH = LENGTH | auto;\nAPLENGTH = PLENGTH | auto;\nPAPLENGTH = PPLENGTH | auto;\nANGLE = POS_ANGLE | ZERO | NEGATIVE;\nLENGTH_OR_NUM = LENGTH | NUM;\nANGLE_OR_NUM = ANGLE | NUM;\nMIN_MAX_FIT_CONTENT = min-content | max-content | fit-content;\nSCOLOR = HASHCOLOR | aliceblue: #F0F8FF | antiquewhite: #FAEBD7 | aqua: #00FFFF | aquamarine: #7FFFD4 | azure: #F0FFFF |\n beige: #F5F5DC | bisque: #FFE4C4 | black: #000000 | blanchedalmond: #FFEBCD | blue: #0000FF | blueviolet: #8A2BE2 | brown: #A52A2A |\n burlywood: #DEB887 | cadetblue: #5F9EA0 | chartreuse: #7FFF00 | chocolate: #D2691E | coral: #FF7F50 | cornflowerblue: #6495ED |\n cornsilk: #FFF8DC | crimson: #DC143C | cyan: #00FFFF | darkblue: #00008B | darkcyan: #008B8B | darkgoldenrod: #B8860B |\n darkgray: #A9A9A9 | darkgreen: #006400 | darkgrey: #A9A9A9 | darkkhaki: #BDB76B | darkmagenta: #8B008B | darkolivegreen: #556B2F |\n darkorange: #FF8C00 | darkorchid: #9932CC | darkred: #8B0000 | darksalmon: #E9967A | darkseagreen: #8FBC8F | darkslateblue: #483D8B |\n darkslategray: #2F4F4F | darkslategrey: #2F4F4F | darkturquoise: #00CED1 | darkviolet: #9400D3 | deeppink: #FF1493 |\n deepskyblue: #00BFFF | dimgray: #696969 | dimgrey: #696969 | dodgerblue: #1E90FF | firebrick: #B22222 | floralwhite: #FFFAF0 |\n forestgreen: #228B22 | fuchsia: #FF00FF | gainsboro: #DCDCDC | ghostwhite: #F8F8FF | gold: #FFD700 | goldenrod: #DAA520 |\n gray: #808080 | green: #008000 | greenyellow: #ADFF2F | grey: #808080 | honeydew: #F0FFF0 | hotpink: #FF69B4 | indianred: #CD5C5C |\n indigo: #4B0082 | ivory: #FFFFF0 | khaki: #F0E68C | lavender: #E6E6FA | lavenderblush: #FFF0F5 | lawngreen: #7CFC00 |\n lemonchiffon: #FFFACD | lightblue: #ADD8E6 | lightcoral: #F08080 | lightcyan: #E0FFFF | lightgoldenrodyellow: #FAFAD2 |\n lightgray: #D3D3D3 | lightgreen: #90EE90 | lightgrey: #D3D3D3 | lightpink: #FFB6C1 | lightsalmon: #FFA07A | lightseagreen: #20B2AA |\n lightskyblue: #87CEFA | lightslategray: #778899 | lightslategrey: #778899 | lightsteelblue: #B0C4DE | lightyellow: #FFFFE0 |\n lime: #00FF00 | limegreen: #32CD32 | linen: #FAF0E6 | magenta: #FF00FF | maroon: #800000 | mediumaquamarine: #66CDAA |\n mediumblue: #0000CD | mediumorchid: #BA55D3 | mediumpurple: #9370DB | mediumseagreen: #3CB371 | mediumslateblue: #7B68EE |\n mediumspringgreen: #00FA9A | mediumturquoise: #48D1CC | mediumvioletred: #C71585 | midnightblue: #191970 | mintcream: #F5FFFA |\n mistyrose: #FFE4E1 | moccasin: #FFE4B5 | navajowhite: #FFDEAD | navy: #000080 | oldlace: #FDF5E6 | olive: #808000 |\n olivedrab: #6B8E23 | orange: #FFA500 | orangered: #FF4500 | orchid: #DA70D6 | palegoldenrod: #EEE8AA | palegreen: #98FB98 |\n paleturquoise: #AFEEEE | palevioletred: #DB7093 | papayawhip: #FFEFD5 | peachpuff: #FFDAB9 | peru: #CD853F | pink: #FFC0CB |\n plum: #DDA0DD | powderblue: #B0E0E6 | purple: #800080 | rebeccapurple: #663399 | red: #FF0000 | rosybrown: #BC8F8F | royalblue: #4169E1 |\n saddlebrown: #8B4513 | salmon: #FA8072 | sandybrown: #F4A460 | seagreen: #2E8B57 | seashell: #FFF5EE | sienna: #A0522D |\n silver: #C0C0C0 | skyblue: #87CEEB | slateblue: #6A5ACD | slategray: #708090 | slategrey: #708090 | snow: #FFFAFA |\n springgreen: #00FF7F | steelblue: #4682B4 | tan: #D2B48C | teal: #008080 | thistle: #D8BFD8 | tomato: #FF6347 |\n turquoise: #40E0D0 | violet: #EE82EE | wheat: #F5DEB3 | white: #FFFFFF | whitesmoke: #F5F5F5 | yellow: #FFFF00 |\n yellowgreen: #9ACD32 | transparent | currentcolor;\nRGBCOLOR = rgb(INT{3}) | rgb(STRICT_PERCENTAGE{3});\nRGBACOLOR = rgba(NUM{4}) | rgba(STRICT_PERCENTAGE{3} NUM);\nHSLCOLOR = hsl(NUM PERCENTAGE{2});\nHSLACOLOR = hsl(NUM PERCENTAGE{2} NUM);\nCOLOR = SCOLOR | RGBCOLOR | RGBACOLOR | HSLCOLOR | HSLACOLOR;\nBG_POSITION_TERM = PLENGTH | left | center | right | top | bottom;\nSIDE_OR_CORNER = [left | right] || [top | bottom];\nCOLOR_STOP = SPACE(COLOR [PERCENTAGE | LENGTH]?);\nLINEAR_GRADIENT = linear-gradient([ANGLE | SPACE(to SIDE_OR_CORNER)]? COLOR_STOP+) |\n repeating-linear-gradient([ANGLE | SPACE(to SIDE_OR_CORNER)]? COLOR_STOP+) |;\nGRADIENT_EXTENT = closest-corner | closest-side | farthest-corner | farthest-side;\nGRADIENT_POSITION = at BG_POSITION_TERM{1,4};\nGRADIENT_SHAPE = SPACE(circle LENGTH? GRADIENT_POSITION?) | SPACE(ellipse PLENGTH{2}? GRADIENT_POSITION?)| SPACE([circle | ellipse] GRADIENT_EXTENT? GRADIENT_POSITION?);\nRADIAL_GRADIENT = radial-gradient([GRADIENT_SHAPE | SPACE(GRADIENT_POSITION)]? COLOR_STOP+) |\n repeating-radial-gradient([GRADIENT_SHAPE | SPACE(GRADIENT_POSITION)]? COLOR_STOP+);\nURI_OR_NONE = URI | none;\nIMAGE = URI | LINEAR_GRADIENT | RADIAL_GRADIENT | none;\nbackground-attachment = COMMA( [scroll | fixed | local]+ );\nbackground-color = COLOR;\nbackground-image = COMMA( IMAGE+ );\nbackground-position = COMMA( SPACE(BG_POSITION_TERM{1,4})+ ); /* relaxed */\nbackground-repeat = COMMA( [repeat | repeat-x | repeat-y | no-repeat]+ );\nborder-collapse = collapse | separate;\nBORDER_SIDE_COLOR = COLOR;\nBORDER_SIDE_STYLE = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset;\nBORDER_SIDE_WIDTH = thin: 1px | medium: 3px | thick: 5px | NNEG_LENGTH;\nborder-spacing = LENGTH LENGTH?;\nborder-top-color = BORDER_SIDE_COLOR;\nborder-right-color = BORDER_SIDE_COLOR;\nborder-bottom-color = BORDER_SIDE_COLOR;\nborder-left-color = BORDER_SIDE_COLOR;\nborder-top-style = BORDER_SIDE_STYLE;\nborder-right-style = BORDER_SIDE_STYLE;\nborder-bottom-style = BORDER_SIDE_STYLE;\nborder-left-style = BORDER_SIDE_STYLE;\nborder-top-width = BORDER_SIDE_WIDTH;\nborder-right-width = BORDER_SIDE_WIDTH;\nborder-bottom-width = BORDER_SIDE_WIDTH;\nborder-left-width = BORDER_SIDE_WIDTH;\nBORDER_RADIUS = PLENGTH{1,2};\nborder-top-left-radius = BORDER_RADIUS;\nborder-top-right-radius = BORDER_RADIUS;\nborder-bottom-right-radius = BORDER_RADIUS;\nborder-bottom-left-radius = BORDER_RADIUS;\nborder-image-source = IMAGE;\nborder-image-slice = [NUM | PERCENTAGE]{1,4} || fill; /* relaxed */\nborder-image-width = [NUM | PLENGTH | auto]{1,4};\nborder-image-outset = [NUM | LENGTH]{1,4};\nborder-image-repeat = [ stretch | repeat | round | space ]{1,2};\nbottom = APLENGTH;\ncaption-side = top | bottom;\nclear = none | left | right | top | bottom | both | all | same;\nclip = rect(ALENGTH{4}) | rect(SPACE(ALENGTH{4})) | auto;\ncolor = COLOR;\nLIST_STYLE_TYPE = disc | circle | square | decimal | decimal-leading-zero | lower-roman |\n upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha |\n upper-alpha | russian | upper-russian | lower-russian | cjk-ideographic | trad-chinese-informal |\n hebrew | none;\nTYPE_OR_UNIT_IN_ATTR = string | color | url | integer | number | length | angle | time | frequency;\nATTR = attr(SPACE(IDENT TYPE_OR_UNIT_IN_ATTR?) [ STRING | IDENT | COLOR | INT | NUM | PLENGTH | ANGLE | POS_TIME | FREQUENCY]?);\nCONTENT_LIST = [ STRING | URI | counter(IDENT LIST_STYLE_TYPE?) |\n counters(IDENT STRING LIST_STYLE_TYPE?) | ATTR |\n target-counter([ STRING | URI ] IDENT LIST_STYLE_TYPE?) |\n target-counter(ATTR IDENT LIST_STYLE_TYPE?) |\n target-counters([ STRING | URI ] IDENT STRING LIST_STYLE_TYPE?) |\n target-counters(ATTR IDENT STRING LIST_STYLE_TYPE?) |\n open-quote | close-quote | no-open-quote | no-close-quote |\n content([ text | before | after | first-letter ]?) |\n string(IDENT [first | start | last | first-except]?) ]+;\nCONTENT = normal | none | CONTENT_LIST;\ncontent = CONTENT;\nCOUNTER = [ IDENT INT? ]+ | none;\ncounter-increment = COUNTER;\ncounter-reset = COUNTER;\ncounter-set = COUNTER;\ncursor = COMMA(URI* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize |\n n-resize | se-resize | sw-resize | s-resize | w-resize | text | wait | help | progress ]);\ndirection = ltr | rtl;\ndisplay = inline | block | list-item | inline-block | table | inline-table | table-row-group |\n table-header-group | table-footer-group | table-row | table-column-group | table-column |\n table-cell | table-caption | none | oeb-page-head | oeb-page-foot | flex | inline-flex |\n ruby | ruby-base | ruby-text | ruby-base-container | ruby-text-container | run-in | compact | marker;\nempty-cells = show | hide;\nFAMILY = SPACE(IDENT+) | STRING;\nFAMILY_LIST = COMMA( FAMILY+ );\nfont-family = FAMILY_LIST;\nfont-size = xx-small | x-small | small | medium | large | x-large | xx-large | larger | smaller | PPLENGTH | POS_NUM;\nfont-style = normal | italic | oblique;\nfont-weight = normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\nheight = PAPLENGTH | POS_NUM | MIN_MAX_FIT_CONTENT;\nleft = APLENGTH;\nletter-spacing = normal | LENGTH_OR_NUM;\nline-height = normal | POS_NUM | PPLENGTH;\nlist-style-image = IMAGE;\nlist-style-position = inside | outside;\nlist-style-type = LIST_STYLE_TYPE;\nmargin-right = APLENGTH;\nmargin-left = APLENGTH;\nmargin-top = APLENGTH;\nmargin-bottom = APLENGTH;\nNPLENGTH = none | PLENGTH;\nmax-height = NPLENGTH | MIN_MAX_FIT_CONTENT;\nmax-width = NPLENGTH | MIN_MAX_FIT_CONTENT;\nmin-height = APLENGTH | MIN_MAX_FIT_CONTENT;\nmin-width = APLENGTH | MIN_MAX_FIT_CONTENT;\norphans = POS_INT;\noutline-offset = LENGTH;\noutline-color = COLOR | invert;\noutline-style = BORDER_SIDE_STYLE;\noutline-width = BORDER_SIDE_WIDTH;\noverflow = visible | hidden | scroll | auto;\npadding-right = PPLENGTH;\npadding-left = PPLENGTH;\npadding-top = PPLENGTH;\npadding-bottom = PPLENGTH;\nPAGE_BREAK = auto | always | avoid | left | right | recto | verso;\npage-break-after = PAGE_BREAK;\npage-break-before = PAGE_BREAK;\npage-break-inside = avoid | auto;\nposition = static | relative | absolute | fixed;\nquotes = [STRING STRING]+ | none;\nright = APLENGTH;\ntable-layout = auto | fixed;\ntext-align = left | right | center | justify | start | end;\ntext-decoration = none | [ underline || overline || line-through || blink ];\ntext-indent = PLENGTH;\ntext-transform = capitalize | uppercase | lowercase | none;\ntop = APLENGTH;\nvertical-align = baseline | sub | super | top | text-top | middle | bottom | text-bottom | PLENGTH;\nvisibility = visible | hidden | collapse;\nwhite-space = normal | pre | nowrap | pre-wrap | pre-line | break-spaces;\nwidows = POS_INT;\nwidth = PAPLENGTH | POS_NUM | MIN_MAX_FIT_CONTENT;\nword-spacing = normal | LENGTH_OR_NUM;\nz-index = auto | INT;\n\n[epub,moz,webkit]hyphens = auto | manual | none;\n[webkit]hyphenate-character = auto | STRING;\n\n/* css-logical */\nmargin-block-start = APLENGTH;\nmargin-block-end = APLENGTH;\nmargin-inline-start = APLENGTH;\nmargin-inline-end = APLENGTH;\npadding-block-start = APLENGTH;\npadding-block-end = APLENGTH;\npadding-inline-start = APLENGTH;\npadding-inline-end = APLENGTH;\nborder-block-start-color = BORDER_SIDE_COLOR;\nborder-block-end-color = BORDER_SIDE_COLOR;\nborder-inline-start-color = BORDER_SIDE_COLOR;\nborder-inline-end-color = BORDER_SIDE_COLOR;\nborder-block-start-style = BORDER_SIDE_STYLE;\nborder-block-end-style = BORDER_SIDE_STYLE;\nborder-inline-start-style = BORDER_SIDE_STYLE;\nborder-inline-end-style = BORDER_SIDE_STYLE;\nborder-block-start-width = BORDER_SIDE_WIDTH;\nborder-block-end-width = BORDER_SIDE_WIDTH;\nborder-inline-start-width = BORDER_SIDE_WIDTH;\nborder-inline-end-width = BORDER_SIDE_WIDTH;\nblock-start = APLENGTH;\nblock-end = APLENGTH;\ninline-start = APLENGTH;\ninline-end = APLENGTH;\nblock-size = PAPLENGTH | MIN_MAX_FIT_CONTENT;\ninline-size = PAPLENGTH | MIN_MAX_FIT_CONTENT;\nmax-block-size = NPLENGTH | MIN_MAX_FIT_CONTENT;\nmax-inline-size = NPLENGTH | MIN_MAX_FIT_CONTENT;\nmin-block-size = APLENGTH | MIN_MAX_FIT_CONTENT;\nmin-inline-size = APLENGTH | MIN_MAX_FIT_CONTENT;\n\nSHAPE = auto | rectangle( PLENGTH{4} ) | ellipse( PLENGTH{4} ) | circle( PLENGTH{3} ) |\n polygon( SPACE(PLENGTH+)+ );\n[epubx]shape-inside = SHAPE;\n[epubx,webkit]shape-outside = SHAPE;\n[epubx]wrap-flow = auto | both | start | end | maximum | clear | around /* epub al */;\n\nTRANSFORM_FUNCTION = matrix(NUM{6}) | translate(PLENGTH{1,2}) | translateX(PLENGTH) | translateY(PLENGTH) |\n scale(NUM{1,2}) | scaleX(NUM) | scaleY(NUM) | rotate(ANGLE) | skewX(ANGLE) | skewY(ANGLE);\n[epub]transform = none | TRANSFORM_FUNCTION+;\n[epub]transform-origin = [[[ top | bottom | left | right] PLENGTH?] | center | PLENGTH]{1,2}; /* relaxed */\n\nBOX = border-box | padding-box | content-box;\nSHADOW = SPACE(inset || LENGTH{2,4} || COLOR); /* relaxed */\n[webkit]background-size = COMMA( SPACE( [PLENGTH | auto ]{1,2} | cover | contain)+ );\n[webkit]background-origin = COMMA( BOX+ );\n[webkit]background-clip = COMMA( BOX+ );\n[webkit]box-shadow = none | COMMA( SHADOW+ );\ntext-shadow = none | COMMA( SHADOW+ );\n[webkit]box-decoration-break = slice | clone;\nFILTER_FUNCTION = blur(LENGTH) | brightness(NUM | PERCENTAGE) | contrast(NUM | PERCENTAGE) | drop-shadow(SPACE(LENGTH{2,3} COLOR?))\n | grayscale(NUM | PERCENTAGE) | hue-rotate(ANGLE) | invert(NUM | PERCENTAGE) | opacity(NUM | PERCENTAGE)\n | saturate(NUM | PERCENTAGE) | sepia(NUM | PERCENTAGE);\nFILTER_FUNCTION_LIST = FILTER_FUNCTION+;\n[webkit]filter = none | FILTER_FUNCTION_LIST;\n\nopacity = NUM;\n\n[moz,webkit]column-width = LENGTH | auto;\n[moz,webkit]column-count = INT | auto;\n[moz,webkit]column-gap = LENGTH | normal;\n[moz,webkit]column-rule-color = COLOR;\n[moz,webkit]column-rule-style = BORDER_SIDE_STYLE;\n[moz,webkit]column-rule-width = BORDER_SIDE_WIDTH;\nBREAK = auto | avoid | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region;\nbreak-before = BREAK;\nbreak-after = BREAK;\nbreak-inside = auto | avoid | avoid-page | avoid-column | avoid-region;\n[webkit]column-span = none | auto | all;\n[moz]column-fill = auto | balance | balance-all;\n\nsrc = COMMA([SPACE(URI format(STRING+)?) | local(FAMILY)]+); /* for font-face */\n\n[epubx,webkit]flow-from = IDENT;\n[epubx,webkit]flow-into = IDENT;\n[epubx]flow-linger = INT | none;\n[epubx]flow-priority = INT;\n[epubx]flow-options = none | [ exclusive || last || static ];\n[epubx]page = INT | auto | IDENT; /* page: IDENT is for CSS Paged Media */\n[epubx]min-page-width = LENGTH;\n[epubx]min-page-height = LENGTH;\n[epubx]required = true | false;\n[epubx]enabled = true | false;\n[epubx]conflicting-partitions = COMMA(IDENT+);\n[epubx]required-partitions = COMMA(IDENT+);\n[epubx]snap-height = LENGTH | none;\n[epubx]snap-width = LENGTH | none;\n[epubx]flow-consume = all | some;\n[epubx]utilization = NUM;\n[epubx]text-zoom = font-size | scale;\n\n[adapt]template = URI_OR_NONE;\n[adapt]behavior = IDENT;\n\n/* CSS Fonts */\nCOMMON_LIG_VALUES = [ common-ligatures | no-common-ligatures ];\nDISCRETIONARY_LIG_VALUES = [ discretionary-ligatures | no-discretionary-ligatures ];\nHISTORICAL_LIG_VALUES = [ historical-ligatures | no-historical-ligatures ];\nCONTEXTUAL_ALT_VALUES = [ contextual | no-contextual ];\nfont-variant-ligatures = normal | none | [ COMMON_LIG_VALUES || DISCRETIONARY_LIG_VALUES || HISTORICAL_LIG_VALUES || CONTEXTUAL_ALT_VALUES ];\nfont-variant-caps = normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps;\nNUMERIC_FIGURE_VALUES = [ lining-nums | oldstyle-nums ];\nNUMERIC_SPACING_VALUES = [ proportional-nums | tabular-nums ];\nNUMERIC_FRACTION_VALUES = [ diagonal-fractions | stacked-fractions ];\nfont-variant-numeric = normal | [ NUMERIC_FIGURE_VALUES || NUMERIC_SPACING_VALUES || NUMERIC_FRACTION_VALUES || ordinal || slashed-zero ];\nEAST_ASIAN_VARIANT_VALUES = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ];\nEAST_ASIAN_WIDTH_VALUES = [ full-width | proportional-width ];\nfont-variant-east-asian = normal | [ EAST_ASIAN_VARIANT_VALUES || EAST_ASIAN_WIDTH_VALUES || ruby ];\nfont-variant_css2 = normal | small-caps; /* for font shorthand */\nfont-size-adjust = none | NNEG_NUM;\n[webkit]font-kerning = auto | normal | none;\nfont-feature-settings = COMMA( normal | SPACE( STRING [ on | off | INT ]? )+ );\nFONT_STRETCH_CSS3_VALUES = normal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded;\nfont-stretch = FONT_STRETCH_CSS3_VALUES | PERCENTAGE;\nfont-stretch_css3 = FONT_STRETCH_CSS3_VALUES; /* for font shorthand */\nfont-display = [ auto | block | swap | fallback | optional ];\nunicode-range = COMMA( URANGE+ );\n\n/* CSS Images */\nimage-resolution = RESOLUTION;\nobject-fit = fill | contain | cover | none | scale-down;\nobject-position = COMMA( SPACE(BG_POSITION_TERM{1,4})+ ); /* relaxed */\n\n/* CSS Paged Media */\nPAGE_SIZE = a10 | a9 | a8 | a7 | a6 | a5 | a4 | a3 | a2 | a1 | a0\n | b10 | b9 | b8 | b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0\n | c10 | c9 | c8 | c7 | c6 | c5 | c4 | c3 | c2 | c1 | c0\n | jis-b10 | jis-b9 | jis-b8 | jis-b7 | jis-b6 | jis-b5 | jis-b4 | jis-b3 | jis-b2 | jis-b1 | jis-b0\n | letter | legal | ledger;\nbleed = auto | LENGTH;\nmarks = none | [ crop || cross ];\nsize = POS_LENGTH{1,2} | auto | [ PAGE_SIZE || [ portrait | landscape ] ];\n\n/* CSS Page Floats */\nfloat-reference = inline | column | region | page;\nfloat = block-start | block-end | inline-start | inline-end | snap-block | snap-inline | left | right | top | bottom | none | footnote;\nfloat-min-wrap-block = PPLENGTH;\n\n/* CSS Ruby */\nruby-align = start | center | space-between | space-around;\nruby-position = over | under | inter-character;\n\n/* CSS Size Adjust */\n[moz]text-size-adjust = auto | none | POS_PERCENTAGE;\n\n/* CSS Text */\n[webkit]line-break = auto | loose | normal | strict | anywhere;\noverflow-wrap = normal | break-word | anywhere;\n[moz]tab-size = NNEG_INT | NNEG_LENGTH;\n[moz]text-align-last = auto | start | end | left | right | center | justify;\ntext-justify = auto | none | inter-word | inter-character;\nword-break = normal | keep-all | break-all | break-word;\ntext-spacing = normal | none | auto | [[ trim-start | space-start | space-first ] ||\n [ trim-end | space-end | allow-end ] || [ trim-adjacent | space-adjacent ] ||\n no-compress || ideograph-alpha || ideograph-numeric || punctuation];\nhanging-punctuation = none | [ first || [ force-end | allow-end ] || last ];\n\n/* CSS Text Decoration */\n[webkit]text-decoration-color = COLOR;\n[webkit]text-decoration-line = none | [ underline || overline || line-through || blink ];\n[webkit]text-decoration-skip = none | [ objects || spaces || ink || edges || box-decoration ];\n[webkit]text-decoration-style = solid | double | dotted | dashed | wavy;\n[epub,webkit]text-emphasis-color = COLOR;\n[webkit]text-emphasis-position = [ over | under ] [ right | left ];\n[epub,webkit]text-emphasis-style = none | [[ filled | open ] || [ dot | circle | double-circle | triangle | sesame ]] | STRING;\n[webkit]text-underline-position = auto | [ under || [ left | right ]];\n\n/* CSS Transforms */\n[webkit]backface-visibility = visible | hidden;\n\n/* CSS UI */\nbox-sizing = content-box | padding-box | border-box;\ntext-overflow = [clip | ellipsis | STRING]{1,2};\n\n/* CSS Writing Modes */\n[epub,webkit]text-combine = none | horizontal;\ntext-combine-upright = none | all; /* relaxed */\n[epub,webkit]text-orientation = mixed | upright | sideways-right | sideways-left | sideways | use-glyph-orientation /* the following values are kept for backward-compatibility */ | vertical-right | rotate-right | rotate-left | rotate-normal | auto;\nunicode-bidi = normal | embed | isolate | bidi-override | isolate-override | plaintext;\n[epub,webkit]writing-mode = horizontal-tb | vertical-rl | lr-tb | rl-tb | tb-rl | lr | rl | tb;\n\n/* CSS Flex box */\nFLEX_BASIS = content | PAPLENGTH;\nflex-direction = row | row-reverse | column | column-reverse;\nflex-wrap = nowrap | wrap | wrap-reverse;\norder = INT;\nflex-grow = NNEG_NUM;\nflex-shrink = NNEG_NUM;\nflex-basis = FLEX_BASIS;\nflex = none | [ [ NNEG_NUM NNEG_NUM? ] || FLEX_BASIS ];\njustify-content = flex-start | flex-end | center | space-between | space-around;\nalign-items = flex-start | flex-end | center | baseline | stretch;\nalign-self = auto | flex-start | flex-end | center | baseline | stretch;\nalign-content = flex-start | flex-end | center | space-between | space-around | stretch;\n\n/* Pointer Events */\ntouch-action = auto | none | [ pan-x || pan-y ] | manipulation;\n\n/* SVG 2 */\nOPACITY_VALUE = NUM | PERCENTAGE;\nDASH_ARRAY = COMMA( SPACE( [ LENGTH | PERCENTAGE | NUM ]+ )+ );\nPAINT = none | child | child(INT) | COLOR | SPACE( URI [none | COLOR]? ) | context-fill | context-stroke;\ncolor-interpolation = auto | sRGB | linearRGB;\ncolor-rendering = auto | optimizeSpeed | optimizeQuality;\nfill = PAINT;\nfill-opacity = OPACITY_VALUE;\nfill-rule = nonzero | evenodd;\nglyph-orientation-vertical = auto | NUM | ANGLE;\nimage-rendering = auto | optimizeSpeed | optimizeQuality | crisp-edges | pixelated;\nmarker-start = none | URI;\nmarker-mid = none | URI;\nmarker-end = none | URI;\npointer-events = bounding-box | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | none;\npaint-order = normal | [ fill || stroke || markers ];\nshape-rendering = auto | optimizeSpeed | crispEdges | geometricPrecision;\nstop-color = COLOR;\nstop-opacity = OPACITY_VALUE;\nstroke = PAINT;\nstroke-dasharray = none | DASH_ARRAY;\nstroke-dashoffset = PERCENTAGE | LENGTH_OR_NUM;\nstroke-linecap = butt | round | square;\nstroke-linejoin = miter | round | bevel;\nstroke-miterlimit = NUM;\nstroke-opacity = OPACITY_VALUE;\nstroke-width = PERCENTAGE | LENGTH_OR_NUM;\ntext-anchor = start | middle | end;\ntext-rendering = auto | optimizeSpeed | optimizeLegibility | geometricPrecision;\nvector-effect = none | SPACE( [ non-scaling-stroke | non-scaling-size | non-rotation | fixed-position ]+ [ viewport | screen ]? );\n\n/* SVG 1.1 */\nalignment-baseline = auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical;\nbaseline-shift = baseline | sub | super | PERCENTAGE | LENGTH_OR_NUM;\ndominant-baseline = auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge;\nmask = none | URI;\n\n/* css-masking-1 */\nSHAPE_RADIUS = PLENGTH | closest-side | farthest-side;\nFILL_RULE = nonzero | evenodd;\nSHAPE_BOX = BOX | margin-box;\nGEOMETRY_BOX = SHAPE_BOX | fill-box | stroke-box | view-box;\nBASIC_SHAPE =\n inset( SPACE( PLENGTH{1,4} [ round PLENGTH{1,4} [ SLASH PLENGTH{1,4} ]? ]? ) )\n | circle( SPACE( [SHAPE_RADIUS]? [at BG_POSITION_TERM{1,4}]? ) )\n | ellipse( SPACE( SHAPE_RADIUS{2}? [at BG_POSITION_TERM{1,4}]? ) )\n | polygon( FILL_RULE? COMMA( SPACE( PLENGTH{2} )+ )+ );\n[webkit]clip-path = none | URI | [ BASIC_SHAPE || GEOMETRY_BOX ];\nclip-rule = nonzero | evenodd;\n\n/* filters */\nflood-color = COLOR;\nflood-opacity = OPACITY_VALUE;\nlighting-color = COLOR;\n\n/* compositing-1 */\nBLEND_MODE = normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity;\nmix-blend-mode = BLEND_MODE;\nisolation = auto | isolate;\nbackground-blend-mode = COMMA( BLEND_MODE+ );\n\n/* CSS GCPM */\nstring-set = COMMA( SPACE( IDENT CONTENT_LIST )+ | none );\nfootnote-policy = auto | line;\n\n/* CSS Repeated Headers and Footers */\n[viv]repeat-on-break = auto | none | header | footer;\n\nDEFAULTS\n\nbackground-attachment: scroll;\nbackground-color: transparent;\nbackground-image: none;\nbackground-repeat: repeat;\nbackground-position: 0% 0%;\nbackground-clip: border-box;\nbackground-origin: padding-box;\nbackground-size: auto;\nborder-top-color: currentColor;\nborder-right-color: currentColor;\nborder-bottom-color: currentColor;\nborder-left-color: currentColor;\nborder-top-style: none;\nborder-right-style: none;\nborder-bottom-style: none;\nborder-left-style: none;\nborder-top-width: 3px;\nborder-right-width: 3px;\nborder-bottom-width: 3px;\nborder-left-width: 3px;\nborder-top-left-radius: 0;\nborder-top-right-radius: 0;\nborder-bottom-right-radius: 0;\nborder-bottom-left-radius: 0;\nborder-image-source: none;\nborder-image-slice: 100%;\nborder-image-width: 1;\nborder-image-outset: 0;\nborder-image-repeat: stretch;\ncolumn-count: auto;\ncolumn-gap: normal;\ncolumn-width: auto;\ncolumn-rule-color: currentColor;\ncolumn-rule-style: none;\ncolumn-rule-width: 3px;\ncolumn-fill: balance;\noutline-color: currentColor;\noutline-style: none;\noutline-width: 3px;\nflex-direction: row;\nflex-wrap: nowrap;\nfont-family: serif;\nfont-style: normal;\nfont-size: medium;\nfont-size-adjust: none;\nfont-kerning: auto;\nfont-feature-settings: normal;\nfont-variant-ligatures: normal;\nfont-variant-caps: normal;\nfont-variant-numeric: normal;\nfont-variant-east-asian: normal;\nfont-weight: normal;\nfont-stretch: normal;\nline-height: normal;\nlist-style-image: none;\nlist-style-position: outside;\nlist-style-type: disc;\nmargin-bottom: auto;\nmargin-left: auto;\nmargin-right: auto;\nmargin-top: auto;\npadding-bottom: auto;\npadding-left: auto;\npadding-right: auto;\npadding-top: auto;\ntext-emphasis-color: currentColor;\ntext-emphasis-style: none;\nmarker-start: none;\nmarker-mid: none;\nmarker-end: none;\n\n/* css-logical */\nborder-block-start-color: currentColor;\nborder-block-end-color: currentColor;\nborder-inline-start-color: currentColor;\nborder-inline-end-color: currentColor;\nborder-block-start-style: none;\nborder-block-end-style: none;\nborder-inline-start-style: none;\nborder-inline-end-style: none;\nborder-block-start-width: 3px;\nborder-block-end-width: 3px;\nborder-inline-start-width: 3px;\nborder-inline-end-width: 3px;\n\nSHORTHANDS\n\nbackground = COMMA background-image [background-position [ / background-size ]] background-repeat\n background-attachment [background-origin background-clip] background-color; /* background-color is a special case, see the code */\nborder-top = border-top-width border-top-style border-top-color;\nborder-right = border-right-width border-right-style border-right-color;\nborder-bottom = border-bottom-width border-bottom-style border-bottom-color;\nborder-left = border-left-width border-left-style border-left-color;\nborder-width = INSETS border-top-width border-right-width border-bottom-width border-left-width;\nborder-style = INSETS border-top-style border-right-style border-bottom-style border-left-style;\nborder-color = INSETS border-top-color border-right-color border-bottom-color border-left-color;\nborder = border-width border-style border-color;\nborder-image = border-image-source border-image-slice [ / border-image-width [ / border-image-outset ] ]\n border-image-repeat;\nborder-radius = INSETS_SLASH border-top-left-radius border-top-right-radius\n border-bottom-right-radius border-bottom-left-radius;\n[moz,webkit]columns = column-width column-count;\n[moz,webkit]column-rule = column-rule-width column-rule-style column-rule-color;\nflex-flow = flex-direction flex-wrap;\noeb-column-number = column-count;\noutline = outline-width outline-style outline-color;\nlist-style = list-style-type list-style-position list-style-image;\nmargin = INSETS margin-top margin-right margin-bottom margin-left;\npadding = INSETS padding-top padding-right padding-bottom padding-left;\nfont = FONT font-style font-variant_css2 font-weight font-stretch_css3 /* font-size line-height font-family are special-cased */;\nfont-variant = font-variant-ligatures font-variant-caps font-variant-numeric font-variant-east-asian;\n[epub,webkit]text-emphasis = text-emphasis-style text-emphasis-color;\nmarker = INSETS marker-start marker-mid marker-end;\n\n/* css-logical */\nmargin-block = INSETS margin-block-start margin-block-end;\nmargin-inline = INSETS margin-inline-start margin-inline-end;\npadding-block = INSETS padding-block-start padding-block-end;\npadding-inline = INSETS padding-inline-start padding-inline-end;\nborder-block-width = INSETS border-block-start-width border-block-end-width;\nborder-block-style = INSETS border-block-start-style border-block-end-style;\nborder-block-color = INSETS border-block-start-color border-block-end-color;\nborder-inline-width = INSETS border-inline-start-width border-inline-end-width;\nborder-inline-style = INSETS border-inline-start-style border-inline-end-style;\nborder-inline-color = INSETS border-inline-start-color border-inline-end-color;\nborder-block = border-block-width border-block-style border-block-color;\nborder-inline = border-inline-width border-inline-style border-inline-color;\nborder-block-start = border-block-start-width border-block-start-style border-block-start-color;\nborder-block-end = border-block-end-width border-block-end-style border-block-end-color;\nborder-inline-start = border-inline-start-width border-inline-start-style border-inline-start-color;\nborder-inline-end = border-inline-end-width border-inline-end-style border-inline-end-color;\ninset-block-start = block-start;\ninset-block-end = block-end;\ninset-inline-start = inline-start;\ninset-inline-end = inline-end;\ninset-block = INSETS block-start block-end;\ninset-inline = INSETS inline-start inline-end;\n\n/* old names */\nword-wrap = overflow-wrap;\n[adapt,webkit]margin-before = margin-block-start;\n[adapt,webkit]margin-after = margin-block-end;\n[adapt,webkit]margin-start = margin-inline-start;\n[adapt,webkit]margin-end = margin-inline-end;\n[adapt,webkit]padding-before = padding-block-start;\n[adapt,webkit]padding-after = padding-block-end;\n[adapt,webkit]padding-start = padding-inline-start;\n[adapt,webkit]padding-end = padding-inline-end;\n[adapt,webkit]border-before-color = border-block-start-color;\n[adapt,webkit]border-after-color = border-block-end-color;\n[adapt,webkit]border-start-color = border-inline-start-color;\n[adapt,webkit]border-end-color = border-inline-end-color;\n[adapt,webkit]border-before-style = border-block-start-style;\n[adapt,webkit]border-after-style = border-block-end-style;\n[adapt,webkit]border-start-style = border-inline-start-style;\n[adapt,webkit]border-end-style = border-inline-end-style;\n[adapt,webkit]border-before-width = border-block-start-width;\n[adapt,webkit]border-after-width = border-block-end-width;\n[adapt,webkit]border-start-width = border-inline-start-width;\n[adapt,webkit]border-end-width = border-inline-end-width;\n[adapt,webkit]before = block-start;\n[adapt,webkit]after = block-end;\n[adapt,webkit]start = inline-start;\n[adapt,webkit]end = inline-end;\n\n",$n='\n<!DOCTYPE html>\n<html xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://www.pyroxy.com/ns/shadow">\n<head>\n<style><![CDATA[\n\n.footnote-content {\n float: footnote;\n}\n\n.table-cell-container {\n display: block;\n}\n\n]]></style>\n</head>\n<body>\n\n<s:template id="footnote"><s:content/><s:include class="footnote-content"/></s:template>\n\n<s:template id="table-cell"><div data-vivliostyle-flow-root="true" class="table-cell-container"><s:content/></div></s:template>\n\n</body>\n</html>',Qn='\n@namespace html "http://www.w3.org/1999/xhtml";\n\n:root {\n hyphens: -epubx-expr(pref-hyphenate? "auto": "manual");\n}\n:root[data-vivliostyle-epub-spine-properties~="page-spread-left"] {\n break-before: left;\n}\n:root[data-vivliostyle-epub-spine-properties~="page-spread-right"] {\n break-before: right;\n}\n\n@-adapt-footnote-area {\n display: block;\n margin-block-start: 0.5em;\n margin-block-end: 0.5em;\n}\n\n@-adapt-footnote-area ::before {\n display: block;\n border-block-start-width: 1px;\n border-block-start-style: solid;\n border-block-start-color: black;\n margin-block-end: 0.4em;\n margin-inline-start: 0;\n margin-inline-end: 60%;\n}\n\n/* default page master */\n@-epubx-page-master :background-host {\n @-epubx-partition :layout-host {\n -epubx-flow-from: body;\n top: -epubx-expr(header.margin-bottom-edge);\n bottom: -epubx-expr(page-height - footer.margin-top-edge);\n left: 0px;\n right: 0px;\n column-width: 25em;\n }\n @-epubx-partition footer :oeb-page-foot {\n writing-mode: horizontal-tb;\n -epubx-flow-from: oeb-page-foot;\n bottom: 0px;\n left: 0px;\n right: 0px;\n }\n @-epubx-partition header :oeb-page-head {\n writing-mode: horizontal-tb;\n -epubx-flow-from: oeb-page-head;\n top: 0px;\n left: 0px;\n right: 0px;\n }\n}\n\n@page {\n @top-left-corner {\n text-align: right;\n vertical-align: middle;\n }\n @top-left {\n text-align: left;\n vertical-align: middle;\n }\n @top-center {\n text-align: center;\n vertical-align: middle;\n }\n @top-right {\n text-align: right;\n vertical-align: middle;\n }\n @top-right-corner {\n text-align: left;\n vertical-align: middle;\n }\n @left-top {\n text-align: center;\n vertical-align: top;\n }\n @left-middle {\n text-align: center;\n vertical-align: middle;\n }\n @left-bottom {\n text-align: center;\n vertical-align: bottom;\n }\n @right-top {\n text-align: center;\n vertical-align: top;\n }\n @right-middle {\n text-align: center;\n vertical-align: middle;\n }\n @right-bottom {\n text-align: center;\n vertical-align: bottom;\n }\n @bottom-left-corner {\n text-align: right;\n vertical-align: middle;\n }\n @bottom-left {\n text-align: left;\n vertical-align: middle;\n }\n @bottom-center {\n text-align: center;\n vertical-align: middle;\n }\n @bottom-right {\n text-align: right;\n vertical-align: middle;\n }\n @bottom-right-corner {\n text-align: left;\n vertical-align: middle;\n }\n}\n\n@media print {\n @page {\n margin: 10%;\n }\n}\n',Zn='\n@namespace html "http://www.w3.org/1999/xhtml";\n\nhtml|html,\nhtml|address,\nhtml|blockquote,\nhtml|body,\nhtml|dd,\nhtml|div,\nhtml|dl,\nhtml|dt,\nhtml|fieldset,\nhtml|form,\nhtml|frame,\nhtml|frameset,\nhtml|h1,\nhtml|h2,\nhtml|h3,\nhtml|h4,\nhtml|h5,\nhtml|h6,\nhtml|noframes,\nhtml|ol,\nhtml|p,\nhtml|ul,\nhtml|center,\nhtml|dir,\nhtml|hr,\nhtml|menu,\nhtml|pre,\nhtml|article,\nhtml|section,\nhtml|nav,\nhtml|aside,\nhtml|hgroup,\nhtml|footer,\nhtml|header,\nhtml|figure,\nhtml|figcaption,\nhtml|main {\n display: block;\n unicode-bidi: normal;\n}\nhtml|li {\n display: list-item;\n}\nhtml|head {\n display: none !important;\n}\nhtml|table {\n display: table;\n}\nhtml|tr {\n display: table-row;\n}\nhtml|thead {\n display: table-header-group;\n break-after: avoid;\n}\nhtml|tbody {\n display: table-row-group;\n}\nhtml|tfoot {\n display: table-footer-group;\n break-before: avoid;\n}\nhtml|col {\n display: table-column;\n}\nhtml|colgroup {\n display: table-column-group;\n}\nhtml|td,\nhtml|th {\n display: table-cell;\n}\nhtml|caption {\n display: table-caption;\n text-align: center;\n}\nhtml|th {\n font-weight: bolder;\n text-align: center;\n}\nhtml|*[hidden],\nhtml|link,\nhtml|style,\nhtml|script {\n display: none;\n}\nhtml|h1 {\n font-size: 2em;\n margin-block-start: 0.67em;\n margin-block-end: 0.67em;\n margin-inline-start: 0em;\n margin-inline-end: 0em;\n}\nhtml|h2 {\n font-size: 1.5em;\n margin-block-start: 0.75em;\n margin-block-end: 0.75em;\n margin-inline-start: 0em;\n margin-inline-end: 0em;\n}\nhtml|h3 {\n font-size: 1.17em;\n margin-block-start: 0.83em;\n margin-block-end: 0.83em;\n margin-inline-start: 0em;\n margin-inline-end: 0em;\n}\nhtml|h4,\nhtml|p,\nhtml|blockquote,\nhtml|ul,\nhtml|fieldset,\nhtml|form,\nhtml|ol,\nhtml|dl,\nhtml|dir,\nhtml|menu,\nhtml|h5,\nhtml|h6 {\n margin-block-start: 1em;\n margin-block-end: 1em;\n margin-inline-start: 0em;\n margin-inline-end: 0em;\n}\nhtml|h5 {\n font-size: 0.83em;\n}\nhtml|h6 {\n font-size: 0.75em;\n}\nhtml|h1,\nhtml|h2,\nhtml|h3,\nhtml|h4,\nhtml|h5,\nhtml|h6,\nhtml|b,\nhtml|strong {\n font-weight: bolder;\n}\nhtml|h1,\nhtml|h2,\nhtml|h3,\nhtml|h4,\nhtml|h5,\nhtml|h6 {\n break-after: avoid;\n}\nhtml|blockquote {\n margin-block-start: 0px;\n margin-block-end: 0px;\n margin-inline-start: 40px;\n margin-inline-end: 40px;\n}\nhtml|i,\nhtml|cite,\nhtml|em,\nhtml|var,\nhtml|address {\n font-style: italic;\n}\nhtml|pre,\nhtml|tt,\nhtml|code,\nhtml|kbd,\nhtml|samp {\n font-family: monospace;\n}\nhtml|pre {\n white-space: pre;\n}\nhtml|button,\nhtml|textarea,\nhtml|input,\nhtml|select {\n display: inline-block;\n}\nhtml|big {\n font-size: 1.17em;\n}\nhtml|small,\nhtml|sub,\nhtml|sup {\n font-size: 0.83em;\n}\nhtml|sub {\n vertical-align: sub;\n}\nhtml|sup {\n vertical-align: super;\n}\nhtml|table {\n border-spacing: 2px;\n}\nhtml|thead,\nhtml|tbody,\nhtml|tfoot {\n vertical-align: middle;\n}\n/* for XHTML tables without tbody */\nhtml|table > html|tr {\n vertical-align: middle;\n}\nhtml|td,\nhtml|th {\n vertical-align: inherit;\n}\nhtml|s,\nhtml|strike,\nhtml|del {\n text-decoration: line-through;\n}\nhtml|hr {\n border: 1px inset;\n}\nhtml|ol,\nhtml|ul,\nhtml|dir,\nhtml|menu,\nhtml|dd {\n margin: 0px;\n margin-inline-start: 40px;\n}\nhtml|ol html|ul,\nhtml|ul html|ol,\nhtml|ul html|ul,\nhtml|ol html|ol {\n margin-block-start: 0;\n margin-block-end: 0;\n}\nhtml|u,\nhtml|ins {\n text-decoration: underline;\n}\nhtml|center {\n text-align: center;\n}\nhtml|q:before {\n content: open-quote;\n}\nhtml|q:after {\n content: close-quote;\n}\n\nhtml|audio,\nhtml|video {\n break-inside: avoid;\n}\n\nhtml|ruby {\n display: ruby;\n}\nhtml|rp {\n display: none;\n}\nhtml|rbc {\n display: ruby-base-container;\n}\nhtml|rtc {\n display: ruby-text-container;\n}\nhtml|rb {\n display: ruby-base;\n white-space: nowrap;\n}\nhtml|rt {\n display: ruby-text;\n}\n\nhtml|rtc,\nhtml|rt {\n font-variant-east-asian: ruby;\n text-emphasis: none;\n white-space: nowrap;\n line-height: 1;\n}\n\nhtml|rtc:lang(zh),\nhtml|rt:lang(zh) {\n ruby-align: center;\n}\n\nhtml|rtc,\nhtml|rt {\n font-size: 50%;\n}\n\nhtml|rtc:lang(zh-TW),\nhtml|rt:lang(zh-TW) {\n font-size: 30%;\n}\n\nhtml|rtc > html|rt,\nhtml|rtc > html|rt:lang(zh-TW) {\n font-size: 100%;\n}\n\n/* Bidi settings */\nhtml|bdo[dir="ltr"] {\n direction: ltr;\n unicode-bidi: bidi-override;\n}\nhtml|bdo[dir="rtl"] {\n direction: rtl;\n unicode-bidi: bidi-override;\n}\nhtml|*[dir="ltr"] {\n direction: ltr;\n unicode-bidi: embed;\n}\nhtml|*[dir="rtl"] {\n direction: rtl;\n unicode-bidi: embed;\n}\n\n/*------------------ epub-specific ---------------------*/\n\n@namespace epub "http://www.idpf.org/2007/ops";\n\nhtml|a[epub|type="noteref"] {\n font-size: 0.75em;\n vertical-align: super;\n line-height: 0.01;\n}\n\nhtml|a[epub|type="noteref"]:href-epub-type(footnote) {\n -adapt-template: url(user-agent.xml#footnote);\n text-decoration: none;\n}\n\nhtml|aside[epub|type="footnote"] {\n display: none;\n}\n\nhtml|aside[epub|type="footnote"]:footnote-content {\n display: block;\n margin: 0.25em;\n font-size: 1.2em;\n line-height: 1.2;\n}\n\nepub|trigger {\n display: none;\n}\n\nepub|switch {\n display: inline;\n}\n\nepub|default {\n display: inline;\n}\n\nepub|case {\n display: none;\n}\n\nepub|case[required-namespace::supported] {\n display: inline;\n}\n\nepub|case[required-namespace::supported] ~ epub|case {\n display: none;\n}\n\nepub|case[required-namespace::supported] ~ epub|default {\n display: none;\n}\n\n/*--------------- ncx and toc ----------------------*/\n\n@namespace ncx "http://www.daisy.org/z3986/2005/ncx/";\n\nncx|ncx {\n display: block;\n padding-top: 10px;\n padding-bottom: 10px;\n}\n\nncx|content {\n display: none;\n}\n\nbody > * {\n -adapt-behavior: body-child;\n}\n\n[role="doc-toc"],\n[role="directory"],\nnav,\n.toc,\n#toc,\n#table-of-contents,\n#contents {\n -adapt-behavior: toc-root;\n}\n\n[role="doc-toc"] a,\n[role="directory"] a,\nnav a,\n.toc a,\n#toc a,\nncx|navLabel {\n -adapt-behavior: toc-node-anchor;\n}\n\n[role="doc-toc"] li,\n[role="directory"] li,\nnav li,\n.toc li,\n#toc li,\nncx|navPoint {\n -adapt-behavior: toc-node;\n}\n\n[role="doc-toc"] li > *:first-child,\n[role="directory"] li > *:first-child,\nnav li > *:first-child,\n.toc li > *:first-child,\n#toc li > *:first-child {\n -adapt-behavior: toc-node-first-child;\n}\n\n[role="doc-toc"] ol,\n[role="directory"] ol,\nnav ol,\n.toc ol,\n#toc ol,\n[role="doc-toc"] ul,\n[role="directory"] ul,\nnav ul,\n.toc ul,\n#toc ul,\nol[role="doc-toc"],\nol[role="directory"],\nol.toc,\nol#toc,\nul[role="doc-toc"],\nul[role="directory"],\nul.toc,\nul#toc {\n -adapt-behavior: toc-container;\n}\n',Jn='\nviv-ts-open:not(.viv-ts-trim,.viv-ts-space,.viv-hang-first)::before,\nviv-ts-close:not(.viv-ts-trim,.viv-ts-space,.viv-hang-last)::after {\n content: " ";\n font-family: Courier, monospace;\n font-size: 83%;\n line-height: 0;\n text-orientation: mixed;\n visibility: hidden;\n}\nviv-ts-open:not(.viv-ts-space,.viv-hang-first) > viv-ts-inner {\n margin-inline-start: -0.5em;\n}\nviv-ts-close:not(.viv-ts-space,.viv-hang-last,.viv-hang-end:not(.viv-ts-trim)) > viv-ts-inner {\n margin-inline-end: -0.5em;\n}\nviv-ts-close.viv-hang-end:not(.viv-ts-trim,.viv-hang-hw)::after {\n font-size: 166%;\n}\nviv-ts-close.viv-hang-end:not(.viv-ts-trim) > viv-ts-inner {\n margin-inline-end: -1em;\n}\nviv-ts-close.viv-hang-end.viv-hang-hw > viv-ts-inner {\n margin-inline-end: -0.5em;\n}\nviv-ts-close.viv-hang-last > viv-ts-inner {\n display: inline-block;\n inline-size: 0;\n text-indent: 0;\n text-align: start;\n text-align-last: start;\n}\nviv-ts-open.viv-hang-first > viv-ts-inner {\n display: inline-block;\n inline-size: 1em;\n text-indent: 0;\n text-align: end;\n text-align-last: end;\n margin-inline-start: -1em;\n}\nviv-ts-thin-sp::after {\n content: " ";\n font-family: Times, serif;\n font-size: 66.6%;\n line-height: 0;\n text-orientation: mixed;\n visibility: hidden;\n}\n';function ti(t,e,u,n,i){var r=Pn("ajax"),o=new XMLHttpRequest,a=r.suspend(o),s={status:0,statusText:"",url:t,contentType:null,responseText:null,responseXML:null,responseBlob:null};o.open(u||"GET",t,!0),e&&(o.responseType=e),o.onreadystatechange=function(){if(4===o.readyState){if(s.status=o.status,s.statusText=o.statusText||404==o.status&&"Not Found"||"",200==s.status||0==s.status)if(e&&e!==jn.DOCUMENT||!o.responseXML||"parsererror"==o.responseXML.documentElement.localName)if((!e||e===jn.DOCUMENT)&&o.response instanceof HTMLDocument)s.responseXML=o.response,s.contentType=o.response.contentType;else{var u=o.response;e&&e!==jn.TEXT||"string"!=typeof u?u?s.responseBlob="string"==typeof u?ei([u]):u:c.warn("Unexpected empty success response for",t):s.responseText=u;var n=o.getResponseHeader("Content-Type");n&&(s.contentType=n.replace(/(.*);.*$/,"$1"))}else s.responseXML=o.responseXML,s.contentType=o.responseXML.contentType;a.schedule(s)}};try{n?(o.setRequestHeader("Content-Type",i||"text/plain; charset=UTF-8"),o.send(n)):(/^file:|^https?:\/\/[^/]+\.githubusercontent\.com|\.(xhtml|xht|opf)$/i.test(t)?/\/aozorabunko\/[^/]+\/cards\/[^/]+\/files\/[^/.]+\.html$/.test(t)?o.overrideMimeType("text/html; charset=Shift_JIS"):/\.(html|htm)$/i.test(t)?o.overrideMimeType("text/html; charset=UTF-8"):/\.(xhtml|xht|xml|opf)$/i.test(t)?o.overrideMimeType("application/xml; charset=UTF-8"):/\.(txt|css)$/i.test(t)?o.overrideMimeType("text/plain; charset=UTF-8"):o.overrideMimeType("text/html; charset=UTF-8"):/^data:,(<|%3c)/i.test(t)?o.overrideMimeType("text/html; charset=UTF-8"):/^data:,/i.test(t)&&o.overrideMimeType("text/plain; charset=UTF-8"),o.send(null))}catch(e){c.warn(e,"Error fetching "+t),a.schedule(s)}return r.result()}function ei(t,e){var u=e||"application/octet-stream",n=window.WebKitBlobBuilder||window.MSBlobBuilder;if(n){for(var i=new n,r=0;r<t.length;r++)i.append(t[r]);return i.getBlob(u)}return new Blob(t,{type:u})}!function(t){t.DEFAULT="",t.ARRAYBUFFER="arraybuffer",t.BLOB="blob",t.DOCUMENT="document",t.JSON="json",t.TEXT="text"}(jn||(jn={}));var ui,ni=function(){function t(t,e){this.parser=void 0,this.type=void 0,this.resources={},this.fetchers={},this.parser=t,this.type=e}var e=t.prototype;return e.load=function(t,e,u){t=H(t);var n=this.resources[t];return void 0!==n?Rn(n):this.fetch(t,e,u).get()},e.fetchInner=function(t,e,u){var n=this,i=Pn("fetch"),r=t.endsWith("?viv-toc-box");r&&(t=t.replace("?viv-toc-box",""));var o=K("user-agent.xml",W),a=!r&&t===o;return a&&(t="data:application/xml,"+encodeURIComponent($n)),ti(t,this.type).then((function(s){if(s.status>=400&&e)throw new Error((u||"Failed to fetch required resource: "+t)+" ("+s.status+(s.statusText?" "+s.statusText:"")+")");r?(t+="?viv-toc-box",s.url+="?viv-toc-box"):a&&(s.url=t=o),n.parser(s,n).then((function(e){delete n.fetchers[t],n.resources[t]=e,i.finish(e)}))})),i.result()},e.fetch=function(t,e,u){var n=this;if(t=H(t),this.resources[t])return null;var i=this.fetchers[t];return i||(i=new Gn((function(){return n.fetchInner(t,e,u)}),"Fetch "+t),this.fetchers[t]=i,i.start()),i},e.get=function(t){return this.resources[H(t)]},e.delete=function(t){delete this.resources[H(t)]},t}();function ii(t,e){var u=t.responseText;return Rn(u?V(u):null)}function ri(t){var e=parseInt(t,16);if(isNaN(e))throw new Error("E_CSS_COLOR");if(6==t.length)return new je(e);if(3==t.length)return new je(e=15&e|(15&e)<<4|(240&e)<<4|(240&e)<<8|(3840&e)<<8|(3840&e)<<12);throw new Error("E_CSS_COLOR")}!function(t){t.USER_AGENT="UA",t.USER="User",t.AUTHOR="Author"}(ui||(ui={}));var oi,ai=function(){function t(t){this.scope=void 0,this.flavor=void 0,this.scope=t,this.flavor=ui.AUTHOR}var e=t.prototype;return e.getCurrentToken=function(){return null},e.getScope=function(){return this.scope},e.error=function(t,e){},e.startStylesheet=function(t){this.flavor=t},e.tagSelector=function(t,e){},e.classSelector=function(t){},e.pseudoclassSelector=function(t,e){},e.pseudoelementSelector=function(t,e){},e.idSelector=function(t){},e.attributeSelector=function(t,e,u,n){},e.descendantSelector=function(){},e.childSelector=function(){},e.adjacentSiblingSelector=function(){},e.followingSiblingSelector=function(){},e.nextSelector=function(){},e.startSelectorRule=function(){},e.startFontFaceRule=function(){},e.startFootnoteRule=function(t){},e.startViewportRule=function(){},e.startDefineRule=function(){},e.startRegionRule=function(){},e.startPageRule=function(){},e.startPageMarginBoxRule=function(t){},e.startWhenRule=function(t){},e.startMediaRule=function(t){this.startWhenRule(t)},e.startFlowRule=function(t){},e.startPageTemplateRule=function(){},e.startPageMasterRule=function(t,e,u){},e.startPartitionRule=function(t,e,u){},e.startPartitionGroupRule=function(t,e,u){},e.startRuleBody=function(){},e.property=function(t,e,u){},e.endRule=function(){},e.startFuncWithSelector=function(t){},e.endFuncWithSelector=function(){},e.getImportantSpecificity=function(){switch(this.flavor){case ui.USER_AGENT:return 0;case ui.USER:return 100663296;default:return 83886080}},e.getBaseSpecificity=function(){switch(this.flavor){case ui.USER_AGENT:return 0;case ui.USER:return 16777216;default:return 33554432}},t}(),si=function(t){function e(){var e;return(e=t.call(this,null)||this).stack=[],e.tokenizer=null,e.slave=null,e}T(e,t);var u=e.prototype;return u.pushHandler=function(t){this.stack.push(this.slave),this.slave=t},u.popHandler=function(){this.slave=this.stack.pop()},u.getCurrentToken=function(){return this.tokenizer?this.tokenizer.token():null},u.getScope=function(){return this.slave.getScope()},u.error=function(t,e){this.slave.error(t,e)},u.errorMsg=function(t,e){c.warn(t)},u.startStylesheet=function(e){t.prototype.startStylesheet.call(this,e),this.stack.length>0&&(this.slave=this.stack[0],this.stack=[]),this.slave.startStylesheet(e)},u.tagSelector=function(t,e){this.slave.tagSelector(t,e)},u.classSelector=function(t){this.slave.classSelector(t)},u.pseudoclassSelector=function(t,e){this.slave.pseudoclassSelector(t,e)},u.pseudoelementSelector=function(t,e){this.slave.pseudoelementSelector(t,e)},u.idSelector=function(t){this.slave.idSelector(t)},u.attributeSelector=function(t,e,u,n){this.slave.attributeSelector(t,e,u,n)},u.descendantSelector=function(){this.slave.descendantSelector()},u.childSelector=function(){this.slave.childSelector()},u.adjacentSiblingSelector=function(){this.slave.adjacentSiblingSelector()},u.followingSiblingSelector=function(){this.slave.followingSiblingSelector()},u.nextSelector=function(){this.slave.nextSelector()},u.startSelectorRule=function(){this.slave.startSelectorRule()},u.startFontFaceRule=function(){this.slave.startFontFaceRule()},u.startFootnoteRule=function(t){this.slave.startFootnoteRule(t)},u.startViewportRule=function(){this.slave.startViewportRule()},u.startDefineRule=function(){this.slave.startDefineRule()},u.startRegionRule=function(){this.slave.startRegionRule()},u.startPageRule=function(){this.slave.startPageRule()},u.startPageMarginBoxRule=function(t){this.slave.startPageMarginBoxRule(t)},u.startWhenRule=function(t){this.slave.startWhenRule(t)},u.startFlowRule=function(t){this.slave.startFlowRule(t)},u.startPageTemplateRule=function(){this.slave.startPageTemplateRule()},u.startPageMasterRule=function(t,e,u){this.slave.startPageMasterRule(t,e,u)},u.startPartitionRule=function(t,e,u){this.slave.startPartitionRule(t,e,u)},u.startPartitionGroupRule=function(t,e,u){this.slave.startPartitionGroupRule(t,e,u)},u.startRuleBody=function(){this.slave.startRuleBody()},u.property=function(t,e,u){this.slave.property(t,e,u)},u.endRule=function(){this.slave.endRule()},u.startFuncWithSelector=function(t){this.slave.startFuncWithSelector(t)},u.endFuncWithSelector=function(){this.slave.endFuncWithSelector()},e}(ai),li=function(t){function e(e,u,n){var i;return(i=t.call(this,e)||this).owner=void 0,i.topLevel=void 0,i.depth=0,i.owner=u,i.topLevel=n,u&&(i.flavor=u.flavor),i}T(e,t);var u=e.prototype;return u.getCurrentToken=function(){return this.owner.getCurrentToken()},u.error=function(t,e){this.owner.errorMsg(t,e)},u.startRuleBody=function(){this.depth++},u.endRule=function(){0!=--this.depth||this.topLevel||this.owner.popHandler()},e}(ai),Di=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.report=function(t){this.error(t,this.getCurrentToken())},u.reportAndSkip=function(t){this.report(t),this.owner.pushHandler(new li(this.scope,this.owner,!1))},u.startSelectorRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_SELECTOR")},u.startFontFaceRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_FONT_FACE")},u.startFootnoteRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_FOOTNOTE")},u.startViewportRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_VIEWPORT")},u.startDefineRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_DEFINE")},u.startRegionRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_REGION")},u.startPageRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE")},u.startWhenRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_WHEN")},u.startFlowRule=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_FLOW")},u.startPageTemplateRule=function(){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE_TEMPLATE")},u.startPageMasterRule=function(t,e,u){this.reportAndSkip("E_CSS_UNEXPECTED_PAGE_MASTER")},u.startPartitionRule=function(t,e,u){this.reportAndSkip("E_CSS_UNEXPECTED_PARTITION")},u.startPartitionGroupRule=function(t,e,u){this.reportAndSkip("E_CSS_UNEXPECTED_PARTITION_GROUP")},u.startFuncWithSelector=function(t){this.reportAndSkip("E_CSS_UNEXPECTED_SELECTOR_FUNC")},u.endFuncWithSelector=function(){this.reportAndSkip("E_CSS_UNEXPECTED_END_SELECTOR_FUNC")},u.property=function(t,e,u){this.error("E_CSS_UNEXPECTED_PROPERTY",this.getCurrentToken())},e}(li),hi=[],ci=[],di=[],fi=[],pi=[],Ei=[],Ci=[],Fi=[],Ai=[],gi=[],vi=[],mi=[],Bi=[];!function(t){t[t.SELECTOR_NAME_1=1]="SELECTOR_NAME_1",t[t.SELECTOR_NAME=2]="SELECTOR_NAME",t[t.SELECTOR_ANY_1=3]="SELECTOR_ANY_1",t[t.SELECTOR_ANY=4]="SELECTOR_ANY",t[t.SELECTOR_ID_1=5]="SELECTOR_ID_1",t[t.SELECTOR_ID=6]="SELECTOR_ID",t[t.SELECTOR_CLASS_1=7]="SELECTOR_CLASS_1",t[t.SELECTOR_CLASS=8]="SELECTOR_CLASS",t[t.SELECTOR_ATTR_1=9]="SELECTOR_ATTR_1",t[t.SELECTOR_ATTR=10]="SELECTOR_ATTR",t[t.SELECTOR_CHILD=11]="SELECTOR_CHILD",t[t.SELECTOR_SIBLING=12]="SELECTOR_SIBLING",t[t.SELECTOR_BODY=13]="SELECTOR_BODY",t[t.SELECTOR_PSEUDOCLASS=14]="SELECTOR_PSEUDOCLASS",t[t.VAL_IDENT=15]="VAL_IDENT",t[t.VAL_HASH=16]="VAL_HASH",t[t.VAL_NUM=17]="VAL_NUM",t[t.VAL_INT=18]="VAL_INT",t[t.VAL_NUMERIC=19]="VAL_NUMERIC",t[t.VAL_STR=20]="VAL_STR",t[t.VAL_URL=21]="VAL_URL",t[t.VAL_COMMA=22]="VAL_COMMA",t[t.VAL_SLASH=23]="VAL_SLASH",t[t.VAL_FUNC=24]="VAL_FUNC",t[t.VAL_C_PAR=25]="VAL_C_PAR",t[t.VAL_END=26]="VAL_END",t[t.RULE_END=27]="RULE_END",t[t.IDENT=28]="IDENT",t[t.SELECTOR_START=29]="SELECTOR_START",t[t.AT=30]="AT",t[t.EXPR_IDENT=31]="EXPR_IDENT",t[t.EXPR_NUM=32]="EXPR_NUM",t[t.EXPR_NUMERIC=33]="EXPR_NUMERIC",t[t.EXPR_STR=34]="EXPR_STR",t[t.EXPR_PARAM=35]="EXPR_PARAM",t[t.EXPR_PREFIX=36]="EXPR_PREFIX",t[t.EXPR_INFIX=37]="EXPR_INFIX",t[t.EXPR_FUNC=38]="EXPR_FUNC",t[t.EXPR_C_PAR=39]="EXPR_C_PAR",t[t.EXPR_O_PAR=40]="EXPR_O_PAR",t[t.SELECTOR_NEXT=41]="SELECTOR_NEXT",t[t.SELECTOR_PSEUDOELEM=42]="SELECTOR_PSEUDOELEM",t[t.EXPR_O_BRC=43]="EXPR_O_BRC",t[t.VAL_FINISH=44]="VAL_FINISH",t[t.EXPR_INFIX_NAME=45]="EXPR_INFIX_NAME",t[t.PROP=46]="PROP",t[t.VAL_BANG=47]="VAL_BANG",t[t.VAL_BRC=48]="VAL_BRC",t[t.EXPR_SEMICOL=49]="EXPR_SEMICOL",t[t.ERROR_PUSH=50]="ERROR_PUSH",t[t.ERROR_POP=51]="ERROR_POP",t[t.ERROR_POP_DECL=52]="ERROR_POP_DECL",t[t.ERROR_SEMICOL=53]="ERROR_SEMICOL",t[t.VAL_PLUS=54]="VAL_PLUS",t[t.SELECTOR_PSEUDOCLASS_1=55]="SELECTOR_PSEUDOCLASS_1",t[t.SELECTOR_FOLLOWING_SIBLING=56]="SELECTOR_FOLLOWING_SIBLING",t[t.VAL_URANGE=57]="VAL_URANGE",t[t.DONE=200]="DONE"}(oi||(oi={}));var wi,yi=Vu.LAST+1,Ni=Vu.LAST+2,bi=Vu.LAST+3;hi[Vu.IDENT]=oi.IDENT,hi[Vu.STAR]=oi.SELECTOR_START,hi[Vu.HASH]=oi.SELECTOR_START,hi[Vu.CLASS]=oi.SELECTOR_START,hi[Vu.O_BRK]=oi.SELECTOR_START,hi[Vu.COLON]=oi.SELECTOR_START,hi[Vu.AT]=oi.AT,hi[Vu.C_BRC]=oi.RULE_END,hi[Vu.EOF]=oi.DONE,ci[Vu.IDENT]=oi.PROP,ci[Vu.EOF]=oi.DONE,Ei[Vu.IDENT]=oi.SELECTOR_NAME,Ei[Vu.STAR]=oi.SELECTOR_ANY,Ei[Vu.HASH]=oi.SELECTOR_ID,Ei[Vu.CLASS]=oi.SELECTOR_CLASS,Ei[Vu.O_BRK]=oi.SELECTOR_ATTR,Ei[Vu.COLON]=oi.SELECTOR_PSEUDOCLASS,di[Vu.GT]=oi.SELECTOR_CHILD,di[Vu.PLUS]=oi.SELECTOR_SIBLING,di[Vu.TILDE]=oi.SELECTOR_FOLLOWING_SIBLING,di[Vu.IDENT]=oi.SELECTOR_NAME_1,di[Vu.STAR]=oi.SELECTOR_ANY_1,di[Vu.HASH]=oi.SELECTOR_ID_1,di[Vu.CLASS]=oi.SELECTOR_CLASS_1,di[Vu.O_BRK]=oi.SELECTOR_ATTR_1,di[Vu.O_BRC]=oi.SELECTOR_BODY,di[Vu.COLON]=oi.SELECTOR_PSEUDOCLASS_1,di[Vu.COL_COL]=oi.SELECTOR_PSEUDOELEM,di[Vu.COMMA]=oi.SELECTOR_NEXT,fi[Vu.GT]=oi.SELECTOR_CHILD,fi[Vu.PLUS]=oi.SELECTOR_SIBLING,fi[Vu.TILDE]=oi.SELECTOR_FOLLOWING_SIBLING,fi[Vu.IDENT]=oi.SELECTOR_NAME_1,fi[Vu.STAR]=oi.SELECTOR_ANY_1,fi[Vu.HASH]=oi.SELECTOR_ID_1,fi[Vu.CLASS]=oi.SELECTOR_CLASS_1,fi[Vu.O_BRK]=oi.SELECTOR_ATTR_1,fi[Vu.C_PAR]=oi.DONE,fi[Vu.COLON]=oi.SELECTOR_PSEUDOCLASS_1,pi[Vu.IDENT]=oi.SELECTOR_NAME,pi[Vu.STAR]=oi.SELECTOR_ANY,pi[Vu.HASH]=oi.SELECTOR_ID,pi[Vu.CLASS]=oi.SELECTOR_CLASS,pi[Vu.COLON]=oi.SELECTOR_PSEUDOCLASS,pi[Vu.COL_COL]=oi.SELECTOR_PSEUDOELEM,pi[Vu.O_BRK]=oi.SELECTOR_ATTR,pi[Vu.O_BRC]=oi.SELECTOR_BODY,Ci[Vu.IDENT]=oi.VAL_IDENT,Ci[Vu.HASH]=oi.VAL_HASH,Ci[Vu.NUM]=oi.VAL_NUM,Ci[Vu.INT]=oi.VAL_INT,Ci[Vu.NUMERIC]=oi.VAL_NUMERIC,Ci[Vu.STR]=oi.VAL_STR,Ci[Vu.URL]=oi.VAL_URL,Ci[Vu.URANGE]=oi.VAL_URANGE,Ci[Vu.COMMA]=oi.VAL_COMMA,Ci[Vu.SLASH]=oi.VAL_SLASH,Ci[Vu.FUNC]=oi.VAL_FUNC,Ci[Vu.C_PAR]=oi.VAL_C_PAR,Ci[Vu.SEMICOL]=oi.VAL_END,Ci[Vu.C_BRC]=oi.VAL_BRC,Ci[Vu.BANG]=oi.VAL_BANG,Ci[Vu.PLUS]=oi.VAL_PLUS,Ci[Vu.EOF]=oi.VAL_FINISH,Fi[Vu.IDENT]=oi.EXPR_IDENT,Fi[Vu.NUM]=oi.EXPR_NUM,Fi[Vu.INT]=oi.EXPR_NUM,Fi[Vu.NUMERIC]=oi.EXPR_NUMERIC,Fi[Vu.STR]=oi.EXPR_STR,Fi[Vu.O_PAR]=oi.EXPR_O_PAR,Fi[Vu.FUNC]=oi.EXPR_FUNC,Fi[Vu.BANG]=oi.EXPR_PREFIX,Fi[Vu.MINUS]=oi.EXPR_PREFIX,Fi[Vu.DOLLAR]=oi.EXPR_PARAM,Ai[Vu.IDENT]=oi.EXPR_INFIX_NAME,Ai[Vu.COMMA]=oi.EXPR_INFIX,Ai[Vu.GT]=oi.EXPR_INFIX,Ai[Vu.LT]=oi.EXPR_INFIX,Ai[Vu.GT_EQ]=oi.EXPR_INFIX,Ai[Vu.LT_EQ]=oi.EXPR_INFIX,Ai[Vu.EQ]=oi.EXPR_INFIX,Ai[Vu.EQ_EQ]=oi.EXPR_INFIX,Ai[Vu.BANG_EQ]=oi.EXPR_INFIX,Ai[Vu.AMP_AMP]=oi.EXPR_INFIX,Ai[Vu.BAR_BAR]=oi.EXPR_INFIX,Ai[Vu.PLUS]=oi.EXPR_INFIX,Ai[Vu.MINUS]=oi.EXPR_INFIX,Ai[Vu.SLASH]=oi.EXPR_INFIX,Ai[Vu.PERCENT]=oi.EXPR_INFIX,Ai[Vu.STAR]=oi.EXPR_INFIX,Ai[Vu.COLON]=oi.EXPR_INFIX,Ai[Vu.QMARK]=oi.EXPR_INFIX,Ai[Vu.C_PAR]=oi.EXPR_C_PAR,Ai[Vu.O_BRC]=oi.EXPR_O_BRC,Ai[Vu.SEMICOL]=oi.EXPR_SEMICOL,gi[Vu.EOF]=oi.DONE,gi[Vu.O_BRC]=oi.ERROR_PUSH,gi[Vu.C_BRC]=oi.ERROR_POP,gi[Vu.O_BRK]=oi.ERROR_PUSH,gi[Vu.C_BRK]=oi.ERROR_POP,gi[Vu.O_PAR]=oi.ERROR_PUSH,gi[Vu.C_PAR]=oi.ERROR_POP,gi[Vu.SEMICOL]=oi.ERROR_SEMICOL,vi[Vu.EOF]=oi.DONE,vi[Vu.O_BRC]=oi.ERROR_PUSH,vi[Vu.C_BRC]=oi.ERROR_POP_DECL,vi[Vu.O_BRK]=oi.ERROR_PUSH,vi[Vu.C_BRK]=oi.ERROR_POP,vi[Vu.O_PAR]=oi.ERROR_PUSH,vi[Vu.C_PAR]=oi.ERROR_POP,vi[Vu.SEMICOL]=oi.ERROR_SEMICOL,mi[Vu.EOF]=oi.DONE,mi[Vu.O_BRC]=oi.ERROR_PUSH,mi[Vu.C_BRC]=oi.ERROR_POP,mi[Vu.O_BRK]=oi.ERROR_PUSH,mi[Vu.C_BRK]=oi.ERROR_POP,mi[Vu.O_PAR]=oi.ERROR_PUSH,mi[Vu.C_PAR]=oi.ERROR_POP,Bi[Vu.C_PAR]=0,Bi[Vu.COMMA]=0,Bi[Vu.QMARK]=1,Bi[Vu.COLON]=1,Bi[Vu.AMP_AMP]=2,Bi[Vu.BAR_BAR]=2,Bi[Vu.LT]=3,Bi[Vu.GT]=3,Bi[Vu.LT_EQ]=3,Bi[Vu.GT_EQ]=3,Bi[Vu.EQ]=3,Bi[Vu.EQ_EQ]=3,Bi[Vu.BANG_EQ]=3,Bi[Vu.PLUS]=4,Bi[Vu.MINUS]=4,Bi[Vu.STAR]=5,Bi[Vu.SLASH]=5,Bi[Vu.PERCENT]=5,Bi[Vu.EOF]=6,Bi[yi]=2,Bi[Ni]=2,function(t){t[t.PROP=0]="PROP",t[t.WHEN=1]="WHEN",t[t.MEDIA=2]="MEDIA",t[t.IMPORT=3]="IMPORT",t[t.SUPPORTS=4]="SUPPORTS"}(wi||(wi={}));var Si=function(){function t(t,e,u,n){this.actions=void 0,this.tokenizer=void 0,this.handler=void 0,this.baseURL=void 0,this.valStack=[],this.namespacePrefixToURI={},this.defaultNamespaceURI=null,this.propName=null,this.propImportant=!1,this.exprContext=void 0,this.result=null,this.importReady=!1,this.importURL=null,this.importCondition=null,this.errorBrackets=[],this.ruleStack=[],this.regionRule=!1,this.pageRule=!1,this.actions=t,this.tokenizer=e,this.handler=u,this.baseURL=n,this.exprContext=wi.MEDIA}var e=t.prototype;return e.extractVals=function(t,e){for(var u=[],n=this.valStack;e<n.length&&(u.push(n[e++]),e!=n.length);)if(n[e++]!=t)throw new Error("Unexpected state");return u},e.valStackReduce=function(t,e){var u,n=this.valStack,i=n.length;do{u=n[--i]}while(void 0!==u&&"string"!=typeof u);var r=n.length-(i+1);if(r>1&&n.splice(i+1,r,new $e(n.slice(i+1,n.length))),","==t)return null;i++;do{u=n[--i]}while(void 0!==u&&("string"!=typeof u||","==u));if(r=n.length-(i+1),"("==u){if(")"!=t)return this.handler.error("E_CSS_MISMATCHED_C_PAR",e),this.actions=vi,null;var o=new Ze(n[i-1],this.extractVals(",",i+1));return n.splice(i-1,r+2,o),null}return";"!=t||i>=0?(this.handler.error("E_CSS_UNEXPECTED_VAL_END",e),this.actions=vi,null):r>1?new Qe(this.extractVals(",",i+1)):n[0]},e.exprError=function(t,e){this.actions=this.propName?vi:gi,c.warn(t)},e.exprStackReduce=function(t,e){for(var u,n=this.valStack,i=this.handler,r=n.pop();;){var o=n.pop();if(t==Vu.C_PAR){for(var a=[r];o==Vu.COMMA;)a.unshift(n.pop()),o=n.pop();if("string"==typeof o){if("{"==o){for(;a.length>=2;){var s=a.shift(),l=a.shift(),D=new ie(i.getScope(),s,l);a.unshift(D)}return n.push(new Je(a[0])),!0}if("("==o){var h=n.pop(),c=n.pop();r=new ve(i.getScope(),Mt(c,h),a),t=Vu.EOF;continue}}if(o==Vu.O_PAR){r.isMediaName()&&(r=new we(i.getScope(),r,null)),t=Vu.EOF;continue}}else if("string"==typeof o){n.push(o);break}if(o<0)if(o==-Vu.BANG)r=new Zt(i.getScope(),r);else if(o==-Vu.MINUS)r=new te(i.getScope(),r);else{if(o!=-bi)return this.exprError("F_UNEXPECTED_STATE",e),!1;r=new Jt(i.getScope(),r)}else{if(Bi[t]>Bi[o]){n.push(o);break}switch(u=n.pop(),o){case Vu.AMP_AMP:r=new ee(i.getScope(),u,r);break;case yi:r=new ue(i.getScope(),u,r);break;case Ni:r=new re(i.getScope(),u,r);break;case Vu.BAR_BAR:r=new ne(i.getScope(),u,r);break;case Vu.LT:r=new oe(i.getScope(),u,r);break;case Vu.GT:r=new se(i.getScope(),u,r);break;case Vu.LT_EQ:r=new ae(i.getScope(),u,r);break;case Vu.GT_EQ:r=new le(i.getScope(),u,r);break;case Vu.EQ:case Vu.EQ_EQ:r=new De(i.getScope(),u,r);break;case Vu.BANG_EQ:r=new he(i.getScope(),u,r);break;case Vu.PLUS:r=new ce(i.getScope(),u,r);break;case Vu.MINUS:r=new de(i.getScope(),u,r);break;case Vu.STAR:r=new fe(i.getScope(),u,r);break;case Vu.SLASH:r=new pe(i.getScope(),u,r);break;case Vu.PERCENT:r=new Ee(i.getScope(),u,r);break;case Vu.COLON:if(!(n.length>1))return this.exprError("E_CSS_EXPR_COND",e),!1;switch(n[n.length-1]){case Vu.QMARK:n.pop(),r=new me(i.getScope(),n.pop(),u,r);break;case Vu.O_PAR:if(!u.isMediaName())return this.exprError("E_CSS_MEDIA_TEST",e),!1;r=new we(i.getScope(),u,r)}break;case Vu.QMARK:if(t!=Vu.COLON)return this.exprError("E_CSS_EXPR_COND",e),!1;case Vu.O_PAR:return n.push(u),n.push(o),n.push(r),!1;default:return this.exprError("F_UNEXPECTED_STATE",e),!1}}}return n.push(r),!1},e.readSupportsTest=function(t){var e,u,n=t.type===Vu.FUNC,i=this.tokenizer;if(n)e=t.position+(u=t.text).length+1;else{if(t.type!==Vu.O_PAR)return null;var r=i.nthToken(1),o=i.nthToken(2);if(r.type===Vu.IDENT&&o.type===Vu.COLON)i.consume(),i.consume(),u=r.text,e=o.position+1;else{if(r.type===Vu.O_PAR||r.type===Vu.FUNC||r.type===Vu.IDENT&&"not"===r.text.toLowerCase()&&(o.type===Vu.O_PAR||o.type===Vu.FUNC))return null;e=t.position+1}}for(var a,s=0;s>=0;)switch(i.consume(),(a=i.token()).type){case Vu.C_PAR:s--;break;case Vu.O_PAR:case Vu.FUNC:s++;break;case Vu.INVALID:case Vu.EOF:return this.exprError("E_CSS_UNEXPECTED_EOF",a),null}i.consume();var l=i.input.substring(e,a.position).trim();return new ye(this.handler.getScope(),u,l,n)},e.readPseudoParams=function(){for(var t=[];;){var e=this.tokenizer.token();switch(e.type){case Vu.IDENT:t.push(e.text);break;case Vu.PLUS:t.push("+");break;case Vu.NUM:case Vu.INT:t.push(e.num);break;default:return t}this.tokenizer.consume()}},e.readNthPseudoParams=function(){var t=!1,e=this.tokenizer.token();if(e.type===Vu.PLUS)t=!0,this.tokenizer.consume(),e=this.tokenizer.token();else if(e.type===Vu.IDENT&&("even"===e.text||"odd"===e.text))return this.tokenizer.consume(),[2,"odd"===e.text?1:0];switch(e.type){case Vu.NUMERIC:if(t&&e.num<0)return null;case Vu.IDENT:if(t&&"-"===e.text.charAt(0))return null;if("n"===e.text||"-n"===e.text){if(t&&e.precededBySpace)return null;var u="-n"===e.text?-1:1;e.type===Vu.NUMERIC&&(u=e.num);var n=0;this.tokenizer.consume();var i=(e=this.tokenizer.token()).type===Vu.MINUS,r=e.type===Vu.PLUS||i;if(r&&(this.tokenizer.consume(),e=this.tokenizer.token()),e.type===Vu.INT){if(1/(n=e.num)==-1/0){if(n=0,r)return null}else if(n<0){if(r)return null}else if(n>=0&&!r)return null;this.tokenizer.consume()}else if(r)return null;return[u,i&&n>0?-n:n]}if("n-"===e.text||"-n-"===e.text){if(t&&e.precededBySpace)return null;var o="-n-"===e.text?-1:1;if(e.type===Vu.NUMERIC&&(o=e.num),this.tokenizer.consume(),(e=this.tokenizer.token()).type===Vu.INT)return e.num<0||1/e.num==-1/0?null:(this.tokenizer.consume(),[o,e.num])}else{var a=e.text.match(/^n(-[0-9]+)$/);if(a)return t&&e.precededBySpace?null:(this.tokenizer.consume(),[e.type===Vu.NUMERIC?e.num:1,parseInt(a[1],10)]);if(a=e.text.match(/^-n(-[0-9]+)$/))return this.tokenizer.consume(),[-1,parseInt(a[1],10)]}return null;case Vu.INT:return t&&(e.precededBySpace||e.num<0)?null:(this.tokenizer.consume(),[0,e.num])}return null},e.makeCondition=function(t,e){var u=this.handler.getScope();if(!u)return null;if(e=e||u._true,t)for(var n,i=_(t.split(/\s+/));!(n=i()).done;)switch(n.value){case"vertical":e=be(u,e,new Zt(u,new Fe(u,"pref-horizontal")));break;case"horizontal":e=be(u,e,new Fe(u,"pref-horizontal"));break;case"day":e=be(u,e,new Zt(u,new Fe(u,"pref-night-mode")));break;case"night":e=be(u,e,new Fe(u,"pref-night-mode"));break;default:e=u._false}return e===u._true?null:new Je(e)},e.isInsidePropertyOnlyRule=function(){switch(this.ruleStack[this.ruleStack.length-1]){case"[selector]":case"font-face":case"-epubx-flow":case"-epubx-viewport":case"-epubx-define":case"-adapt-footnote-area":return!0}return!1},e.runParser=function(t,e,u,n,i){var r,o,a,s,l,D,h,c=this.handler,d=this.tokenizer,f=this.valStack;n&&(this.exprContext=wi.MEDIA,this.valStack.push("{"));t:for(;t>0;--t)switch(r=d.token(),this.actions[r.type]){case oi.IDENT:if(d.nthToken(1).type!=Vu.COLON){this.isInsidePropertyOnlyRule()?(c.error("E_CSS_COLON_EXPECTED",d.nthToken(1)),this.actions=vi):(this.actions=Ei,c.startSelectorRule());continue}(o=d.nthToken(2)).precededBySpace||o.type!=Vu.IDENT&&o.type!=Vu.FUNC||d.mark(),this.propName=r.text,this.propImportant=!1,d.consume(),d.consume(),this.actions=Ci,f.splice(0,f.length);continue;case oi.PROP:if(d.nthToken(1).type!=Vu.COLON){this.actions=vi,c.error("E_CSS_COLON_EXPECTED",d.nthToken(1));continue}this.propName=r.text,this.propImportant=!1,d.consume(),d.consume(),this.actions=Ci,f.splice(0,f.length);continue;case oi.SELECTOR_START:this.actions=Ei,c.startSelectorRule();continue;case oi.SELECTOR_NAME_1:if(!r.precededBySpace){this.actions=mi,c.error("E_CSS_SPACE_EXPECTED",r);continue}c.descendantSelector();case oi.SELECTOR_NAME:if(d.nthToken(1).type==Vu.BAR)if(d.consume(),d.consume(),null!=(a=this.namespacePrefixToURI[r.text]))switch((r=d.token()).type){case Vu.IDENT:c.tagSelector(a,r.text),this.actions=i?fi:di,d.consume();break;case Vu.STAR:c.tagSelector(a,null),this.actions=i?fi:di,d.consume();break;default:this.actions=gi,c.error("E_CSS_NAMESPACE",r)}else this.actions=gi,c.error("E_CSS_UNDECLARED_PREFIX",r);else c.tagSelector(this.defaultNamespaceURI,r.text),this.actions=i?fi:di,d.consume();continue;case oi.SELECTOR_ANY_1:if(!r.precededBySpace){this.actions=mi,c.error("E_CSS_SPACE_EXPECTED",r);continue}c.descendantSelector();case oi.SELECTOR_ANY:if(d.nthToken(1).type==Vu.BAR)switch(d.consume(),d.consume(),(r=d.token()).type){case Vu.IDENT:c.tagSelector(null,r.text),this.actions=i?fi:di,d.consume();break;case Vu.STAR:c.tagSelector(null,null),this.actions=i?fi:di,d.consume();break;default:this.actions=gi,c.error("E_CSS_NAMESPACE",r)}else c.tagSelector(this.defaultNamespaceURI,null),this.actions=i?fi:di,d.consume();continue;case oi.SELECTOR_ID_1:r.precededBySpace&&c.descendantSelector();case oi.SELECTOR_ID:c.idSelector(r.text),this.actions=i?fi:di,d.consume();continue;case oi.SELECTOR_CLASS_1:r.precededBySpace&&c.descendantSelector();case oi.SELECTOR_CLASS:c.classSelector(r.text),this.actions=i?fi:di,d.consume();continue;case oi.SELECTOR_PSEUDOCLASS_1:r.precededBySpace&&c.descendantSelector();case oi.SELECTOR_PSEUDOCLASS:d.consume();e:switch((r=d.token()).type){case Vu.IDENT:c.pseudoclassSelector(r.text,null),d.consume(),this.actions=i?fi:di;continue;case Vu.FUNC:switch(s=r.text,d.consume(),s){case"not":this.actions=Ei,c.startFuncWithSelector("not"),this.actions=this.runParser(Number.POSITIVE_INFINITY,!1,!1,!1,!0)?di:mi;break t;case"lang":case"href-epub-type":if((r=d.token()).type===Vu.IDENT){h=[r.text],d.consume();break}break e;case"nth-child":case"nth-of-type":case"nth-last-child":case"nth-last-of-type":case"nth":if(h=this.readNthPseudoParams())break;break e;default:h=this.readPseudoParams()}if((r=d.token()).type==Vu.C_PAR){c.pseudoclassSelector(s,h),d.consume(),this.actions=i?fi:di;continue}}c.error("E_CSS_PSEUDOCLASS_SYNTAX",r),this.actions=gi;continue;case oi.SELECTOR_PSEUDOELEM:switch(d.consume(),(r=d.token()).type){case Vu.IDENT:c.pseudoelementSelector(r.text,null),this.actions=i?fi:di,d.consume();continue;case Vu.FUNC:if(s=r.text,d.consume(),"nth-fragment"==s){if(null===(h=this.readNthPseudoParams()))break}else h=this.readPseudoParams();if((r=d.token()).type==Vu.C_PAR){c.pseudoelementSelector(s,h),this.actions=i?fi:di,d.consume();continue}}c.error("E_CSS_PSEUDOELEM_SYNTAX",r),this.actions=gi;continue;case oi.SELECTOR_ATTR_1:r.precededBySpace&&c.descendantSelector();case oi.SELECTOR_ATTR:if(d.consume(),(r=d.token()).type==Vu.IDENT)s=r.text,d.consume();else if(r.type==Vu.STAR)s=null,d.consume();else{if(r.type!=Vu.BAR){this.actions=mi,c.error("E_CSS_ATTR",r),d.consume();continue}s=""}if((r=d.token()).type==Vu.BAR){if(null==(a=s?this.namespacePrefixToURI[s]:s)){this.actions=mi,c.error("E_CSS_UNDECLARED_PREFIX",r),d.consume();continue}if(d.consume(),(r=d.token()).type!=Vu.IDENT){this.actions=mi,c.error("E_CSS_ATTR_NAME_EXPECTED",r);continue}s=r.text,d.consume(),r=d.token()}else a="";switch(r.type){case Vu.EQ:case Vu.TILDE_EQ:case Vu.BAR_EQ:case Vu.HAT_EQ:case Vu.DOLLAR_EQ:case Vu.STAR_EQ:case Vu.COL_COL:l=r.type,d.consume(),r=d.token();break;case Vu.C_BRK:c.attributeSelector(a,s,Vu.EOF,null),this.actions=i?fi:di,d.consume();continue;default:this.actions=mi,c.error("E_CSS_ATTR_OP_EXPECTED",r);continue}switch(r.type){case Vu.IDENT:case Vu.STR:c.attributeSelector(a,s,l,r.text),d.consume(),r=d.token();break;default:this.actions=mi,c.error("E_CSS_ATTR_VAL_EXPECTED",r);continue}if(r.type!=Vu.C_BRK){this.actions=mi,c.error("E_CSS_ATTR",r);continue}this.actions=i?fi:di,d.consume();continue;case oi.SELECTOR_CHILD:c.childSelector(),this.actions=pi,d.consume();continue;case oi.SELECTOR_SIBLING:c.adjacentSiblingSelector(),this.actions=pi,d.consume();continue;case oi.SELECTOR_FOLLOWING_SIBLING:c.followingSiblingSelector(),this.actions=pi,d.consume();continue;case oi.SELECTOR_BODY:this.regionRule?(this.ruleStack.push("-epubx-region"),this.regionRule=!1):this.pageRule?(this.ruleStack.push("page"),this.pageRule=!1):this.ruleStack.push("[selector]"),c.startRuleBody(),this.actions=hi,d.consume();continue;case oi.SELECTOR_NEXT:c.nextSelector(),this.actions=Ei,d.consume();continue;case oi.VAL_IDENT:f.push(ze(r.text)),d.consume();continue;case oi.VAL_HASH:l=parseInt(r.text,16);try{f.push(ri(r.text))}catch(t){if(this.actions===Ci&&d.hasMark()){d.reset(),this.actions=Ei,c.startSelectorRule();continue}c.error("E_CSS_COLOR",r),this.actions=gi}d.consume();continue;case oi.VAL_NUM:f.push(new Xe(r.num)),d.consume();continue;case oi.VAL_INT:f.push(new We(r.num)),d.consume();continue;case oi.VAL_NUMERIC:Ht(r.text)?f.push(new Je(new Ce(c.getScope(),r.num,r.text))):f.push(new Ge(r.num,r.text)),d.consume();continue;case oi.VAL_STR:f.push(new Ue(r.text)),d.consume();continue;case oi.VAL_URL:f.push(new Ke(K(r.text,this.baseURL))),d.consume();continue;case oi.VAL_URANGE:f.push(new Ye(r.text)),d.consume();continue;case oi.VAL_COMMA:this.valStackReduce(",",r),f.push(","),d.consume();continue;case oi.VAL_SLASH:f.push(Me),d.consume();continue;case oi.VAL_FUNC:"-epubx-expr"==(s=r.text.toLowerCase())||"calc"==s||"env"==s?(this.actions=Fi,this.exprContext=wi.PROP,f.push("{")):(f.push(s),f.push("(")),d.consume();continue;case oi.VAL_C_PAR:this.valStackReduce(")",r),d.consume();continue;case oi.VAL_BANG:if(d.consume(),r=d.token(),o=d.nthToken(1),r.type==Vu.IDENT&&"important"==r.text.toLowerCase()&&(o.type==Vu.SEMICOL||o.type==Vu.EOF||o.type==Vu.C_BRC)){d.consume(),this.propImportant=!0;continue}this.exprError("E_CSS_SYNTAX",r);continue;case oi.VAL_PLUS:switch((o=d.nthToken(1)).type){case Vu.NUM:case Vu.NUMERIC:case Vu.INT:if(!o.precededBySpace){d.consume();continue}}if(this.actions===Ci&&d.hasMark()){d.reset(),this.actions=Ei,c.startSelectorRule();continue}this.exprError("E_CSS_UNEXPECTED_PLUS",r);continue;case oi.VAL_END:d.consume();case oi.VAL_BRC:d.unmark(),(D=this.valStackReduce(";",r))&&this.propName&&c.property(this.propName,D,this.propImportant),this.actions=u?ci:hi;continue;case oi.VAL_FINISH:if(d.consume(),d.unmark(),D=this.valStackReduce(";",r),e)return this.result=D,!0;if(this.propName&&D&&c.property(this.propName,D,this.propImportant),u)return!0;this.exprError("E_CSS_SYNTAX",r);continue;case oi.EXPR_IDENT:if((o=d.nthToken(1)).type==Vu.CLASS)d.nthToken(2).type!=Vu.O_PAR||d.nthToken(2).precededBySpace?(f.push(new Fe(c.getScope(),Mt(r.text,o.text))),this.actions=Ai):(f.push(r.text,o.text,"("),d.consume()),d.consume();else{if(this.exprContext==wi.MEDIA||this.exprContext==wi.IMPORT)"not"==r.text.toLowerCase()?(d.consume(),f.push(new Ae(c.getScope(),!0,o.text))):("only"==r.text.toLowerCase()&&(d.consume(),r=o),f.push(new Ae(c.getScope(),!1,r.text)));else{if(this.exprContext===wi.SUPPORTS&&"not"===r.text.toLowerCase()&&f[f.length-1]!==yi&&f[f.length-1]!==Ni&&(o.type===Vu.O_PAR||o.type===Vu.FUNC)){f.push(-bi),d.consume();continue}f.push(new Fe(c.getScope(),r.text))}this.actions=Ai}d.consume();continue;case oi.EXPR_FUNC:if(this.exprContext===wi.SUPPORTS){f.push(this.readSupportsTest(r)),this.actions=Ai;continue}f.push(null,r.text,"("),d.consume();continue;case oi.EXPR_NUM:f.push(new Be(c.getScope(),r.num)),d.consume(),this.actions=Ai;continue;case oi.EXPR_NUMERIC:"%"==(s=r.text)&&(s=this.propName&&this.propName.match(/height|^(top|bottom)$/)?"vh":"vw"),f.push(new Ce(c.getScope(),r.num,s)),d.consume(),this.actions=Ai;continue;case oi.EXPR_STR:f.push(new Be(c.getScope(),r.text)),d.consume(),this.actions=Ai;continue;case oi.EXPR_PARAM:d.consume(),(r=d.token()).type!=Vu.INT||r.precededBySpace?this.exprError("E_CSS_SYNTAX",r):(f.push(new Ne(c.getScope(),r.num)),d.consume(),this.actions=Ai);continue;case oi.EXPR_PREFIX:f.push(-r.type),d.consume();continue;case oi.EXPR_INFIX:this.actions=Fi,this.exprStackReduce(r.type,r),f.push(r.type),d.consume();continue;case oi.EXPR_INFIX_NAME:"and"===r.text.toLowerCase()&&f[f.length-2]!==Ni&&f[f.length-2]!==-bi?(this.actions=Fi,this.exprStackReduce(yi,r),f.push(yi),d.consume()):"or"===r.text.toLowerCase()&&f[f.length-2]!==yi&&f[f.length-2]!==-bi?(this.actions=Fi,this.exprStackReduce(Ni,r),f.push(Ni),d.consume()):this.exprError("E_CSS_SYNTAX",r);continue;case oi.EXPR_C_PAR:this.exprStackReduce(r.type,r)&&(this.actions=Ci),d.consume();continue;case oi.EXPR_O_BRC:this.exprStackReduce(Vu.C_PAR,r)&&(this.propName||this.exprContext==wi.IMPORT?this.exprError("E_CSS_UNEXPECTED_BRC",r):(this.exprContext==wi.WHEN?c.startWhenRule(f.pop()):c.startMediaRule(f.pop()),this.ruleStack.push("media"),c.startRuleBody(),this.actions=hi)),d.consume();continue;case oi.EXPR_SEMICOL:if(this.exprStackReduce(Vu.C_PAR,r))return this.propName||this.exprContext!=wi.IMPORT?(this.exprError("E_CSS_UNEXPECTED_SEMICOL",r),this.actions=hi,d.consume(),!1):(this.importCondition=f.pop(),this.importReady=!0,this.actions=hi,d.consume(),!1);d.consume();continue;case oi.EXPR_O_PAR:if(this.exprContext===wi.SUPPORTS){var p=this.readSupportsTest(r);if(p){f.push(p),this.actions=Ai;continue}}f.push(r.type),d.consume();continue;case oi.RULE_END:this.actions=hi,d.consume(),c.endRule(),this.ruleStack.length&&this.ruleStack.pop();continue;case oi.AT:switch(s=r.text.toLowerCase()){case"import":if(d.consume(),(r=d.token()).type==Vu.STR||r.type==Vu.URL){if(this.importURL=r.text,d.consume(),(r=d.token()).type==Vu.SEMICOL||r.type==Vu.EOF)return this.importReady=!0,d.consume(),!1;this.propName=null,this.exprContext=wi.IMPORT,this.actions=Fi,f.push("{");continue}c.error("E_CSS_IMPORT_SYNTAX",r),this.actions=gi;continue;case"namespace":switch(d.consume(),(r=d.token()).type){case Vu.IDENT:if(s=r.text,d.consume(),((r=d.token()).type==Vu.STR||r.type==Vu.URL)&&d.nthToken(1).type==Vu.SEMICOL){this.namespacePrefixToURI[s]=r.text,d.consume(),d.consume();continue}break;case Vu.STR:case Vu.URL:if(d.nthToken(1).type==Vu.SEMICOL){this.defaultNamespaceURI=r.text,d.consume(),d.consume();continue}}c.error("E_CSS_NAMESPACE_SYNTAX",r),this.actions=gi;continue;case"charset":if(d.consume(),(r=d.token()).type==Vu.STR&&d.nthToken(1).type==Vu.SEMICOL){"utf-8"!=(s=r.text.toLowerCase())&&"utf-16"!=s&&c.error("E_CSS_UNEXPECTED_CHARSET "+s,r),d.consume(),d.consume();continue}c.error("E_CSS_CHARSET_SYNTAX",r),this.actions=gi;continue;case"font-face":case"-epubx-page-template":case"-epubx-define":case"-epubx-viewport":if(d.nthToken(1).type==Vu.O_BRC){switch(d.consume(),d.consume(),s){case"font-face":c.startFontFaceRule();break;case"-epubx-page-template":c.startPageTemplateRule();break;case"-epubx-define":c.startDefineRule();break;case"-epubx-viewport":c.startViewportRule()}this.ruleStack.push(s),c.startRuleBody();continue}break;case"-adapt-footnote-area":switch(d.consume(),(r=d.token()).type){case Vu.O_BRC:d.consume(),c.startFootnoteRule(null),this.ruleStack.push(s),c.startRuleBody();continue;case Vu.COL_COL:if(d.consume(),(r=d.token()).type==Vu.IDENT&&d.nthToken(1).type==Vu.O_BRC){s=r.text,d.consume(),d.consume(),c.startFootnoteRule(s),this.ruleStack.push("-adapt-footnote-area"),c.startRuleBody();continue}}break;case"-epubx-region":d.consume(),c.startRegionRule(),this.regionRule=!0,this.actions=Ei;continue;case"page":d.consume(),c.startPageRule(),this.pageRule=!0,this.actions=pi;continue;case"top-left-corner":case"top-left":case"top-center":case"top-right":case"top-right-corner":case"right-top":case"right-middle":case"right-bottom":case"bottom-right-corner":case"bottom-right":case"bottom-center":case"bottom-left":case"bottom-left-corner":case"left-bottom":case"left-middle":case"left-top":if(d.consume(),(r=d.token()).type==Vu.O_BRC){d.consume(),c.startPageMarginBoxRule(s),this.ruleStack.push(s),c.startRuleBody();continue}break;case"-epubx-when":d.consume(),this.propName=null,this.exprContext=wi.WHEN,this.actions=Fi,f.push("{");continue;case"media":d.consume(),this.propName=null,this.exprContext=wi.MEDIA,this.actions=Fi,f.push("{");continue;case"supports":d.consume(),this.propName=null,this.exprContext=wi.SUPPORTS,this.actions=Fi,f.push("{");continue;case"-epubx-flow":if(d.nthToken(1).type==Vu.IDENT&&d.nthToken(2).type==Vu.O_BRC){c.startFlowRule(d.nthToken(1).text),d.consume(),d.consume(),d.consume(),this.ruleStack.push(s),c.startRuleBody();continue}break;case"-epubx-page-master":case"-epubx-partition":case"-epubx-partition-group":d.consume();var E=null,C=null,F=[];for((r=d.token()).type==Vu.IDENT&&(E=r.text,d.consume(),r=d.token()),r.type==Vu.COLON&&d.nthToken(1).type==Vu.IDENT&&(C=d.nthToken(1).text,d.consume(),d.consume(),r=d.token());r.type==Vu.FUNC&&"class"==r.text.toLowerCase()&&d.nthToken(1).type==Vu.IDENT&&d.nthToken(2).type==Vu.C_PAR;)F.push(d.nthToken(1).text),d.consume(),d.consume(),d.consume(),r=d.token();if(r.type==Vu.O_BRC){switch(d.consume(),s){case"-epubx-page-master":c.startPageMasterRule(E,C,F);break;case"-epubx-partition":c.startPartitionRule(E,C,F);break;case"-epubx-partition-group":c.startPartitionGroupRule(E,C,F)}this.ruleStack.push(s),c.startRuleBody();continue}break;case"":c.error("E_CSS_UNEXPECTED_AT"+s,r),this.actions=mi;continue;default:c.error("E_CSS_AT_UNKNOWN "+s,r),this.actions=gi;continue}c.error("E_CSS_AT_SYNTAX "+s,r),this.actions=gi;continue;case oi.ERROR_PUSH:if(e||u)return!0;this.errorBrackets.push(r.type+1),d.consume();continue;case oi.ERROR_POP_DECL:if(e||u)return!0;if(0==this.errorBrackets.length){this.actions=hi;continue}case oi.ERROR_POP:this.errorBrackets.length>0&&this.errorBrackets[this.errorBrackets.length-1]==r.type&&this.errorBrackets.pop(),0==this.errorBrackets.length&&r.type==Vu.C_BRC&&(this.actions=hi),d.consume();continue;case oi.ERROR_SEMICOL:if(e||u)return!0;0==this.errorBrackets.length&&(this.actions=hi),d.consume();continue;case oi.DONE:return i&&(d.consume(),c.endFuncWithSelector()),!0;default:if(e||u)return!0;if(n)return!!this.exprStackReduce(Vu.C_PAR,r)&&(this.result=f.pop(),!0);if(i)return c.error(r.type==Vu.INVALID?r.text:"E_CSS_SYNTAX",r),!1;if(this.actions===Ci&&d.hasMark()){d.reset(),this.actions=Ei,c.startSelectorRule();continue}if(this.actions!==gi&&this.actions!==mi&&this.actions!==vi){if(r.type==Vu.INVALID)c.error(r.text,r);else{if(r.type===Vu.O_BRC){c.startMediaRule(f.pop()),this.ruleStack.push("media"),c.startRuleBody(),this.actions=hi,d.consume();continue}if(r.type===Vu.SEMICOL)return this.actions=hi,d.consume(),!1;c.error("E_CSS_SYNTAX",r)}this.actions=this.isInsidePropertyOnlyRule()?vi:mi;continue}d.consume();continue}return!1},t}(),Ti=function(t){function e(e){var u;return(u=t.call(this,null)||this).scope=void 0,u.scope=e,u}T(e,t);var u=e.prototype;return u.error=function(t,e){throw new Error(t)},u.getScope=function(){return this.scope},e}(ai);function xi(t,e,u,n,i){return Ln("parseStylesheetFromText",(function(r){(function(t,e,u,n,i){var r=Pn("parseStylesheet"),o=new Si(hi,t,e,u),a=null;return i&&(a=function(t,e,u){var n=new Si(Fi,t,e,u);return n.runParser(Number.POSITIVE_INFINITY,!1,!1,!0,!1),n.result}(new Sn(i,e),e,u)),(a=o.makeCondition(n,a&&a.toExpr()))&&(e.startMediaRule(a),e.startRuleBody()),r.loop((function(){for(;!o.runParser(100,!1,!1,!1,!1);){if(o.importReady){var t=function(){var t=K(o.importURL,u);o.importCondition&&(e.startMediaRule(o.importCondition),e.startRuleBody());var n=Pn("parseStylesheet.import");return Ii(t,e,null,null).then((function(){o.importCondition&&e.endRule(),o.importReady=!1,o.importURL=null,o.importCondition=null,n.finish(!0)})),{v:n.result()}}();if("object"==typeof t)return t.v}var n=r.timeSlice();if(n.isPending)return n}return Rn(!1)})).then((function(){a&&e.endRule(),r.finish(!0)})),r.result()})(new Sn(t,e),e,u,n,i).thenFinish(r)}),(function(e,u){c.warn(u,"Failed to parse stylesheet text: "+t),e.finish(!1)}))}function Ii(t,e,u,n){return Ln("parseStylesheetFromURL",(function(i){ti(t).then((function(r){r.responseText?xi(r.responseText,e,t,u,n).then((function(e){e||c.warn("Failed to parse stylesheet from "+t),i.finish(!0)})):i.finish(!0)}))}),(function(e,u){c.warn(u,"Exception while fetching and parsing:",t),e.finish(!0)}))}function Pi(t,e,u){var n=new Si(Ci,e,new Ti(t),u);return n.runParser(Number.POSITIVE_INFINITY,!0,!1,!1,!1),n.result}var Ri={"z-index":!0,"column-count":!0,"flow-linger":!0,opacity:!0,page:!0,"flow-priority":!0,utilization:!0};function Li(t,e,u){if(e.isExpr()){try{return function(t,e,u){var n=e.evaluate(t);switch(typeof n){case"number":return function(t){return!!Ri[t]}(u)?n==Math.round(n)?new We(n):new Xe(n):new Ge(n,"px");case"string":return n?Pi(e.scope,new Sn(n,null),""):ke;case"boolean":return n?uu._true:uu._false;case"undefined":return ke}throw new Error("E_UNEXPECTED")}(t,e.expr,u)}catch(t){c.warn(t)}return ke}return e}function Oi(t,e,u){return t-=u,0===e?0===t:t%e==0&&t/e>=0}var ki=function(){function t(t){this.matchers=void 0,this.matchers=t}return t.prototype.matches=function(){return this.matchers.some((function(t){return t.matches()}))},t}(),_i=function(){function t(t){this.matchers=void 0,this.matchers=t}return t.prototype.matches=function(){return this.matchers.every((function(t){return t.matches()}))},t}(),Mi=function(){function t(t,e,u){this.elementOffset=void 0,this.a=void 0,this.b=void 0,this.elementOffset=t,this.a=e,this.b=u}return t.registerFragmentIndex=function(e,u,n){var i=t.fragmentIndices;(!i[e]||i[e].priority<=n)&&(i[e]={fragmentIndex:u,priority:n})},t.clearFragmentIndices=function(){t.fragmentIndices={}},t.prototype.matches=function(){var e=t.fragmentIndices[this.elementOffset];return null!=e&&null!=e.fragmentIndex&&Oi(e.fragmentIndex,this.a,this.b)},t}();Mi.fragmentIndices={};var Ui,Vi,Hi,zi,Gi,Xi,Wi=function(){function t(){}return t.buildViewConditionMatcher=function(t,e){var u=e.split("_");return"NFS"==u[0]?new Mi(t,parseInt(u[1],10),parseInt(u[2],10)):null},t.buildAllMatcher=function(t){return new _i(t)},t.buildAnyMatcher=function(t){return new ki(t)},t}();function ji(t){return t.reduce((function(t,e){return e[0]===o.default.DELETE?t:t+e[1]}),"")}function Ki(t,e,u){var n=0,i=0;return t.some((function(t){for(var r=0;r<t[1].length;r++){switch(t[0]*u){case o.default.INSERT:n++;break;case o.default.DELETE:n--,i++;break;case o.default.EQUAL:i++}if(i>e)return!0}return!1})),Math.max(Math.min(e,i-1)+n,0)}!function(t){t.isInstanceOfBlockFormattingContext=function(t){return t&&"Block"===t.formattingContextType}}(Ui||(Ui={})),function(t){!function(t){t.INLINE="inline",t.COLUMN="column",t.REGION="region",t.PAGE="page"}(t.FloatReference||(t.FloatReference={}))}(Vi||(Vi={})),function(t){t.isInstanceOfAfterIfContinuesLayoutConstraint=function(t){return t&&"AfterIfContinue"==t.flagmentLayoutConstraintType}}(Hi||(Hi={})),function(t){t.isInstanceOfRepetitiveElementsOwnerFormattingContext=function(t){return!!t&&("RepetitiveElementsOwner"===t.formattingContextType||Gi.isInstanceOfTableFormattingContext(t))},t.isInstanceOfRepetitiveElementsOwnerLayoutConstraint=function(t){return!!t&&("RepetitiveElementsOwner"===t.flagmentLayoutConstraintType||Gi.isInstanceOfTableRowLayoutConstraint(t))}}(zi||(zi={})),function(t){t.isInstanceOfTableFormattingContext=function(t){return t&&"Table"===t.formattingContextType},t.isInstanceOfTableRowLayoutConstraint=function(t){return t&&"TableRow"===t.flagmentLayoutConstraintType}}(Gi||(Gi={})),function(t){!function(t){t[t.IGNORE=0]="IGNORE",t[t.NEWLINE=1]="NEWLINE",t[t.PRESERVE=2]="PRESERVE"}(t.Whitespace||(t.Whitespace={})),function(t){t[t.NONE=0]="NONE",t[t.CONTENT=1]="CONTENT",t[t.ROOTLESS=2]="ROOTLESS",t[t.ROOTED=3]="ROOTED"}(t.ShadowType||(t.ShadowType={}))}(Xi||(Xi={}));var Yi={transform:!0,"transform-origin":!0},qi={top:!0,bottom:!0,left:!0,right:!0},$i=function(t,e,u){this.target=void 0,this.name=void 0,this.value=void 0,this.target=t,this.name=e,this.value=u},Qi={show:function(t){t.style.visibility="visible"},hide:function(t){t.style.visibility="hidden"},play:function(t){t.currentTime=0,t.play()},pause:function(t){t.pause()},resume:function(t){t.play()},mute:function(t){t.muted=!0},unmute:function(t){t.muted=!1}};function Zi(t,e){var u=Qi[e];return u?function(){for(var e=0;e<t.length;e++)try{u(t[e])}catch(t){}}:null}var Ji=function(t){function e(e,u){var n;return(n=t.call(this)||this).container=void 0,n.bleedBox=void 0,n.pageAreaElement=null,n.delayedItems=[],n.hrefHandler=void 0,n.elementsById={},n.dimensions={width:0,height:0},n.isFirstPage=!1,n.isLastPage=!1,n.isBlankPage=!1,n.isAutoPageWidth=!0,n.isAutoPageHeight=!0,n.spineIndex=0,n.position=null,n.offset=-1,n.side=null,n.fetchers=[],n.marginBoxes={top:{},bottom:{},left:{},right:{}},n.container=e,n.bleedBox=u,n.hrefHandler=function(t){var e=t.currentTarget,u=e.getAttribute("href")||e.getAttributeNS(X.XLINK,"href");u&&n.dispatchEvent({type:"hyperlink",target:null,currentTarget:null,anchorElement:e,href:u,preventDefault:function(){t.preventDefault()}})},n}T(e,t);var u=e.prototype;return u.setAutoPageWidth=function(t){this.isAutoPageWidth=t,t?this.container.setAttribute(e.AUTO_PAGE_WIDTH_ATTRIBUTE,"true"):this.container.removeAttribute(e.AUTO_PAGE_WIDTH_ATTRIBUTE)},u.setAutoPageHeight=function(t){this.isAutoPageHeight=t,t?this.container.setAttribute(e.AUTO_PAGE_HEIGHT_ATTRIBUTE,"true"):this.container.removeAttribute(e.AUTO_PAGE_HEIGHT_ATTRIBUTE)},u.registerElementWithId=function(t,e){var u=this.elementsById[e];u?u.push(t):this.elementsById[e]=[t]},u.finish=function(t,e){var u=this;Object.keys(this.elementsById).forEach((function(t){for(var e=u.elementsById[t],n=0;n<e.length;)u.container.contains(e[n])?n++:e.splice(n,1);0===e.length&&delete u.elementsById[t]}));for(var n=this.delayedItems,i=0;i<n.length;i++){var r=n[i];(r.target!==this.container||"transform"!==r.name||this.isAutoPageWidth||this.isAutoPageHeight)&&et(r.target,r.name,r.value.toString())}var o=e.getElementClientRect(this.container);this.dimensions.width=o.width,this.dimensions.height=o.height;for(var a=0;a<t.length;a++){var s=t[a],l=this.elementsById[s.ref],D=this.elementsById[s.observer];if(l&&D){var h=Zi(l,s.action);if(h)for(var c=0;c<D.length;c++)D[c].addEventListener(s.event,h,!1)}}},u.zoom=function(t){et(this.container,"transform","scale("+t+")")},u.getPageAreaElement=function(){return this.pageAreaElement||this.container},e}(Et);Ji.AUTO_PAGE_WIDTH_ATTRIBUTE="data-vivliostyle-auto-page-width",Ji.AUTO_PAGE_HEIGHT_ATTRIBUTE="data-vivliostyle-auto-page-height";var tr=Xi.Whitespace;function er(t){switch(t){case"normal":case"nowrap":return tr.IGNORE;case"pre-line":return tr.NEWLINE;case"pre":case"pre-wrap":case"break-spaces":return tr.PRESERVE;default:return null}}function ur(t,e){if(1==t.nodeType)return!1;var u=t.textContent;switch(e){case tr.IGNORE:return!!u.match(/^\s*$/);case tr.NEWLINE:return!!u.match(/^[ \t\f]*$/);case tr.PRESERVE:return 0==u.length}throw new Error("Unexpected whitespace: "+e)}var nr=function(t,e){this.flowName=void 0,this.parentFlowName=void 0,this.forcedBreakOffsets=[],this.formattingContext=null,this.flowName=t,this.parentFlowName=e},ir=function(){function t(t,e,u,n,i,r,o,a,s){this.flowName=void 0,this.element=void 0,this.startOffset=void 0,this.priority=void 0,this.linger=void 0,this.exclusive=void 0,this.repeated=void 0,this.last=void 0,this.breakBefore=void 0,this.startPage=-1,this.flowName=t,this.element=e,this.startOffset=u,this.priority=n,this.linger=i,this.exclusive=r,this.repeated=o,this.last=a,this.breakBefore=s}return t.prototype.isBetter=function(t){return!!this.exclusive&&(!t.exclusive||this.priority>t.priority||this.last)},t}();function rr(t,e){return t.top-e.top}function or(t,e){return e.right-t.right}function ar(t,e){return t===e||!(!t||!e)&&t.node===e.node&&t.shadowType===e.shadowType&&dr(t.shadowContext,e.shadowContext)&&dr(t.nodeShadow,e.nodeShadow)&&ar(t.shadowSibling,e.shadowSibling)}function sr(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.offsetInNode!==e.offsetInNode||t.after!==e.after||t.steps.length!==e.steps.length)return!1;for(var u=0;u<t.steps.length;u++)if(!ar(t.steps[u],e.steps[u]))return!1;return!0}function lr(t,e){return{steps:[{node:t.sourceNode,shadowType:hr.NONE,shadowContext:t.shadowContext,nodeShadow:null,shadowSibling:null,formattingContext:null,fragmentIndex:null!=e?e:t.fragmentIndex}],offsetInNode:0,after:!1,preprocessedTextContent:t.preprocessedTextContent}}function Dr(t,e){var u=new pr(t.node,e,0);return u.shadowType=t.shadowType,u.shadowContext=t.shadowContext,u.nodeShadow=t.nodeShadow,u.shadowSibling=t.shadowSibling?Dr(t.shadowSibling,e.copy()):null,u.formattingContext=t.formattingContext,u.fragmentIndex=t.fragmentIndex+1,u}var hr=Xi.ShadowType,cr=function(){function t(t,e,u,n,i,r,o){this.owner=void 0,this.root=void 0,this.xmldoc=void 0,this.parentShadow=void 0,this.type=void 0,this.styler=void 0,this.subShadow=null,this.owner=t,this.root=e,this.xmldoc=u,this.parentShadow=n,this.type=r,this.styler=o,i&&(i.subShadow=this)}return t.prototype.equals=function(t){return!!t&&this.owner===t.owner&&this.xmldoc===t.xmldoc&&this.type===t.type&&dr(this.parentShadow,t.parentShadow)},t}();function dr(t,e){return t===e||!!t&&!!e&&t.equals(e)}var fr=function(t,e){this.outer=void 0,this.count=void 0,this.outer=t,this.count=e},pr=function(){function t(t,e,u){this.sourceNode=void 0,this.parent=void 0,this.boxOffset=void 0,this.offsetInNode=0,this.after=!1,this.shadowType=void 0,this.shadowContext=void 0,this.nodeShadow=null,this.shadowSibling=null,this.shared=!1,this.inline=!0,this.overflow=!1,this.breakPenalty=void 0,this.display=null,this.floatReference=void 0,this.floatSide=null,this.clearSide=null,this.floatMinWrapBlock=null,this.columnSpan=null,this.verticalAlign="baseline",this.captionSide="top",this.inlineBorderSpacing=0,this.blockBorderSpacing=0,this.flexContainer=!1,this.whitespace=void 0,this.hyphenateCharacter=void 0,this.breakWord=void 0,this.establishesBFC=!1,this.containingBlockForAbsolute=!1,this.breakBefore=null,this.breakAfter=null,this.viewNode=null,this.clearSpacer=null,this.inheritedProps=void 0,this.vertical=void 0,this.direction=void 0,this.firstPseudo=void 0,this.lang=null,this.preprocessedTextContent=null,this.formattingContext=void 0,this.repeatOnBreak=null,this.pluginProps={},this.fragmentIndex=1,this.afterIfContinues=null,this.footnotePolicy=null,this.pageType=void 0,this.sourceNode=t,this.parent=e,this.boxOffset=u,this.shadowType=hr.NONE,this.shadowContext=e?e.shadowContext:null,this.breakPenalty=e?e.breakPenalty:0,this.floatReference=Vi.FloatReference.INLINE,this.whitespace=e?e.whitespace:tr.IGNORE,this.hyphenateCharacter=e?e.hyphenateCharacter:null,this.breakWord=!!e&&e.breakWord,this.inheritedProps=e?e.inheritedProps:{},this.vertical=!!e&&e.vertical,this.direction=e?e.direction:"ltr",this.firstPseudo=e?e.firstPseudo:null,this.formattingContext=e?e.formattingContext:null,this.pageType=e?e.pageType:null}var e=t.prototype;return e.resetView=function(){this.inline=!0,this.breakPenalty=this.parent?this.parent.breakPenalty:0,this.viewNode=null,this.clearSpacer=null,this.offsetInNode=0,this.after=!1,this.display=null,this.floatReference=Vi.FloatReference.INLINE,this.floatSide=null,this.clearSide=null,this.floatMinWrapBlock=null,this.columnSpan=null,this.verticalAlign="baseline",this.flexContainer=!1,this.whitespace=this.parent?this.parent.whitespace:tr.IGNORE,this.hyphenateCharacter=this.parent?this.parent.hyphenateCharacter:null,this.breakWord=!!this.parent&&this.parent.breakWord,this.breakBefore=null,this.breakAfter=null,this.nodeShadow=null,this.establishesBFC=!1,this.containingBlockForAbsolute=!1,this.vertical=!!this.parent&&this.parent.vertical,this.nodeShadow=null,this.preprocessedTextContent=null,this.formattingContext=this.parent?this.parent.formattingContext:null,this.repeatOnBreak=null,this.pluginProps={},this.fragmentIndex=1,this.afterIfContinues=null,this.footnotePolicy=null},e.cloneItem=function(){var e=new t(this.sourceNode,this.parent,this.boxOffset);return e.offsetInNode=this.offsetInNode,e.after=this.after,e.nodeShadow=this.nodeShadow,e.shadowType=this.shadowType,e.shadowContext=this.shadowContext,e.shadowSibling=this.shadowSibling,e.inline=this.inline,e.breakPenalty=this.breakPenalty,e.display=this.display,e.floatReference=this.floatReference,e.floatSide=this.floatSide,e.clearSide=this.clearSide,e.floatMinWrapBlock=this.floatMinWrapBlock,e.columnSpan=this.columnSpan,e.verticalAlign=this.verticalAlign,e.captionSide=this.captionSide,e.inlineBorderSpacing=this.inlineBorderSpacing,e.blockBorderSpacing=this.blockBorderSpacing,e.establishesBFC=this.establishesBFC,e.containingBlockForAbsolute=this.containingBlockForAbsolute,e.flexContainer=this.flexContainer,e.whitespace=this.whitespace,e.hyphenateCharacter=this.hyphenateCharacter,e.breakWord=this.breakWord,e.breakBefore=this.breakBefore,e.breakAfter=this.breakAfter,e.viewNode=this.viewNode,e.clearSpacer=this.clearSpacer,e.firstPseudo=this.firstPseudo,e.vertical=this.vertical,e.overflow=this.overflow,e.preprocessedTextContent=this.preprocessedTextContent,e.formattingContext=this.formattingContext,e.repeatOnBreak=this.repeatOnBreak,e.pluginProps=Object.create(this.pluginProps),e.fragmentIndex=this.fragmentIndex,e.afterIfContinues=this.afterIfContinues,e.footnotePolicy=this.footnotePolicy,e},e.modify=function(){return this.shared?this.cloneItem():this},e.copy=function(){var t=this;do{if(t.shared)break;t.shared=!0,t=t.parent}while(t);return this},e.clone=function(){for(var t,e=this.cloneItem(),u=e;null!=(t=u.parent);)t=t.cloneItem(),u.parent=t,u=t;return e},e.toNodePositionStep=function(){return{node:this.sourceNode,shadowType:this.shadowType,shadowContext:this.shadowContext,nodeShadow:this.nodeShadow,shadowSibling:this.shadowSibling?this.shadowSibling.toNodePositionStep():null,formattingContext:this.formattingContext,fragmentIndex:this.fragmentIndex}},e.toNodePosition=function(){var t,e,u,n=this,i=[];n.shadowType!==Xi.ShadowType.ROOTLESS||n.floatReference===Vi.FloatReference.INLINE&&"footnote"!==n.floatSide||null==(t=n.shadowContext)||null==(e=t.styler)||null==(u=e.style)||!u._pseudos||(n=n.parent);do{n.firstPseudo&&n.parent&&n.parent.firstPseudo!==n.firstPseudo||i.push(n.toNodePositionStep()),n=n.parent}while(n);return{steps:i,offsetInNode:this.preprocessedTextContent?Ki(this.preprocessedTextContent,this.offsetInNode,-1):this.offsetInNode,after:this.after,preprocessedTextContent:this.preprocessedTextContent}},e.isInsideBFC=function(){for(var t=this.parent;t;){if(t.establishesBFC)return!0;t=t.parent}return!1},e.getContainingBlockForAbsolute=function(){for(var t=this.parent;t;){if(t.containingBlockForAbsolute)return t;t=t.parent}return null},e.walkUpBlocks=function(t){for(var e=this;e;)e.inline||t(e),e=e.parent},e.belongsTo=function(t){return this.formattingContext===t&&!!this.parent&&this.parent.formattingContext===t},t}(),Er=function(){function t(t){this.primary=void 0,this.floats=null,this.primary=t}var e=t.prototype;return e.clone=function(){var e=new t(this.primary);if(this.floats){e.floats=[];for(var u=0;u<this.floats.length;++u)e.floats[u]=this.floats[u]}return e},e.isSamePosition=function(t){if(!t)return!1;if(this===t)return!0;if(!sr(this.primary,t.primary))return!1;if(this.floats){if(!t.floats||this.floats.length!==t.floats.length)return!1;for(var e=0;e<this.floats.length;e++)if(!sr(this.floats[e],t.floats[e]))return!1}else if(t.floats)return!1;return!0},t}(),Cr=function(){function t(t,e){this.chunkPosition=void 0,this.flowChunk=void 0,this.chunkPosition=t,this.flowChunk=e}var e=t.prototype;return e.clone=function(){return new t(this.chunkPosition.clone(),this.flowChunk)},e.isSamePosition=function(t){return!!t&&(this===t||this.chunkPosition.isSamePosition(t.chunkPosition))},t}(),Fr=function(){function t(){this.positions=[],this.startSide="any",this.breakAfter=null}var e=t.prototype;return e.clone=function(){for(var e=new t,u=this.positions,n=e.positions,i=0;i<u.length;i++)n[i]=u[i].clone();return e.startSide=this.startSide,e.breakAfter=this.breakAfter,e},e.isSamePosition=function(t){if(this===t)return!0;if(!t||this.positions.length!==t.positions.length)return!1;for(var e=0;e<this.positions.length;e++)if(!this.positions[e].isSamePosition(t.positions[e]))return!1;return!0},e.hasContent=function(t){return this.positions.length>0&&this.positions[0].flowChunk.startOffset<=t},t}(),Ar=function(){function t(){this.page=0,this.flows={},this.flowPositions={},this.isBlankPage=!1,this.highestSeenOffset=0,this.highestSeenNode=void 0,this.lookupPositionOffset=void 0}var e=t.prototype;return e.clone=function(){var e=new t;for(var u in e.page=this.page,e.isBlankPage=this.isBlankPage,e.highestSeenNode=this.highestSeenNode,e.highestSeenOffset=this.highestSeenOffset,e.lookupPositionOffset=this.lookupPositionOffset,e.flows=this.flows,this.flowPositions)e.flowPositions[u]=this.flowPositions[u].clone();return e},e.isSamePosition=function(t){if(this===t)return!0;if(!t||this.page!==t.page||this.highestSeenOffset!==t.highestSeenOffset)return!1;var e=Object.keys(this.flowPositions),u=Object.keys(t.flowPositions);if(e.length!==u.length)return!1;for(var n=0,i=e;n<i.length;n++){var r=i[n];if(!this.flowPositions[r].isSamePosition(t.flowPositions[r]))return!1}return!0},e.hasContent=function(t,e){var u=this.flowPositions[t];return!!u&&u.hasContent(e)},e.startSideOfFlow=function(t){var e=this.flowPositions[t];return e?e.startSide:"any"},e.firstFlowChunkOfFlow=function(t){var e=this.flowPositions[t];if(!e)return null;var u=e.positions[0];return u?u.flowChunk:null},t}(),gr=function(){function t(t){this.element=void 0,this.left=0,this.top=0,this.marginLeft=0,this.marginRight=0,this.marginTop=0,this.marginBottom=0,this.borderLeft=0,this.borderRight=0,this.borderTop=0,this.borderBottom=0,this.paddingLeft=0,this.paddingRight=0,this.paddingTop=0,this.paddingBottom=0,this.width=0,this.height=0,this.originX=0,this.originY=0,this.exclusions=null,this.innerShape=null,this.computedBlockSize=0,this.snapWidth=0,this.snapHeight=0,this.snapOffsetX=0,this.snapOffsetY=0,this.vertical=!1,this.element=t}var e=t.prototype;return e.getInsetTop=function(){return this.marginTop+this.borderTop+this.paddingTop},e.getInsetBottom=function(){return this.marginBottom+this.borderBottom+this.paddingBottom},e.getInsetLeft=function(){return this.marginLeft+this.borderLeft+this.paddingLeft},e.getInsetRight=function(){return this.marginRight+this.borderRight+this.paddingRight},e.getInsetBefore=function(){return this.vertical?this.getInsetRight():this.getInsetTop()},e.getInsetAfter=function(){return this.vertical?this.getInsetLeft():this.getInsetBottom()},e.getInsetStart=function(){return this.vertical?this.getInsetTop():this.getInsetLeft()},e.getInsetEnd=function(){return this.vertical?this.getInsetBottom():this.getInsetRight()},e.getBeforeEdge=function(t){return this.vertical?t.right:t.top},e.getAfterEdge=function(t){return this.vertical?t.left:t.bottom},e.getStartEdge=function(t){return this.vertical?t.top:t.left},e.getEndEdge=function(t){return this.vertical?t.bottom:t.right},e.getInlineSize=function(t){return this.vertical?t.bottom-t.top:t.right-t.left},e.getBoxSize=function(t){return this.vertical?t.right-t.left:t.bottom-t.top},e.getBoxDir=function(){return this.vertical?-1:1},e.getInlineDir=function(){return 1},e.copyFrom=function(t){this.element=t.element,this.left=t.left,this.top=t.top,this.marginLeft=t.marginLeft,this.marginRight=t.marginRight,this.marginTop=t.marginTop,this.marginBottom=t.marginBottom,this.borderLeft=t.borderLeft,this.borderRight=t.borderRight,this.borderTop=t.borderTop,this.borderBottom=t.borderBottom,this.paddingLeft=t.paddingLeft,this.paddingRight=t.paddingRight,this.paddingTop=t.paddingTop,this.paddingBottom=t.paddingBottom,this.width=t.width,this.height=t.height,this.originX=t.originX,this.originY=t.originY,this.innerShape=t.innerShape,this.exclusions=t.exclusions,this.computedBlockSize=t.computedBlockSize,this.snapWidth=t.snapWidth,this.snapHeight=t.snapHeight,this.vertical=t.vertical},e.setVerticalPosition=function(t,e){this.top=t,this.height=e,et(this.element,"top",t+"px"),et(this.element,"height",e+"px")},e.setHorizontalPosition=function(t,e){this.left=t,this.width=e,et(this.element,"left",t+"px"),et(this.element,"width",e+"px")},e.setBlockPosition=function(t,e){this.vertical?this.setHorizontalPosition(t+e*this.getBoxDir(),e):this.setVerticalPosition(t,e)},e.setInlinePosition=function(t,e){this.vertical?this.setVerticalPosition(t,e):this.setHorizontalPosition(t,e)},e.clear=function(){for(var t,e=this.element;t=e.lastChild;)e.removeChild(t)},e.getInnerShape=function(){var t=this.getInnerRect();return this.innerShape?this.innerShape.withOffset(t.x1,t.y1):Fu(t.x1,t.y1,t.x2,t.y2)},e.getInnerRect=function(){var t=this.originX+this.left+this.getInsetLeft(),e=this.originY+this.top+this.getInsetTop();return new Du(t,e,t+this.width,e+this.height)},e.getPaddingRect=function(){var t=this.originX+this.left+this.marginLeft+this.borderLeft,e=this.originY+this.top+this.marginTop+this.borderTop;return new Du(t,e,t+(this.paddingLeft+this.width+this.paddingRight),e+(this.paddingTop+this.height+this.paddingBottom))},e.getOuterShape=function(t,e){var u=this.getOuterRect();return Ou(t,u.x1,u.y1,u.x2-u.x1,u.y2-u.y1,e)},e.getOuterRect=function(){var t=this.originX+this.left,e=this.originY+this.top,u=this.getInsetLeft()+this.width+this.getInsetRight(),n=this.getInsetTop()+this.height+this.getInsetBottom();return new Du(t,e,t+u,e+n)},t}(),vr=function(t){function e(e,u,n,i){var r;return(r=t.call(this)||this).elem=void 0,r.context=void 0,r.rootContentValue=void 0,r.exprContentListener=void 0,r.elem=e,r.context=u,r.rootContentValue=n,r.exprContentListener=i,r}T(e,t);var u=e.prototype;return u.visitStrInner=function(t,e){e||(e=this.elem.ownerDocument.createTextNode(t)),this.elem.appendChild(e)},u.visitStr=function(t){return this.visitStrInner(t.str),null},u.visitURL=function(t){if(this.rootContentValue.url)this.elem.setAttribute("src",t.url);else{var e=this.elem.ownerDocument.createElementNS(X.XHTML,"img");e.setAttribute("src",t.url),this.elem.appendChild(e)}return null},u.visitSpaceList=function(t){return this.visitValues(t.values),null},u.visitExpr=function(t){var e=t.toExpr(),u=e.evaluate(this.context);if("string"==typeof u){e instanceof Fe&&(u=Pi(e.scope,new Sn(u,null),"").stringValue());var n=this.exprContentListener(e,u,this.elem.ownerDocument);this.visitStrInner(u,n)}return null},e}(Pe);function mr(t){return null!=t&&t!==ke&&t!==uu.normal&&t!==uu.none&&t!==uu.inherit}var Br={"border-collapse":!0,"border-spacing":!0,"caption-side":!0,"clip-rule":!0,color:!0,"color-interpolation":!0,"color-rendering":!0,cursor:!0,direction:!0,"empty-cells":!0,fill:!0,"fill-opacity":!0,"fill-rule":!0,"font-kerning":!0,"font-size":!0,"font-size-adjust":!0,"font-family":!0,"font-feature-settings":!0,"font-style":!0,"font-stretch":!0,"font-variant-ligatures":!0,"font-variant-caps":!0,"font-variant-numeric":!0,"font-variant-east-asian":!0,"font-weight":!0,"glyph-orientation-vertical":!0,"hanging-punctuation":!0,hyphens:!0,"hyphenate-character":!0,"hyphenate-limit-chars":!0,"hyphenate-limit-last":!0,"image-rendering":!0,"image-resolution":!0,"letter-spacing":!0,"line-break":!0,"line-height":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,marker:!0,"marker-end":!0,"marker-mid":!0,"marker-start":!0,orphans:!0,"overflow-wrap":!0,"paint-order":!0,"pointer-events":!0,quotes:!0,"ruby-align":!0,"ruby-position":!0,"shape-rendering":!0,stroke:!0,"stroke-dasharray":!0,"stroke-dashoffset":!0,"stroke-linecap":!0,"stroke-linejoin":!0,"stroke-miterlimit":!0,"stroke-opacity":!0,"stroke-width":!0,"tab-size":!0,"text-align":!0,"text-align-last":!0,"text-anchor":!0,"text-decoration-skip":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-combine-upright":!0,"text-indent":!0,"text-justify":!0,"text-rendering":!0,"text-size-adjust":!0,"text-spacing":!0,"text-transform":!0,"text-underline-position":!0,visibility:!0,"white-space":!0,widows:!0,"word-break":!0,"word-spacing":!0,"writing-mode":!0},wr=["box-decoration-break","image-resolution","orphans","widows"],yr={"http://www.idpf.org/2007/ops":!0,"http://www.w3.org/1999/xhtml":!0,"http://www.w3.org/2000/svg":!0},Nr=["margin-%","padding-%","border-%-width","border-%-style","border-%-color","%"],br=["max-%","min-%","%"],Sr=function(){for(var t=["left","right","top","bottom"],e={width:!0,height:!0,"max-width":!0,"max-height":!0,"min-width":!0,"min-height":!0},u=0;u<Nr.length;u++)for(var n=0;n<t.length;n++)e[Nr[u].replace("%",t[n])]=!0;return e}();function Tr(t,e){for(var u,n={},i=_(Nr);!(u=i()).done;){var r=u.value;for(var o in t){var a=r.replace("%",o),s=r.replace("%",t[o]);n[a]=s,n[s]=a}}for(var l,D=_(br);!(l=D()).done;){var h=l.value;for(var c in e){var d=h.replace("%",c),f=h.replace("%",e[c]);n[d]=f,n[f]=d}}return n}var xr=Tr({"block-start":"right","block-end":"left","inline-start":"top","inline-end":"bottom"},{"block-size":"width","inline-size":"height"}),Ir=Tr({"block-start":"top","block-end":"bottom","inline-start":"left","inline-end":"right"},{"block-size":"height","inline-size":"width"}),Pr=Tr({"block-start":"right","block-end":"left","inline-start":"bottom","inline-end":"top"},{"block-size":"width","inline-size":"height"}),Rr=Tr({"block-start":"top","block-end":"bottom","inline-start":"right","inline-end":"left"},{"block-size":"height","inline-size":"width"}),Lr=function(){function t(t,e){this.value=void 0,this.priority=void 0,this.value=t,this.priority=e}var e=t.prototype;return e.getBaseValue=function(){return this},e.filterValue=function(e){var u=this.value.visit(e);return u===this.value?this:new t(u,this.priority)},e.increaseSpecificity=function(e){return 0==e?this:new t(this.value,this.priority+e)},e.evaluate=function(t,e){return Li(t,this.value,e)},e.isEnabled=function(t){return!0},t}(),Or=function(t){function e(e,u,n){var i;return(i=t.call(this,e,u)||this).condition=void 0,i.condition=n,i}T(e,t);var u=e.prototype;return u.getBaseValue=function(){return new Lr(this.value,this.priority)},u.filterValue=function(t){var u=this.value.visit(t);return u===this.value?this:new e(u,this.priority,this.condition)},u.increaseSpecificity=function(t){return 0==t?this:new e(this.value,this.priority+t,this.condition)},u.isEnabled=function(t){try{return!!this.condition.evaluate(t)}catch(t){c.warn(t)}return!1},e}(Lr);function kr(t,e,u){return(null==e||u.priority>e.priority)&&u.isEnabled(t)?u.getBaseValue():e}var _r={"region-id":!0,"fragment-selector-id":!0};function Mr(t){return"_"!=t.charAt(0)&&!_r[t]}function Ur(t){return!!Br[t]}function Vr(t,e){return t[e]}function Hr(t,e,u){u?t[e]=u:delete t[e]}function zr(t,e){return t[e]}function Gr(t,e){var u=t[e];return u||(t[e]=u={}),u}var Xr=function(t){var e=t._viewConditionalStyles;return e||(t._viewConditionalStyles=e=[]),e};function Wr(t,e){return t[e]}function jr(t,e){var u=t[e];return u||(t[e]=u=[]),u}function Kr(t,e,u,n,i,r,o){for(var a in[{id:i,styleKey:"_pseudos"},{id:r,styleKey:"_regions"}].forEach((function(t){if(t.id){var u=Gr(e,t.styleKey);(e=u[t.id])||(u[t.id]=e={})}})),o&&Xr(e).push({styles:e={},matcher:o}),u)if("_"!=a.charAt(0))if(_r[a]){var s=Wr(u,a),l=jr(e,a);Array.prototype.push.apply(l,s)}else{var D=Vr(u,a).increaseSpecificity(n),h=Vr(e,a);Hr(e,a,kr(t,h,D))}}function Yr(t,e){if(t.length>0){t.sort((function(t,e){return e.getPriority()-t.getPriority()}));for(var u=null,n=t.length-1;n>=0;n--)(u=t[n]).chained=e,e=u;return u}return e}var qr=function(t){function e(e,u){var n;return(n=t.call(this)||this).props=void 0,n.context=void 0,n.propName="",n.props=e,n.context=u,n}T(e,t);var u=e.prototype;return u.setPropName=function(t){this.propName=t},u.getFontSize=function(){var t=Vr(this.props,"font-size");if(!t.value.isNumeric())return zt.em;var e=t.value;if(!function(t){switch(t.toLowerCase()){case"px":case"in":case"pt":case"pc":case"cm":case"mm":case"q":return!0;default:return!1}}(e.unit))throw new Error("Unexpected state");return e.num*zt[e.unit]},u.visitNumeric=function(t){if("font-size"===this.propName)return function(t,e,u){var n=(t=$r(t,e,u)).unit,i=t.num;return"px"===n?t:new Ge("%"===n?i/100*e:i*u.queryUnitSize(n,!1),"px")}(t,this.getFontSize(),this.context);if("em"==t.unit||"ex"==t.unit||"rem"==t.unit)return $r(t,this.getFontSize(),this.context);if("%"==t.unit){if("line-height"===this.propName)return t;var e=this.propName.match(/height|^(top|bottom)$/)?"vh":"vw";return new Ge(t.num,e)}return t},u.visitExpr=function(t){return"font-size"==this.propName?Li(this.context,t,this.propName).visit(this):t},e}(Re);function $r(t,e,u){var n=t.unit,i=t.num;return"em"===n||"ex"===n?new Ge(i*(zt[n]/zt.em)*e,"px"):"rem"===n?new Ge(i*u.fontSize(),"px"):t}var Qr=function(){function t(){}var e=t.prototype;return e.apply=function(t){},e.mergeWith=function(t){return new Jr([this,t])},e.clone=function(){return this},t}(),Zr=function(t){function e(e){var u;return(u=t.call(this)||this).conditionItem=void 0,u.conditionItem=e,u}return T(e,t),e.prototype.apply=function(t){t.pushConditionItem(this.conditionItem.fresh(t))},e}(Qr),Jr=function(t){function e(e){var u;return(u=t.call(this)||this).list=void 0,u.list=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){for(var e=0;e<this.list.length;e++)this.list[e].apply(t)},u.mergeWith=function(t){return this.list.push(t),this},u.clone=function(){return new e([].concat(this.list))},e}(Qr),to=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this)||this).style=void 0,o.specificity=void 0,o.pseudoelement=void 0,o.regionId=void 0,o.viewConditionId=void 0,o.style=e,o.specificity=u,o.pseudoelement=n,o.regionId=i,o.viewConditionId=r,o}return T(e,t),e.prototype.apply=function(t){Kr(t.context,t.currentStyle,this.style,this.specificity,this.pseudoelement,this.regionId,t.buildViewConditionMatcher(this.viewConditionId))},e}(Qr),eo=function(t){function e(){var e;return(e=t.call(this)||this).chained=null,e}T(e,t);var u=e.prototype;return u.apply=function(t){this.chained.apply(t)},u.getPriority=function(){return 0},u.makePrimary=function(t){return!1},e}(Qr),uo=function(t){function e(e){var u;return(u=t.call(this)||this).className=void 0,u.className=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){t.currentClassNames.includes(this.className)&&this.chained.apply(t)},u.getPriority=function(){return 10},u.makePrimary=function(t){return this.chained&&t.insertInTable(t.classes,this.className,this.chained),!0},e}(eo),no=function(t){function e(e){var u;return(u=t.call(this)||this).id=void 0,u.id=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){t.currentId!=this.id&&t.currentXmlId!=this.id||this.chained.apply(t)},u.getPriority=function(){return 11},u.makePrimary=function(t){return this.chained&&t.insertInTable(t.ids,this.id,this.chained),!0},e}(eo),io=function(t){function e(e){var u;return(u=t.call(this)||this).localName=void 0,u.localName=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){t.currentLocalName==this.localName&&this.chained.apply(t)},u.getPriority=function(){return 8},u.makePrimary=function(t){return this.chained&&t.insertInTable(t.tags,this.localName,this.chained),!0},e}(eo),ro=function(t){function e(e,u){var n;return(n=t.call(this)||this).ns=void 0,n.localName=void 0,n.ns=e,n.localName=u,n}T(e,t);var u=e.prototype;return u.apply=function(t){t.currentLocalName==this.localName&&t.currentNamespace==this.ns&&this.chained.apply(t)},u.getPriority=function(){return 8},u.makePrimary=function(t){if(this.chained){var e=t.nsPrefix[this.ns];e||(e="ns"+t.nsCount+++":",t.nsPrefix[this.ns]=e),t.insertInTable(t.nstags,e+this.localName,this.chained)}return!0},e}(eo),oo=function(t){function e(e){var u;return(u=t.call(this)||this).epubTypePatt=void 0,u.epubTypePatt=e,u}return T(e,t),e.prototype.apply=function(t){var e=t.currentElement;if(e&&"a"==t.currentLocalName){var u=e.getAttribute("href");if(u&&u.match(/^#/)){var n=u.substring(1),i=e.ownerDocument.getElementById(n);if(i){var r=i.getAttributeNS(X.epub,"type");r&&r.match(this.epubTypePatt)&&this.chained.apply(t)}}}},e}(eo),ao=function(t){function e(e){var u;return(u=t.call(this)||this).ns=void 0,u.ns=e,u}return T(e,t),e.prototype.apply=function(t){t.currentNamespace==this.ns&&this.chained.apply(t)},e}(eo),so=function(t){function e(e,u){var n;return(n=t.call(this)||this).ns=void 0,n.name=void 0,n.ns=e,n.name=u,n}return T(e,t),e.prototype.apply=function(t){t.currentElement&&t.currentElement.hasAttributeNS(this.ns,this.name)&&this.chained.apply(t)},e}(eo),lo=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).ns=void 0,i.name=void 0,i.value=void 0,i.ns=e,i.name=u,i.value=n,i}T(e,t);var u=e.prototype;return u.apply=function(t){t.currentElement&&t.currentElement.getAttributeNS(this.ns,this.name)==this.value&&this.chained.apply(t)},u.getPriority=function(){return"type"==this.name&&this.ns==X.epub?9:0},u.makePrimary=function(t){return"type"==this.name&&this.ns==X.epub&&(this.chained&&t.insertInTable(t.epubtypes,this.value,this.chained),!0)},e}(eo),Do=function(t){function e(e,u){var n;return(n=t.call(this)||this).ns=void 0,n.name=void 0,n.ns=e,n.name=u,n}T(e,t);var u=e.prototype;return u.apply=function(t){if(t.currentElement){var e=t.currentElement.getAttributeNS(this.ns,this.name);e&&yr[e]&&this.chained.apply(t)}},u.getPriority=function(){return 0},u.makePrimary=function(t){return!1},e}(eo),ho=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).ns=void 0,i.name=void 0,i.regexp=void 0,i.ns=e,i.name=u,i.regexp=n,i}return T(e,t),e.prototype.apply=function(t){if(t.currentElement){var e=t.currentElement.getAttributeNS(this.ns,this.name);e&&e.match(this.regexp)&&this.chained.apply(t)}},e}(eo),co=function(t){function e(e){var u;return(u=t.call(this)||this).langRegExp=void 0,u.langRegExp=e,u}return T(e,t),e.prototype.apply=function(t){t.lang.match(this.langRegExp)&&this.chained.apply(t)},e}(eo),fo=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.apply=function(t){t.isFirst&&this.chained.apply(t)},u.getPriority=function(){return 6},e}(eo),po=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.apply=function(t){t.isRoot&&this.chained.apply(t)},u.getPriority=function(){return 12},e}(eo),Eo=function(t){function e(e,u){var n;return(n=t.call(this)||this).a=void 0,n.b=void 0,n.a=e,n.b=u,n}return T(e,t),e.prototype.matchANPlusB=function(t){return Oi(t,this.a,this.b)},e}(eo),Co=function(t){function e(e,u){return t.call(this,e,u)||this}T(e,t);var u=e.prototype;return u.apply=function(t){this.matchANPlusB(t.currentSiblingOrder)&&this.chained.apply(t)},u.getPriority=function(){return 5},e}(Eo),Fo=function(t){function e(e,u){return t.call(this,e,u)||this}T(e,t);var u=e.prototype;return u.apply=function(t){this.matchANPlusB(t.currentSiblingTypeCounts[t.currentNamespace][t.currentLocalName])&&this.chained.apply(t)},u.getPriority=function(){return 5},e}(Eo),Ao=function(t){function e(e,u){return t.call(this,e,u)||this}T(e,t);var u=e.prototype;return u.apply=function(t){var e=t.currentFollowingSiblingOrder;null===e&&(e=t.currentFollowingSiblingOrder=t.currentElement.parentNode.childElementCount-t.currentSiblingOrder+1),this.matchANPlusB(e)&&this.chained.apply(t)},u.getPriority=function(){return 4},e}(Eo),go=function(t){function e(e,u){return t.call(this,e,u)||this}T(e,t);var u=e.prototype;return u.apply=function(t){var e=t.currentFollowingSiblingTypeCounts;if(!e[t.currentNamespace]){var u=t.currentElement;do{var n=u.namespaceURI,i=u.localName,r=e[n];r||(r=e[n]={}),r[i]=(r[i]||0)+1}while(u=u.nextElementSibling)}this.matchANPlusB(e[t.currentNamespace][t.currentLocalName])&&this.chained.apply(t)},u.getPriority=function(){return 4},e}(Eo),vo=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.apply=function(t){for(var e=t.currentElement.firstChild;e;){switch(e.nodeType){case Node.ELEMENT_NODE:return;case Node.TEXT_NODE:if(e.length>0)return}e=e.nextSibling}this.chained.apply(t)},u.getPriority=function(){return 4},e}(eo),mo=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.apply=function(t){!1===t.currentElement.disabled&&this.chained.apply(t)},u.getPriority=function(){return 5},e}(eo),Bo=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.apply=function(t){!0===t.currentElement.disabled&&this.chained.apply(t)},u.getPriority=function(){return 5},e}(eo),wo=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.apply=function(t){var e=t.currentElement;!0!==e.selected&&!0!==e.checked||this.chained.apply(t)},u.getPriority=function(){return 5},e}(eo),yo=function(t){function e(e){var u;return(u=t.call(this)||this).condition=void 0,u.condition=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){if(t.conditions[this.condition])try{t.dependentConditions.push(this.condition),this.chained.apply(t)}finally{t.dependentConditions.pop()}},u.getPriority=function(){return 5},e}(eo),No=function(t){function e(){var e;return(e=t.call(this)||this).applied=!1,e}T(e,t);var u=e.prototype;return u.apply=function(t){this.applied=!0},u.clone=function(){var t=new e;return t.applied=this.applied,t},e}(Qr),bo=function(t){function e(e){var u;return(u=t.call(this)||this).checkAppliedAction=void 0,u.firstAction=void 0,u.checkAppliedAction=new No,u.firstAction=Yr(e,u.checkAppliedAction),u}T(e,t);var u=e.prototype;return u.apply=function(t){this.firstAction.apply(t),this.checkAppliedAction.applied||this.chained.apply(t),this.checkAppliedAction.applied=!1},u.getPriority=function(){return this.firstAction.getPriority()},e}(eo),So=function(){function t(t,e,u){this.condition=void 0,this.viewConditionId=void 0,this.viewCondition=void 0,this.condition=t,this.viewConditionId=e,this.viewCondition=u}var e=t.prototype;return e.increment=function(t){t.increment(this.condition,this.viewCondition)},e.decrement=function(t){t.decrement(this.condition,this.viewCondition)},e.buildViewConditionMatcher=function(t){return t.buildViewConditionMatcher(this.viewConditionId)},t}(),To=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return 0==e&&this.increment(t),!1},u.pop=function(t,e){return 0==e&&(this.decrement(t),!0)},e}(So),xo=function(t){function e(e,u,n){return t.call(this,e,u,n)||this}T(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return 0==e?this.increment(t):1==e&&this.decrement(t),!1},u.pop=function(t,e){return 0==e?(this.decrement(t),!0):(1==e&&this.increment(t),!1)},e}(So),Io=function(t){function e(e,u,n){var i;return(i=t.call(this,e,u,n)||this).fired=!1,i}T(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return!!this.fired&&(this.decrement(t),!0)},u.pop=function(t,e){return this.fired?(this.decrement(t),!0):(0==e&&(this.fired=!0,this.increment(t)),!1)},e}(So),Po=function(t){function e(e,u,n){var i;return(i=t.call(this,e,u,n)||this).fired=!1,i}T(e,t);var u=e.prototype;return u.fresh=function(t){return new e(this.condition,this.viewConditionId,this.buildViewConditionMatcher(t))},u.push=function(t,e){return this.fired&&(-1==e?this.increment(t):0==e&&this.decrement(t)),!1},u.pop=function(t,e){if(this.fired){if(-1==e)return this.decrement(t),!0;0==e&&this.increment(t)}else 0==e&&(this.fired=!0,this.increment(t));return!1},e}(So),Ro=function(){function t(t,e){this.afterprop=void 0,this.element=void 0,this.afterprop=t,this.element=e}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.processPseudoelementProps(this.afterprop,this.element),!0)},t}(),Lo=function(){function t(t){this.lang=void 0,this.lang=t}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.lang=this.lang,!0)},t}(),Oo=function(){function t(t){this.oldQuotes=void 0,this.oldQuotes=t}var e=t.prototype;return e.fresh=function(t){return this},e.push=function(t,e){return!1},e.pop=function(t,e){return 0==e&&(t.quotes=this.oldQuotes,!0)},t}(),ko=function(t){function e(e){var u;return(u=t.call(this)||this).element=void 0,u.element=e,u}T(e,t);var u=e.prototype;return u.createValueFromString=function(t,e){return"url"===e?new Ke(t||"about:invalid"):new Ue(t||"")},u.visitFunc=function(e){if("attr"!==e.name)return t.prototype.visitFunc.call(this,e);var u,n="string",i=null;if(e.values[0]instanceof $e){var r=e.values[0].values;r.length>=2&&(n=r[1].stringValue()),i=r[0].stringValue()}else i=e.values[0].stringValue();return u=this.createValueFromString(e.values.length>1?e.values[1].stringValue():null,n),this.element&&this.element.hasAttribute(i)?this.createValueFromString(this.element.getAttribute(i),n):u},e}(Re);function _o(t){if(mr(t)){if(t instanceof Ue)return t.stringValue();if(t instanceof $e)return t.values.map((function(t){return _o(t)})).join("")}return""}var Mo=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).cascade=void 0,i.element=void 0,i.counterResolver=void 0,i.cascade=e,i.element=u,i.counterResolver=n,i}T(e,t);var u=e.prototype;return u.visitIdent=function(t){var e=this.cascade,u=e.quotes,n=Math.floor(u.length/2)-1;switch(t.name){case"open-quote":var i=u[2*Math.min(n,e.quoteDepth)];return e.quoteDepth++,i;case"close-quote":return e.quoteDepth>0&&e.quoteDepth--,u[2*Math.min(n,e.quoteDepth)+1];case"no-open-quote":return e.quoteDepth++,new Ue("");case"no-close-quote":return e.quoteDepth>0&&e.quoteDepth--,new Ue("")}return t},u.format=function(t,e){var u,n=!1,i=!1;null!=(u=e.match(/^upper-(.*)/))?(n=!0,e=u[1]):null!=(u=e.match(/^lower-(.*)/))&&(i=!0,e=u[1]);var r="";return Uo[e]?r=function(t,e){if(e>t[0]||e<=0||e!=Math.round(e))return"";for(var u="",n=1;n<t.length;n+=2){var i=t[n],r=Math.floor(e/i);if(r>20)return"";for(e-=r*i;r>0;)u+=t[n+1],r--}return u}(Uo[e],t):Vo[e]?r=function(t,e){if(e<=0||e!=Math.round(e))return"";var u=function(t){for(var e=[],u=0;u<t.length;)if("-"==t.substr(u+1,1)){var n=t.charCodeAt(u),i=t.charCodeAt(u+2);u+=3;for(var r=n;r<=i;r++)e.push(String.fromCharCode(r))}else e.push(t.substr(u++,1));return e}(t),n="";do{var i=--e%u.length;n=u[i]+n,e=(e-i)/u.length}while(e>0);return n}(Vo[e],t):null!=Ho[e]?r=Ho[e]:"decimal-leading-zero"==e?1==(r=""+t).length&&(r="0"+r):r="cjk-ideographic"==e||"trad-chinese-informal"==e?function(t,e){if(t>9999||t<-9999)return""+t;if(0==t)return e.digits.charAt(0);var u=new it;if(t<0&&(u.append(e.negative),t=-t),t<10)u.append(e.digits.charAt(t));else if(!e.formal&&t<=19)u.append(e.markers.charAt(0)),0!=t&&u.append(e.digits.charAt(t-10));else{var n=Math.floor(t/1e3);n&&(u.append(e.digits.charAt(n)),u.append(e.markers.charAt(2)));var i=Math.floor(t/100)%10;i&&(u.append(e.digits.charAt(i)),u.append(e.markers.charAt(1)));var r=Math.floor(t/10)%10;r&&(u.append(e.digits.charAt(r)),u.append(e.markers.charAt(0)));var o=t%10;o&&u.append(e.digits.charAt(o))}return u.toString()}(t,zo):""+t,n?r.toUpperCase():i?r.toLowerCase():r},u.visitFuncCounter=function(t){var e=this,u=t[0].toString(),n=t.length>1?t[1].stringValue():"decimal",i=this.cascade.counters[u];if(i&&i.length)return new Ue(this.format(i&&i.length&&i[i.length-1]||0,n));var r=new Je(this.counterResolver.getPageCounterVal(u,(function(t){return e.format(t||0,n)})));return new $e([r])},u.visitFuncCounters=function(t){var e=this,u=t[0].toString(),n=t[1].stringValue(),i=t.length>2?t[2].stringValue():"decimal",r=this.cascade.counters[u],o=new it;if(r&&r.length)for(var a=0;a<r.length;a++)a>0&&o.append(n),o.append(this.format(r[a],i));var s=new Je(this.counterResolver.getPageCountersVal(u,(function(t){var u=[];if(t.length)for(var r=0;r<t.length;r++)u.push(e.format(t[r],i));var a=o.toString();return a.length&&u.push(a),u.length?u.join(n):e.format(0,i)})));return new $e([s])},u.visitFuncTargetCounter=function(t){var e,u=this,n=t[0];e=n instanceof Ke?n.url:n.stringValue();var i=t[1].toString(),r=t.length>2?t[2].stringValue():"decimal",o=new Je(this.counterResolver.getTargetCounterVal(e,i,(function(t){return u.format(t||0,r)})));return new $e([o])},u.visitFuncTargetCounters=function(t){var e,u=this,n=t[0];e=n instanceof Ke?n.url:n.stringValue();var i=t[1].toString(),r=t[2].stringValue(),o=t.length>3?t[3].stringValue():"decimal",a=new Je(this.counterResolver.getTargetCountersVal(e,i,(function(t){var e=t.map((function(t){return u.format(t,o)}));return e.length?e.join(r):u.format(0,o)})));return new $e([a])},u.visitFuncString=function(t){var e=t.length>0?t[0].stringValue():"",u=t.length>1?t[1].stringValue():"first",n=new Je(this.counterResolver.getNamedStringVal(e,u));return new $e([n])},u.visitFuncContent=function(t){var e=t.length>0?t[0].stringValue():"text",u="";switch(e){case"text":case"first-letter":if(u=this.element.textContent.trim().replace(/\s+/g," "),"first-letter"===e){var n=u.match(M);u=n?n[0]:""}break;case"before":case"after":var i,r,o=zr(this.cascade.currentStyle,"_pseudos");u=_o(null==o||null==(i=o[e])||null==(r=i.content)?void 0:r.value)}return new Ue(u)},u.visitFunc=function(t){switch(t.name){case"counter":if(t.values.length<=2)return this.visitFuncCounter(t.values);break;case"counters":if(t.values.length<=3)return this.visitFuncCounters(t.values);break;case"target-counter":if(t.values.length<=3)return this.visitFuncTargetCounter(t.values);break;case"target-counters":if(t.values.length<=4)return this.visitFuncTargetCounters(t.values);break;case"string":if(t.values.length<=2)return this.visitFuncString(t.values);break;case"content":if(t.values.length<=1)return this.visitFuncContent(t.values)}return c.warn("E_CSS_CONTENT_PROP:",t.toString()),new Ue("")},e}(Re),Uo={roman:[4999,1e3,"M",900,"CM",500,"D",400,"CD",100,"C",90,"XC",50,"L",40,"XL",10,"X",9,"IX",5,"V",4,"IV",1,"I"],armenian:[9999,9e3,"ք",8e3,"փ",7e3,"ւ",6e3,"ց",5e3,"ր",4e3,"տ",3e3,"վ",2e3,"ս",1e3,"ռ",900,"ջ",800,"պ",700,"չ",600,"ո",500,"շ",400,"ն",300,"յ",200,"մ",100,"ճ",90,"ղ",80,"ձ",70,"հ",60,"կ",50,"ծ",40,"խ",30,"լ",20,"ի",10,"ժ",9,"թ",8,"ը",7,"է",6,"զ",5,"ե",4,"դ",3,"գ",2,"բ",1,"ա"],georgian:[19999,1e4,"ჵ",9e3,"ჰ",8e3,"ჯ",7e3,"ჴ",6e3,"ხ",5e3,"ჭ",4e3,"წ",3e3,"ძ",2e3,"ც",1e3,"ჩ",900,"შ",800,"ყ",700,"ღ",600,"ქ",500,"ფ",400,"ჳ",300,"ტ",200,"ს",100,"რ",90,"ჟ",80,"პ",70,"ო",60,"ჲ",50,"ნ",40,"მ",30,"ლ",20,"კ",10,"ი",9,"თ",8,"ჱ",7,"ზ",6,"ვ",5,"ე",4,"დ",3,"გ",2,"ბ",1,"ა"],hebrew:[999,400,"ת",300,"ש",200,"ר",100,"ק",90,"צ",80,"פ",70,"ע",60,"ס",50,"נ",40,"מ",30,"ל",20,"כ",19,"יט",18,"יח",17,"יז",16,"טז",15,"טו",10,"י",9,"ט",8,"ח",7,"ז",6,"ו",5,"ה",4,"ד",3,"ג",2,"ב",1,"א"]},Vo={latin:"a-z",alpha:"a-z",greek:"α-ρσ-ω",russian:"а-ик-щэ-я"},Ho={square:"■",disc:"•",circle:"◦",none:""},zo={formal:!1,digits:"零一二三四五六七八九",markers:"十百千",negative:"負"};function Go(t,e){for(var u in t)e[u]=t[u].clone()}var Xo,Wo=function(){function t(){this.nsCount=0,this.nsPrefix={},this.tags={},this.nstags={},this.epubtypes={},this.classes={},this.ids={},this.pagetypes={},this.order=0}var e=t.prototype;return e.clone=function(){var e=new t;for(var u in e.nsCount=this.nsCount,this.nsPrefix)e.nsPrefix[u]=this.nsPrefix[u];return Go(this.tags,e.tags),Go(this.nstags,e.nstags),Go(this.epubtypes,e.epubtypes),Go(this.classes,e.classes),Go(this.ids,e.ids),Go(this.pagetypes,e.pagetypes),e.order=this.order,e},e.insertInTable=function(t,e,u){var n=t[e];n&&(u=n.mergeWith(u)),t[e]=u},e.createInstance=function(t,e,u,n){return new jo(this,t,e,u,n)},e.nextOrder=function(){return this.order+=9.5367431640625e-7},t}(),jo=function(){function t(t,e,u,n,i){this.context=void 0,this.counterListener=void 0,this.counterResolver=void 0,this.code=void 0,this.stack=[[],[]],this.conditions={},this.currentElement=null,this.currentElementOffset=null,this.currentStyle=null,this.currentClassNames=null,this.currentLocalName="",this.currentNamespace="",this.currentId="",this.currentXmlId="",this.currentNSTag="",this.currentEpubTypes=null,this.currentPageType=null,this.previousPageType=null,this.firstPageType=null,this.isFirst=!0,this.isRoot=!0,this.counters={},this.counterScoping=[{}],this.quotes=void 0,this.quoteDepth=0,this.lang="",this.siblingOrderStack=[0],this.currentSiblingOrder=0,this.siblingTypeCountsStack=[{}],this.currentSiblingTypeCounts=void 0,this.currentFollowingSiblingOrder=null,this.followingSiblingOrderStack=void 0,this.followingSiblingTypeCountsStack=[{}],this.currentFollowingSiblingTypeCounts=void 0,this.viewConditions={},this.dependentConditions=[],this.elementStack=void 0,this.context=e,this.counterListener=u,this.counterResolver=n,this.code=t,this.quotes=[new Ue("“"),new Ue("”"),new Ue("‘"),new Ue("’")],this.currentSiblingTypeCounts=this.siblingTypeCountsStack[0],this.followingSiblingOrderStack=[this.currentFollowingSiblingOrder],this.currentFollowingSiblingTypeCounts=this.siblingTypeCountsStack[0]}var e=t.prototype;return e.pushConditionItem=function(t){this.stack[this.stack.length-1].push(t)},e.increment=function(t,e){this.conditions[t]=(this.conditions[t]||0)+1,e&&(this.viewConditions[t]?this.viewConditions[t].push(e):this.viewConditions[t]=[e])},e.decrement=function(t,e){this.conditions[t]--,this.viewConditions[t]&&(this.viewConditions[t]=this.viewConditions[t].filter((function(t){return t!==e})),0===this.viewConditions[t].length&&delete this.viewConditions[t])},e.buildViewConditionMatcher=function(t){var e=this,u=null;t&&(u=Wi.buildViewConditionMatcher(this.currentElementOffset,t));var n=this.dependentConditions.map((function(t){var u=e.viewConditions[t];return u&&u.length>0?1===u.length?u[0]:Wi.buildAnyMatcher([].concat(u)):null})).filter((function(t){return t}));return n.length<=0?u:null===u?1===n.length?n[0]:Wi.buildAllMatcher(n):Wi.buildAllMatcher([u].concat(n))},e.applyAction=function(t,e){var u=t[e];u&&u.apply(this)},e.pushRule=function(t,e,u){this.currentElement=null,this.currentElementOffset=null,this.currentStyle=u,this.currentNamespace="",this.currentLocalName="",this.currentId="",this.currentXmlId="",this.currentClassNames=t,this.currentNSTag="",this.currentEpubTypes=Ko,this.currentPageType=e,this.applyActions()},e.defineCounter=function(t,e){this.counters[t]?this.counters[t].push(e):this.counters[t]=[e];var u=this.counterScoping[this.counterScoping.length-1];u||(this.counterScoping[this.counterScoping.length-1]=u={}),u[t]=!0},e.pushCounters=function(t){var e,u=uu.inline,n=t.display;n&&(u=n.evaluate(this.context));var i=uu.inline,r=t.float;r&&(i=r.evaluate(this.context));var o=null,a=null,s=null,l=t["counter-reset"];if(l){var D=l.evaluate(this.context);D&&(o=_u(D,!0))}var h=t["counter-set"];if(h){var c=h.evaluate(this.context);c&&(s=_u(c,!1))}var d,f,p,E,C=t["counter-increment"];if(C){var F=C.evaluate(this.context);F&&(a=_u(F,!1))}if("ol"!=this.currentLocalName&&"ul"!=this.currentLocalName||this.currentNamespace!=X.XHTML||(o||(o={}),o["ua-list-item"]=(null!=(d=null==(f=this.currentElement)?void 0:f.start)?d:1)-1),u===uu.list_item&&(a||(a={}),a["ua-list-item"]=1,/^\s*[-+]?\d/.test(null!=(p=null==(E=this.currentElement)?void 0:E.getAttribute("value"))?p:"")&&(o||(o={}),o["ua-list-item"]=this.currentElement.value-1)),(null==(e=this.currentElement)?void 0:e.parentNode.nodeType)===Node.DOCUMENT_NODE&&(o||(o={}),void 0===o.footnote&&(o.footnote=0)),i===uu.footnote&&(a||(a={}),void 0===a.footnote)){var A,g,v=null==(A=this.currentStyle["counter-increment"])?void 0:A.value;v&&(v===uu.footnote||null!=(g=v.values)&&g.includes(uu.footnote))||(a.footnote=1)}if(o)for(var m in o)this.defineCounter(m,o[m]);if(s)for(var B in s)if(this.counters[B]){var w=this.counters[B];w[w.length-1]=s[B]}else this.defineCounter(B,s[B]);if(a)for(var y in a){this.counters[y]||this.defineCounter(y,0);var N=this.counters[y];N[N.length-1]+=a[y]}if(u===uu.list_item){var b=this.counters["ua-list-item"];t["ua-list-item-count"]=new Lr(new Xe(b[b.length-1]),0)}this.counterScoping.push(null)},e.popCounters=function(){var t=this.counterScoping.pop();if(t)for(var e in t){var u=this.counters[e];u&&(1==u.length?delete this.counters[e]:u.pop())}},e.setNamedStrings=function(t){var e=t["string-set"];if(e){for(var u,n=_((e=e.filterValue(new Mo(this,this.currentElement,this.counterResolver))).value instanceof Qe?e.value.values:[e.value]);!(u=n()).done;){var i=u.value;if(i instanceof $e){var r=i.values[0].stringValue(),o=i.values.slice(1).map((function(t){return _o(t)})).join("");this.counterResolver.setNamedString(r,o,this)}}delete t["string-set"]}},e.processPseudoelementProps=function(t,e){this.pushCounters(t),t.content&&(t.content=t.content.filterValue(new Mo(this,e,this.counterResolver))),this.popCounters()},e.pushElement=function(t,e,u){var n=this;this.currentPageType=null,this.currentElement=t,this.currentElementOffset=u,this.currentStyle=e,this.currentNamespace=t.namespaceURI,this.currentLocalName=t.localName;var i=this.code.nsPrefix[this.currentNamespace];this.currentNSTag=i?i+this.currentLocalName:"",this.currentId=t.getAttribute("id"),this.currentXmlId=t.getAttributeNS(X.XML,"id");var r=t.getAttribute("class");this.currentClassNames=r?r.split(/\s+/):Ko;var o=t.getAttributeNS(X.epub,"type");this.currentEpubTypes=o?o.split(/\s+/):Ko;var a=nt(t);a&&(this.stack[this.stack.length-1].push(new Lo(this.lang)),this.lang=a.toLowerCase());var s=this.isRoot,l=this.siblingOrderStack;this.currentSiblingOrder=++l[l.length-1],l.push(0);var D=this.siblingTypeCountsStack,h=this.currentSiblingTypeCounts=D[D.length-1],c=h[this.currentNamespace];c||(c=h[this.currentNamespace]={}),c[this.currentLocalName]=(c[this.currentLocalName]||0)+1,D.push({});var d=this.followingSiblingOrderStack;this.currentFollowingSiblingOrder=null!==d[d.length-1]?--d[d.length-1]:null,d.push(null);var f=this.followingSiblingTypeCountsStack,p=this.currentFollowingSiblingTypeCounts=f[f.length-1];p&&p[this.currentNamespace]&&p[this.currentNamespace][this.currentLocalName]--,f.push({}),this.applyActions(),this.applyAttrFilter(t);var E=e.quotes,C=null;if(E){var F=E.evaluate(this.context);F&&(C=new Oo(this.quotes),F===uu.none?this.quotes=[new Ue(""),new Ue("")]:F instanceof $e&&(this.quotes=F.values))}this.pushCounters(this.currentStyle);var A=this.currentId||this.currentXmlId||t.getAttribute("name")||"";if(s||A){var g={};Object.keys(this.counters).forEach((function(t){g[t]=Array.from(n.counters[t])})),this.counterListener.countersOfId(A,g)}var v=zr(this.currentStyle,"_pseudos");if(v)for(var m,B=!0,w=_(Yo);!(m=w()).done;){var y=m.value;y||(B=!1);var N,b=v[y];b&&("before"!==y&&"after"!==y||mr(null==(N=b.content)?void 0:N.value)?B?this.processPseudoelementProps(b,t):this.stack[this.stack.length-2].push(new Ro(b,t)):delete v[y])}this.setNamedStrings(this.currentStyle),C&&this.stack[this.stack.length-2].push(C)},e.applyAttrFilterInner=function(t,e){for(var u in e)Mr(u)&&(e[u]=e[u].filterValue(t))},e.applyAttrFilter=function(t){var e=new ko(t),u=this.currentStyle,n=zr(u,"_pseudos");for(var i in n)this.applyAttrFilterInner(e,n[i]);this.applyAttrFilterInner(e,u)},e.applyActions=function(){var t;for(t=0;t<this.currentClassNames.length;t++)this.applyAction(this.code.classes,this.currentClassNames[t]);for(t=0;t<this.currentEpubTypes.length;t++)this.applyAction(this.code.epubtypes,this.currentEpubTypes[t]);this.applyAction(this.code.ids,this.currentId),this.applyAction(this.code.tags,this.currentLocalName),""!=this.currentLocalName&&this.applyAction(this.code.tags,"*"),this.applyAction(this.code.nstags,this.currentNSTag),null!==this.currentPageType&&(this.applyAction(this.code.pagetypes,this.currentPageType),this.applyAction(this.code.pagetypes,"*")),this.stack.push([]);for(var e=1;e>=-1;--e){var u=this.stack[this.stack.length-e-2];for(t=0;t<u.length;)u[t].push(this,e)?u.splice(t,1):t++}this.isFirst=!0,this.isRoot=!1},e.pop=function(){for(var t=1;t>=-1;--t)for(var e=this.stack[this.stack.length-t-2],u=0;u<e.length;)e[u].pop(this,t)?e.splice(u,1):u++;this.stack.pop(),this.isFirst=!1},e.popRule=function(){this.pop()},e.popElement=function(t){this.siblingOrderStack.pop(),this.siblingTypeCountsStack.pop(),this.followingSiblingOrderStack.pop(),this.followingSiblingTypeCountsStack.pop(),this.pop(),this.popCounters()},t}(),Ko=[],Yo=["before","transclusion-before","footnote-call","footnote-marker","inner","first-letter","first-line","","transclusion-after","after"];!function(t){t[t.TOP=0]="TOP",t[t.SELECTOR=1]="SELECTOR",t[t.RULE=2]="RULE"}(Xo||(Xo={}));var qo=null,$o=function(t){function e(e,u,n,i,r,o,a){var s;return(s=t.call(this,e,u,a)||this).condition=void 0,s.regionId=void 0,s.validatorSet=void 0,s.chain=null,s.specificity=0,s.elementStyle=null,s.conditionCount=0,s.pseudoelement=null,s.footnoteContent=!1,s.cascade=void 0,s.state=void 0,s.viewConditionId=null,s.insideSelectorRule=void 0,s.condition=n,s.regionId=r,s.validatorSet=o,s.cascade=i?i.cascade:qo?qo.clone():new Wo,s.state=Xo.TOP,s}T(e,t);var u=e.prototype;return u.insertNonPrimary=function(t){this.cascade.insertInTable(this.cascade.tags,"*",t)},u.processChain=function(t){var e=Yr(this.chain,t);e!==t&&e.makePrimary(this.cascade)||this.insertNonPrimary(e)},u.isInsideSelectorRule=function(t){return this.state!=Xo.TOP&&(this.reportAndSkip(t),!0)},u.tagSelector=function(t,e){(e||t)&&(this.specificity+=1,this.chain.push(e&&t?new ro(t,e.toLowerCase()):e?new io(e.toLowerCase()):new ao(t)))},u.classSelector=function(t){if(this.pseudoelement)return c.warn("::"+this.pseudoelement,"followed by ."+t),void this.chain.push(new yo(""));this.specificity+=256,this.chain.push(new uo(t))},u.pseudoclassSelector=function(t,e){if(this.pseudoelement)return c.warn("::"+this.pseudoelement,"followed by :"+t),void this.chain.push(new yo(""));switch(t.toLowerCase()){case"enabled":this.chain.push(new mo);break;case"disabled":this.chain.push(new Bo);break;case"checked":this.chain.push(new wo);break;case"root":this.chain.push(new po);break;case"link":this.chain.push(new io("a")),this.chain.push(new so("","href"));break;case"-adapt-href-epub-type":case"href-epub-type":if(e&&1==e.length&&"string"==typeof e[0]){var u=new RegExp("(^|s)"+ht(e[0])+"($|s)");this.chain.push(new oo(u))}else this.chain.push(new yo(""));break;case"-adapt-footnote-content":case"footnote-content":this.footnoteContent=!0;break;case"visited":case"active":case"hover":case"focus":this.chain.push(new yo(""));break;case"lang":this.chain.push(e&&1==e.length&&"string"==typeof e[0]?new co(new RegExp("^"+ht(e[0].toLowerCase())+"($|-)")):new yo(""));break;case"nth-child":case"nth-last-child":case"nth-of-type":case"nth-last-of-type":var n=Qo[t.toLowerCase()];this.chain.push(e&&2==e.length?new n(e[0],e[1]):new yo(""));break;case"first-child":this.chain.push(new fo);break;case"last-child":this.chain.push(new Ao(0,1));break;case"first-of-type":this.chain.push(new Fo(0,1));break;case"last-of-type":this.chain.push(new go(0,1));break;case"only-child":this.chain.push(new fo),this.chain.push(new Ao(0,1));break;case"only-of-type":this.chain.push(new Fo(0,1)),this.chain.push(new go(0,1));break;case"empty":this.chain.push(new vo);break;case"before":case"after":case"first-line":case"first-letter":return void this.pseudoelementSelector(t,e);default:c.warn("unknown pseudo-class selector: "+t),this.chain.push(new yo(""))}this.specificity+=256},u.pseudoelementSelector=function(t,e){switch(t){case"before":case"after":case"first-line":case"first-letter":case"footnote-call":case"footnote-marker":case"inner":case"after-if-continues":this.pseudoelement?(c.warn("Double pseudoelement ::"+this.pseudoelement+"::"+t),this.chain.push(new yo(""))):this.pseudoelement=t;break;case"first-n-lines":if(e&&1==e.length&&"number"==typeof e[0]){var u=Math.round(e[0]);if(u>0&&u==e[0]){this.pseudoelement?(c.warn("Double pseudoelement ::"+this.pseudoelement+"::"+t),this.chain.push(new yo(""))):this.pseudoelement="first-"+u+"-lines";break}}this.chain.push(new yo(""));break;case"nth-fragment":e&&2==e.length?this.viewConditionId="NFS_"+e[0]+"_"+e[1]:this.chain.push(new yo(""));break;default:c.warn("Unrecognized pseudoelement: ::"+t),this.chain.push(new yo(""))}this.specificity+=1},u.idSelector=function(t){this.specificity+=65536,this.chain.push(new no(t))},u.attributeSelector=function(t,e,u,n){var i;switch(this.specificity+=256,e=e.toLowerCase(),n=n||"",u){case Vu.EOF:i=new so(t,e);break;case Vu.EQ:i=new lo(t,e,n);break;case Vu.TILDE_EQ:i=!n||n.match(/\s/)?new yo(""):new ho(t,e,new RegExp("(^|\\s)"+ht(n)+"($|\\s)"));break;case Vu.BAR_EQ:i=new ho(t,e,new RegExp("^"+ht(n)+"($|-)"));break;case Vu.HAT_EQ:i=n?new ho(t,e,new RegExp("^"+ht(n))):new yo("");break;case Vu.DOLLAR_EQ:i=n?new ho(t,e,new RegExp(ht(n)+"$")):new yo("");break;case Vu.STAR_EQ:i=n?new ho(t,e,new RegExp(ht(n))):new yo("");break;case Vu.COL_COL:"supported"==n?i=new Do(t,e):(c.warn("Unsupported :: attr selector op:",n),i=new yo(""));break;default:c.warn("Unsupported attr selector:",u),i=new yo("")}this.chain.push(i)},u.descendantSelector=function(){var t="d"+Zo++;this.processChain(new Zr(new To(t,this.viewConditionId,null))),this.chain=[new yo(t)],this.viewConditionId=null},u.childSelector=function(){var t="c"+Zo++;this.processChain(new Zr(new xo(t,this.viewConditionId,null))),this.chain=[new yo(t)],this.viewConditionId=null},u.adjacentSiblingSelector=function(){var t="a"+Zo++;this.processChain(new Zr(new Io(t,this.viewConditionId,null))),this.chain=[new yo(t)],this.viewConditionId=null},u.followingSiblingSelector=function(){var t="f"+Zo++;this.processChain(new Zr(new Po(t,this.viewConditionId,null))),this.chain=[new yo(t)],this.viewConditionId=null},u.nextSelector=function(){this.finishChain(),this.pseudoelement=null,this.footnoteContent=!1,this.specificity=0,this.chain=[]},u.startSelectorRule=function(){this.isInsideSelectorRule("E_CSS_UNEXPECTED_SELECTOR")||(this.state=Xo.SELECTOR,this.elementStyle={},this.pseudoelement=null,this.specificity=0,this.footnoteContent=!1,this.chain=[])},u.error=function(e,u){t.prototype.error.call(this,e,u),this.state==Xo.SELECTOR&&(this.state=Xo.TOP)},u.startStylesheet=function(e){t.prototype.startStylesheet.call(this,e),this.state=Xo.TOP},u.startRuleBody=function(){this.finishChain(),t.prototype.startRuleBody.call(this),this.state==Xo.SELECTOR&&(this.state=Xo.TOP)},u.endRule=function(){t.prototype.endRule.call(this),this.insideSelectorRule=Xo.TOP},u.finishChain=function(){if(this.chain){var t=this.specificity+this.cascade.nextOrder();this.processChain(this.makeApplyRuleAction(t)),this.chain=null,this.pseudoelement=null,this.viewConditionId=null,this.footnoteContent=!1,this.specificity=0}},u.makeApplyRuleAction=function(t){var e=this.regionId;return this.footnoteContent&&(e=e?"xxx-bogus-xxx":"footnote"),new to(this.elementStyle,t,this.pseudoelement,e,this.viewConditionId)},u.special=function(t,e){var u;u=this.condition?new Or(e,0,this.condition):new Lr(e,0),jr(this.elementStyle,t).push(u)},u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},u.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},u.simpleProperty=function(t,e,u){"display"!=t||e!==uu.oeb_page_head&&e!==uu.oeb_page_foot||(this.simpleProperty("flow-options",new $e([uu.exclusive,uu._static]),u),this.simpleProperty("flow-into",e,u),e=uu.block),C("SIMPLE_PROPERTY").forEach((function(n){var i=n({name:t,value:e,important:u});t=i.name,e=i.value,u=i.important}));var n=u?this.getImportantSpecificity():this.getBaseSpecificity(),i=this.condition?new Or(e,n,this.condition):new Lr(e,n);Hr(this.elementStyle,t,i)},u.finish=function(){return this.cascade},u.startFuncWithSelector=function(t){if("not"===t){var e=new Jo(this);e.startSelectorRule(),this.owner.pushHandler(e)}},e}(Di),Qo={"nth-child":Co,"nth-of-type":Fo,"nth-last-child":Ao,"nth-last-of-type":go},Zo=0,Jo=function(t){function e(e){var u;return(u=t.call(this,e.scope,e.owner,e.condition,e,e.regionId,e.validatorSet,!1)||this).parent=void 0,u.parentChain=void 0,u.parent=e,u.parentChain=e.chain,u}T(e,t);var u=e.prototype;return u.startFuncWithSelector=function(t){"not"==t&&this.reportAndSkip("E_CSS_UNEXPECTED_NOT")},u.startRuleBody=function(){this.reportAndSkip("E_CSS_UNEXPECTED_RULE_BODY")},u.nextSelector=function(){this.reportAndSkip("E_CSS_UNEXPECTED_NEXT_SELECTOR")},u.endFuncWithSelector=function(){this.chain&&this.chain.length>0&&this.parentChain.push(new bo(this.chain)),this.parent.specificity+=this.specificity,this.owner.popHandler()},u.error=function(e,u){t.prototype.error.call(this,e,u),this.owner.popHandler()},e}($o),ta=function(t){function e(e,u){return t.call(this,e,u,!1)||this}return T(e,t),e.prototype.property=function(t,e,u){if(this.scope.values[t])this.error("E_CSS_NAME_REDEFINED "+t,this.getCurrentToken());else{var n=t.match(/height|^(top|bottom)$/)?"vh":"vw",i=new Ce(this.scope,100,n);this.scope.defineName(t,e.toExpr(this.scope,i))}},e}(Di),ea=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,!1)||this).condition=void 0,o.elementStyle=void 0,o.validatorSet=void 0,o.order=void 0,o.condition=n,o.elementStyle=i,o.validatorSet=r,o.order=0,o}T(e,t);var u=e.prototype;return u.property=function(t,e,u){u?c.warn("E_IMPORTANT_NOT_ALLOWED"):this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){c.warn("E_INVALID_PROPERTY_VALUE",t+":",e.toString())},u.unknownProperty=function(t,e){c.warn("E_INVALID_PROPERTY",t+":",e.toString())},u.simpleProperty=function(t,e,u){var n=u?this.getImportantSpecificity():this.getBaseSpecificity();n+=this.order,this.order+=9.5367431640625e-7;var i=this.condition?new Or(e,n,this.condition):new Lr(e,n);Hr(this.elementStyle,t,i)},e}(Di),ua=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).validatorSet=void 0,n.elementStyle={},n.order=0,n.validatorSet=u,n}T(e,t);var u=e.prototype;return u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){c.warn("E_INVALID_PROPERTY_VALUE",t+":",e.toString())},u.unknownProperty=function(t,e){c.warn("E_INVALID_PROPERTY",t+":",e.toString())},u.simpleProperty=function(t,e,u){var n=u?67108864:50331648;n+=this.order,this.order+=9.5367431640625e-7;var i=new Lr(e,n);Hr(this.elementStyle,t,i)},e}(Ti);function na(t,e){var u=Xr(t);u&&u.forEach((function(t){t.matcher.matches()&&e(t.styles)}))}function ia(t,e,u){na(u,(function(u){la(t,u,e)}))}function ra(t,e,u){var n=t["writing-mode"];if(n){var i=n.evaluate(e,"writing-mode");if(i&&i!==uu.inherit)return i===uu.vertical_rl}return u}function oa(t,e,u){var n=t.direction;if(n){var i=n.evaluate(e,"direction");if(i&&i!==uu.inherit)return i===uu.rtl}return u}function aa(t,e,u,n,i){var r={};for(var o in t)Mr(o)&&(r[o]=Vr(t,o));return ia(r,e,t),sa(t,u,n,(function(t,u){la(r,u,e),ia(r,e,u)})),r}function sa(t,e,u,n){var i=zr(t,"_regions");if((e||u)&&i){if(u){var r=["footnote"];e=e?e.concat(r):r}for(var o,a=_(e);!(o=a()).done;){var s=o.value,l=i[s];l&&n(s,l)}}}function la(t,e,u){for(var n in e)if(Mr(n)){var i=Vr(e,n);t[n]=kr(u,t[n],i)}}var Da=function(t,e,u,n,i){var r=u?n?Pr:xr:n?Rr:Ir;for(var o in t)if(t.hasOwnProperty(o)){var a=t[o];if(!a)continue;var s=r[o],l=void 0;if(s){var D=t[s];if(D&&D.priority>a.priority)continue;l=Sr[s]?s:o}else l=o;e[l]=i(o,a)}};function ha(t,e){var u={};return Object.keys(t).forEach((function(n){var i=u[n]={},r=t[n];Object.keys(r).forEach((function(t){i[t]=r[t].map((function(t){var u=e?t.physical:t.logical;return{regexp:new RegExp("(-?)"+(e?t.logical:t.physical)+"(-?)"),to:"$1"+u+"$2"}}))}))})),u}function ca(t,e,u,n){var i=n[e];if(!i)throw new Error("unknown writing-mode: "+e);var r=i[u||"ltr"];if(!r)throw new Error("unknown direction: "+u);for(var o,a=_(r);!(o=a()).done;){var s=o.value,l=t.replace(s.regexp,s.to);if(l!==t)return l}return t}var da={"horizontal-tb":{ltr:[{logical:"inline-start",physical:"left"},{logical:"inline-end",physical:"right"},{logical:"block-start",physical:"top"},{logical:"block-end",physical:"bottom"},{logical:"inline-size",physical:"width"},{logical:"block-size",physical:"height"}],rtl:[{logical:"inline-start",physical:"right"},{logical:"inline-end",physical:"left"},{logical:"block-start",physical:"top"},{logical:"block-end",physical:"bottom"},{logical:"inline-size",physical:"width"},{logical:"block-size",physical:"height"}]},"vertical-rl":{ltr:[{logical:"inline-start",physical:"top"},{logical:"inline-end",physical:"bottom"},{logical:"block-start",physical:"right"},{logical:"block-end",physical:"left"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}],rtl:[{logical:"inline-start",physical:"bottom"},{logical:"inline-end",physical:"top"},{logical:"block-start",physical:"right"},{logical:"block-end",physical:"left"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}]},"vertical-lr":{ltr:[{logical:"inline-start",physical:"top"},{logical:"inline-end",physical:"bottom"},{logical:"block-start",physical:"left"},{logical:"block-end",physical:"right"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}],rtl:[{logical:"inline-start",physical:"bottom"},{logical:"inline-end",physical:"top"},{logical:"block-start",physical:"left"},{logical:"block-end",physical:"right"},{logical:"inline-size",physical:"height"},{logical:"block-size",physical:"width"}]}},fa=ha(da,!0);function pa(t,e,u){return ca(t,e,u||null,fa)}var Ea=ha(da,!1);function Ca(t,e,u){return ca(t,e,u||null,Ea)}var Fa,Aa={"horizontal-tb":[{logical:"line-left",physical:"left"},{logical:"line-right",physical:"right"},{logical:"over",physical:"top"},{logical:"under",physical:"bottom"}],"vertical-rl":[{logical:"line-left",physical:"top"},{logical:"line-right",physical:"bottom"},{logical:"over",physical:"right"},{logical:"under",physical:"left"}],"vertical-lr":[{logical:"line-left",physical:"top"},{logical:"line-right",physical:"bottom"},{logical:"over",physical:"right"},{logical:"under",physical:"left"}]};function ga(t,e,u){var n={display:e.style.display,position:e.style.position,width:e.style.width,maxWidth:e.style.maxWidth,minWidth:e.style.minWidth,height:e.style.height,maxHeight:e.style.maxHeight,minHeight:e.style.minHeight},i=e.parentNode,r=e.ownerDocument.createElement("div");function o(u){return t.getElementComputedStyle(e).getPropertyValue(u)}et(r,"position",n.position),i.insertBefore(r,e),r.appendChild(e),et(e,"width","auto"),et(e,"max-width","none"),et(e,"min-width","0"),et(e,"height","auto"),et(e,"max-height","none"),et(e,"min-height","0");var a=tt("writing-mode"),s=(a?o(a[0]):null)||o("writing-mode"),l="vertical-rl"===s||"tb-rl"===s||"vertical-lr"===s||"tb-lr"===s,D=l?"height":"width",h=l?"width":"height";function c(){return et(e,"display","block"),et(e,"position","static"),o(D)}function d(){et(e,"display","inline-block"),et(r,D,"99999999px");var t=o(D);return et(r,D,""),t}function f(){et(e,"display","inline-block"),et(r,D,"0");var t=o(D);return et(r,D,""),t}function p(){var t=c(),e=f(),u=parseFloat(t);if(u<=parseFloat(e))return e;var n=d();return u<=parseFloat(n)?t:n}function E(){return o(h)}function C(){throw new Error("Getting fill-available block size is not implemented")}var F={};return u.forEach((function(t){var u;switch(t){case Fa.FILL_AVAILABLE_INLINE_SIZE:u=c();break;case Fa.MAX_CONTENT_INLINE_SIZE:u=d();break;case Fa.MIN_CONTENT_INLINE_SIZE:u=f();break;case Fa.FIT_CONTENT_INLINE_SIZE:u=p();break;case Fa.FILL_AVAILABLE_BLOCK_SIZE:u=C();break;case Fa.MAX_CONTENT_BLOCK_SIZE:case Fa.MIN_CONTENT_BLOCK_SIZE:case Fa.FIT_CONTENT_BLOCK_SIZE:u=E();break;case Fa.FILL_AVAILABLE_WIDTH:u=l?C():c();break;case Fa.FILL_AVAILABLE_HEIGHT:u=l?c():C();break;case Fa.MAX_CONTENT_WIDTH:u=l?E():d();break;case Fa.MAX_CONTENT_HEIGHT:u=l?d():E();break;case Fa.MIN_CONTENT_WIDTH:u=l?E():f();break;case Fa.MIN_CONTENT_HEIGHT:u=l?f():E();break;case Fa.FIT_CONTENT_WIDTH:u=l?E():p();break;case Fa.FIT_CONTENT_HEIGHT:u=l?p():E()}F[t]=parseFloat(u),et(e,"position",n.position),et(e,"display",n.display)})),et(e,"width",n.width),et(e,"max-width",n.maxWidth),et(e,"min-width",n.minWidth),et(e,"height",n.height),et(e,"max-height",n.maxHeight),et(e,"min-height",n.minHeight),i.insertBefore(e,r),i.removeChild(r),F}!function(t){t.FILL_AVAILABLE_INLINE_SIZE="fill-available inline size",t.FILL_AVAILABLE_BLOCK_SIZE="fill-available block size",t.FILL_AVAILABLE_WIDTH="fill-available width",t.FILL_AVAILABLE_HEIGHT="fill-available height",t.MAX_CONTENT_INLINE_SIZE="max-content inline size",t.MAX_CONTENT_BLOCK_SIZE="max-content block size",t.MAX_CONTENT_WIDTH="max-content width",t.MAX_CONTENT_HEIGHT="max-content height",t.MIN_CONTENT_INLINE_SIZE="min-content inline size",t.MIN_CONTENT_BLOCK_SIZE="min-content block size",t.MIN_CONTENT_WIDTH="min-content width",t.MIN_CONTENT_HEIGHT="min-content height",t.FIT_CONTENT_INLINE_SIZE="fit-content inline size",t.FIT_CONTENT_BLOCK_SIZE="fit-content block size",t.FIT_CONTENT_WIDTH="fit-content width",t.FIT_CONTENT_HEIGHT="fit-content height"}(Fa||(Fa={}));var va=Vi.FloatReference;function ma(t){switch(t){case va.INLINE:return!1;case va.COLUMN:case va.REGION:case va.PAGE:return!0;default:throw new Error("Unknown float-reference: "+t)}}var Ba=function(){function t(t,e,u,n,i,r){this.nodePosition=void 0,this.floatReference=void 0,this.floatSide=void 0,this.clearSide=void 0,this.flowName=void 0,this.floatMinWrapBlock=void 0,this.order=null,this.id=null,this.nodePosition=t,this.floatReference=e,this.floatSide=u,this.clearSide=n,this.flowName=i,this.floatMinWrapBlock=r}var e=t.prototype;return e.getOrder=function(){if(null===this.order)throw new Error("The page float is not yet added");return this.order},e.getId=function(){if(!this.id)throw new Error("The page float is not yet added");return this.id},e.isAllowedOnContext=function(t){return t.isAnchorAlreadyAppeared(this.getId())},e.isAllowedToPrecede=function(t){return!1},t}(),wa=function(){function t(){this.floats=[],this.nextPageFloatIndex=0}var e=t.prototype;return e.nextOrder=function(){return this.nextPageFloatIndex++},e.createPageFloatId=function(t){return"pf"+t},e.addPageFloat=function(t){if(this.floats.findIndex((function(e){return sr(e.nodePosition,t.nodePosition)}))>=0)throw new Error("A page float with the same source node is already registered");var e=t.order=this.nextOrder();t.id=this.createPageFloatId(e),this.floats.push(t)},e.findPageFloatByNodePosition=function(t){var e=this.floats.findIndex((function(e){return sr(e.nodePosition,t)}));return e>=0?this.floats[e]:null},e.findPageFloatById=function(t){var e=this.floats.findIndex((function(e){return e.id===t}));return e>=0?this.floats[e]:null},t}(),ya=function(){function t(t,e,u,n,i){this.floatReference=void 0,this.floatSide=void 0,this.continuations=void 0,this.area=void 0,this.continues=void 0,this.floatReference=t,this.floatSide=e,this.continuations=u,this.area=n,this.continues=i}var e=t.prototype;return e.hasFloat=function(t){return this.continuations.some((function(e){return e.float===t}))},e.findNotAllowedFloat=function(t){for(var e=this.continuations.length-1;e>=0;e--){var u=this.continuations[e].float;if(!u.isAllowedOnContext(t))return u}return null},e.getOuterShape=function(){return this.area.getOuterShape(null,null)},e.getOuterRect=function(){return this.area.getOuterRect()},e.getOrder=function(){var t=this.continuations.map((function(t){return t.float}));return Math.min.apply(null,t.map((function(t){return t.getOrder()})))},e.shouldBeStashedBefore=function(t){return this.getOrder()<t.getOrder()},e.addContinuations=function(t){var e=this;t.forEach((function(t){e.continuations.push(t)}))},e.getFlowName=function(){var t=this.continuations[0].float.flowName;return this.continuations.every((function(e){return e.float.flowName===t})),t},t}(),Na=function(){function t(t,e){this.float=void 0,this.nodePosition=void 0,this.float=t,this.nodePosition=e}return t.prototype.equals=function(t){return!!t&&(this===t||this.float===t.float&&sr(this.nodePosition,t.nodePosition))},t}(),ba=function(){function t(t,e,u,n,i,r,o){this.parent=void 0,this.floatReference=void 0,this.container=void 0,this.flowName=void 0,this.generatingNodePosition=void 0,this.children=[],this.writingMode=void 0,this.direction=void 0,this.invalidated=!1,this.floatStore=void 0,this.forbiddenFloats=[],this.floatFragments=[],this.stashedFloatFragments=[],this.floatAnchors={},this.floatsDeferredToNext=[],this.floatsDeferredFromPrevious=void 0,this.layoutConstraints=[],this.locked=!1,this.parent=t,this.floatReference=e,this.container=u,this.flowName=n,this.generatingNodePosition=i,t&&t.children.push(this),this.writingMode=r||t&&t.writingMode||uu.horizontal_tb,this.direction=o||t&&t.direction||uu.ltr,this.floatStore=t?t.floatStore:new wa;var a=this.getPreviousSibling();this.floatsDeferredFromPrevious=a?[].concat(a.floatsDeferredToNext):[]}var e=t.prototype;return e.getParent=function(t){if(!this.parent)throw new Error("No PageFloatLayoutContext for "+t);return this.parent},e.getPreviousSiblingOf=function(t,e,u,n){var i=this.children.indexOf(t);i<0&&(i=this.children.length);for(var r=i-1;r>=0;r--){var o=this.children[r];if(o.floatReference===e&&o.flowName===u&&sr(o.generatingNodePosition,n))return o;if(o=o.getPreviousSiblingOf(null,e,u,n))return o}return null},e.getPreviousSibling=function(){for(var t,e=this,u=this.parent;u;){if(t=u.getPreviousSiblingOf(e,this.floatReference,this.flowName,this.generatingNodePosition))return t;e=u,u=u.parent}return null},e.getContainer=function(t){return t&&t!==this.floatReference?this.getParent(t).getContainer(t):this.container},e.setContainer=function(t){this.container=t,this.reattachFloatFragments()},e.addPageFloat=function(t){this.floatStore.addPageFloat(t)},e.getPageFloatLayoutContext=function(t){return t===this.floatReference?this:this.getParent(t).getPageFloatLayoutContext(t)},e.findPageFloatByNodePosition=function(t){return this.floatStore.findPageFloatByNodePosition(t)},e.forbid=function(t){var e=t.getId(),u=t.floatReference;u===this.floatReference?this.forbiddenFloats.includes(e)||(this.forbiddenFloats.push(e),(new Ta).findByFloat(t).forbid(t,this)):this.getParent(u).forbid(t)},e.isForbidden=function(t){var e=t.getId(),u=t.floatReference;return u===this.floatReference?this.forbiddenFloats.includes(e):this.getParent(u).isForbidden(t)},e.addPageFloatFragment=function(t,e){var u=t.floatReference;u!==this.floatReference?this.getParent(u).addPageFloatFragment(t,e):this.floatFragments.includes(t)||(this.floatFragments.push(t),this.floatFragments.sort((function(t,e){return t.getOrder()-e.getOrder()}))),e||this.invalidate()},e.removePageFloatFragment=function(t,e){var u=t.floatReference;if(u!==this.floatReference)this.getParent(u).removePageFloatFragment(t,e);else{var n=this.floatFragments.indexOf(t);if(n>=0){var i=this.floatFragments.splice(n,1)[0],r=i.area&&i.area.element;r&&r.parentNode&&r.parentNode.removeChild(r),e||this.invalidate()}}},e.findPageFloatFragment=function(t){if(t.floatReference!==this.floatReference)return this.getParent(t.floatReference).findPageFloatFragment(t);var e=this.floatFragments.findIndex((function(e){return e.hasFloat(t)}));return e>=0?this.floatFragments[e]:null},e.hasFloatFragments=function(t){return!(!(this.floatFragments.length>0)||t&&!this.floatFragments.some(t))||!!this.parent&&this.parent.hasFloatFragments(t)},e.hasContinuingFloatFragmentsInFlow=function(t){return this.hasFloatFragments((function(e){return e.continues&&e.getFlowName()===t}))},e.registerPageFloatAnchor=function(t,e){this.floatAnchors[t.getId()]=e},e.collectPageFloatAnchors=function(){var t=Object.assign({},this.floatAnchors);return this.children.reduce((function(t,e){return Object.assign(t,e.collectPageFloatAnchors())}),t)},e.isAnchorAlreadyAppeared=function(t){if(this.getDeferredPageFloatContinuations().some((function(e){return e.float.getId()===t})))return!0;var e=this.collectPageFloatAnchors()[t];return!!e&&!(!this.container||!this.container.element)&&this.container.element.contains(e)},e.deferPageFloat=function(t){var e=t.float;if(e.floatReference===this.floatReference){var u=this.floatsDeferredToNext.findIndex((function(t){return t.float===e}));u>=0?this.floatsDeferredToNext.splice(u,1,t):this.floatsDeferredToNext.push(t)}else this.getParent(e.floatReference).deferPageFloat(t)},e.hasPrecedingFloatsDeferredToNext=function(t,e){if(!e&&t.floatReference!==this.floatReference)return this.getParent(t.floatReference).hasPrecedingFloatsDeferredToNext(t,!1);var u=t.getOrder();return!!this.floatsDeferredToNext.some((function(e){return e.float.getOrder()<u&&!t.isAllowedToPrecede(e.float)}))||!!this.parent&&this.parent.hasPrecedingFloatsDeferredToNext(t,!0)},e.getLastFollowingFloatInFragments=function(t){var e=t.getOrder(),u=null;if(this.floatFragments.forEach((function(t){t.continuations.forEach((function(t){var n=t.float,i=n.getOrder();i>e&&(!u||i>u.getOrder())&&(u=n)}))})),this.parent){var n=this.parent.getLastFollowingFloatInFragments(t);n&&(!u||n.getOrder()>u.getOrder())&&(u=n)}return u},e.getDeferredPageFloatContinuations=function(t){t=t||this.flowName;var e=this.floatsDeferredFromPrevious.filter((function(e){return!t||e.float.flowName===t}));return this.parent&&(e=this.parent.getDeferredPageFloatContinuations(t).concat(e)),e.sort((function(t,e){return t.float.getOrder()-e.float.getOrder()}))},e.getPageFloatContinuationsDeferredToNext=function(t){t=t||this.flowName;var e=this.floatsDeferredToNext.filter((function(e){return!t||e.float.flowName===t}));return this.parent?this.parent.getPageFloatContinuationsDeferredToNext(t).concat(e):e},e.getFloatsDeferredToNextInChildContexts=function(){for(var t=[],e=[],u=this.children.length-1;u>=0;u--){var n=this.children[u];e.includes(n.flowName)||(e.push(n.flowName),t=(t=t.concat(n.floatsDeferredToNext.map((function(t){return t.float})))).concat(n.getFloatsDeferredToNextInChildContexts()))}return t},e.checkAndForbidNotAllowedFloat=function(){if(this.checkAndForbidFloatFollowingDeferredFloat())return!0;for(var t=this.floatFragments.length-1;t>=0;t--){var e=this.floatFragments[t],u=e.findNotAllowedFloat(this);if(u)return this.locked?this.invalidate():(this.removePageFloatFragment(e),this.forbid(u),this.removeEndFloatFragments(e.floatSide)),!0}return!(this.floatReference!==va.REGION||!this.parent.locked)&&this.parent.checkAndForbidNotAllowedFloat()},e.checkAndForbidFloatFollowingDeferredFloat=function(){var t=this,e=this.getFloatsDeferredToNextInChildContexts(),u=this.floatFragments.reduce((function(t,e){return t.concat(e.continuations.map((function(t){return t.float})))}),[]);u.sort((function(t,e){return e.getOrder()-t.getOrder()}));for(var n,i=function(){var u=n.value,i=u.getOrder();if(e.some((function(t){return!u.isAllowedToPrecede(t)&&i>t.getOrder()}))){if(t.locked)t.invalidate();else{t.forbid(u);var r=t.findPageFloatFragment(u);t.removePageFloatFragment(r)}return{v:!0}}},r=_(u);!(n=r()).done;){var o=i();if("object"==typeof o)return o.v}return!1},e.finish=function(){var t=this;if(!this.checkAndForbidNotAllowedFloat()){for(var e=this.floatsDeferredToNext.length-1;e>=0;e--)if(!this.floatsDeferredToNext[e].float.isAllowedOnContext(this)){if(this.locked)return void this.invalidate();this.floatsDeferredToNext.splice(e,1)}this.floatsDeferredFromPrevious.forEach((function(e){t.floatsDeferredToNext.findIndex((function(t){return e.equals(t)}))>=0||t.floatFragments.some((function(t){return t.hasFloat(e.float)}))||t.floatsDeferredToNext.push(e)}))}},e.hasSameContainerAs=function(t){return!!this.container&&!!t.container&&this.container.element===t.container.element},e.invalidate=function(){var t=this;this.invalidated=!0,this.locked||(this.container&&(this.children.forEach((function(e){t.hasSameContainerAs(e)&&e.floatFragments.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))})),this.container.clear()),this.children.forEach((function(t){t.layoutConstraints.splice(0)})),this.children.splice(0),Object.keys(this.floatAnchors).forEach((function(e){delete t.floatAnchors[e]})))},e.detachChildren=function(){var t=this.children.splice(0);return t.forEach((function(t){t.floatFragments.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))})),t},e.attachChildren=function(t){var e=this;t.forEach((function(t){e.children.push(t),t.reattachFloatFragments()}))},e.isInvalidated=function(){return this.invalidated||!!this.parent&&this.parent.isInvalidated()},e.validate=function(){this.invalidated=!1},e.toLogical=function(t){return Ca(t,this.writingMode.toString(),this.direction.toString())},e.toPhysical=function(t){return pa(t,this.writingMode.toString(),this.direction.toString())},e.removeEndFloatFragments=function(t){var e=this.toLogical(t);if("block-end"===e||"inline-end"===e)for(var u=0;u<this.floatFragments.length;){var n=this.floatFragments[u];this.toLogical(n.floatSide)===e?this.removePageFloatFragment(n):u++}},e.stashEndFloatFragments=function(t){var e=t.floatReference;if(e===this.floatReference){var u=this.toLogical(t.floatSide);if("block-end"===u||"snap-block"===u||"inline-end"===u)for(var n=0;n<this.floatFragments.length;){var i=this.floatFragments[n],r=this.toLogical(i.floatSide);(r===u||"snap-block"===u&&"block-end"===r)&&i.shouldBeStashedBefore(t)?(this.stashedFloatFragments.push(i),this.floatFragments.splice(n,1)):n++}}else this.getParent(e).stashEndFloatFragments(t)},e.restoreStashedFragments=function(t){var e=this;t===this.floatReference?(this.stashedFloatFragments.forEach((function(t){e.addPageFloatFragment(t,!0)})),this.stashedFloatFragments.splice(0)):this.getParent(t).restoreStashedFragments(t)},e.discardStashedFragments=function(t){t===this.floatReference?this.stashedFloatFragments.splice(0):this.getParent(t).discardStashedFragments(t)},e.getStashedFloatFragments=function(t){return t===this.floatReference?this.stashedFloatFragments.concat().sort((function(t,e){return e.getOrder()-t.getOrder()})):this.getParent(t).getStashedFloatFragments(t)},e.getLimitValue=function(t,e,u,n){var i=this.toLogical(t),r=this.toPhysical(t),o=this.getLimitValueInner(i,e,u,n);if(this.parent&&this.parent.container){var a=this.parent.getLimitValue(r,e,u,n);switch(r){case"top":case"left":return Math.max(o,a);case"bottom":case"right":return Math.min(o,a)}}return o},e.getLimitValueInner=function(t,e,u,n){var i=this.getLimitValuesInner(e,u,n);switch(t){case"block-start":return this.container.vertical?i.right:i.top;case"block-end":return this.container.vertical?i.left:i.bottom;case"inline-start":return this.container.vertical?i.top:i.left;case"inline-end":return this.container.vertical?i.bottom:i.right;default:throw new Error("Unknown logical side: "+t)}},e.getLimitValuesInner=function(t,e,u){var n=this,i=this.container.originX,r=this.container.originY,o=this.container.getPaddingRect(),a={top:o.y1-r,left:o.x1-i,bottom:o.y2-r,right:o.x2-i,floatMinWrapBlockStart:0,floatMinWrapBlockEnd:0};function s(u,n,i){return"%"===u.unit?i*u.num/100:t.convertLengthToPx(u,n,e)}var l=this.floatFragments;return l.length>0&&(a=l.reduce((function(t,e){if(u&&!u(e,n))return t;var i=n.toLogical(e.floatSide),r=e.area,a=e.continuations[0].float.floatMinWrapBlock,l=t.top,D=t.left,h=t.bottom,c=t.right,d=t.floatMinWrapBlockStart,f=t.floatMinWrapBlockEnd;switch(i){case"inline-start":r.vertical?l=Math.max(l,r.top+r.height):D=Math.max(D,r.left+r.width);break;case"block-start":r.vertical?(a&&r.left<c&&(d=s(a,r.rootViewNodes[0],o.x2-o.x1)),c=Math.min(c,r.left)):(a&&r.top+r.height>l&&(d=s(a,r.rootViewNodes[0],o.y2-o.y1)),l=Math.max(l,r.top+r.height));break;case"inline-end":r.vertical?h=Math.min(h,r.top):c=Math.min(c,r.left);break;case"block-end":r.vertical?(a&&r.left+r.width>D&&(f=s(a,r.rootViewNodes[0],o.x2-o.x1)),D=Math.max(D,r.left+r.width)):(a&&r.top<h&&(f=s(a,r.rootViewNodes[0],o.y2-o.y1)),h=Math.min(h,r.top));break;default:throw new Error("Unknown logical float side: "+i)}return{top:l,left:D,bottom:h,right:c,floatMinWrapBlockStart:d,floatMinWrapBlockEnd:f}}),a)),a.left+=i,a.right+=i,a.top+=r,a.bottom+=r,a},e.setFloatAreaDimensions=function(t,e,u,n,i,r,o){if(e!==this.floatReference)return this.getParent(e).setFloatAreaDimensions(t,e,u,n,i,r,o);var a=this.toLogical(u);if("snap-block"===a){if(!o["block-start"]&&!o["block-end"])return null}else if(!o[a])return null;var s,l,D,h,c=this.getLimitValue("block-start",t.layoutContext,t.clientLayout),d=this.getLimitValue("block-end",t.layoutContext,t.clientLayout),f=this.getLimitValue("inline-start",t.layoutContext,t.clientLayout),p=this.getLimitValue("inline-end",t.layoutContext,t.clientLayout),E=t.vertical?t.originX:t.originY,C=t.vertical?t.originY:t.originX;function F(e,u){var n=e(t.bands,u);return n?(t.vertical&&(n=yu(n)),c=t.vertical?Math.min(c,n.x2):Math.max(c,n.y1),d=t.vertical?Math.max(d,n.x1):Math.min(d,n.y2),!0):r}if(c=t.vertical?Math.min(c,t.left+t.getInsetLeft()+t.width+t.getInsetRight()+E):Math.max(c,t.top+E),d=t.vertical?Math.max(d,t.left+E):Math.min(d,t.top+t.getInsetTop()+t.height+t.getInsetBottom()+E),i){var A=t.vertical?wu(new Du(d,f,c,p)):new Du(f,c,p,d);if(("block-start"===a||"snap-block"===a||"inline-start"===a)&&!F(Tu,A))return null;if(("block-end"===a||"snap-block"===a||"inline-end"===a)&&!F(xu,A))return null;if(s=(D=(d-c)*t.getBoxDir())-t.getInsetBefore()-t.getInsetAfter(),l=(h=p-f)-t.getInsetStart()-t.getInsetEnd(),!r&&(s<=0||l<=0))return null}else{D=(s=t.computedBlockSize)+t.getInsetBefore()+t.getInsetAfter();var g=(d-c)*t.getBoxDir();if("snap-block"===a){if(null===n)a="block-start";else{var v=this.container.getPaddingRect();a=this.container.getBoxDir()*(n-(this.container.vertical?v.x2:v.y1))<=this.container.getBoxDir()*((this.container.vertical?v.x1:v.y2)-n-D)?"block-start":"block-end"}if(!o[a]){if(!o["block-end"])return null;a="block-end"}}if(!r&&g<D)return null;if(h=(l="inline-start"===a||"inline-end"===a?ga(t.clientLayout,t.element,[Fa.FIT_CONTENT_INLINE_SIZE])[Fa.FIT_CONTENT_INLINE_SIZE]:t.adjustContentRelativeSize?t.getContentInlineSize():t.vertical?t.height:t.width)+t.getInsetStart()+t.getInsetEnd(),!r&&p-f<h)return null}switch(c-=E,d-=E,f-=C,p-=C,a){case"inline-start":case"block-start":case"snap-block":t.setInlinePosition(f,l),t.setBlockPosition(c,s);break;case"inline-end":case"block-end":t.setInlinePosition(p-h,l),t.setBlockPosition(d-D*t.getBoxDir(),s);break;default:throw new Error("unknown float direction: "+u)}return a},e.getFloatFragmentExclusions=function(){var t=this.floatFragments.map((function(t){return t.getOuterShape()}));return this.parent?this.parent.getFloatFragmentExclusions().concat(t):t},e.reattachFloatFragments=function(){var t=this.container.element&&this.container.element.parentNode;t&&this.floatFragments.forEach((function(e){t.appendChild(e.area.element)}))},e.getMaxReachedAfterEdge=function(){var t=this.getContainer().vertical;return this.floatFragments.reduce((function(e,u){var n=u.getOuterRect();return t?Math.min(e,n.x1):Math.max(e,n.y2)}),t?1/0:0)},e.getBlockStartEdgeOfBlockEndFloats=function(){var t=this.getContainer().vertical;return this.floatFragments.filter((function(t){return"block-end"===t.floatSide})).reduce((function(e,u){var n=u.getOuterRect();return t?Math.max(e,n.x2):Math.min(e,n.y1)}),t?0:1/0)},e.getPageFloatClearEdge=function(t,e){function u(t){return function(e){return t.isAnchorAlreadyAppeared(e.float.getId())}}function n(t,e){return t.continuations.some(u(e))}for(var i=e.getPaddingRect(),r=e.vertical?i.x1:i.y2,o=this;o;){if(o.floatsDeferredToNext.some(u(o)))return r;o=o.parent}var a=this.getLimitValue("block-start",e.layoutContext,e.clientLayout,n);return this.getLimitValue("block-end",e.layoutContext,e.clientLayout,n)*e.getBoxDir()<r*e.getBoxDir()?r:a},e.getPageFloatPlacementCondition=function(t,e,u){var n=this;if(t.floatReference!==this.floatReference)return this.getParent(t.floatReference).getPageFloatPlacementCondition(t,e,u);var i={"block-start":!0,"block-end":!0,"inline-start":!0,"inline-end":!0};if(!u)return i;var r,o=this.toLogical(e),a=this.toLogical(u);r="all"===a?["block-start","block-end","inline-start","inline-end"]:"both"===a?["inline-start","inline-end"]:"same"===a?"snap-block"===o?["block-start","block-end"]:[o]:[a];var s=t.getOrder();function l(t){return function(e){return e.floatSide===t&&e.getOrder()<s}}function D(t,e){return t.children.some((function(t){return t.floatFragments.some(l(e))||D(t,e)}))}function h(t,e){var u=t.parent;return!!u&&(u.floatFragments.some(l(e))||h(u,e))}return r.forEach((function(t){switch(t){case"block-start":case"inline-start":i[t]=!D(n,t);break;case"block-end":case"inline-end":i[t]=!h(n,t);break;default:throw new Error("Unexpected side: "+t)}})),i},e.getLayoutConstraints=function(){return(this.parent?this.parent.getLayoutConstraints():[]).concat(this.layoutConstraints)},e.addLayoutConstraint=function(t,e){e===this.floatReference?this.layoutConstraints.push(t):this.getParent(e).addLayoutConstraint(t,e)},e.isColumnFullWithPageFloats=function(t){for(var e=t.layoutContext,u=t.clientLayout,n=this,i=null;n&&n.container;){var r=n.getLimitValuesInner(e,u);i?t.vertical?(r.right<i.right&&(i.right=r.right,i.floatMinWrapBlockStart=r.floatMinWrapBlockStart),r.left>i.left&&(i.left=r.left,i.floatMinWrapBlockEnd=r.floatMinWrapBlockEnd)):(r.top>i.top&&(i.top=r.top,i.floatMinWrapBlockStart=r.floatMinWrapBlockStart),r.bottom<i.bottom&&(i.bottom=r.bottom,i.floatMinWrapBlockEnd=r.floatMinWrapBlockEnd)):i=r,n=n.parent}var o=Math.max(i.floatMinWrapBlockStart,i.floatMinWrapBlockEnd);return(t.vertical?i.right-i.left:i.bottom-i.top)<=o},e.getMaxBlockSizeOfPageFloats=function(){var t=this.getContainer().vertical;return this.floatFragments.length?Math.max.apply(null,this.floatFragments.map((function(e){var u=e.area;return t?u.width:u.height}))):0},e.lock=function(){this.locked=!0},e.unlock=function(){this.locked=!1},e.isLocked=function(){return this.locked},t}(),Sa=[],Ta=function(){function t(){}t.register=function(t){Sa.push(t)};var e=t.prototype;return e.findByNodeContext=function(t){for(var e=Sa.length-1;e>=0;e--){var u=Sa[e];if(u.appliesToNodeContext(t))return u}throw new Error("No PageFloatLayoutStrategy found for "+t)},e.findByFloat=function(t){for(var e=Sa.length-1;e>=0;e--){var u=Sa[e];if(u.appliesToFloat(t))return u}throw new Error("No PageFloatLayoutStrategy found for "+t)},t}();Ta.register(new(function(){function t(){}var e=t.prototype;return e.appliesToNodeContext=function(t){return ma(t.floatReference)},e.appliesToFloat=function(t){return!0},e.createPageFloat=function(t,e,u){var n=t.floatReference,i=t.floatSide,r=t.toNodePosition();return u.resolveFloatReferenceFromColumnSpan(n,t.columnSpan,t).thenAsync((function(u){var o=new Ba(r,n=u,i,t.clearSide,e.flowName,t.floatMinWrapBlock);return e.addPageFloat(o),Rn(o)}))},e.createPageFloatFragment=function(t,e,u,n){return new ya(t[0].float.floatReference,e,t,u,n)},e.findPageFloatFragment=function(t,e){return e.findPageFloatFragment(t)},e.adjustPageFloatArea=function(t,e,u){},e.forbid=function(t,e){},t}()));var xa=ya,Ia=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,"block-end",null,n,r)||this).footnotePolicy=void 0,o.footnotePolicy=i,o}return T(e,t),e.prototype.isAllowedToPrecede=function(t){return!(t instanceof e)},e}(Ba),Pa=function(t){function e(e,u,n,i){return t.call(this,e,"block-end",u,n,i)||this}T(e,t);var u=e.prototype;return u.getOrder=function(){return 1/0},u.shouldBeStashedBefore=function(t){return t instanceof Ia||this.getOrder()<t.getOrder()},e}(xa),Ra=function(){function t(t){this.footnote=void 0,this.footnote=t}return t.prototype.allowLayout=function(t){return!sr(t.toNodePosition(),this.footnote.nodePosition)},t}();Ta.register(new(function(){function t(){}var e=t.prototype;return e.appliesToNodeContext=function(t){return"footnote"===t.floatSide},e.appliesToFloat=function(t){return t instanceof Ia},e.createPageFloat=function(t,e,u){var n=va.REGION,i=e.getPageFloatLayoutContext(n);e.getPageFloatLayoutContext(va.PAGE).hasSameContainerAs(i)&&(n=va.PAGE);var r=t.toNodePosition(),o=new Ia(r,n,e.flowName,t.footnotePolicy,t.floatMinWrapBlock);return e.addPageFloat(o),Rn(o)},e.createPageFloatFragment=function(t,e,u,n){return new Pa(t[0].float.floatReference,t,u,n)},e.findPageFloatFragment=function(t,e){return e.getPageFloatLayoutContext(t.floatReference).floatFragments.filter((function(t){return t instanceof Pa}))[0]||null},e.adjustPageFloatArea=function(t,e,u){t.isFootnote=!0,t.adjustContentRelativeSize=!1;var n=t.element;t.vertical=u.layoutContext.applyFootnoteStyle(e.vertical,u.layoutContext.nodeContext&&"rtl"===u.layoutContext.nodeContext.direction,n),t.convertPercentageSizesToPx(n),u.setComputedInsets(n,t),u.setComputedWidthAndHeight(n,t)},e.forbid=function(t,e){var u=t;if(u.footnotePolicy===uu.line){var n=new Ra(u);e.addLayoutConstraint(n,u.floatReference)}},t}()));var La={page:!0,left:!0,right:!0,recto:!0,verso:!0,column:!0,region:!0};function Oa(t){return!!La[t]}var ka={left:!0,right:!0,recto:!0,verso:!0};function _a(t){return!!ka[t]}var Ma={avoid:!0,"avoid-page":!0,"avoid-column":!0,"avoid-region":!0};function Ua(t){return!!Ma[t]}function Va(t,e){if(!t)return e;if(!e)return t;if(_a(e))return e;if(_a(t))return t;var u=Oa(t),n=Oa(e);if(!u||!n)return n?e:u?t:Ua(e)?e:Ua(t)?t:e;switch(e){case"column":return t;case"region":return"column"===t?e:t;default:return e}}function Ha(t){switch(t){case"left":case"right":case"recto":case"verso":return t;default:return"any"}}function za(t){switch(t){case"left":case"right":case"recto":case"verso":return t;default:return null}}function Ga(t,e,u,n){var i=t.viewNode;if(!i)return NaN;var r=1==i.nodeType?i:i.parentElement;if(r&&r instanceof HTMLElement){if("rt"===r.localName&&r.style.zoom)return NaN;if(/^([\d\.]|super|(text-)?top)/.test(r.style.verticalAlign))return NaN}if(1==i.nodeType){if(t.after||!t.inline){var o=e.getElementClientRect(i);if(0===o.left&&0===o.top&&0===o.right&&0===o.bottom)return NaN;if(o.right>=o.left&&o.bottom>=o.top)return t.after?n?o.left:o.bottom:n?o.right:o.top}return NaN}var a=i.ownerDocument.createRange(),s=i.textContent.length;if(!s)return NaN;t.after&&(u+=s),u>=s&&(u=s-1),a.setStart(i,u),a.setEnd(i,u+1);var l=e.getRangeClientRects(a);return n&&function(t){if(null==Ct){var e=t.ownerDocument,u=e.createElement("div");u.style.position="absolute",u.style.top="0px",u.style.left="0px",u.style.width="100px",u.style.height="100px",u.style.overflow="hidden",u.style.lineHeight="16px",u.style.fontSize="16px",et(u,"writing-mode","vertical-rl"),t.appendChild(u);var n=e.createTextNode("a a a a a a a a a a a a a a a a");u.appendChild(n);var i=e.createRange();i.setStart(n,0),i.setEnd(n,1);var r=i.getBoundingClientRect();Ct=r.right-r.left<10,t.removeChild(u)}return Ct}(document.body)&&(l=function(t,e,u){var n=u.ownerDocument.createRange();n.setStart(u,0),n.setEnd(u,u.textContent.length);for(var i,r=t.getRangeClientRects(n),o=[],a=_(e);!(i=a()).done;){var s=i.value,l=void 0;for(l=0;l<r.length;l++){var D=r[l];if(s.top>=D.top&&s.bottom<=D.bottom&&Math.abs(s.left-D.left)<1){o.push({top:s.top,left:D.left,bottom:s.bottom,right:D.right});break}}l==r.length&&(c.warn("Could not fix character box"),o.push(s))}return o}(e,l,i)),(l=l.filter((function(t){return t.right>t.left&&t.bottom>t.top}))).length?n?Math.min.apply(null,l.map((function(t){return t.left}))):Math.max.apply(null,l.map((function(t){return t.bottom}))):NaN}function Xa(t,e,u){var n=e.clientLayout.getElementClientRect(t),i=e.getComputedMargin(t);return u?n.width+i.left+i.right:n.height+i.top+i.bottom}function Wa(t){for(;t;){if(t.parentNode===t.ownerDocument)return!1;t=t.parentNode}return!0}function ja(t,e){if(t)for(var u;(u=t.lastChild)!=e;)t.removeChild(u)}function Ka(t){return!!t.getAttribute("data-adapt-spec")}p("SIMPLE_PROPERTY",(function(t){var e=t.name,u=t.value;switch(e){case"page-break-before":case"page-break-after":case"page-break-inside":return{name:e.replace(/^page-/,""),value:u===uu.always?uu.page:u,important:t.important};default:return t}}));var Ya={ruby:!0,"ruby-base":!0,"ruby-base-container":!0,"ruby-text":!0,"ruby-text-container":!0,"inline-block":!0,"inline-flex":!0,"inline-grid":!0,"inline-list-item":!0,"inline-table":!0};function qa(t){return!!Ya[t]}function $a(t){if(!t)return!1;var e=t.viewNode;if(e&&1===e.nodeType&&Ka(e))return!0;for(var u=t.parent;u;u=u.parent)if(qa(u.display))return!0;return!1}var Qa=function(){function t(){}var e=t.prototype;return e.calculateOffset=function(t){return Za(this.getNodeContext(),t.collectElementsOffset())},e.breakPositionChosen=function(t){},e.getNodeContext=function(){return null},t}();function Za(t,e){return{current:e.reduce((function(e,u){return e+u.calculateOffset(t)}),0),minimum:e.reduce((function(e,u){return e+u.calculateMinimumOffset(t)}),0)}}var Ja=function(t){function e(e,u,n,i){var r;return(r=t.call(this)||this).position=void 0,r.breakOnEdge=void 0,r.overflows=void 0,r.computedBlockSize=void 0,r.overflowIfRepetitiveElementsDropped=void 0,r.isEdgeUpdated=!1,r.edge=0,r.position=e,r.breakOnEdge=u,r.overflows=n,r.computedBlockSize=i,r.overflowIfRepetitiveElementsDropped=n,r}T(e,t);var u=e.prototype;return u.findAcceptableBreak=function(t,e){return this.updateOverflows(t),e<this.getMinBreakPenalty()?null:t.findEdgeBreakPosition(this)},u.getMinBreakPenalty=function(){if(!this.isEdgeUpdated)throw new Error("EdgeBreakPosition.prototype.updateEdge not called");var t=this.isFirstContentOfRepetitiveElementsOwner()&&!this.overflowIfRepetitiveElementsDropped;return(Ua(this.breakOnEdge)?1:0)+(this.overflows&&!t?3:0)+(this.position.parent?this.position.parent.breakPenalty:0)},u.updateEdge=function(t){var e=t.calculateClonedPaddingBorder(this.position);this.edge=Ga(this.position,t.clientLayout,0,t.vertical)+e,this.isEdgeUpdated=!0},u.updateOverflows=function(t){this.isEdgeUpdated||this.updateEdge(t);var e=this.edge,u=this.calculateOffset(t);this.overflowIfRepetitiveElementsDropped=t.isOverflown(e+(t.vertical?-1:1)*u.minimum),this.overflows=this.position.overflow=t.isOverflown(e+(t.vertical?-1:1)*u.current)},u.getNodeContext=function(){return this.position},u.isFirstContentOfRepetitiveElementsOwner=function(){var t=this.getNodeContext();if(!t||!t.parent)return!1;var e=t.parent.formattingContext;if(!zi.isInstanceOfRepetitiveElementsOwnerFormattingContext(e))return!1;var u=e.getRepetitiveElements();return!!u&&u.isFirstContentNode(t)},e}(Qa);function ts(t){var e,u=t.toString();switch(u){case"inline-flex":e="flex";break;case"inline-grid":e="grid";break;case"inline-table":e="table";break;case"inline":case"table-row-group":case"table-column":case"table-column-group":case"table-header-group":case"table-footer-group":case"table-row":case"table-cell":case"table-caption":case"inline-block":e="block";break;default:e=u}return ze(e)}function es(t){return t===uu.absolute||t===uu.fixed}function us(t,e,u,n){return t===uu.none||(es(e)?(u=uu.none,t=ts(t)):(u&&u!==uu.none||n)&&(t=ts(t))),{display:t,position:e,float:u}}function ns(t,e,u,n){return us(t,e,u,n).display===uu.block}function is(t){switch(t.toString()){case"inline":case"inline-block":case"inline-list-item":case"inline-flex":case"inline-grid":case"ruby":case"inline-table":return!0;default:return!1}}var rs=function(){function t(){}return t.prototype.find=function(t){for(var u=C(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR),n=0;n<u.length;n++){var i=u[n](t);if(i)return i}throw new Error("No processor found for a formatting context: "+t.getName())},t}(),os=function(){function t(){}var e=t.prototype;return e.layout=function(t,e,u){return e.isFloatNodeContext(t)?e.layoutFloatOrFootnote(t):e.isBreakable(t)?e.layoutBreakableBlock(t):e.layoutUnbreakable(t)},e.createEdgeBreakPosition=function(t,e,u,n){return new Ja(t.copy(),e,u,n)},e.startNonInlineElementNode=function(t){return!1},e.afterNonInlineElementNode=function(t,e){return!1},e.clearOverflownViewNodes=function(t,e,u,n){var i;if(u.viewNode&&u.viewNode.parentNode&&(u.shadowType!==Xi.ShadowType.ROOTLESS||!$a(u))){var r=u.viewNode;"viv-ts-inner"===(null==(i=r.parentElement)?void 0:i.localName)&&(r=r.parentElement.parentElement);var o=r.parentNode;ja(o,r),n&&o.removeChild(r)}},e.finishBreak=function(t,e,u,n){var i=u||null!=e.viewNode&&1==e.viewNode.nodeType&&!e.after;return t.clearOverflownViewNodes(e,i),n&&(t.fixJustificationIfNeeded(e,!0),t.layoutContext.processFragmentedBlockEdge(i?e:e.parent)),Rn(!0)},t}(),as=function(){function t(t){this.parent=void 0,this.formattingContextType="Block",this.parent=t}var e=t.prototype;return e.getName=function(){return"Block formatting context (BlockFormattingContext)"},e.isFirstTime=function(t,e){return e},e.getParent=function(){return this.parent},e.saveState=function(){},e.restoreState=function(t){},t}(),ss=new os,ls=Ui.isInstanceOfBlockFormattingContext;p(e.HOOKS.RESOLVE_FORMATTING_CONTEXT,(function(t,e,u,n,i,r){var o=t.parent;return!o&&t.formattingContext||o&&t.formattingContext!==o.formattingContext?null:t.establishesBFC||!t.formattingContext&&ns(u,n,i,r)?new as(o?o.formattingContext:null):null})),p(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR,(function(t){return t instanceof as?ss:null}));var Ds=function(){function t(){this.initialBreakPositions=null,this.initialStateOfFormattingContext=null,this.initialPosition=void 0,this.initialFragmentLayoutConstraints=void 0}var e=t.prototype;return e.layout=function(t,e){return this.prepareLayout(t,e),this.tryLayout(t,e)},e.tryLayout=function(t,e){var u=this,n=Pn("AbstractLayoutRetryer.tryLayout");this.saveState(t,e);var i=this.resolveLayoutMode(t);return i.doLayout(t,e).then((function(r){var o=i.accept(r,e);(o=i.postLayout(r,u.initialPosition,e,o))?n.finish(r):(u.clearNodes(u.initialPosition),u.restoreState(t,e),u.tryLayout(u.initialPosition,e).thenFinish(n))})),n.result()},e.prepareLayout=function(t,e){},e.clearNodes=function(t){for(var e,u,n=t.viewNode||t.parent.viewNode;e=n.lastChild;)n.removeChild(e);for(;u=n.nextSibling;)u.parentNode.removeChild(u)},e.saveState=function(t,e){this.initialPosition=t.copy(),this.initialBreakPositions=[].concat(e.breakPositions),this.initialFragmentLayoutConstraints=[].concat(e.fragmentLayoutConstraints),t.formattingContext&&(this.initialStateOfFormattingContext=t.formattingContext.saveState())},e.restoreState=function(t,e){e.breakPositions=this.initialBreakPositions,e.fragmentLayoutConstraints=this.initialFragmentLayoutConstraints,t.formattingContext&&t.formattingContext.restoreState(this.initialStateOfFormattingContext)},t}(),hs=function(){function t(){}var e=t.prototype;return e.initialState=function(t){return{nodeContext:t,atUnforcedBreak:!1,break:!1}},e.startNonDisplayableNode=function(t){},e.afterNonDisplayableNode=function(t){},e.startIgnoredTextNode=function(t){},e.afterIgnoredTextNode=function(t){},e.startNonElementNode=function(t){},e.afterNonElementNode=function(t){},e.startInlineElementNode=function(t){},e.afterInlineElementNode=function(t){},e.startNonInlineElementNode=function(t){},e.afterNonInlineElementNode=function(t){},e.finish=function(t){},t}(),cs=function(){function t(t,e){this.strategy=void 0,this.layoutContext=void 0,this.strategy=t,this.layoutContext=e}return t.prototype.iterate=function(t){var e=this,u=this.strategy,n=u.initialState(t),i=Pn("LayoutIterator");return i.loopWithFrame((function(t){for(var i;n.nodeContext;){var r=((i=n.nodeContext.viewNode?1!==n.nodeContext.viewNode.nodeType?ur(n.nodeContext.viewNode,n.nodeContext.whitespace)?n.nodeContext.after?u.afterIgnoredTextNode(n):u.startIgnoredTextNode(n):n.nodeContext.after?u.afterNonElementNode(n):u.startNonElementNode(n):n.nodeContext.inline?n.nodeContext.after?u.afterInlineElementNode(n):u.startInlineElementNode(n):n.nodeContext.after?u.afterNonInlineElementNode(n):u.startNonInlineElementNode(n):n.nodeContext.after?u.afterNonDisplayableNode(n):u.startNonDisplayableNode(n))&&i.isPending()?i:Rn(!0)).thenAsync((function(){return n.break?Rn(null):e.layoutContext.nextInTree(n.nodeContext,n.atUnforcedBreak)}));if(r.isPending())return void r.then((function(e){n.break?t.breakLoop():(n.nodeContext=e,t.continueLoop())}));if(n.break)return void t.breakLoop();n.nodeContext=r.get()}u.finish(n),t.breakLoop()})).then((function(){i.finish(n.nodeContext)})),i.result()},t}(),ds=function(t){function e(e){var u;return(u=t.call(this)||this).leadingEdge=void 0,u.leadingEdge=e,u}T(e,t);var u=e.prototype;return u.startNonInlineBox=function(t){},u.endEmptyNonInlineBox=function(t){},u.endNonInlineBox=function(t){},u.initialState=function(t){return{nodeContext:t,atUnforcedBreak:!!this.leadingEdge&&t.after,break:!1,leadingEdge:this.leadingEdge,breakAtTheEdge:null,onStartEdges:!1,leadingEdgeContexts:[],lastAfterNodeContext:null}},u.processForcedBreak=function(t,e){var u=!t.leadingEdge&&Oa(t.breakAtTheEdge);if(u){var n=t.nodeContext=t.leadingEdgeContexts[0]||t.nodeContext;n.viewNode.parentNode.removeChild(n.viewNode),e.pageBreakType=t.breakAtTheEdge}return u},u.saveEdgeAndProcessOverflow=function(t,e){var u=e.checkOverflowAndSaveEdgeAndBreakPosition(t.lastAfterNodeContext,null,!0,t.breakAtTheEdge);return u&&(t.nodeContext=(t.lastAfterNodeContext||t.nodeContext).modify(),t.nodeContext.overflow=!0),u},u.processLayoutConstraint=function(t,e,u){var n=t.nodeContext,i=!e.allowLayout(n);return i&&(u.checkOverflowAndSaveEdgeAndBreakPosition(t.lastAfterNodeContext,null,!1,t.breakAtTheEdge),(n=t.nodeContext=n.modify()).overflow=!0),i},u.startNonElementNode=function(t){t.onStartEdges=!1},u.startNonInlineElementNode=function(t){return t.leadingEdgeContexts.push(t.nodeContext.copy()),t.breakAtTheEdge=Va(t.breakAtTheEdge,t.nodeContext.breakBefore),t.onStartEdges=!0,this.startNonInlineBox(t)},u.afterNonInlineElementNode=function(t){var e;return(t.onStartEdges?((e=this.endEmptyNonInlineBox(t))&&e.isPending()?e:Rn(!0)).thenAsync((function(){return t.break||(t.leadingEdgeContexts=[],t.leadingEdge=!1,t.atUnforcedBreak=!1,t.breakAtTheEdge=null),Rn(!0)})):(e=this.endNonInlineBox(t))&&e.isPending()?e:Rn(!0)).thenAsync((function(){return t.break||(t.onStartEdges=!1,t.lastAfterNodeContext=t.nodeContext.copy(),t.breakAtTheEdge=Va(t.breakAtTheEdge,t.nodeContext.breakAfter)),Rn(!0)}))},e}(hs),fs=[],ps=(new DOMParser).parseFromString('<root xmlns="'+X.SHADOW+'"/>',"text/xml"),Es=["footnote-marker","first-5-lines","first-4-lines","first-3-lines","first-2-lines","first-line","first-letter","before","","after"];function Cs(t){return t.getAttribute("data-adapt-pseudo")||""}function Fs(t,e){t.setAttribute("data-adapt-pseudo",e)}var As=function(){function t(t,e,u,n,i){this.element=void 0,this.style=void 0,this.styler=void 0,this.context=void 0,this.exprContentListener=void 0,this.contentProcessed={},this.element=t,this.style=e,this.styler=u,this.context=n,this.exprContentListener=i}var e=t.prototype;return e.getStyle=function(t,e){var u=Cs(t);this.styler&&u&&u.match(/after$/)&&(this.style=this.styler.getStyle(this.element,!0),this.styler=null);var n=zr(this.style,"_pseudos")[u]||{};if(u.match(/^first-/)&&!n["x-first-pseudo"]){var i,r=1;"first-letter"==u?r=0:null!=(i=u.match(/^first-([0-9]+)-lines$/))&&(r=i[1]-0),n["x-first-pseudo"]=new Lr(new We(r),0)}return n},e.processContent=function(t,e){var u=Cs(t);if(!this.contentProcessed[u]){this.contentProcessed[u]=!0;var n=e.content;n&&mr(n)&&n.visit(new vr(t,this.context,n,this.exprContentListener))}},t}(),gs=Mi.registerFragmentIndex,vs=function(){function t(t,e){this.sourceNode=void 0,this.styler=void 0,this.sourceNode=t,this.styler=e}var e=t.prototype;return e.createElement=function(t,e){var u=this,n=e.viewNode.ownerDocument.createElement("div"),i=new xs(t,n,e),r=i.getColumn().pageBreakType;return i.getColumn().pageBreakType=null,i.layout(this.createNodePositionForPseudoElement(),!0).thenAsync((function(){u.styler.contentProcessed["after-if-continues"]=!1,i.getColumn().pageBreakType=r;var t=n.firstChild;return et(t,"display","block"),Rn(t)}))},e.createNodePositionForPseudoElement=function(){var t=ps.createElementNS(X.XHTML,"div");Fs(t,"after-if-continues");var e=this.createShadowContext(t);return new Er({steps:[{node:t,shadowType:e.type,shadowContext:e,nodeShadow:null,shadowSibling:null}],offsetInNode:0,after:!1,preprocessedTextContent:null})},e.createShadowContext=function(t){return new cr(this.sourceNode,t,null,null,null,Xi.ShadowType.ROOTED,this.styler)},t}(),ms=function(){function t(t,e,u){this.nodeContext=void 0,this.afterIfContinues=void 0,this.pseudoElementHeight=void 0,this.flagmentLayoutConstraintType="AfterIfContinue",this.nodeContext=t,this.afterIfContinues=e,this.pseudoElementHeight=u}var e=t.prototype;return e.allowLayout=function(t,e,u){return!(e&&!t||t&&t.overflow)},e.nextCandidate=function(t){return!1},e.postLayout=function(t,e,u,n){},e.finishBreak=function(t,e){var u=this;return this.getRepetitiveElements().affectTo(t)?this.afterIfContinues.createElement(e,this.nodeContext).thenAsync((function(t){return u.nodeContext.viewNode.appendChild(t),Rn(!0)})):Rn(!0)},e.getRepetitiveElements=function(){return new Bs(this.nodeContext,this.pseudoElementHeight)},e.equalsTo=function(e){return e instanceof t&&this.afterIfContinues==e.afterIfContinues},e.getPriorityOfFinishBreak=function(){return 9},t}(),Bs=function(){function t(t,e){this.nodeContext=void 0,this.pseudoElementHeight=void 0,this.nodeContext=t,this.pseudoElementHeight=e}var e=t.prototype;return e.calculateOffset=function(t){return this.affectTo(t)?this.pseudoElementHeight:0},e.calculateMinimumOffset=function(t){return this.calculateOffset(t)},e.affectTo=function(t){if(!t)return!1;var e=t.shadowContext?t.shadowContext.owner:t.sourceNode;if(e===this.nodeContext.sourceNode)return!!t.after;for(var u=e.parentNode;u;u=u.parentNode)if(u===this.nodeContext.sourceNode)return!0;return!1},t}();function ws(t,e){if(!t||!t.afterIfContinues||t.after||e.isFloatNodeContext(t))return Rn(t);var u=t.afterIfContinues;return u.createElement(e,t).thenAsync((function(n){var i=function(t,e,u){var n=t.viewNode;n.appendChild(u);var i=Xa(u,e,t.vertical);return n.removeChild(u),i}(t,e,n);return e.fragmentLayoutConstraints.push(new ms(t,u,i)),Rn(t)}))}function ys(t,e){return t.thenAsync((function(t){return ws(t,e)}))}var Ns={img:!0,svg:!0,audio:!0,video:!0},bs=function(){function t(t){this.constraints=void 0,this.constraints=t}return t.prototype.allowLayout=function(t){return this.constraints.every((function(e){return e.allowLayout(t)}))},t}(),Ss=function(t){function e(e,u){var n;return(n=t.call(this)||this).checkPoints=void 0,n.penalty=void 0,n.alreadyEvaluated=!1,n.breakNodeContext=null,n.checkPoints=e,n.penalty=u,n}T(e,t);var u=e.prototype;return u.findAcceptableBreak=function(t,e){return e<this.getMinBreakPenalty()?null:(this.alreadyEvaluated||(this.breakNodeContext=t.findBoxBreakPosition(this,e>0),this.alreadyEvaluated=!0),this.breakNodeContext)},u.getMinBreakPenalty=function(){return this.penalty},u.getNodeContext=function(){return this.alreadyEvaluated?this.breakNodeContext:this.checkPoints[this.checkPoints.length-1]},e}(Qa),Ts=function(t){function u(e,u,n,i,r){var o;return(o=t.call(this,e)||this).layoutContext=void 0,o.clientLayout=void 0,o.layoutConstraint=void 0,o.pageFloatLayoutContext=void 0,o.last=void 0,o.viewDocument=void 0,o.flowRootFormattingContext=null,o.isFloat=!1,o.isFootnote=!1,o.startEdge=0,o.endEdge=0,o.beforeEdge=0,o.afterEdge=0,o.footnoteEdge=0,o.box=null,o.chunkPositions=null,o.bands=null,o.overflown=!1,o.breakPositions=null,o.pageBreakType=null,o.forceNonfitting=!0,o.leftFloatEdge=0,o.rightFloatEdge=0,o.bottommostFloatTop=0,o.stopAtOverflow=!0,o.lastAfterPosition=null,o.fragmentLayoutConstraints=[],o.pseudoParent=null,o.nodeContextOverflowingDueToRepetitiveElements=null,o.blockDistanceToBlockEndFloats=NaN,o.layoutContext=u,o.clientLayout=n,o.layoutConstraint=i,o.pageFloatLayoutContext=r,o.last=e.lastChild,o.viewDocument=e.ownerDocument,r.setContainer(O(o)),o}T(u,t);var n=u.prototype;return n.getTopEdge=function(){return this.vertical?this.startEdge:this.beforeEdge},n.getBottomEdge=function(){return this.vertical?this.endEdge:this.afterEdge},n.getLeftEdge=function(){return this.vertical?this.afterEdge:this.startEdge},n.getRightEdge=function(){return this.vertical?this.beforeEdge:this.endEdge},n.isFloatNodeContext=function(t){return!(!t.floatSide||this.isFloat&&!t.parent)},n.stopByOverflow=function(t){return this.stopAtOverflow&&!!t&&t.overflow},n.isOverflown=function(t){return this.vertical?t<this.footnoteEdge:t>this.footnoteEdge},n.getExclusions=function(){var t=this.pageFloatLayoutContext.getFloatFragmentExclusions();return this.exclusions.concat(t)},n.openAllViews=function(t){var e=this,u=Pn("openAllViews"),n=t.steps;this.layoutContext.setViewRoot(this.element,this.isFootnote);var i=n.length-1,r=null;return u.loop((function(){for(;i>=0&&(r=Dr(n[i],r),i!==n.length-1||r.formattingContext||(r.formattingContext=e.flowRootFormattingContext),0!=i||(r.offsetInNode=e.calculateOffsetInNodeForNodeContext(t),r.after=t.after,r.preprocessedTextContent=t.preprocessedTextContent,!r.after));){var u=e.layoutContext.setCurrent(r,0==i&&0==r.offsetInNode);if(i--,u.isPending())return u}return Rn(!1)})).then((function(){u.finish(r)})),u.result()},n.calculateOffsetInNodeForNodeContext=function(t){return t.preprocessedTextContent?Ki(t.preprocessedTextContent,t.offsetInNode,1):t.offsetInNode},n.maybePeelOff=function(t,e){if(t.firstPseudo&&t.inline&&!t.after&&0==t.firstPseudo.count&&1!=t.viewNode.nodeType){var u=t.viewNode.textContent,n=u.match(M),i=n?n[0].length:0;if(!n&&t.sourceNode instanceof Text&&t.sourceNode.nextSibling instanceof Text&&u===t.sourceNode.textContent){var r=u+t.sourceNode.nextSibling.textContent,o=r.match(M);if(o){var a=o[0];i=a.length,t.sourceNode.textContent=a,t.viewNode.textContent=a,t.sourceNode.nextSibling.textContent=r.substr(i)}}return this.layoutContext.peelOff(t,i)}return Rn(t)},n.buildViewToNextBlockEdge=function(t,e){var u=this,n=!1,i=Pn("buildViewToNextBlockEdge");return i.loopWithFrame((function(i){t.viewNode&&!$a(t)&&e.push(t.copy()),u.maybePeelOff(t,0).then((function(r){r!==t&&($a(t=r)||e.push(t.copy())),u.nextInTree(t).then((function(e){(t=e)?(!n&&u.layoutConstraint.allowLayout(t)||(n=!0,(t=t.modify()).overflow=!0),u.isFloatNodeContext(t)&&!u.vertical?u.layoutFloatOrFootnote(t).then((function(e){t=e,u.pageFloatLayoutContext.isInvalidated()&&(t=null),t?i.continueLoop():i.breakLoop()})):t.inline?i.continueLoop():i.breakLoop()):i.breakLoop()}))}))})).then((function(){i.finish(t)})),i.result()},n.nextInTree=function(t,e){return ys(this.layoutContext.nextInTree(t,e),this)},n.buildDeepElementView=function(t){var e=this;if(!t.viewNode)return Rn(t);var u=[],n=t.sourceNode,i=Pn("buildDeepElementView");return i.loopWithFrame((function(i){t.viewNode&&t.inline&&!$a(t)?u.push(t.copy()):(u.length>0&&e.postLayoutBlock(t,u),u=[]),e.maybePeelOff(t,0).then((function(r){var o=r;if(o!==t){for(var a=o;a&&a.sourceNode!=n;)a=a.parent;if(null==a)return t=o,void i.breakLoop();$a(o)||u.push(o.copy())}e.nextInTree(o).then((function(u){(t=u)&&t.sourceNode!=n?e.layoutConstraint.allowLayout(t)?i.continueLoop():((t=t.modify()).overflow=!0,e.stopAtOverflow?i.breakLoop():i.continueLoop()):i.breakLoop()}))}))})).then((function(){u.length>0&&e.postLayoutBlock(t,u),i.finish(t)})),i.result()},n.createFloat=function(t,e,u,n){var i=this.viewDocument.createElement("div");return this.vertical?(n>=this.height&&(n-=.1),et(i,"height",u+"px"),et(i,"width",n+"px")):(u>=this.width&&(u-=.1),et(i,"width",u+"px"),et(i,"height",n+"px")),et(i,"float",e),et(i,"clear",e),this.element.insertBefore(i,t),i},n.killFloats=function(){for(var t=this.element.firstChild;t;){var e=t.nextSibling;if(1==t.nodeType){var u=t,n=u.style.cssFloat;if("left"!=n&&"right"!=n)break;this.element.removeChild(u)}t=e}},n.createFloats=function(){for(var t,e=this.element.firstChild,u=this.bands,n=this.vertical?this.getTopEdge():this.getLeftEdge(),i=this.vertical?this.getBottomEdge():this.getRightEdge(),r=_(u);!(t=r()).done;){var o=t.value,a=o.y2-o.y1;o.left=this.createFloat(e,"left",o.x1-n,a),o.right=this.createFloat(e,"right",i-o.x2,a)}},n.calculateEdge=function(t,e,u,n){var i;if(t&&Wa(t.viewNode))return NaN;if(t&&t.after&&!t.inline&&(i=Ga(t,this.clientLayout,0,this.vertical),!isNaN(i)))return i;for(var r=n-(t=e[u]).boxOffset;;){if(i=Ga(t,this.clientLayout,r,this.vertical),!isNaN(i))return i;if(r>0)r--;else{if(--u<0)return this.beforeEdge;1!=(t=e[u]).viewNode.nodeType&&(r=t.viewNode.textContent.length)}}},n.parseComputedLength=function(t){if("number"==typeof t)return t;var e=t.match(/^(-?[0-9]*(\.[0-9]*)?)px$/);return e?parseFloat(e[0]):0},n.getComputedMargin=function(t){var e=this.clientLayout.getElementComputedStyle(t),u=new cu(0,0,0,0);return e&&(u.left=this.parseComputedLength(e.marginLeft),u.top=this.parseComputedLength(e.marginTop),u.right=this.parseComputedLength(e.marginRight),u.bottom=this.parseComputedLength(e.marginBottom)),u},n.getComputedPaddingBorder=function(t){var e=this.clientLayout.getElementComputedStyle(t),u=new cu(0,0,0,0);return e&&(u.left=this.parseComputedLength(e.borderLeftWidth)+this.parseComputedLength(e.paddingLeft),u.top=this.parseComputedLength(e.borderTopWidth)+this.parseComputedLength(e.paddingTop),u.right=this.parseComputedLength(e.borderRightWidth)+this.parseComputedLength(e.paddingRight),u.bottom=this.parseComputedLength(e.borderBottomWidth)+this.parseComputedLength(e.paddingBottom)),u},n.getComputedInsets=function(t){var e=this.clientLayout.getElementComputedStyle(t),u=new cu(0,0,0,0);if(e){if("border-box"==e.boxSizing)return this.getComputedMargin(t);u.left=this.parseComputedLength(e.marginLeft)+this.parseComputedLength(e.borderLeftWidth)+this.parseComputedLength(e.paddingLeft),u.top=this.parseComputedLength(e.marginTop)+this.parseComputedLength(e.borderTopWidth)+this.parseComputedLength(e.paddingTop),u.right=this.parseComputedLength(e.marginRight)+this.parseComputedLength(e.borderRightWidth)+this.parseComputedLength(e.paddingRight),u.bottom=this.parseComputedLength(e.marginBottom)+this.parseComputedLength(e.borderBottomWidth)+this.parseComputedLength(e.paddingBottom)}return u},n.setComputedInsets=function(t,e){var u=this.clientLayout.getElementComputedStyle(t);u&&(e.marginLeft=this.parseComputedLength(u.marginLeft),e.borderLeft=this.parseComputedLength(u.borderLeftWidth),e.paddingLeft=this.parseComputedLength(u.paddingLeft),e.marginTop=this.parseComputedLength(u.marginTop),e.borderTop=this.parseComputedLength(u.borderTopWidth),e.paddingTop=this.parseComputedLength(u.paddingTop),e.marginRight=this.parseComputedLength(u.marginRight),e.borderRight=this.parseComputedLength(u.borderRightWidth),e.paddingRight=this.parseComputedLength(u.paddingRight),e.marginBottom=this.parseComputedLength(u.marginBottom),e.borderBottom=this.parseComputedLength(u.borderBottomWidth),e.paddingBottom=this.parseComputedLength(u.paddingBottom))},n.setComputedWidthAndHeight=function(t,e){var u=this.clientLayout.getElementComputedStyle(t);u&&(e.width=this.parseComputedLength(u.width),e.height=this.parseComputedLength(u.height))},n.layoutUnbreakable=function(t){return this.buildDeepElementView(t)},n.layoutFloat=function(t){var e=this,u=Pn("layoutFloat"),n=t.viewNode,i=function(t,e,u){var n=e?"vertical-rl":"horizontal-tb";if("top"!==t&&"bottom"!==t||(t=Ca(t,n,u)),"block-start"===t&&(t="inline-start"),"block-end"===t&&(t="inline-end"),"inline-start"===t||"inline-end"===t){var i=function(t,e){var u=Aa[e];if(!u)throw new Error("unknown writing-mode: "+e);for(var n=0;n<u.length;n++)if(u[n].physical===t)return u[n].logical;return t}(pa(t,n,u),n);"line-left"===i?t="left":"line-right"===i&&(t="right")}return"left"!==t&&"right"!==t&&(c.warn("Invalid float value: "+t+". Fallback to left."),t="left"),t}(t.floatSide,t.vertical,t.direction);return et(n,"float","none"),et(n,"display","inline-block"),et(n,"vertical-align","top"),this.buildDeepElementView(t).then((function(r){for(var o=e.clientLayout.getElementClientRect(n),a=e.getComputedMargin(n),s=new Du(o.left-a.left,o.top-a.top,o.right+a.right,o.bottom+a.bottom),l=e.startEdge,D=e.endEdge,h=t.parent;h&&h.inline;)h=h.parent;if(h){var c=h.viewNode.ownerDocument.createElement("div");c.style.left="0px",c.style.top="0px",e.vertical?(c.style.bottom="0px",c.style.width="1px"):(c.style.right="0px",c.style.height="1px"),h.viewNode.appendChild(c);var d=e.clientLayout.getElementClientRect(c);l=Math.max(e.getStartEdge(d),l),D=Math.min(e.getEndEdge(d),D),h.viewNode.removeChild(c);var f=e.vertical?s.y2-s.y1:s.x2-s.x1;"left"==i?D=Math.max(D,l+f):l=Math.min(l,D-f),h.viewNode.appendChild(t.viewNode)}var p=new Du(l,e.getBoxDir()*e.beforeEdge,D,e.getBoxDir()*e.afterEdge),E=s;e.vertical&&(E=wu(s));var C=e.getBoxDir();if(E.y1<e.bottommostFloatTop*C){var F=E.y2-E.y1;E.y1=e.bottommostFloatTop*C,E.y2=E.y1+F}!function(t,e,u,n){for(var i=u.y1,r=u.x2-u.x1,o=u.y2-u.y1,a=Su(e,i);;){var s=i+o;if(s>t.y2)return!1;for(var l=t.x1,D=t.x2,h=a;h<e.length&&e[h].y1<s;h++){var c=e[h];c.x1>l&&(l=c.x1),c.x2<D&&(D=c.x2)}if(l+r<=D||a>=e.length)return"left"==n?(u.x1=l,u.x2=l+r):(u.x1=D-r,u.x2=D),u.y2+=i-u.y1,u.y1=i,!0;i=e[a].y2,a++}}(p,e.bands,E,i),e.vertical&&(s=yu(E));var A,g=e.getComputedInsets(n);et(n,"width",s.x2-s.x1-g.left-g.right+"px"),et(n,"height",s.y2-s.y1-g.top-g.bottom+"px"),et(n,"position","absolute"),et(n,"display",t.display);var v=null;if(h&&(v=h.containingBlockForAbsolute?h:h.getContainingBlockForAbsolute()),v){var m=v.viewNode.ownerDocument.createElement("div");m.style.position="absolute",v.vertical?m.style.right="0":m.style.left="0",m.style.top="0",v.viewNode.appendChild(m),A=e.clientLayout.getElementClientRect(m),v.viewNode.removeChild(m)}else A={left:e.getLeftEdge()-e.paddingLeft,right:e.getRightEdge()+e.paddingRight,top:e.getTopEdge()-e.paddingTop};(v?v.vertical:e.vertical)?et(n,"right",A.right-s.x2+"px"):et(n,"left",s.x1-A.left+"px"),et(n,"top",s.y1-A.top+"px"),t.clearSpacer&&(t.clearSpacer.parentNode.removeChild(t.clearSpacer),t.clearSpacer=null);var B=e.vertical?s.x1:s.y2,w=e.vertical?s.x2:s.y1;e.isOverflown(B)&&0!=e.breakPositions.length?((t=t.modify()).overflow=!0,u.finish(t)):(e.killFloats(),p=new Du(e.getLeftEdge(),e.getTopEdge(),e.getRightEdge(),e.getBottomEdge()),e.vertical&&(p=wu(p)),function(t,e,u,n,i){for(n||(n=[new fu(u.y1,u.y2,u.x1,u.x2)]);n.length>0&&n[0].y2<=t.y1;)n.shift();if(0!=n.length){var r;n[0].y1<t.y1&&(n[0].y1=t.y1);var o=0==e.length?t.y1:e[e.length-1].y2;o<t.y2&&e.push(new fu(o,t.y2,t.x1,t.x2));for(var a,s=Su(e,n[0].y1),l=_(n);!(a=l()).done;){var D=a.value;if(s==e.length)break;for(e[s].y1<D.y1&&(r=e[s],s++,e.splice(s,0,new fu(D.y1,r.y2,r.x1,r.x2)),r.y2=D.y1);s<e.length&&((r=e[s++]).y2>D.y2&&(e.splice(s,0,new fu(D.y2,r.y2,r.x1,r.x2)),r.y2=D.y2),D.x1!=D.x2&&("left"==i?r.x1=Math.min(D.x2,t.x2):r.x2=Math.max(D.x1,t.x1)),r.y2!=D.y2););}bu(t,e)}}(p,e.bands,E,null,i),e.createFloats(),"left"==i?e.leftFloatEdge=B:e.rightFloatEdge=B,e.bottommostFloatTop=w,e.updateMaxReachedAfterEdge(B),u.finish(r))})),u.result()},n.setupFloatArea=function(t,e,u,n,i,r){var o=this.pageFloatLayoutContext,a=o.getContainer(e),s=t.element;a.element.parentNode.appendChild(s),t.isFloat=!0,t.originX=a.originX,t.originY=a.originY,t.vertical=a.vertical,t.marginLeft=t.marginRight=t.marginTop=t.marginBottom=0,t.borderLeft=t.borderRight=t.borderTop=t.borderBottom=0,t.paddingLeft=t.paddingRight=t.paddingTop=t.paddingBottom=0,t.exclusions=(a.exclusions||[]).concat(),t.forceNonfitting=!o.hasFloatFragments(),t.innerShape=null;var l=a.getPaddingRect();t.setHorizontalPosition(l.x1-a.originX,l.x2-l.x1),t.setVerticalPosition(l.y1-a.originY,l.y2-l.y1),i.adjustPageFloatArea(t,a,this),t.init();var D=!!o.setFloatAreaDimensions(t,e,u,n,!0,!o.hasFloatFragments(),r);return D?(t.killFloats(),t.init()):a.element.parentNode.removeChild(s),D},n.createPageFloatArea=function(t,e,u,n,i){var r=this.element.ownerDocument.createElement("div");et(r,"position","absolute");var o=this.pageFloatLayoutContext.getPageFloatLayoutContext(t.floatReference),a=new ba(null,va.COLUMN,null,this.pageFloatLayoutContext.flowName,t.nodePosition,null,null),s=o.getContainer(),l=new Os(e,r,this.layoutContext.clone(),this.clientLayout,this.layoutConstraint,a,s);return a.setContainer(l),this.setupFloatArea(l,t.floatReference,e,u,n,i)?l:null},n.layoutSinglePageFloatFragment=function(t,e,u,n,i,r,o){var a=this.pageFloatLayoutContext,s=(t=(o?o.continuations:[]).concat(t))[0].float,l=a.getPageFloatPlacementCondition(s,e,u),D=this.createPageFloatArea(s,e,r,i,l),h={floatArea:D,pageFloatFragment:null,newPosition:null};if(!D)return Rn(h);var c=Pn("layoutSinglePageFloatFragment"),d=!1,f=0;return c.loopWithFrame((function(e){if(f>=t.length)e.breakLoop();else{var u=new Er(t[f].nodePosition);D.layout(u,!0).then((function(t){h.newPosition=t,!t||n?(f++,e.continueLoop()):(d=!0,e.breakLoop())}))}})).then((function(){if(!d){var u=a.setFloatAreaDimensions(D,s.floatReference,e,r,!1,n,l);if(u){var o=i.createPageFloatFragment(t,u,D,!!h.newPosition);a.addPageFloatFragment(o,!0),h.pageFloatFragment=o}else d=!0}c.finish(h)})),c.result()},n.layoutPageFloatInner=function(t,e,u,n){var i=this,r=this.pageFloatLayoutContext,o=t.float;function a(e,u){u?r.removePageFloatFragment(u,!0):e&&e.element.parentNode.removeChild(e.element),r.restoreStashedFragments(o.floatReference),r.deferPageFloat(t)}r.stashEndFloatFragments(o);var s=Pn("layoutPageFloatInner");return this.layoutSinglePageFloatFragment([t],o.floatSide,o.clearSide,!r.hasFloatFragments(),e,u,n).then((function(t){var e=t.floatArea,u=t.pageFloatFragment,l=t.newPosition;u?i.layoutStashedPageFloats(o.floatReference,[n]).then((function(t){if(t){if(r.addPageFloatFragment(u),r.discardStashedFragments(o.floatReference),l){var n=new Na(o,l.primary);r.deferPageFloat(n)}s.finish(!0)}else a(e,u),s.finish(!1)})):(a(e,u),s.finish(!1))})),s.result()},n.layoutStashedPageFloats=function(t,e){var u=this,n=this.pageFloatLayoutContext,i=n.getStashedFloatFragments(t),r=[],o=[],a=!1,s=Pn("layoutStashedPageFloats"),l=0;return s.loopWithFrame((function(t){if(l>=i.length)t.breakLoop();else{var n=i[l];if(e.includes(n))return l++,void t.continueLoop();var s=(new Ta).findByFloat(n.continuations[0].float);u.layoutSinglePageFloatFragment(n.continuations,n.floatSide,null,!1,s,null).then((function(e){var u=e.floatArea;u&&r.push(u);var n=e.pageFloatFragment;n?(o.push(n),l++,t.continueLoop()):(a=!0,t.breakLoop())}))}})).then((function(){a?(o.forEach((function(t){n.removePageFloatFragment(t,!0)})),r.forEach((function(t){var e=t.element;e&&e.parentNode&&e.parentNode.removeChild(e)}))):i.forEach((function(t){var e=t.area.element;e&&e.parentNode&&e.parentNode.removeChild(e)})),s.finish(!a)})),s.result()},n.setFloatAnchorViewNode=function(t){var e=t.viewNode.parentNode,u=e.ownerDocument.createElement("span");u.setAttribute("data-adapt-spec","1"),"footnote"===t.floatSide&&this.layoutContext.applyPseudoelementStyle(t,"footnote-call",u),e.appendChild(u),e.removeChild(t.viewNode);var n=t.modify();return n.after=!0,n.viewNode=u,n},n.resolveFloatReferenceFromColumnSpan=function(t,e,u){var n=this,i=Pn("resolveFloatReferenceFromColumnSpan"),r=this.pageFloatLayoutContext,o=r.getPageFloatLayoutContext(va.REGION);return r.getContainer().width<o.getContainer().width&&t===va.COLUMN?e===uu.auto?this.buildDeepElementView(u.copy()).then((function(e){var u=e.viewNode,r=ga(n.clientLayout,u,[Fa.MIN_CONTENT_INLINE_SIZE])[Fa.MIN_CONTENT_INLINE_SIZE],o=n.getComputedMargin(u);i.finish((r+=n.vertical?o.top+o.bottom:o.left+o.right)>n.width?va.REGION:t)})):i.finish(e===uu.all?va.REGION:t):i.finish(t),i.result()},n.layoutPageFloat=function(t){var e=this,u=this.pageFloatLayoutContext,n=(new Ta).findByNodeContext(t),i=u.findPageFloatByNodePosition(t.toNodePosition());return(i?Rn(i):n.createPageFloat(t,u,this)).thenAsync((function(i){var r=lr(t,0),o=e.setFloatAnchorViewNode(t),a=n.findPageFloatFragment(i,u),s=new Na(i,r);if(a&&a.hasFloat(i))return u.registerPageFloatAnchor(i,o.viewNode),Rn(o);if(u.isForbidden(i)||u.hasPrecedingFloatsDeferredToNext(i))return u.deferPageFloat(s),u.registerPageFloatAnchor(i,o.viewNode),Rn(o);if(e.nodeContextOverflowingDueToRepetitiveElements)return Rn(null);var l=Ga(o,e.clientLayout,0,e.vertical);return e.isOverflown(l)?Rn(o):e.layoutPageFloatInner(s,n,l,a).thenAsync((function(t){return t?Rn(null):(u.registerPageFloatAnchor(i,o.viewNode),Rn(o))}))}))},n.createJustificationAdjustmentElement=function(t,e,u,n){var i=e.createElement("span");i.style.visibility="hidden",i.style.verticalAlign="top",i.setAttribute("data-adapt-spec","1");var r=e.createElement("span");r.style.fontSize="0",r.style.lineHeight="0",r.textContent=" #",i.appendChild(r),i.style.display="block",i.style.textIndent="0",i.style.textAlign="left",u.insertBefore(i,t);var o=this.clientLayout.getElementClientRect(r);i.style.textAlign="right";var a=this.clientLayout.getElementClientRect(r);i.style.textAlign="",i.style.display=function(t){if(null===Ft){var e=t.ownerDocument,u=e.createElement("div");u.style.position="absolute",u.style.top="0px",u.style.left="0px",u.style.width="30px",u.style.height="100px",u.style.lineHeight="16px",u.style.fontSize="16px",u.style.textAlign="justify",t.appendChild(u);var n=e.createTextNode("a | ");u.appendChild(n);var i=e.createElement("span");i.style.display="inline-block",i.style.width="30px",u.appendChild(i);var r=e.createRange();r.setStart(n,0),r.setEnd(n,3);var o=r.getBoundingClientRect();Ft=o.right<27,t.removeChild(u)}return Ft}(document.body)?"inline":"inline-block";var s=n?a.top-o.top:a.left-o.left,l=s>=1?s-1+"px":"100%";return n?i.style.paddingTop=l:i.style.paddingLeft=l,i},n.addAndAdjustJustificationElement=function(t,e,u,n,i,r){return function(t,e,u,n){if(function(t){if(null===At){var e=t.ownerDocument,u=e.createElement("div");u.style.position="absolute",u.style.top="0px",u.style.left="0px",u.style.width="40px",u.style.height="100px",u.style.lineHeight="16px",u.style.fontSize="16px",u.style.textAlign="justify",t.appendChild(u);var n=e.createTextNode("a a-");u.appendChild(n);var i=e.createElement("span");i.style.display="inline-block",i.style.width="40px",u.appendChild(i);var r=e.createRange();r.setStart(n,2),r.setEnd(n,4);var o=r.getBoundingClientRect();At=o.right<37,t.removeChild(u)}return At}(document.body)){var i=Ps(t),r=e?u:u.previousSibling,o=r?r.textContent:"";if(o.charAt(o.length-1)===i){var a=u.ownerDocument,s=u.parentNode;!function(t){if(null===gt){var e=t.ownerDocument,u=e.createElement("div");u.style.position="absolute",u.style.top="0px",u.style.left="0px",u.style.width="40px",u.style.height="100px",u.style.lineHeight="16px",u.style.fontSize="16px",u.style.textAlign="justify",t.appendChild(u);var n=e.createTextNode("a a-");u.appendChild(n),u.appendChild(e.createElement("wbr"));var i=e.createElement("span");i.style.display="inline-block",i.style.width="40px",u.appendChild(i);var r=e.createRange();r.setStart(n,2),r.setEnd(n,4);var o=r.getBoundingClientRect();gt=o.right<37,t.removeChild(u)}return gt}(document.body)?s.insertBefore(a.createElement("wbr"),n):s.insertBefore(a.createTextNode(" "),n)}}}(t,e,u,n),this.createJustificationAdjustmentElement(n,i,r,t.vertical)},n.compensateJustificationLineHeight=function(t,e,u){var n=this.clientLayout.getElementClientRect(t),i=this.clientLayout.getElementClientRect(e);u.vertical?(e.style.marginRight=i.right-n.right+"px",e.style.width="0px"):(e.style.marginTop=n.top-i.top+"px",e.style.height="0px"),e.setAttribute("data-adapt-spec","1")},n.fixJustificationIfNeeded=function(t,e){var u;if(!t.after||t.inline){if(e){var n,i=null==(n=t.parent)?void 0:n.viewNode;if("justify"!==(i&&this.clientLayout.getElementComputedStyle(i).textAlign))return}var r=t.viewNode;"viv-ts-inner"===(null==(u=r.parentElement)?void 0:u.localName)&&(r=r.parentElement.parentElement);var o=r.ownerDocument,a=e&&(t.after||1!=r.nodeType),s=a?r.nextSibling:r;s&&!s.parentNode&&(s=null);var l=r.parentNode||t.parent&&t.parent.viewNode;if(l){var D=this.addAndAdjustJustificationElement(t,a,r,s,o,l);if(!e){var h=o.createElement("div");l.insertBefore(h,s),this.compensateJustificationLineHeight(D,h,t)}}}},n.processLineStyling=function(t,e,u){var n=this,i=Pn("processLineStyling"),r=u.concat([]);u.splice(0,u.length);var o=0,a=t.firstPseudo;return 0==a.count&&(a=a.outer),i.loopWithFrame((function(u){if(a){var i=n.findLinePositions(r),s=a.count-o;if(i.length<=s)u.breakLoop();else{var l=n.findAcceptableBreakInside(r,i[s-1],!0);null!=l?n.finishBreak(l,!1,!1).then((function(){o+=s,n.layoutContext.peelOff(l,0).then((function(i){n.fixJustificationIfNeeded(t=i,!1),a=t.firstPseudo,n.buildViewToNextBlockEdge(t,r=[]).then((function(t){e=t,u.continueLoop()}))}))})):u.breakLoop()}}else u.breakLoop()})).then((function(){Array.prototype.push.apply(u,r),i.finish(e)})),i.result()},n.isLoneImage=function(t){return!(2!=t.length&&this.breakPositions.length>0)&&t[0].sourceNode==t[1].sourceNode&&Ns[t[0].sourceNode.localName]},n.getTrailingMarginEdgeAdjustment=function(t){for(var e=0,u=0,n=t.length-1;n>=0;n--){var i=t[n];if(!i.after||!i.viewNode||1!=i.viewNode.nodeType)break;var r=this.getComputedMargin(i.viewNode),o=this.vertical?-r.left:r.bottom;o>0?e=Math.max(e,o):u=Math.min(u,o)}return e-u},n.layoutBreakableBlock=function(t){var e=this,u=Pn("layoutBreakableBlock"),n=[];return this.buildViewToNextBlockEdge(t,n).then((function(i){var r=n.length-1;if(r<0)u.finish(i);else{var o=e.calculateEdge(i,n,r,n[r].boxOffset),a=!1;if(!i||!Wa(i.viewNode)){var s=Za(i,e.collectElementsOffset());a=e.isOverflown(o+(e.vertical?-1:1)*s.minimum),e.isOverflown(o+(e.vertical?-1:1)*s.current)&&!e.nodeContextOverflowingDueToRepetitiveElements&&(e.nodeContextOverflowingDueToRepetitiveElements=i)}null==i&&(o+=e.getTrailingMarginEdgeAdjustment(n)),e.updateMaxReachedAfterEdge(o),(t.firstPseudo?e.processLineStyling(t,i,n):Rn(i)).then((function(t){e.postLayoutBlock(t,n),n.length>0&&(e.saveBoxBreakPosition(n),a&&!e.isLoneImage(n)&&t&&((t=t.modify()).overflow=!0)),u.finish(t)}))}})),u.result()},n.postLayoutBlock=function(t,u){var n=this;C(e.HOOKS.POST_LAYOUT_BLOCK).forEach((function(e){e(t,u,n)}))},n.findEndOfLine=function(t,e,u){for(var n,i=this.vertical?t-1:t+1,r=0,o=e[0].boxOffset,a=r,s=e.length-1,l=e[s].boxOffset;o<l;){n=o+Math.ceil((l-o)/2),a=r;for(var D=s;a<D;){var h=a+Math.ceil((D-a)/2);e[h].boxOffset>n?D=h-1:a=h}var c=this.calculateEdge(null,e,a,n);if(this.vertical?c<=i:c>=i){for(l=n-1;e[a].boxOffset==n;)a--;s=a}else u&&this.updateMaxReachedAfterEdge(c),o=n,r=a}return{nodeContext:e[a],index:o,checkPointIndex:a}},n.findAcceptableBreakInside=function(t,e,u){var n,i=this.findEndOfLine(e,t,!0),r=i.nodeContext,o=r.viewNode;if(1!=o.nodeType&&"viv-ts-inner"!==(null==(n=o.parentElement)?void 0:n.localName)){var a=o;r=this.resolveTextNodeBreaker(r).breakTextNode(a,r,i.index,t,i.checkPointIndex,u)}return this.clearOverflownViewNodes(r,!1),r},n.resolveTextNodeBreaker=function(t){return C(e.HOOKS.RESOLVE_TEXT_NODE_BREAKER).reduce((function(e,u){return u(t)||e}),Is.instance)},n.getRangeBoxes=function(t,e){for(var u=[],n=t.ownerDocument.createRange(),i=!1,r=t,o=null,a=!1,s=!0;s;){var l=!0;do{var D=null;r==e&&(s=1===e.nodeType&&!(!e.firstChild||i)),1!=r.nodeType?(a||(null==r.parentNode?s=!1:(n.setStartBefore(r),a=!0)),o=r):i?i=!1:Ka(r)?l=!a:/^r(uby|[bt]c?)$/.test(r.localName)||qa(this.clientLayout.getElementComputedStyle(r).display)?((l=!a)&&(n.setStartBefore(r),a=!0,o=r),r.contains(e)&&(s=!1)):D=r.firstChild,D||(D=r.nextSibling)||(i=!0,D=r.parentNode),r=D}while(l&&s);if(a){n.setEndAfter(o);for(var h=this.clientLayout.getRangeClientRects(n),c=0;c<h.length;c++)u.push(h[c]);a=!1}}return u},n.findLinePositions=function(t){var e=[],u=this.getRangeBoxes(t[0].viewNode,t[t.length-1].viewNode);u.sort(this.vertical?or:rr);for(var n=0,i=0,r=0,o=0,a=0,s=this.getBoxDir();;){if(a<u.length){var l=u[a],D=1;if(o>0){var h=Math.max(this.getBoxSize(l),1);D=s*this.getBeforeEdge(l)<s*n?s*(this.getAfterEdge(l)-n)/h:s*this.getAfterEdge(l)>s*i?s*(i-this.getBeforeEdge(l))/h:1}if(0==o||D>=.6||D>=.2&&this.getStartEdge(l)>=r-1){r=this.getEndEdge(l),this.vertical?(n=0==o?l.right:Math.max(n,l.right),i=0==o?l.left:Math.min(i,l.left)):(n=0==o?l.top:Math.min(n,l.top),i=0==o?l.bottom:Math.max(i,l.bottom)),o++,a++;continue}}if(o>0&&(e.push(i),o=0),a>=u.length)break}return e.sort(dt),this.vertical&&e.reverse(),e},n.calculateClonedPaddingBorder=function(t){var e=this,u=0;return t.walkUpBlocks((function(t){if("clone"===t.inheritedProps["box-decoration-break"]){var n=e.getComputedPaddingBorder(t.viewNode);u+=t.vertical?-n.left:n.bottom,"table"===t.display&&(u+=t.blockBorderSpacing)}})),u},n.getOffsetByRepetitiveElements=function(t){return(t?t.calculateOffset(this):Za(null,this.collectElementsOffset())).current},n.findBoxBreakPosition=function(t,e){var u=this,n=this.element.parentNode,i=this.element.nextSibling;n.removeChild(this.element),n.insertBefore(this.element,i);for(var r,o,a=t.checkPoints,s=a[0];s.parent&&s.inline;)s=s.parent;e?(r=1,o=1):(r=Math.max((s.inheritedProps.widows||2)-0,1),o=Math.max((s.inheritedProps.orphans||2)-0,1));var l=this.calculateClonedPaddingBorder(s),D=this.findLinePositions(a),h=this.footnoteEdge-l,c=this.getBoxDir(),d=this.getOffsetByRepetitiveElements(t);h-=c*d;var f=this.findFirstOverflowingEdgeAndCheckPoint(a);isNaN(f.edge)&&(f.edge=1/0*c);var p,E=ct(D.length,(function(t){var e=D[t];return u.vertical?e<h||e<=f.edge:e>h||e>=f.edge})),C=E<=0;if(C&&(E=ct(D.length,(function(t){return u.vertical?D[t]<h:D[t]>h}))),(E=Math.min(D.length-r,E))<o)return null;if(h=D[E-1],p=C?f.checkPoint:this.findAcceptableBreakInside(t.checkPoints,h,e)){var F=this.getAfterEdgeOfBlockContainer(p);!isNaN(F)&&F<h&&(h=F),this.computedBlockSize=c*(h-this.beforeEdge)+d}return p},n.getAfterEdgeOfBlockContainer=function(t){var e=t;do{e=e.parent}while(e&&e.inline);return e?((e=e.copy().modify()).after=!0,Ga(e,this.clientLayout,0,this.vertical)):NaN},n.findFirstOverflowingEdgeAndCheckPoint=function(t){var e=t.findIndex((function(t){return t.overflow}));if(e<0)return{edge:NaN,checkPoint:null};var u=t[e];return{edge:this.calculateEdge(null,t,e,u.boxOffset),checkPoint:u}},n.findEdgeBreakPosition=function(t){return this.computedBlockSize=t.computedBlockSize+this.getOffsetByRepetitiveElements(t),t.position},n.finishBreak=function(t,e,u){var n=(new rs).find(t.formattingContext).finishBreak(this,t,e,u);return n||(n=ss.finishBreak(this,t,e,u)),n},n.findAcceptableBreakPosition=function(){var t=null,e=null,u=0,n=0;do{u=n,n=Number.MAX_VALUE;for(var i=this.breakPositions.length-1;i>=0&&!e;--i){e=(t=this.breakPositions[i]).findAcceptableBreak(this,u);var r=t.getMinBreakPenalty();r>u&&(n=Math.min(n,r))}}while(n>u&&!e&&this.forceNonfitting);return{breakPosition:e?t:null,nodeContext:e}},n.doFinishBreak=function(t,e,u,n){var i=this;if(this.pageFloatLayoutContext.isInvalidated()||this.pageBreakType||!e)return Rn(t);var r=Pn("doFinishBreak"),o=!1;if(!t){if(this.forceNonfitting)return c.warn("Could not find any page breaks?!!"),this.skipTailEdges(e).then((function(t){t?((t=t.modify()).overflow=!1,i.finishBreak(t,o,!0).then((function(){r.finish(t)}))):r.finish(t)})),r.result();t=u,o=!0,this.computedBlockSize=n}return this.finishBreak(t,o,!0).then((function(){r.finish(t)})),r.result()},n.isBreakable=function(t){return!!t.after||t.sourceNode.namespaceURI!==X.SVG&&!t.flexContainer},n.zeroIndent=function(t){var e=t.toString();return""==e||"auto"==e||!!e.match(/^0+(.0*)?[^0-9]/)},n.checkOverflowAndSaveEdge=function(t,e){if(!t)return!1;if(Wa(t.viewNode))return!1;var u=Ga(t,this.clientLayout,0,this.vertical),n=Za(t,this.collectElementsOffset()),i=this.isOverflown(u+(this.vertical?-1:1)*n.minimum);if(this.isOverflown(u+(this.vertical?-1:1)*n.current)&&!this.nodeContextOverflowingDueToRepetitiveElements)this.nodeContextOverflowingDueToRepetitiveElements=t;else if(e){var r=u+this.getTrailingMarginEdgeAdjustment(e),o=this.footnoteEdge-this.getBoxDir()*n.current;u=this.vertical?Math.min(u,Math.max(r,o)):Math.max(u,Math.min(r,o))}return this.updateMaxReachedAfterEdge(u),i},n.checkOverflowAndSaveEdgeAndBreakPosition=function(t,e,u,n){if(!t)return!1;if(Wa(t.viewNode))return!1;var i=this.checkOverflowAndSaveEdge(t,e);return!u&&i||this.saveEdgeBreakPosition(t,n,i),i},n.applyClearance=function(t){if(!t.viewNode.parentNode)return!1;var e=this.getComputedMargin(t.viewNode),u=t.viewNode.ownerDocument.createElement("div");this.vertical?(u.style.bottom="0px",u.style.width="1px",u.style.marginRight=e.right+"px"):(u.style.right="0px",u.style.height="1px",u.style.marginTop=e.top+"px"),t.viewNode.parentNode.insertBefore(u,t.viewNode);var n=this.clientLayout.getElementClientRect(u),i=this.getBeforeEdge(n),r=this.getBoxDir(),o=t.clearSide,a=1/0*-this.getBoxDir();switch("all"===o&&(a=this.pageFloatLayoutContext.getPageFloatClearEdge(o,this)),o){case"left":a=r*Math.max(a*r,this.leftFloatEdge*r);break;case"right":a=r*Math.max(a*r,this.rightFloatEdge*r);break;default:a=r*Math.max(a*r,Math.max(this.rightFloatEdge*r,this.leftFloatEdge*r))}if(i*r>=a*r)return t.viewNode.parentNode.removeChild(u),!1;var s=Math.max(1,(a-i)*r);this.vertical?u.style.width=s+"px":u.style.height=s+"px",n=this.clientLayout.getElementClientRect(u);var l=this.getAfterEdge(n);if(this.vertical){var D=l+e.right-a;D>0==e.right>=0&&(D+=e.right),u.style.marginLeft=D+"px"}else{var h=a-(l+e.top);h>0==e.top>=0&&(h+=e.top),u.style.marginBottom=h+"px"}return t.clearSpacer=u,!0},n.isBFC=function(t){return!!ls(t)||!!zi.isInstanceOfRepetitiveElementsOwnerFormattingContext(t)},n.skipEdges=function(t,e,u){var n,i=this,r=t.after?null==(n=t.parent)?void 0:n.formattingContext:t.formattingContext;if(r&&!this.isBFC(r))return Rn(t);var o=Pn("skipEdges"),a=!u&&e&&t&&t.after,s=u,l=null,D=[],h=[],c=!1;function d(){return!!u||!e&&Oa(s)}var f=function(){(t=D[0]||t).viewNode.parentNode.removeChild(t.viewNode),i.pageBreakType=s};return o.loopWithFrame((function(u){for(;t;){var n=(new rs).find(t.formattingContext);do{if(!t.viewNode)break;if(t.inline&&1!=t.viewNode.nodeType){if(ur(t.viewNode,t.whitespace))break;if(!t.after)return d()?f():i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,s)?(t=(i.stopAtOverflow&&l||t).modify()).overflow=!0:(t=t.modify()).breakBefore=s,void u.breakLoop()}if(!t.after){if(n&&n.startNonInlineElementNode(t))break;if(t.clearSide&&i.applyClearance(t)&&e&&0===i.breakPositions.length&&i.saveEdgeBreakPosition(t.copy(),s,!1),!i.isBFC(t.formattingContext)||zi.isInstanceOfRepetitiveElementsOwnerFormattingContext(t.formattingContext)||i.isFloatNodeContext(t)||t.flexContainer)return D.push(t.copy()),s=Va(s,t.breakBefore),d()?f():!i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,s)&&i.layoutConstraint.allowLayout(t)||((t=(i.stopAtOverflow&&l||t).modify()).overflow=!0),void u.breakLoop()}if(1!=t.viewNode.nodeType)break;var r=t.viewNode.style;if(t.after){var o=t.sourceNode;if("svg"===o.localName||"math"===o.localName||"true"===o.getAttribute("data-math-typeset")){c=!1,l=t.copy(),h.push(l),s=Va(null,t.breakAfter),i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!i.stopAtOverflow,s);break}if(t.inline)break;if(n&&n.afterNonInlineElementNode(t,i.stopAtOverflow))break;if(c){if(d())return f(),void u.breakLoop();D=[],e=!1,a=!1,s=null}c=!1,l=t.copy(),h.push(l),s=Va(s,t.breakAfter),!r||i.zeroIndent(r.paddingBottom)&&i.zeroIndent(r.borderBottomWidth)||(h=[l])}else{var p;if(D.push(t.copy()),s=Va(s,t.breakBefore),!(t.pageType==(null==(p=t.parent)?void 0:p.pageType)&&Oa(s)||i.layoutConstraint.allowLayout(t))&&(i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!i.stopAtOverflow,s),(t=t.modify()).overflow=!0,i.stopAtOverflow))return void u.breakLoop();if(Ns[t.viewNode.localName])return d()?f():i.checkOverflowAndSaveEdgeAndBreakPosition(l,null,!0,s)&&((t=(i.stopAtOverflow&&l||t).modify()).overflow=!0),void u.breakLoop();!r||i.zeroIndent(r.paddingTop)&&i.zeroIndent(r.borderTopWidth)||(a=!1,h=[]),c=!0}}while(0);var E=i.nextInTree(t,a);if(E.isPending())return void E.then((function(e){t=e,u.continueLoop()}));t=E.get()}i.checkOverflowAndSaveEdgeAndBreakPosition(l,h,!i.stopAtOverflow,s)?l&&i.stopAtOverflow&&((t=l.modify()).overflow=!0):Oa(s)&&(i.pageBreakType=s),u.breakLoop()})).then((function(){l&&(i.lastAfterPosition=l.toNodePosition()),o.finish(t)})),o.result()},n.skipTailEdges=function(t){var e=this,u=t.copy(),n=Pn("skipEdges"),i=null,r=!1;return n.loopWithFrame((function(n){for(;t;){do{if(!t.viewNode)break;if(t.inline&&1!=t.viewNode.nodeType){if(ur(t.viewNode,t.whitespace))break;if(!t.after)return Oa(i)&&(e.pageBreakType=i),void n.breakLoop()}if(!t.after&&(e.isFloatNodeContext(t)||t.flexContainer))return Oa(i=Va(i,t.breakBefore))&&(e.pageBreakType=i),void n.breakLoop();if(1!=t.viewNode.nodeType)break;var o=t.viewNode.style;if(t.after){if(r){if(Oa(i))return e.pageBreakType=i,void n.breakLoop();i=null}r=!1,i=Va(i,t.breakAfter)}else{if(i=Va(i,t.breakBefore),Ns[t.viewNode.localName])return Oa(i)&&(e.pageBreakType=i),void n.breakLoop();if(o&&(!e.zeroIndent(o.paddingTop)||!e.zeroIndent(o.borderTopWidth)))return void n.breakLoop()}r=!0}while(0);var a=e.layoutContext.nextInTree(t);if(a.isPending())return void a.then((function(e){t=e,n.continueLoop()}));t=a.get()}u=null,n.breakLoop()})).then((function(){n.finish(u)})),n.result()},n.layoutFloatOrFootnote=function(t){return ma(t.floatReference)||"footnote"===t.floatSide?this.layoutPageFloat(t):this.layoutFloat(t)},n.layoutNext=function(t,e,u){var n=this,i=Pn("layoutNext");return this.skipEdges(t,e,u||null).then((function(u){if(!(t=u)||n.pageBreakType||n.stopByOverflow(t))i.finish(t);else{var r=t.formattingContext;(new rs).find(r).layout(t,n,e).thenFinish(i)}})),i.result()},n.clearOverflownViewNodes=function(t,e){if(t)for(var u=t.parent;t;t=u,u=u?u.parent:null){var n=(u||t).formattingContext;(new rs).find(n).clearOverflownViewNodes(this,u,t,e),e=!1}},n.initGeom=function(){var t=this.element.ownerDocument.createElement("div");t.style.position="absolute",t.style.top=this.paddingTop+"px",t.style.right=this.paddingRight+"px",t.style.bottom=this.paddingBottom+"px",t.style.left=this.paddingLeft+"px",this.element.appendChild(t);var e=this.clientLayout.getElementClientRect(t);this.element.removeChild(t);var u=this.originX+this.left+this.getInsetLeft(),n=this.originY+this.top+this.getInsetTop();this.box=new Du(u,n,u+this.width,n+this.height),this.startEdge=e?this.vertical?e.top:e.left:0,this.endEdge=e?this.vertical?e.bottom:e.right:0,this.beforeEdge=e?this.vertical?e.right:e.top:0,this.afterEdge=e?this.vertical?e.left:e.bottom:0,this.leftFloatEdge=this.beforeEdge,this.rightFloatEdge=this.beforeEdge,this.bottommostFloatTop=this.beforeEdge,this.footnoteEdge=this.afterEdge,this.bands=function(t,e,u,n,i,r){r&&(t=wu(t),e=e.map((function(t){return Nu(t)})),u=u.map((function(t){return Nu(t)})));var o,a,s,l=e.length,D=u?u.length:0,h=[],c=[];for(o=0;o<l;o++)e[o].addSegments(c,o);for(o=0;o<D;o++)u[o].addSegments(c,o+l);var d=c.length;c.sort(pu);for(var f=0;c[f].shapeId>=l;)f++;var p=c[f].low.y;p>t.y1&&h.push(new fu(t.y1,p,t.x2,t.x2));for(var E,C,F=0,A=[];F<d&&(s=c[F]).low.y<p;)s.high.y>p&&A.push(s),F++;for(;F<d||A.length>0;){var g=t.y2,v=Math.min((E=Math.ceil(p+8),(C=i)?Math.ceil(E/C)*C:E),t.y2);for(a=0;a<A.length&&g>v;a++)(s=A[a]).low.x==s.high.x?s.high.y<g&&(g=Math.max(Bu(s.high.y,i),v)):s.low.x!=s.high.x&&(g=v);for(g>t.y2&&(g=t.y2);F<d&&(s=c[F]).low.y<g;)if(s.high.y<p)F++;else{if(!(s.low.y<v)){var m=Bu(s.low.y,i);m<g&&(g=m);break}s.low.y==s.high.y&&s.low.y==p||(A.push(s),g=v),F++}var B=[];for(a=0;a<A.length;a++)vu(B,A[a],p,g);B.sort((function(t,e){return t.x-e.x||t.lowOrHigh-e.lowOrHigh}));var w=mu(B,l,D);if(0==w.length)h.push(new fu(p,g,t.x2,t.x2));else{var y=0,N=t.x1;for(a=0;a<w.length;a+=2){var b=Math.max(t.x1,w[a]),S=Math.min(t.x2,w[a+1])-b;S>y&&(y=S,N=b)}h.push(0==y?new fu(p,g,t.x2,t.x2):new fu(p,g,Math.max(N,t.x1),Math.min(N+y,t.x2)))}if(g==t.y2)break;for(p=g,a=A.length-1;a>=0;a--)A[a].high.y<=g&&A.splice(a,1)}return bu(t,h),h}(this.box,[this.getInnerShape()],this.getExclusions(),0,this.snapHeight,this.vertical),this.createFloats()},n.init=function(){this.chunkPositions=[],et(this.element,"width",this.width+"px"),et(this.element,"height",this.height+"px"),this.initGeom(),this.computedBlockSize=0,this.overflown=!1,this.pageBreakType=null,this.lastAfterPosition=null},n.saveEdgeBreakPosition=function(t,e,u){var n=t.copy(),i=(new rs).find(t.formattingContext),r=this.calculateClonedPaddingBorder(n),o=i.createEdgeBreakPosition(n,e,u,this.computedBlockSize+r);this.breakPositions.push(o)},n.saveBoxBreakPosition=function(t){var e=t[0].breakPenalty;if(e){for(var u=t[0];u.parent&&u.inline;)u=u.parent;e=u.breakPenalty}var n=new Ss(t,e);this.breakPositions.push(n)},n.updateMaxReachedAfterEdge=function(t){if(!isNaN(t)){var e=this.getBoxDir()*(t-this.beforeEdge);this.computedBlockSize=Math.max(e,this.computedBlockSize)}},n.layout=function(t,e,u){var n=this;if(this.chunkPositions.push(t),t.primary.after&&(this.lastAfterPosition=t.primary),this.stopAtOverflow&&this.overflown)return Rn(t);if(this.isFullWithPageFloats())return Rn(t.primary.after&&1===t.primary.steps.length?null:t);var i=Pn("layout");return this.openAllViews(t.primary).then((function(t){var r=null;t.viewNode?r=t.copy():n.layoutContext.addEventListener("nextInTree",(function t(e){e.nodeContext.viewNode&&(r=e.nodeContext,n.layoutContext.removeEventListener("nextInTree",t))}));var o=new Rs(e,u);o.layout(t,n).then((function(t){n.doFinishBreak(t,o.context.overflownNodeContext,r,o.initialComputedBlockSize).then((function(t){(n.pseudoParent?Rn(null):n.doFinishBreakOfFragmentLayoutConstraints(t)).then((function(){if(n.pageFloatLayoutContext.isInvalidated())i.finish(null);else if(t){n.overflown=!0;var e=new Er(t.toNodePosition());i.finish(e)}else i.finish(null)}))}))}))})),i.result()},n.isFullWithPageFloats=function(){return this.pageFloatLayoutContext.isColumnFullWithPageFloats(this)},n.getMaxBlockSizeOfPageFloats=function(){return this.pageFloatLayoutContext.getMaxBlockSizeOfPageFloats()},n.doFinishBreakOfFragmentLayoutConstraints=function(t){var e=this,u=Pn("doFinishBreakOfFragmentLayoutConstraints"),n=[].concat(this.fragmentLayoutConstraints);n.sort((function(t,e){return t.getPriorityOfFinishBreak()-e.getPriorityOfFinishBreak()}));var i=0;return u.loop((function(){return i<n.length?n[i++].finishBreak(t,e).thenReturn(!0):Rn(!1)})).then((function(){u.finish(!0)})),u.result()},n.doLayout=function(t,e,u){var n=this,i=Pn("doLayout"),r=null;return this.breakPositions=[],this.nodeContextOverflowingDueToRepetitiveElements=null,i.loopWithFrame((function(i){for(var o=function(){var o=!0;if(n.layoutNext(t,e,u||null).then((function(a){if(e=!1,u=null,n.nodeContextOverflowingDueToRepetitiveElements&&n.stopAtOverflow?(n.pageBreakType=null,(t=n.nodeContextOverflowingDueToRepetitiveElements).overflow=!0):t=a,n.pageFloatLayoutContext.isInvalidated())i.breakLoop();else if(n.pageBreakType)i.breakLoop();else if(t&&n.stopByOverflow(t)){r=t;var s=n.findAcceptableBreakPosition();t=s.nodeContext,s.breakPosition&&s.breakPosition.breakPositionChosen(n),i.breakLoop()}else o?o=!1:i.continueLoop()})),o)return o=!1,{v:void 0}};t;){var a=o();if("object"==typeof a)return a.v}n.computedBlockSize+=n.getOffsetByRepetitiveElements(),i.breakLoop()})).then((function(){i.finish({nodeContext:t,overflownNodeContext:r})})),i.result()},n.redoLayout=function(){for(var t=this,e=this.chunkPositions,u=this.element.lastChild;u!=this.last;){var n=u.previousSibling;this.element===u.parentNode&&this.layoutContext.isPseudoelement(u)||this.element.removeChild(u),u=n}this.killFloats(),this.init();var i=Pn("redoLayout"),r=0,o=null,a=!0;return i.loopWithFrame((function(u){if(r<e.length){var n=e[r++];t.layout(n,a).then((function(t){a=!1,t?(o=t,u.breakLoop()):u.continueLoop()}))}else u.breakLoop()})).then((function(){i.finish(o)})),i.result()},n.saveDistanceToBlockEndFloats=function(){var t=this.pageFloatLayoutContext.getBlockStartEdgeOfBlockEndFloats();t>0&&isFinite(t)&&(this.blockDistanceToBlockEndFloats=this.getBoxDir()*(t-this.beforeEdge-this.computedBlockSize))},n.collectElementsOffset=function(){for(var t=this,e=[],u=this;u;u=u.pseudoParent)u.fragmentLayoutConstraints.forEach((function(u){if(zi.isInstanceOfRepetitiveElementsOwnerLayoutConstraint(u)){var n=u.getRepetitiveElements();e.push(n)}if(Hi.isInstanceOfAfterIfContinuesLayoutConstraint(u)){var i=u.getRepetitiveElements();e.push(i)}Gi.isInstanceOfTableRowLayoutConstraint(u)&&u.getElementsOffsetsForTableCell(t).forEach((function(t){e.push(t)}))}));return e},u}(gr),xs=function(){function t(t,e,u){this.startNodeContexts=[],this.column=void 0,this.column=Object.create(t),this.column.element=e,this.column.layoutContext=t.layoutContext.clone(),this.column.stopAtOverflow=!1,this.column.flowRootFormattingContext=u.formattingContext,this.column.pseudoParent=t;var n=this.column.calculateClonedPaddingBorder(u);this.column.footnoteEdge=this.column.footnoteEdge-n;var i=this;this.column.openAllViews=function(t){return Ts.prototype.openAllViews.call(this,t).thenAsync((function(t){return i.startNodeContexts.push(t.copy()),Rn(t)}))}}var e=t.prototype;return e.layout=function(t,e){return this.column.layout(t,e)},e.findAcceptableBreakPosition=function(t){var e=this.column.findAcceptableBreakPosition();if(t){var u=this.startNodeContexts[0].copy(),n=new Ja(u,null,u.overflow,0);if(n.findAcceptableBreak(this.column,0),!e.nodeContext)return{breakPosition:n,nodeContext:u}}return e},e.finishBreak=function(t,e,u){return this.column.finishBreak(t,e,u)},e.doFinishBreakOfFragmentLayoutConstraints=function(t){this.column.doFinishBreakOfFragmentLayoutConstraints(t)},e.isStartNodeContext=function(t){var e=this.startNodeContexts[0];return e.viewNode===t.viewNode&&e.after===t.after&&e.offsetInNode===t.offsetInNode},e.isLastAfterNodeContext=function(t){return sr(t.toNodePosition(),this.column.lastAfterPosition)},e.getColumnElement=function(){return this.column.element},e.getColumn=function(){return this.column},t}(),Is=function(){function t(){}var e=t.prototype;return e.breakTextNode=function(t,e,u,n,i,r){if(e.after)e.offsetInNode=t.length;else{var o=u-e.boxOffset,a=t.data;(o=173==a.charCodeAt(o)?this.breakAfterSoftHyphen(t,a,o,e):this.breakAfterOtherCharacter(t,a,o,e))>0&&(e=this.updateNodeContext(e,o,t))}return e},e.breakAfterSoftHyphen=function(t,e,u,n){return t.replaceData(u,e.length-u,n.breakWord?"":Ps(n)),u+1},e.breakAfterOtherCharacter=function(t,e,u,n){var i=e.charAt(u);u++;var r=e.charAt(u);return t.replaceData(u,e.length-u,!n.breakWord&&lt(i)&&lt(r)?Ps(n):""),u},e.updateNodeContext=function(t,e,u){return(t=t.modify()).offsetInNode+=e,t.breakBefore=null,t},t}();function Ps(t){return t.hyphenateCharacter||t.parent&&t.parent.hyphenateCharacter||"-"}Is.instance=void 0,Is.instance=new Is;var Rs=function(t){function e(e,u){var n;return(n=t.call(this)||this).leadingEdge=void 0,n.breakAfter=void 0,n.initialPageBreakType=null,n.initialComputedBlockSize=0,n.initialOverflown=!1,n.context={overflownNodeContext:null},n.leadingEdge=e,n.breakAfter=u||null,n}T(e,t);var u=e.prototype;return u.resolveLayoutMode=function(t){return new Ls(this.leadingEdge,this.breakAfter,this.context)},u.prepareLayout=function(t,e){e.fragmentLayoutConstraints=[],e.pseudoParent||(fs=[])},u.clearNodes=function(e){t.prototype.clearNodes.call(this,e);for(var u=e;u;){var n=u.viewNode;n&&ja(n.parentNode,n),u=u.parent}},u.saveState=function(e,u){t.prototype.saveState.call(this,e,u),this.initialPageBreakType=u.pageBreakType,this.initialComputedBlockSize=u.computedBlockSize,this.initialOverflown=u.overflown},u.restoreState=function(e,u){t.prototype.restoreState.call(this,e,u),u.pageBreakType=this.initialPageBreakType,u.computedBlockSize=this.initialComputedBlockSize,u.overflown=this.initialOverflown},e}(Ds),Ls=function(){function t(t,e,u){this.leadingEdge=void 0,this.breakAfter=void 0,this.context=void 0,this.leadingEdge=t,this.breakAfter=e,this.context=u}var e=t.prototype;return e.doLayout=function(t,e){var u=this,n=Pn("DefaultLayoutMode.doLayout");return function(t,e){var u=Pn("processAfterIfContinuesOfAncestors"),n=t;return u.loop((function(){if(null!==n){var t=ws(n,e);return n=n.parent,t.thenReturn(!0)}return Rn(!1)})).then((function(){u.finish(!0)})),u.result()}(t,e).then((function(){e.doLayout(t,u.leadingEdge,u.breakAfter).then((function(t){u.context.overflownNodeContext=t.overflownNodeContext,n.finish(t.nodeContext)}))})),n.result()},e.accept=function(t,e){var u=this;return!(!e.pageFloatLayoutContext.isInvalidated()&&!e.pageBreakType)||e.fragmentLayoutConstraints.length<=0||e.fragmentLayoutConstraints.every((function(n){return n.allowLayout(t,u.context.overflownNodeContext,e)}))},e.postLayout=function(t,e,u,n){if(!n){var i=u.fragmentLayoutConstraints.some((function(e){return e.nextCandidate(t)}));n=!i}return u.fragmentLayoutConstraints.forEach((function(i){i.postLayout(n,t,e,u)})),n},t}(),Os=function(t){function e(e,u,n,i,r,o,a){var s;return(s=t.call(this,u,n,i,r,o)||this).floatSide=void 0,s.parentContainer=void 0,s.rootViewNodes=[],s.floatMargins=[],s.adjustContentRelativeSize=!0,s.floatSide=e,s.parentContainer=a,s}T(e,t);var u=e.prototype;return u.openAllViews=function(e){var u=this;return t.prototype.openAllViews.call(this,e).thenAsync((function(t){return t&&u.fixFloatSizeAndPosition(t),Rn(t)}))},u.convertPercentageSizesToPx=function(t){var e=this.parentContainer.getPaddingRect(),u=e.x2-e.x1,n=e.y2-e.y1;function i(e,u){e.forEach((function(e){var n=ut(t,e);if(n&&"%"===n.charAt(n.length-1)){var i=parseFloat(n);et(t,e,u*i/100+"px")}}))}i(["width","max-width","min-width"],u),i(["height","max-height","min-height"],n),i(["margin-top","margin-right","margin-bottom","margin-left","padding-top","padding-right","padding-bottom","padding-left"],this.vertical?n:u),["margin-top","margin-right","margin-bottom","margin-left"].forEach((function(e){"auto"===ut(t,e)&&et(t,e,"0")}))},u.fixFloatSizeAndPosition=function(t){for(;t.parent;)t=t.parent;var e=t.viewNode;if(this.rootViewNodes.push(e),this.adjustContentRelativeSize&&this.convertPercentageSizesToPx(e),this.floatMargins.push(this.getComputedMargin(e)),this.adjustContentRelativeSize){var u=this.floatSide;if(this.parentContainer.vertical){if("block-end"===u||"left"===u){var n=ut(e,"height");""!==n&&"auto"!==n&&et(e,"margin-top","auto")}}else if("block-end"===u||"bottom"===u){var i=ut(e,"width");""!==i&&"auto"!==i&&et(e,"margin-left","auto")}}},u.getContentInlineSize=function(){var t=this;return Math.max.apply(null,this.rootViewNodes.map((function(e,u){var n=t.clientLayout.getElementClientRect(e),i=t.floatMargins[u];return t.vertical?i.top+n.height+i.bottom:i.left+n.width+i.right})))},e}(Ts),ks=function(){function t(t,e){this.parent=void 0,this.rootSourceNode=void 0,this.formattingContextType="RepetitiveElementsOwner",this.isRoot=!1,this.repetitiveElements=null,this.parent=t,this.rootSourceNode=e}var e=t.prototype;return e.getName=function(){return"Repetitive elements owner formatting context (RepetitiveElementsOwnerFormattingContext)"},e.isFirstTime=function(t,e){return e},e.getParent=function(){return this.parent},e.getRepetitiveElements=function(){return this.repetitiveElements},e.getRootViewNode=function(t){var e=this.getRootNodeContext(t);return e?e.viewNode:null},e.getRootNodeContext=function(t){do{if(!t.belongsTo(this)&&t.sourceNode===this.rootSourceNode)return t}while(t=t.parent);return null},e.initializeRepetitiveElements=function(t){var e=this;this.repetitiveElements||fs.some((function(t){return t.root===e.rootSourceNode&&(e.repetitiveElements=t.elements,!0)}))||(this.repetitiveElements=new _s(t,this.rootSourceNode),fs.push({root:this.rootSourceNode,elements:this.repetitiveElements}))},e.saveState=function(){},e.restoreState=function(t){},t}(),_s=function(){function t(t,e){this.vertical=void 0,this.ownerSourceNode=void 0,this.headerSourceNode=null,this.footerSourceNode=null,this.headerViewNode=null,this.footerViewNode=null,this.headerNodePosition=null,this.footerNodePosition=null,this.headerHeight=0,this.footerHeight=0,this.isSkipHeader=!1,this.isSkipFooter=!1,this.enableSkippingFooter=!0,this.enableSkippingHeader=!0,this.doneInitialLayout=!1,this.firstContentSourceNode=null,this.lastContentSourceNode=null,this.affectedNodeCache=[],this.afterLastContentNodeCache=[],this.allowInsert=!1,this.allowInsertRepeatitiveElements=void 0,this.vertical=t,this.ownerSourceNode=e}var e=t.prototype;return e.setHeaderNodeContext=function(t){this.headerNodePosition||(this.headerNodePosition=lr(t,0),this.headerSourceNode=t.sourceNode,this.headerViewNode=t.viewNode)},e.setFooterNodeContext=function(t){this.footerNodePosition||(this.footerNodePosition=lr(t,0),this.footerSourceNode=t.sourceNode,this.footerViewNode=t.viewNode)},e.updateHeight=function(t){this.headerViewNode&&(this.headerHeight=Xa(this.headerViewNode,t,this.vertical),this.headerViewNode=null),this.footerViewNode&&(this.footerHeight=Xa(this.footerViewNode,t,this.vertical),this.footerViewNode=null)},e.prepareLayoutFragment=function(){this.isSkipHeader=this.isSkipFooter=!1,this.enableSkippingFooter=!0,this.enableSkippingHeader=!0},e.appendHeaderToFragment=function(t,e,u){return!this.headerNodePosition||this.isSkipHeader?Rn(!0):this.appendElementToFragment(this.headerNodePosition,t,e,u)},e.appendFooterToFragment=function(t,e,u){return!this.footerNodePosition||this.isSkipFooter?Rn(!0):this.appendElementToFragment(this.footerNodePosition,t,e,u)},e.appendElementToFragment=function(t,e,u,n){var i=this,r=e.viewNode,o=e.viewNode.ownerDocument.createElement("div");r.appendChild(o);var a=new xs(n,o,e),s=a.getColumn().pageBreakType;return a.getColumn().pageBreakType=null,this.allowInsertRepeatitiveElements=!0,a.layout(new Er(t),!0).thenAsync((function(){return i.allowInsertRepeatitiveElements=!1,r.removeChild(o),i.moveChildren(o,r,u),a.getColumn().pageBreakType=s,Rn(!0)}))},e.moveChildren=function(t,e,u){if(e)for(;t.firstChild;){var n=t.firstChild;t.removeChild(n),n.setAttribute("data-adapt-spec","1"),u?e.insertBefore(n,u):e.appendChild(n)}},e.calculateOffset=function(t){var e=0;return t&&!this.affectTo(t)||((!this.isSkipFooter||t&&this.isAfterLastContent(t))&&(e+=this.footerHeight),this.isSkipHeader||(e+=this.headerHeight)),e},e.calculateMinimumOffset=function(t){var e=0;return t&&!this.affectTo(t)||(t&&this.isAfterLastContent(t)&&(e+=this.footerHeight),this.enableSkippingHeader||(e+=this.headerHeight)),e},e.isAfterLastContent=function(t){var e=this;return this.findResultFromCache(t,this.afterLastContentNodeCache,(function(u){return e.isAfterNodeContextOf(e.lastContentSourceNode,t,!1)}))},e.affectTo=function(t){var e=this;return this.findResultFromCache(t,this.affectedNodeCache,(function(u){return e.isAfterNodeContextOf(e.ownerSourceNode,t,!0)}))},e.findResultFromCache=function(t,e,u){var n=e.filter((function(e){return e.nodeContext.sourceNode===t.sourceNode&&e.nodeContext.after===t.after}));if(n.length>0)return n[0].result;var i=u(t);return e.push({nodeContext:t,result:i}),i},e.isAfterNodeContextOf=function(t,e,u){for(var n=[],i=t;i;i=i.parentNode){if(e.sourceNode===i)return e.after;n.push(i)}for(var r=e.sourceNode;r;r=r.parentNode){var o=n.indexOf(r);if(o>=0)return!!u&&0===o;for(var a=r;a;a=a.previousElementSibling)if(n.includes(a))return!0}return e.after},e.isFirstContentNode=function(t){return t&&this.firstContentSourceNode===t.sourceNode},e.isEnableToUpdateState=function(){return!!(!this.isSkipFooter&&this.enableSkippingFooter&&this.footerNodePosition||!this.isSkipHeader&&this.enableSkippingHeader&&this.headerNodePosition)},e.updateState=function(){!this.isSkipFooter&&this.enableSkippingFooter&&this.footerNodePosition?this.isSkipFooter=!0:!this.isSkipHeader&&this.enableSkippingHeader&&this.headerNodePosition&&(this.isSkipHeader=!0)},e.preventSkippingHeader=function(){this.isSkipHeader=!1,this.enableSkippingHeader=!1},e.preventSkippingFooter=function(){this.isSkipFooter=!1,this.enableSkippingFooter=!1},e.isHeaderRegistered=function(){return!!this.headerNodePosition},e.isFooterRegistered=function(){return!!this.footerNodePosition},e.isHeaderSourceNode=function(t){return this.headerSourceNode===t},e.isFooterSourceNode=function(t){return this.footerSourceNode===t},t}(),Ms=function(){function t(t){this.formattingContext=void 0,this.formattingContext=t}var e=t.prototype;return e.accept=function(t,e){return!!t},e.postLayout=function(t,e,u,n){var i=this.formattingContext.getRepetitiveElements();return i&&(i.doneInitialLayout||(i.updateHeight(u),i.doneInitialLayout=!0)),n},t}(),Us=function(){function t(t){this.formattingContext=void 0,this.formattingContext=t}var e=t.prototype;return e.accept=function(t,e){return!0},e.postLayout=function(t,e,u,n){return n},t}(),Vs=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).processor=void 0,n.processor=u,n}T(e,t);var u=e.prototype;return u.doLayout=function(t,e){return this.processor.doInitialLayout(t,e)},u.accept=function(t,e){return!1},e}(Ms),Hs=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).processor=void 0,n.processor=u,n}return T(e,t),e.prototype.doLayout=function(t,e){return t.belongsTo(this.formattingContext)||t.after||e.fragmentLayoutConstraints.unshift(new zs(t)),this.processor.doLayout(t,e)},e}(Us),zs=function(){function t(t){this.flagmentLayoutConstraintType="RepetitiveElementsOwner",this.nodeContext=void 0,this.nodeContext=t.formattingContext.getRootNodeContext(t)}var e=t.prototype;return e.allowLayout=function(t,e,u){var n=this.getRepetitiveElements();return!(n&&!Wa(this.nodeContext.viewNode)&&n.isEnableToUpdateState()&&(e&&!t||t&&t.overflow))},e.nextCandidate=function(t){var e=this.getRepetitiveElements();return!!e&&!!e.isEnableToUpdateState()&&(e.updateState(),!0)},e.postLayout=function(t,e,u,n){var i=this.getRepetitiveElements();i&&t&&n.stopAtOverflow&&(null==e||i.isAfterLastContent(e))&&i.preventSkippingFooter()},e.finishBreak=function(t,e){var u=this.nodeContext.formattingContext,n=this.getRepetitiveElements();if(!n)return Rn(!0);var i=this.nodeContext;return function(t,e,u){var n=t.getRepetitiveElements();if(n){var i=t.getRootNodeContext(e);if(i.viewNode)return n.appendHeaderToFragment(i,i.viewNode.firstChild,u)}return Rn(!0)}(u,i,e).thenAsync((function(){return function(t,e,u){var n=t.getRepetitiveElements();if(n&&!n.isSkipFooter){var i=t.getRootNodeContext(e);if(i.viewNode)return n.appendFooterToFragment(i,null,u)}return Rn(!0)}(u,i,e).thenAsync((function(){return n.prepareLayoutFragment(),Rn(!0)}))}))},e.getRepetitiveElements=function(){return this.nodeContext.formattingContext.getRepetitiveElements()},e.equalsTo=function(e){return e instanceof t&&this.nodeContext.formattingContext===e.nodeContext.formattingContext},e.getPriorityOfFinishBreak=function(){return 10},t}(),Gs=function(t){function e(e,u){var n;return(n=t.call(this)||this).formattingContext=void 0,n.processor=void 0,n.formattingContext=e,n.processor=u,n}return T(e,t),e.prototype.resolveLayoutMode=function(t){var e=this.formattingContext.getRepetitiveElements();return t.belongsTo(this.formattingContext)||e.doneInitialLayout?(t.belongsTo(this.formattingContext)||t.after||e&&e.preventSkippingHeader(),new Hs(this.formattingContext,this.processor)):new Vs(this.formattingContext,this.processor)},e}(Ds),Xs=function(t){function e(e,u){var n;return(n=t.call(this)||this).formattingContext=void 0,n.column=void 0,n.formattingContext=e,n.column=u,n}T(e,t);var u=e.prototype;return u.startNonInlineElementNode=function(t){var e=this.formattingContext,u=t.nodeContext,n=e.getRepetitiveElements();if(u.parent&&e.rootSourceNode===u.parent.sourceNode){switch(u.repeatOnBreak){case"header":if(!n.isHeaderRegistered())return n.setHeaderNodeContext(u),Rn(!0);u.repeatOnBreak="none";break;case"footer":if(!n.isFooterRegistered())return n.setFooterNodeContext(u),Rn(!0);u.repeatOnBreak="none"}n.firstContentSourceNode||(n.firstContentSourceNode=u.sourceNode)}return ds.prototype.startNonInlineElementNode.call(this,t)},u.afterNonInlineElementNode=function(t){var e=this.formattingContext,u=t.nodeContext;return u.sourceNode===e.rootSourceNode&&(e.getRepetitiveElements().lastContentSourceNode=t.lastAfterNodeContext&&t.lastAfterNodeContext.sourceNode,t.break=!0),"header"===u.repeatOnBreak||"footer"===u.repeatOnBreak?Rn(!0):ds.prototype.afterNonInlineElementNode.call(this,t)},e}(ds);function Ws(t,e){t&&function(t,e){for(var u=t;u;u=u.parent){var n=u.formattingContext;n&&n instanceof ks&&!u.belongsTo(n)&&e(n,u)}}(t.after?t.parent:t,(function(t,u){Gi.isInstanceOfTableFormattingContext(t)||e.fragmentLayoutConstraints.push(new zs(u))}))}var js=new(function(t){function e(){return t.apply(this,arguments)||this}T(e,t);var u=e.prototype;return u.layout=function(t,e,u){if(e.isFloatNodeContext(t))return e.layoutFloatOrFootnote(t);var n=t.formattingContext;return n.getRootViewNode(t)?(u&&Ws(t.parent,e),t.belongsTo(n)?os.prototype.layout.call(this,t,e,u):new Gs(n,this).layout(t,e)):e.buildDeepElementView(t)},u.startNonInlineElementNode=function(t){var e=function(t){var e=t.formattingContext;return e&&e instanceof ks?e:null}(t),u=e.getRepetitiveElements();return!!u&&(u.allowInsertRepeatitiveElements||!u.isHeaderSourceNode(t.sourceNode)&&!u.isFooterSourceNode(t.sourceNode)||t.viewNode.parentNode.removeChild(t.viewNode),!1)},u.doInitialLayout=function(t,e){var u=Pn("BlockLayoutProcessor.doInitialLayout");return this.layoutEntireBlock(t,e).thenFinish(u),u.result()},u.layoutEntireBlock=function(t,e){var u=new Xs(t.formattingContext,e);return new cs(u,e.layoutContext).iterate(t)},u.doLayout=function(t,e){var u=t.formattingContext,n=Pn("doLayout");return ys(e.layoutContext.nextInTree(t,!1),e).then((function(t){var i=t;n.loopWithFrame((function(t){for(var n=function(){var n=!0;if(e.layoutNext(i,!1).then((function(r){i=r,e.pageFloatLayoutContext.isInvalidated()||e.pageBreakType||i&&e.stopByOverflow(i)||i&&i.after&&i.sourceNode==u.rootSourceNode?t.breakLoop():n?n=!1:t.continueLoop()})),n)return n=!1,{v:void 0}};i;){var r=n();if("object"==typeof r)return r.v}t.breakLoop()})).then((function(){n.finish(i)}))})),n.result()},u.finishBreak=function(t,e,u,n){return os.prototype.finishBreak.call(this,t,e,u,n)},u.clearOverflownViewNodes=function(t,e,u,n){os.prototype.clearOverflownViewNodes(t,e,u,n)},e}(os));p(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR,(function(t){return t instanceof ks&&!Gi.isInstanceOfTableFormattingContext(t)?js:null}));var Ks=function(){function t(t,e){this.rowIndex=void 0,this.sourceNode=void 0,this.cells=[],this.rowIndex=t,this.sourceNode=e}var e=t.prototype;return e.addCell=function(t){this.cells.push(t)},e.getMinimumHeight=function(){return Math.min.apply(null,this.cells.map((function(t){return t.height})))},t}(),Ys=function(){function t(t,e,u){this.rowIndex=void 0,this.columnIndex=void 0,this.viewElement=void 0,this.colSpan=void 0,this.rowSpan=void 0,this.height=0,this.anchorSlot=null,this.rowIndex=t,this.columnIndex=e,this.viewElement=u,this.colSpan=u.colSpan||1,this.rowSpan=u.rowSpan||1}var e=t.prototype;return e.setHeight=function(t){this.height=t},e.setAnchorSlot=function(t){this.anchorSlot=t},t}(),qs=function(t,e,u){this.rowIndex=void 0,this.columnIndex=void 0,this.cell=void 0,this.rowIndex=t,this.columnIndex=e,this.cell=u},$s=function(){function t(t,e,u){this.column=void 0,this.cellNodeContext=void 0,this.pseudoColumn=void 0,this.empty=!1,this.column=t,this.cellNodeContext=u,this.pseudoColumn=new xs(t,e,u)}return t.prototype.findAcceptableBreakPosition=function(){var t=this.cellNodeContext.viewNode,e=this.cellNodeContext.verticalAlign;"middle"!==e&&"bottom"!==e||et(t,"vertical-align","top");var u=this.pseudoColumn.findAcceptableBreakPosition(!0);return et(t,"vertical-align",e),u},t}(),Qs=function(t,e){this.viewNode=void 0,this.side=void 0,this.viewNode=t,this.side=e},Zs=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e,u,n,i)||this).formattingContext=void 0,r.acceptableCellBreakPositions=null,r.rowIndex=null,r.formattingContext=e.formattingContext,r}T(e,t);var u=e.prototype;return u.findAcceptableBreak=function(e,u){var n=t.prototype.findAcceptableBreak.call(this,e,u);return u<this.getMinBreakPenalty()?null:this.getAcceptableCellBreakPositions().every((function(t){return!!t.nodeContext}))?n:null},u.getMinBreakPenalty=function(){var e=t.prototype.getMinBreakPenalty.call(this);return this.getAcceptableCellBreakPositions().forEach((function(t){e+=t.breakPosition.getMinBreakPenalty()})),e},u.getAcceptableCellBreakPositions=function(){if(!this.acceptableCellBreakPositions){var t=this.getCellFragments();this.acceptableCellBreakPositions=t.map((function(t){return t.findAcceptableBreakPosition()}))}return this.acceptableCellBreakPositions},u.getRowIndex=function(){return null!=this.rowIndex?this.rowIndex:this.rowIndex=this.formattingContext.findRowIndexBySourceNode(this.position.sourceNode)},u.getCellFragments=function(){return this.formattingContext.getRowSpanningCellsOverflowingTheRow(this.getRowIndex()).map(this.formattingContext.getCellFragmentOfCell,this.formattingContext)},e}(Ja),Js=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).rowIndex=void 0,i.beforeNodeContext=void 0,i.formattingContext=void 0,i.acceptableCellBreakPositions=null,i.rowIndex=e,i.beforeNodeContext=u,i.formattingContext=n,i}T(e,t);var u=e.prototype;return u.findAcceptableBreak=function(t,e){if(e<this.getMinBreakPenalty())return null;var u=this.getCellFragments(),n=this.getAcceptableCellBreakPositions(),i=n.every((function(t){return!!t.nodeContext}))&&n.some((function(t,e){var n=u[e].pseudoColumn,i=t.nodeContext;return!n.isStartNodeContext(i)&&!n.isLastAfterNodeContext(i)}));return this.beforeNodeContext.overflow=n.some((function(t){return t.nodeContext&&t.nodeContext.overflow})),i?this.beforeNodeContext:null},u.getMinBreakPenalty=function(){var t=this.formattingContext,e=t.getRowByIndex(this.rowIndex),u=0;return t.isFreelyFragmentableRow(e)||(u+=10),this.getAcceptableCellBreakPositions().forEach((function(t){u+=t.breakPosition.getMinBreakPenalty()})),u},u.getAcceptableCellBreakPositions=function(){if(!this.acceptableCellBreakPositions){var t=this.getCellFragments();this.acceptableCellBreakPositions=t.map((function(t){return t.findAcceptableBreakPosition()}))}return this.acceptableCellBreakPositions},u.getCellFragments=function(){return this.formattingContext.getCellsFallingOnRow(this.rowIndex).map(this.formattingContext.getCellFragmentOfCell,this.formattingContext)},e}(Qa),tl=function(t){function e(e,u){var n;return(n=t.call(this,e,u)||this).tableSourceNode=void 0,n.formattingContextType="Table",n.vertical=!1,n.columnCount=-1,n.tableWidth=0,n.captions=[],n.colGroups=null,n.colWidths=null,n.inlineBorderSpacing=0,n.rows=[],n.slots=[],n.cellFragments=[],n.lastRowViewNode=null,n.cellBreakPositions=[],n.repetitiveElements=null,n.tableSourceNode=u,n}T(e,t);var u=e.prototype;return u.getName=function(){return"Table formatting context (Table.TableFormattingContext)"},u.isFirstTime=function(t,e){if(!e)return e;switch(t.display){case"table-row":return 0===this.cellBreakPositions.length;case"table-cell":return!this.cellBreakPositions.some((function(e){return e.cellNodePosition.steps[0].node===t.sourceNode}));default:return e}},u.getParent=function(){return this.parent},u.finishFragment=function(){this.cellFragments=[]},u.addRow=function(t,e){this.rows[t]=e},u.getRowSlots=function(t){var e=this.slots[t];return e||(e=this.slots[t]=[]),e},u.addCell=function(t,e){var u=this.rows[t];u||(this.addRow(t,new Ks(t,null)),u=this.rows[t]),u.addCell(e);for(var n=t+e.rowSpan,i=this.getRowSlots(t),r=0;i[r];)r++;for(;t<n;t++){i=this.getRowSlots(t);for(var o=r;o<r+e.colSpan;o++){var a=i[o]=new qs(t,o,e);e.anchorSlot||e.setAnchorSlot(a)}}},u.getRowByIndex=function(t){return this.rows[t]},u.findRowIndexBySourceNode=function(t){return this.rows.findIndex((function(e){return t===e.sourceNode}))},u.addCellFragment=function(t,e,u){var n=this.cellFragments[t];n||(n=this.cellFragments[t]=[]),n[e]=u},u.getCellsFallingOnRow=function(t){return this.getRowSlots(t).reduce((function(t,e){return e.cell!==t[t.length-1]?t.concat(e.cell):t}),[])},u.getRowSpanningCellsOverflowingTheRow=function(t){return this.getCellsFallingOnRow(t).filter((function(e){return e.rowIndex+e.rowSpan-1>t}))},u.getCellFragmentOfCell=function(t){return this.cellFragments[t.rowIndex]&&this.cellFragments[t.rowIndex][t.columnIndex]},u.isFreelyFragmentableRow=function(t){return t.getMinimumHeight()>this.tableWidth/2},u.getColumnCount=function(){return this.columnCount<0&&(this.columnCount=Math.max.apply(null,this.rows.map((function(t){return t.cells.reduce((function(t,e){return t+e.colSpan}),0)})))),this.columnCount},u.updateCellSizes=function(t){var e=this;this.rows.forEach((function(u){u.cells.forEach((function(u){var n=t.getElementClientRect(u.viewElement);u.viewElement=null,u.setHeight(e.vertical?n.width:n.height)}))}))},u.findCellFromColumn=function(t){if(!t)return null;var e=null,u=0,n=0;t:for(u=0;u<this.cellFragments.length;u++)if(this.cellFragments[u])for(n=0;n<this.cellFragments[u].length;n++)if(this.cellFragments[u][n]&&t===this.cellFragments[u][n].pseudoColumn.getColumn()){e=this.rows[u].cells[n];break t}if(!e)return null;for(;u<this.slots.length;u++)for(;n<this.slots[u].length;n++){var i=this.slots[u][n];if(i.cell===e)return{rowIndex:i.rowIndex,columnIndex:i.columnIndex}}return null},u.collectElementsOffsetOfUpperCells=function(t){var e=this,u=[];return this.slots.reduce((function(n,i,r){if(r>=t.rowIndex)return n;var o=i[t.columnIndex]&&e.getCellFragmentOfCell(i[t.columnIndex].cell);return!o||u.includes(o)||(e.collectElementsOffsetFromColumn(o.pseudoColumn.getColumn(),n),u.push(o)),n}),[])},u.collectElementsOffsetOfHighestColumn=function(){var t=this,e=[];return this.rows.forEach((function(u){u.cells.forEach((function(u,n){e[n]||(e[n]={collected:[],elements:[]});var i=e[n],r=t.getCellFragmentOfCell(u);r&&!i.collected.includes(r)&&(t.collectElementsOffsetFromColumn(r.pseudoColumn.getColumn(),i.elements),i.collected.push(r))}))})),[new el(e.map((function(t){return t.elements})))]},u.collectElementsOffsetFromColumn=function(t,e){t.fragmentLayoutConstraints.forEach((function(t){if(zi.isInstanceOfRepetitiveElementsOwnerLayoutConstraint(t)){var u=t.getRepetitiveElements();e.push(u)}Gi.isInstanceOfTableRowLayoutConstraint(t)&&t.getElementsOffsetsForTableCell(null).forEach((function(t){e.push(t)}))}))},u.saveState=function(){return[].concat(this.cellBreakPositions)},u.restoreState=function(t){this.cellBreakPositions=t},e}(ks),el=function(){function t(t){this.repeatitiveElementsInColumns=void 0,this.repeatitiveElementsInColumns=t}var e=t.prototype;return e.calculateOffset=function(t){return this.calculateMaxOffsetOfColumn(t,(function(t){return t.current}))},e.calculateMinimumOffset=function(t){return this.calculateMaxOffsetOfColumn(t,(function(t){return t.minimum}))},e.calculateMaxOffsetOfColumn=function(t,e){var u=0;return this.repeatitiveElementsInColumns.forEach((function(n){var i=Za(t,n);u=Math.max(u,e(i))})),u},t}();function ul(t){return function(t){return"table-row-group"===t||"table-header-group"===t||"table-footer-group"===t}(t)||function(t){return"table"===t||"inline-table"===t}(t)}function nl(t,e,u){var n=t.nodeContext,i=n.display,r=n.parent?n.parent.display:null,o=!1;if("inline-table"===r&&!(n.formattingContext instanceof tl))for(var a=n.parent;a;a=a.parent)if(a.formattingContext instanceof tl){o=a.formattingContext===e;break}return o||"table-row"===i&&!ul(r)||"table-cell"===i&&"table-row"!==r&&!ul(r)||n.formattingContext instanceof tl&&n.formattingContext!==e?u.buildDeepElementView(n).thenAsync((function(e){return t.nodeContext=e,Rn(!0)})):null}var il=function(t){function e(e,u){var n;return(n=t.call(this)||this).formattingContext=void 0,n.column=void 0,n.rowIndex=-1,n.columnIndex=0,n.inRow=!1,n.checkPoints=[],n.inHeaderOrFooter=!1,n.formattingContext=e,n.column=u,n}T(e,t);var u=e.prototype;return u.startNonInlineElementNode=function(e){var u=this.formattingContext,n=nl(e,u,this.column);if(n)return n;this.postLayoutBlockContents(e);var i=e.nodeContext,r=i.display,o=u.getRepetitiveElements();switch(r){case"table":u.inlineBorderSpacing=i.inlineBorderSpacing;break;case"table-caption":var a=new Qs(i.viewNode,i.captionSide);u.captions.push(a);break;case"table-header-group":return o.isHeaderRegistered()||(this.inHeaderOrFooter=!0,o.setHeaderNodeContext(i)),Rn(!0);case"table-footer-group":return o.isFooterRegistered()||(this.inHeaderOrFooter=!0,o.setFooterNodeContext(i)),Rn(!0);case"table-row":this.inHeaderOrFooter||(this.inRow=!0,this.rowIndex++,this.columnIndex=0,u.addRow(this.rowIndex,new Ks(this.rowIndex,i.sourceNode)),o.firstContentSourceNode||(o.firstContentSourceNode=i.sourceNode))}return t.prototype.startNonInlineElementNode.call(this,e)},u.afterNonInlineElementNode=function(e){var u=this.formattingContext,n=e.nodeContext,i=n.display,r=this.column.clientLayout;if(this.postLayoutBlockContents(e),n.sourceNode===u.tableSourceNode){var o=r.getElementComputedStyle(u.getRootViewNode(n));u.tableWidth=parseFloat(o[u.vertical?"height":"width"]),u.getRepetitiveElements().lastContentSourceNode=e.lastAfterNodeContext&&e.lastAfterNodeContext.sourceNode,e.break=!0}else switch(i){case"table-header-group":case"table-footer-group":if(this.inHeaderOrFooter)return this.inHeaderOrFooter=!1,Rn(!0);break;case"table-row":this.inHeaderOrFooter||(u.lastRowViewNode=n.viewNode,this.inRow=!1);break;case"table-cell":this.inHeaderOrFooter||(this.inRow||(this.rowIndex++,this.columnIndex=0,this.inRow=!0),u.addCell(this.rowIndex,new Ys(this.rowIndex,this.columnIndex,n.viewNode)),this.columnIndex++)}return t.prototype.afterNonInlineElementNode.call(this,e)},u.startNonElementNode=function(t){this.registerCheckPoint(t)},u.afterNonElementNode=function(t){this.registerCheckPoint(t)},u.startInlineElementNode=function(t){this.registerCheckPoint(t)},u.afterInlineElementNode=function(t){this.registerCheckPoint(t)},u.registerCheckPoint=function(t){var e=t.nodeContext;e&&e.viewNode&&!$a(e)&&this.checkPoints.push(e.clone())},u.postLayoutBlockContents=function(t){this.checkPoints.length>0&&this.column.postLayoutBlock(t.nodeContext,this.checkPoints),this.checkPoints=[]},e}(ds),rl=function(t){function e(e,u){var n;return(n=t.call(this,!0)||this).formattingContext=void 0,n.column=void 0,n.inRow=!1,n.currentRowIndex=-1,n.currentColumnIndex=0,n.originalStopAtOverflow=void 0,n.inHeader=void 0,n.inFooter=void 0,n.formattingContext=e,n.column=u,n.originalStopAtOverflow=u.stopAtOverflow,u.stopAtOverflow=!1,n}T(e,t);var u=e.prototype;return u.resetColumn=function(){this.column.stopAtOverflow=this.originalStopAtOverflow},u.getColSpanningCellWidth=function(t){for(var e=this.formattingContext.colWidths,u=0,n=0;n<t.colSpan;n++)u+=e[t.anchorSlot.columnIndex+n];return u+this.formattingContext.inlineBorderSpacing*(t.colSpan-1)},u.layoutCell=function(t,e,u){var n=t.rowIndex,i=t.columnIndex,r=e.viewNode;t.colSpan>1&&(et(r,"box-sizing","border-box"),et(r,this.formattingContext.vertical?"height":"width",this.getColSpanningCellWidth(t)+"px"));var o=r.ownerDocument.createElement("div");r.appendChild(o);var a=new $s(this.column,o,e);return this.formattingContext.addCellFragment(n,i,a),1===u.primary.steps.length&&u.primary.after&&(a.empty=!0),a.pseudoColumn.layout(u,!0).thenReturn(!0)},u.hasBrokenCellAtSlot=function(t){var e=this.formattingContext.cellBreakPositions[0];return!!e&&e.cell.anchorSlot.columnIndex===t},u.extractRowSpanningCellBreakPositions=function(){var t=this.formattingContext.cellBreakPositions;if(0===t.length)return[];var e=[],u=0;do{var n=t[u],i=n.cell.rowIndex;if(i<this.currentRowIndex){var r=e[i];r||(r=e[i]=[]),r.push(n),t.splice(u,1)}else u++}while(u<t.length);return e},u.layoutRowSpanningCellsFromPreviousFragment=function(t){var e=this,u=this.formattingContext,n=this.extractRowSpanningCellBreakPositions(),i=n.reduce((function(t){return t+1}),0);if(0===i)return Rn(!0);var r=this.column.layoutContext,o=t.nodeContext;o.viewNode.parentNode.removeChild(o.viewNode);var a=Pn("layoutRowSpanningCellsFromPreviousFragment"),s=Rn(!0),l=0,D=[];return n.forEach((function(t){s=s.thenAsync((function(){var n=Dr(t[0].cellNodePosition.steps[1],o.parent);return r.setCurrent(n,!1).thenAsync((function(){var o=Rn(!0),a=0;function s(t){for(;a<t;){if(!D.includes(a)){var e=n.viewNode.ownerDocument.createElement("td");et(e,"padding","0"),n.viewNode.appendChild(e)}a++}}return t.forEach((function(t){o=o.thenAsync((function(){var u=t.cell;s(u.anchorSlot.columnIndex);var o=t.cellNodePosition,h=Dr(o.steps[0],n);return h.offsetInNode=o.offsetInNode,h.after=o.after,h.fragmentIndex=o.steps[0].fragmentIndex+1,r.setCurrent(h,!1).thenAsync((function(){for(var n=t.breakChunkPosition,r=0;r<u.colSpan;r++)D.push(a+r);return a+=u.colSpan,e.layoutCell(u,h,n).thenAsync((function(){return h.viewNode.rowSpan=u.rowIndex+u.rowSpan-e.currentRowIndex+i-l,Rn(!0)}))}))}))})),o.thenAsync((function(){return s(u.getColumnCount()),l++,Rn(!0)}))}))}))})),s.then((function(){r.setCurrent(o,!0,t.atUnforcedBreak).then((function(){a.finish(!0)}))})),a.result()},u.startTableRow=function(t){var e=this;if(this.inHeader||this.inFooter)return Rn(!0);var u=t.nodeContext,n=this.formattingContext;return this.currentRowIndex<0?this.currentRowIndex=n.findRowIndexBySourceNode(u.sourceNode):this.currentRowIndex++,this.currentColumnIndex=0,this.inRow=!0,this.layoutRowSpanningCellsFromPreviousFragment(t).thenAsync((function(){return e.registerCellFragmentIndex(),e.column.checkOverflowAndSaveEdgeAndBreakPosition(t.lastAfterNodeContext,null,!0,t.breakAtTheEdge)&&0===n.getRowSpanningCellsOverflowingTheRow(e.currentRowIndex-1).length&&(e.resetColumn(),u.overflow=!0,t.break=!0),Rn(!0)}))},u.registerCellFragmentIndex=function(){var t=this;this.formattingContext.getRowByIndex(this.currentRowIndex).cells.forEach((function(e){var u=t.formattingContext.cellBreakPositions[e.columnIndex];if(u&&u.cell.anchorSlot.columnIndex==e.anchorSlot.columnIndex){var n=u.cellNodePosition.steps[0],i=t.column.layoutContext.xmldoc.getElementOffset(n.node);gs(i,n.fragmentIndex+1,1)}}))},u.startTableCell=function(t){var e=this;if(this.inHeader||this.inFooter)return Rn(!0);var u=t.nodeContext;this.inRow||(this.currentRowIndex<0?this.currentRowIndex=0:this.currentRowIndex++,this.currentColumnIndex=0,this.inRow=!0);var n=this.formattingContext.getRowByIndex(this.currentRowIndex).cells[this.currentColumnIndex];if(!n)return t.break=!0,Rn(!0);var i=u.copy().modify();i.after=!0,t.nodeContext=i;var r,o=Pn("startTableCell");if(this.hasBrokenCellAtSlot(n.anchorSlot.columnIndex)){var a=this.formattingContext.cellBreakPositions.shift();u.fragmentIndex=a.cellNodePosition.steps[0].fragmentIndex+1,r=Rn(a.breakChunkPosition)}else r=this.column.nextInTree(u,t.atUnforcedBreak).thenAsync((function(t){t.viewNode&&u.viewNode.removeChild(t.viewNode);var e=lr(t,0);return Rn(new Er(e))}));return r.then((function(i){e.layoutCell(n,u,i).then((function(){e.afterNonInlineElementNode(t),e.currentColumnIndex++,o.finish(!0)}))})),o.result()},u.startNonInlineBox=function(t){var e=nl(t,this.formattingContext,this.column);if(e)return e;var u=t.nodeContext,n=this.formattingContext.getRepetitiveElements(),i=u.display;return"table-header-group"===i&&n&&n.isHeaderSourceNode(u.sourceNode)?(this.inHeader=!0,Rn(!0)):"table-footer-group"===i&&n&&n.isFooterSourceNode(u.sourceNode)?(this.inFooter=!0,Rn(!0)):"table-row"===i?this.startTableRow(t):"table-cell"===i?this.startTableCell(t):Rn(!0)},u.endNonInlineBox=function(t){var e=t.nodeContext;if("table-row"===e.display&&(this.inRow=!1,!this.inHeader&&!this.inFooter)){var u=e.copy().modify();u.after=!1;var n=new Js(this.currentRowIndex,u,this.formattingContext);this.column.breakPositions.push(n)}return Rn(!0)},u.afterNonInlineElementNode=function(u){var n=u.nodeContext,i=this.formattingContext.getRepetitiveElements(),r=n.display;if("table-header-group"===r?i&&!i.allowInsertRepeatitiveElements&&i.isHeaderSourceNode(n.sourceNode)?(this.inHeader=!1,n.viewNode.parentNode.removeChild(n.viewNode)):et(n.viewNode,"display","table-row-group"):"table-footer-group"===r&&(i&&!i.allowInsertRepeatitiveElements&&i.isFooterSourceNode(n.sourceNode)?(this.inFooter=!1,n.viewNode.parentNode.removeChild(n.viewNode)):et(n.viewNode,"display","table-row-group")),r&&e.ignoreList[r])n.viewNode.parentNode.removeChild(n.viewNode);else{if(n.sourceNode!==this.formattingContext.tableSourceNode)return t.prototype.afterNonInlineElementNode.call(this,u);n.overflow=this.column.checkOverflowAndSaveEdge(n,null),this.resetColumn(),u.break=!0}return Rn(!0)},e}(ds);rl.ignoreList={"table-caption":!0,"table-column-group":!0,"table-column":!0};var ol=[],al=function(){function t(){}var e=t.prototype;return e.layoutEntireTable=function(t,e){var u=new il(t.formattingContext,e);return new cs(u,e.layoutContext).iterate(t)},e.getColumnWidths=function(t,e,u,n){for(var i=t.ownerDocument,r=i.createElement("tr"),o=[],a=0;a<e;a++){var s=i.createElement("td");r.appendChild(s),o.push(s)}t.parentNode.insertBefore(r,t.nextSibling);var l=o.map((function(t){var e=n.getElementClientRect(t);return u?e.height:e.width}));return t.parentNode.removeChild(r),l},e.getColGroupElements=function(t){for(var e=[],u=t.firstElementChild;u;)"colgroup"===u.localName&&e.push(u),u=u.nextElementSibling;return e},e.normalizeAndGetColElements=function(t){var e=[];return t.forEach((function(t){var u=t.span;t.removeAttribute("span");for(var n=t.firstElementChild;n;){if("col"===n.localName){var i=n.span;for(n.removeAttribute("span"),u-=i;i-- >1;){var r=n.cloneNode(!0);t.insertBefore(r,n),e.push(r)}e.push(n)}n=n.nextElementSibling}for(;u-- >0;)n=t.ownerDocument.createElement("col"),t.appendChild(n),e.push(n)})),e},e.addMissingColElements=function(t,e,u,n){if(t.length<u){var i=n.ownerDocument.createElement("colgroup");e.push(i);for(var r=t.length;r<u;r++){var o=n.ownerDocument.createElement("col");i.appendChild(o),t.push(o)}}},e.normalizeColGroups=function(t,e,u){var n=t.vertical,i=t.lastRowViewNode;if(i){t.lastRowViewNode=null;var r=i.ownerDocument.createDocumentFragment(),o=t.getColumnCount();if(o>0){var a=t.colWidths=this.getColumnWidths(i,o,n,u.clientLayout),s=this.getColGroupElements(e),l=this.normalizeAndGetColElements(s);this.addMissingColElements(l,s,o,e),l.forEach((function(t,e){et(t,n?"height":"width",a[e]+"px")})),s.forEach((function(t){r.appendChild(t.cloneNode(!0))})),t.colGroups=r}else t.colGroups=r}},e.doInitialLayout=function(t,e){var u=this,n=t.formattingContext;n.vertical=t.vertical,n.initializeRepetitiveElements(t.vertical);var i,r,o,a=(i=t.sourceNode,r=ol.findIndex((function(t){return t.root===i})),(o=ol[r])?o.tableLayoutOption:null);!function(t){var e=ol.findIndex((function(e){return e.root===t}));e>=0&&ol.splice(e,1)}(t.sourceNode);var s=Pn("TableLayoutProcessor.doInitialLayout"),l=t.copy();return this.layoutEntireTable(t,e).then((function(i){var r=i.viewNode,o=e.clientLayout.getElementClientRect(r),D=e.vertical?o.left:o.bottom;if(D+=(e.vertical?-1:1)*Za(t,e.collectElementsOffset()).current,!(e.isOverflown(D)||a&&a.calculateBreakPositionsInside))return e.breakPositions.push(new Dl(l)),void s.finish(i);u.normalizeColGroups(n,r,e),n.updateCellSizes(e.clientLayout),s.finish(null)})),s.result()},e.addCaptions=function(t,e,u){var n=t.captions;n.forEach((function(t,i){t&&(e.insertBefore(t.viewNode,u),"top"===t.side&&(n[i]=null))}))},e.addColGroups=function(t,e,u){t.colGroups&&0===this.getColGroupElements(e).length&&e.insertBefore(t.colGroups.cloneNode(!0),u)},e.removeColGroups=function(t,e){if(t.colGroups&&e){var u=this.getColGroupElements(e);u&&u.forEach((function(t){e.removeChild(t)}))}},e.doLayout=function(t,e){var u=t.formattingContext,n=u.getRootViewNode(t),i=n.firstChild;this.addCaptions(u,n,i),this.addColGroups(u,n,i);var r=new rl(u,e),o=new cs(r,e.layoutContext),a=Pn("TableFormattingContext.doLayout");return o.iterate(t).thenFinish(a),a.result()},e.layout=function(t,e,u){var n=t.formattingContext;return n.getRootViewNode(t)?(u&&Ws(t.parent,e),new sl(n,this).layout(t,e)):e.buildDeepElementView(t)},e.createEdgeBreakPosition=function(t,e,u,n){return new Zs(t,e,u,n)},e.startNonInlineElementNode=function(t){return!1},e.afterNonInlineElementNode=function(t,e){return!1},e.finishBreak=function(t,e,u,n){var i=e.formattingContext;if("table-row"===e.display){var r,o=i.findRowIndexBySourceNode(e.sourceNode);if(i.cellBreakPositions=[],(r=e.after?i.getRowSpanningCellsOverflowingTheRow(o):i.getCellsFallingOnRow(o)).length){var a=Pn("TableLayoutProcessor.finishBreak"),s=0;return a.loopWithFrame((function(t){if(s!==r.length){var e=r[s++],u=i.getCellFragmentOfCell(e),n=u.findAcceptableBreakPosition().nodeContext,a=u.cellNodeContext,l=a.toNodePosition(),D=new Er(n.toNodePosition());i.cellBreakPositions.push({cellNodePosition:l,breakChunkPosition:D,cell:e});var h=a.viewNode;u.column.layoutContext.processFragmentedBlockEdge(u.cellNodeContext),o<e.rowIndex+e.rowSpan-1&&(h.rowSpan=o-e.rowIndex+1),u.empty?t.continueLoop():u.pseudoColumn.finishBreak(n,!1,!0).then((function(){!function(t,e,u){var n=e.getRepetitiveElements();if(n){var i=e.vertical,r=t.column,o=t.pseudoColumn.getColumnElement(),a=t.cellNodeContext.viewNode,s=r.clientLayout.getElementClientRect(a),l=r.getComputedPaddingBorder(a);i?et(o,"max-width",s.right-r.footnoteEdge-n.calculateOffset(u)-l.right+"px"):et(o,"max-height",r.footnoteEdge-n.calculateOffset(u)-s.top-l.top+"px"),et(o,"overflow","hidden")}}(u,i,n),t.continueLoop()}))}else t.breakLoop()})).then((function(){t.clearOverflownViewNodes(e,!1),t.layoutContext.processFragmentedBlockEdge(e),i.finishFragment(),a.finish(!0)})),a.result()}}return i.finishFragment(),ss.finishBreak(t,e,u,n)},e.clearOverflownViewNodes=function(t,e,u,n){os.prototype.clearOverflownViewNodes(t,e,u,n)},t}(),sl=function(t){function e(e,u){var n;return(n=t.call(this)||this).tableFormattingContext=void 0,n.processor=void 0,n.tableFormattingContext=e,n.processor=u,n}T(e,t);var u=e.prototype;return u.resolveLayoutMode=function(t){var e=this.tableFormattingContext.getRepetitiveElements();return e&&e.doneInitialLayout?(t.sourceNode!==this.tableFormattingContext.tableSourceNode||t.after||e&&e.preventSkippingHeader(),new cl(this.tableFormattingContext,this.processor)):new ll(this.tableFormattingContext,this.processor)},u.clearNodes=function(e){t.prototype.clearNodes.call(this,e);var u=this.tableFormattingContext.getRootViewNode(e);this.processor.removeColGroups(this.tableFormattingContext,u)},u.restoreState=function(e,u){t.prototype.restoreState.call(this,e,u),this.tableFormattingContext.finishFragment()},e}(Ds),ll=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).processor=void 0,n.processor=u,n}return T(e,t),e.prototype.doLayout=function(t,e){return this.processor.doInitialLayout(t,e)},e}(Ms),Dl=function(t){function e(e){return t.call(this,e,null,e.overflow,0)||this}T(e,t);var u=e.prototype;return u.getMinBreakPenalty=function(){if(!this.isEdgeUpdated)throw new Error("EdgeBreakPosition.prototype.updateEdge not called");return(this.overflows?3:0)+(this.position.parent?this.position.parent.breakPenalty:0)},u.breakPositionChosen=function(t){t.fragmentLayoutConstraints.push(new hl(this.position.sourceNode))},e}(Ja),hl=function(){function t(t){this.tableRootNode=void 0,this.flagmentLayoutConstraintType="EntireTable",this.tableRootNode=t}var e=t.prototype;return e.allowLayout=function(t,e,u){return!1},e.nextCandidate=function(t){return!0},e.postLayout=function(t,e,u,n){ol.push({root:e.sourceNode,tableLayoutOption:{calculateBreakPositionsInside:!0}})},e.finishBreak=function(t,e){return Rn(!0)},e.equalsTo=function(e){return e instanceof t&&e.tableRootNode===this.tableRootNode},e.getPriorityOfFinishBreak=function(){return 0},t}(),cl=function(t){function e(e,u){var n;return(n=t.call(this,e)||this).processor=void 0,n.processor=u,n}return T(e,t),e.prototype.doLayout=function(t,e){var u=this.formattingContext.getRepetitiveElements();if(u&&!u.isAfterLastContent(t)){var n=new dl(t);e.fragmentLayoutConstraints.some((function(t){return n.equalsTo(t)}))||e.fragmentLayoutConstraints.unshift(n)}return this.processor.doLayout(t,e)},e}(Us),dl=function(t){function e(e){var u;return(u=t.call(this,e)||this).flagmentLayoutConstraintType="TableRow",u.cellFragmentLayoutConstraints=[],u}T(e,t);var u=e.prototype;return u.allowLayout=function(t,e,u){var n=this.getRepetitiveElements();return!(n&&!u.pseudoParent&&!Wa(this.nodeContext.viewNode)&&n.isEnableToUpdateState()&&(e&&!t||t&&t.overflow))},u.nextCandidate=function(e){return!!this.collectCellFragmentLayoutConstraints(e,this.nodeContext.formattingContext).some((function(t){return t.constraints.some((function(t){return t.nextCandidate(e)}))}))||t.prototype.nextCandidate.call(this,e)},u.postLayout=function(e,u,n,i){var r=this.nodeContext.formattingContext;if(this.cellFragmentLayoutConstraints=this.collectCellFragmentLayoutConstraints(u,r),this.cellFragmentLayoutConstraints.forEach((function(t){t.constraints.forEach((function(u){u.postLayout(e,t.breakPosition,n,i)}))})),!e){var o=r.getRootViewNode(this.nodeContext);(new al).removeColGroups(r,o),this.removeDummyRowNodes(n)}t.prototype.postLayout.call(this,e,u,n,i)},u.finishBreak=function(e,u){var n=this,i=Pn("finishBreak"),r=this.cellFragmentLayoutConstraints.reduce((function(t,e){return t.concat(e.constraints.map((function(t){return{constraint:t,breakPosition:e.breakPosition}})))}),[]),o=0;return i.loop((function(){if(o<r.length){var t=r[o++];return t.constraint.finishBreak(t.breakPosition,u).thenReturn(!0)}return Rn(!1)})).then((function(){i.finish(!0)})),i.result().thenAsync((function(){return t.prototype.finishBreak.call(n,e,u)}))},u.removeDummyRowNodes=function(t){if(t&&"table-row"===t.display&&t.viewNode)for(;t.viewNode.previousElementSibling;){var e=t.viewNode.previousElementSibling;e.parentNode&&e.parentNode.removeChild(e)}},u.collectCellFragmentLayoutConstraints=function(t,e){return this.getCellFragemnts(t,e).map((function(t){return{constraints:t.fragment.pseudoColumn.getColumn().fragmentLayoutConstraints,breakPosition:t.breakPosition}}))},u.getCellFragemnts=function(t,e){var u=Number.MAX_VALUE;t&&"table-row"===t.display&&(u=e.findRowIndexBySourceNode(t.sourceNode)+1),u=Math.min(e.cellFragments.length,u);for(var n=[],i=0;i<u;i++)e.cellFragments[i]&&e.cellFragments[i].forEach((function(t){t&&n.push({fragment:t,breakPosition:t.findAcceptableBreakPosition().nodeContext})}));return n},u.getElementsOffsetsForTableCell=function(t){var e=this.nodeContext.formattingContext,u=e.findCellFromColumn(t);return u?e.collectElementsOffsetOfUpperCells(u):e.collectElementsOffsetOfHighestColumn()},u.equalsTo=function(t){return t instanceof e&&this.nodeContext.formattingContext===t.nodeContext.formattingContext},e}(zs),fl=new al;p(e.HOOKS.RESOLVE_FORMATTING_CONTEXT,(function(t,e,u,n,i,r){if(!e)return null;if(u===uu.table){var o=t.parent;return new tl(o?o.formattingContext:null,t.sourceNode)}return null})),p(e.HOOKS.RESOLVE_LAYOUT_PROCESSOR,(function(t){return t instanceof tl?fl:null}));var pl={first:!1,end:!1,allowEnd:!1,last:!1};function El(t){var e=t instanceof Le?t:"string"==typeof t?ze(t):uu.none;if(e===uu.none)return pl;for(var u,n=e instanceof $e?e.values:[e],i=Object.create(pl),r=_(n);!(u=r()).done;){var o=u.value;if(o instanceof He)switch(o.name){case"first":i.first=!0;break;case"force-end":i.end=!0;break;case"allow-end":i.end=!0,i.allowEnd=!0;break;case"last":i.last=!0}}return i}var Cl={trimStart:!1,spaceFirst:!1,trimEnd:!1,allowEnd:!1,trimAdjacent:!1,ideographAlpha:!1,ideographNumeric:!1},Fl={trimStart:!0,spaceFirst:!0,trimEnd:!0,allowEnd:!1,trimAdjacent:!0,ideographAlpha:!1,ideographNumeric:!1},Al={trimStart:!0,spaceFirst:!1,trimEnd:!0,allowEnd:!1,trimAdjacent:!0,ideographAlpha:!0,ideographNumeric:!0};function gl(t){var e=t instanceof Le?t:"string"==typeof t?ze(t):uu.normal;if(e===uu.normal)return Fl;if(e===uu.none)return Cl;if(e===uu.auto)return Al;for(var u,n=e instanceof $e?e.values:[e],i=Object.create(Fl),r=_(n);!(u=r()).done;){var o=u.value;if(o instanceof He)switch(o.name){case"trim-start":i.trimStart=!0,i.spaceFirst=!1;break;case"space-start":i.trimStart=!1,i.spaceFirst=!1;break;case"space-first":i.trimStart=!0,i.spaceFirst=!0;break;case"trim-end":i.trimEnd=!0,i.allowEnd=!1;break;case"space-end":i.trimEnd=!1,i.allowEnd=!1;break;case"allow-end":i.trimEnd=!0,i.allowEnd=!0;break;case"trim-adjacent":i.trimAdjacent=!0;break;case"space-adjacent":i.trimAdjacent=!1;break;case"ideograph-alpha":i.ideographAlpha=!0;break;case"ideograph-numeric":i.ideographNumeric=!0}}return i}function vl(t){return t?(t=t.toLowerCase(),/^zh\b.*-(hant|tw|hk)\b/.test(t)?"zh-hant":/^zh\b/.test(t)?"zh-hans":/^ja\b/.test(t)?"ja":/^ko\b/.test(t)?"ko":t):null}function ml(t){return t.reduce((function(t,e){return t+e}),0)/t.length}(new(function(){function t(){this.textSpacingProcessed=!1}var u=t.prototype;return u.getPolyfilledInheritedProps=function(){return["hanging-punctuation","text-spacing"]},u.preprocessSingleDocument=function(t){if(t.body)for(var e=t.createNodeIterator(t.body,NodeFilter.SHOW_TEXT),u=e.nextNode();u;u=e.nextNode()){var n;if(u.parentElement.namespaceURI===X.XHTML&&"true"!==(null==(n=u.parentElement.dataset)?void 0:n.mathTypeset)){var i=u.textContent.replace(/["'-\)\[\]\{\}\xAB\xBB\u0F3A-\u0F3D\u169B\u169C\u2018-\u201F\u2039\u203A\u2045\u2046\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20-\u2E29\u2E42\u2E55-\u2E5C\u3001\u3002\u3008-\u3011\u3014-\u301B\u301D-\u301F\uFD3E\uFD3F\uFE17\uFE18\uFE35-\uFE44\uFE47\uFE48\uFE59-\uFE5E\uFF08\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF3B\uFF3D\uFF5B\uFF5D\uFF5F-\uFF64](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*(?=(?:[\0-\u02FF\u0370-\u0482\u048A-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u060F\u061B-\u064A\u0660-\u066F\u0671-\u06D5\u06DD\u06DE\u06E5\u06E6\u06E9\u06EE-\u0710\u0712-\u072F\u074B-\u07A5\u07B1-\u07EA\u07F4-\u07FC\u07FE-\u0815\u081A\u0824\u0828\u082E-\u0858\u085C-\u0897\u08A0-\u08C9\u08E2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0964-\u0980\u0984-\u09BB\u09BD\u09C5\u09C6\u09C9\u09CA\u09CE-\u09D6\u09D8-\u09E1\u09E4-\u09FD\u09FF\u0A00\u0A04-\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A6F\u0A72-\u0A74\u0A76-\u0A80\u0A84-\u0ABB\u0ABD\u0AC6\u0ACA\u0ACE-\u0AE1\u0AE4-\u0AF9\u0B00\u0B04-\u0B3B\u0B3D\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B61\u0B64-\u0B81\u0B83-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE-\u0BD6\u0BD8-\u0BFF\u0C05-\u0C3B\u0C3D\u0C45\u0C49\u0C4E-\u0C54\u0C57-\u0C61\u0C64-\u0C80\u0C84-\u0CBB\u0CBD\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CE1\u0CE4-\u0CFF\u0D04-\u0D3A\u0D3D\u0D45\u0D49\u0D4E-\u0D56\u0D58-\u0D61\u0D64-\u0D80\u0D84-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF4-\u0E30\u0E32\u0E33\u0E3B-\u0E46\u0E4F-\u0EB0\u0EB2\u0EB3\u0EBD-\u0EC7\u0ECE-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F40-\u0F70\u0F85\u0F88-\u0F8C\u0F98\u0FBD-\u0FC5\u0FC7-\u102A\u103F-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u109E-\u135C\u1360-\u1711\u1716-\u1731\u1735-\u1751\u1754-\u1771\u1774-\u17B3\u17D4-\u17DC\u17DE-\u180A\u180E\u1810-\u1884\u1887-\u18A8\u18AA-\u191F\u192C-\u192F\u193C-\u1A16\u1A1C-\u1A54\u1A5F\u1A7D\u1A7E\u1A80-\u1AAF\u1ACF-\u1AFF\u1B05-\u1B33\u1B45-\u1B6A\u1B74-\u1B7F\u1B83-\u1BA0\u1BAE-\u1BE5\u1BF4-\u1C23\u1C38-\u1CCF\u1CD3\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA-\u1DBF\u1E00-\u20CF\u20F1-\u2CEE\u2CF2-\u2D7E\u2D80-\u2DDF\u2E00-\u3029\u3030-\u3098\u309B-\uA66E\uA673\uA67E-\uA69D\uA6A0-\uA6EF\uA6F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA828-\uA82B\uA82D-\uA87F\uA882-\uA8B3\uA8C6-\uA8DF\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA954-\uA97F\uA984-\uA9B2\uA9C1-\uA9E4\uA9E6-\uAA28\uAA37-\uAA42\uAA44-\uAA4B\uAA4E-\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2-\uAAEA\uAAF0-\uAAF4\uAAF7-\uABE2\uABEB\uABEE-\uD7FF\uE000-\uFB1D\uFB1F-\uFDFF\uFE10-\uFE1F\uFE30-\uFFFF]|\uD800[\uDC00-\uDDFC\uDDFE-\uDEDF\uDEE1-\uDF75\uDF7B-\uDFFF]|[\uD801\uD808-\uD819\uD81C-\uD82E\uD830-\uD832\uD835\uD837\uD839\uD83B-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD802[\uDC00-\uDE00\uDE04\uDE07-\uDE0B\uDE10-\uDE37\uDE3B-\uDE3E\uDE40-\uDEE4\uDEE7-\uDFFF]|\uD803[\uDC00-\uDD23\uDD28-\uDEAA\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFFF]|\uD804[\uDC03-\uDC37\uDC47-\uDC6F\uDC71\uDC72\uDC75-\uDC7E\uDC83-\uDCAF\uDCBB-\uDCC1\uDCC3-\uDCFF\uDD03-\uDD26\uDD35-\uDD44\uDD47-\uDD72\uDD74-\uDD7F\uDD83-\uDDB2\uDDC1-\uDDC8\uDDCD\uDDD0-\uDE2B\uDE38-\uDE3D\uDE3F-\uDEDE\uDEEB-\uDEFF\uDF04-\uDF3A\uDF3D\uDF45\uDF46\uDF49\uDF4A\uDF4E-\uDF56\uDF58-\uDF61\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC00-\uDC34\uDC47-\uDC5D\uDC5F-\uDCAF\uDCC4-\uDDAE\uDDB6\uDDB7\uDDC1-\uDDDB\uDDDE-\uDE2F\uDE41-\uDEAA\uDEB8-\uDF1C\uDF2C-\uDFFF]|\uD806[\uDC00-\uDC2B\uDC3B-\uDD2F\uDD36\uDD39\uDD3A\uDD3F\uDD41\uDD44-\uDDD0\uDDD8\uDDD9\uDDE1-\uDDE3\uDDE5-\uDE00\uDE0B-\uDE32\uDE3A\uDE3F-\uDE46\uDE48-\uDE50\uDE5C-\uDE89\uDE9A-\uDFFF]|\uD807[\uDC00-\uDC2E\uDC37\uDC40-\uDC91\uDCA8\uDCB7-\uDD30\uDD37-\uDD39\uDD3B\uDD3E\uDD46\uDD48-\uDD89\uDD8F\uDD92\uDD98-\uDEF2\uDEF7-\uDFFF]|\uD81A[\uDC00-\uDEEF\uDEF5-\uDF2F\uDF37-\uDFFF]|\uD81B[\uDC00-\uDF4E\uDF50\uDF88-\uDF8E\uDF93-\uDFE3\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD82F[\uDC00-\uDC9C\uDC9F-\uDFFF]|\uD833[\uDC00-\uDEFF\uDF2E\uDF2F\uDF47-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDD2F\uDD37-\uDEAD\uDEAF-\uDEEB\uDEF0-\uDFFF]|\uD83A[\uDC00-\uDCCF\uDCD7-\uDD43\uDD4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))|(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])(?=["'-\)\[\]\{\}\xAB\xBB\u0F3A-\u0F3D\u169B\u169C\u2018-\u201F\u2039\u203A\u2045\u2046\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20-\u2E29\u2E42\u2E55-\u2E5C\u3001\u3002\u3008-\u3011\u3014-\u301B\u301D-\u301F\uFD3E\uFD3F\uFE17\uFE18\uFE35-\uFE44\uFE47\uFE48\uFE59-\uFE5E\uFF08\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF3B\uFF3D\uFF5B\uFF5D\uFF5F-\uFF64])|(?!(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]))(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*(?=(?!(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9\uFF01-\uFF60]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]))(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BEF\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D66-\u0D6F\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F29\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD30-\uDD39\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC66-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF39\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCE9\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]))|(?!(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9\uFF01-\uFF60]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]))(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BEF\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D66-\u0D6F\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F29\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD30-\uDD39\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC66-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF39\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCE9\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*(?=(?!(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]))(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]))/g,"$&\0").split("\0");if(i.length>1){for(var r=i.length-1,o=0;o<r;o++)u.parentNode.insertBefore(t.createTextNode(i[o]),u);u.textContent=i[r]}}}},u.postLayoutBlock=function(t,e,u){for(var n=!t||1===t.fragmentIndex,i=0;i<e.length;i++){var r=e[i];if(!r.after&&r.inline&&!r.display&&r.parent&&r.viewNode.parentNode&&r.viewNode.nodeType===Node.TEXT_NODE&&r.viewNode.textContent.trimStart().length>0){for(var o,a,s,l,D=function(t){if(t.viewNode instanceof Element)return"br"===t.viewNode.localName;if(t.viewNode instanceof Text){var e;if(t.whitespace===tr.PRESERVE){if(/\n\s*$/.test(t.viewNode.textContent))return!0}else if(t.whitespace===tr.NEWLINE&&/\n$/.test(t.viewNode.textContent))return!0;if("br"===(null==(e=t.viewNode.previousElementSibling)?void 0:e.localName))return ur(t.viewNode,t.whitespace)}return!1},h=vl(null!=(o=null!=(a=null!=(s=r.lang)?s:r.parent.lang)?a:null==t?void 0:t.lang)?o:null==t||null==(l=t.parent)?void 0:l.lang),c=gl(r.inheritedProps["text-spacing"]),d=El(r.inheritedProps["hanging-punctuation"]),f=null,p=null,E=0===i&&n,C=!1,F=!1,A=i-1;A>=0;A--){var g=e[A];if(D(g)){C=!0;break}if(!g.display&&g.viewNode.nodeType===Node.TEXT_NODE&&g.viewNode.textContent.length>0){f=g.viewNode;break}if(g.display&&"inline"!==g.display||g.viewNode instanceof Element&&("br"===g.viewNode.localName||Ns[g.viewNode.localName]))break;0===A&&n&&(E=!0,C=!0)}for(var v=i+1;v<e.length;v++){var m=e[v];if(m.viewNode!==r.viewNode&&!m.display&&m.viewNode.nodeType===Node.TEXT_NODE&&m.viewNode.textContent.length>0){p=m.viewNode;break}if(m.display&&"inline"!==m.display||m.viewNode instanceof Element&&("br"===m.viewNode.localName||Ns[m.viewNode.localName]))break;v===e.length-1&&(F=!0)}this.processTextSpacing(r.viewNode,E,C,F,f,p,c,d,h,r.vertical)}}},u.processTextSpacing=function(t,e,u,n,i,r,o,a,s,l){var D,h=t.textContent,c=t.ownerDocument,d=!1,f=!1;function p(t){var e=c.createElement("viv-ts-inner");e.appendChild(c.createTextNode("水"));var u=t.parentElement;u.appendChild(e);var n=l?t.offsetHeight>=.9*e.offsetHeight:t.offsetWidth>=.9*e.offsetWidth;return u.removeChild(e),n}if(e&&a.first&&/^["'\(\[\{\xAB\xBB\u0F3A\u0F3C\u169B\u2018-\u201F\u2039\u203A\u2045\u207D\u208D\u2308\u230A\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20-\u2E22\u2E24\u2E26\u2E28\u2E42\u2E55\u2E57\u2E59\u2E5B\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3F\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(h)?(D="viv-ts-open",d=!0,f=!0):n&&a.last&&/^["'\)\]\}\xAB\xBB\u0F3B\u0F3D\u169C\u2018\u2019\u201B-\u201D\u201F\u2039\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(h)||a.end&&/^[\u3001\u3002\uFF0C\uFF0E\uFF61\uFF64](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(h)?(D="viv-ts-close",d=!0,f=!0):(o.trimStart||o.trimAdjacent)&&/^[\u2018\u201C\u2329\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFF08\uFF3B\uFF5B\uFF5F](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(h)?(D="viv-ts-open",d=!0):(o.trimEnd||o.trimAdjacent)&&(/^[\u2019\u201D\u232A\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFF09\uFF3D\uFF5D\uFF60](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(h)||"zh-hans"===s&&/^[\uFF1A\uFF1B](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(h)||"zh-hant"!==s&&/^[\u3001\u3002\uFF0C\uFF0E](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(h))&&(D="viv-ts-close",d=!0),d){var E=c.createElement(D),C=c.createElement("viv-ts-inner");E.appendChild(C),t.parentNode.insertBefore(E,t),C.appendChild(t),f||p(C)?"viv-ts-open"===D?f&&a.first?E.className="viv-hang-first":i&&/[\(\)\[\]\{\}\xAB\xB7\xBB\u0F3A-\u0F3D\u169B\u169C\u2018-\u201F\u2027\u2039\u203A\u2045\u2046\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2E02-\u2E05\u2E09\u2E0A\u2E0C\u2E0D\u2E1C\u2E1D\u2E20-\u2E29\u2E42\u2E55-\u2E5C\u3000-\u3002\u3008-\u3011\u3014-\u301B\u301D-\u301F\u30FB\uFD3E\uFD3F\uFE17\uFE18\uFE35-\uFE44\uFE47\uFE48\uFE59-\uFE5E\uFF08\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF3B\uFF3D\uFF5B\uFF5D\uFF5F\uFF60\uFF62\uFF63](?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(i.textContent)?o.trimAdjacent&&(E.className="viv-ts-trim"):e||u?E.className=o.spaceFirst||!o.trimStart?"viv-ts-first viv-ts-space":"viv-ts-first":o.trimStart||(E.className="viv-ts-space"):"viv-ts-close"===D&&(f&&a.last?E.className="viv-hang-last":r&&/^[\)\]\}\xB7\xBB\u0F3B\u0F3D\u169C\u2019\u201D\u2027\u203A\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u2E56\u2E58\u2E5A\u2E5C\u3000-\u3002\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\u30FB\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF3D\uFF5D\uFF60\uFF63]/.test(r.textContent)?o.trimAdjacent&&(E.className="viv-ts-trim"):f&&a.end?E.className=p(C)?"viv-hang-end":"viv-hang-end viv-hang-hw":o.trimEnd||(E.className="viv-ts-space")):(E.parentNode.insertBefore(t,E),E.parentNode.removeChild(E),d=!1)}else d=!1;var F=!1;function A(t){return!!(t&&t instanceof HTMLElement)&&("upright"===t.style.textOrientation||"all"===t.style.textCombineUpright||A(t.parentElement))}(o.ideographAlpha||o.ideographNumeric)&&(!(i&&/^(?!(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]))(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/.test(h)&&(o.ideographAlpha&&/(?!(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9\uFF01-\uFF60]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]))(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(i.textContent)||o.ideographNumeric&&/(?![\uFF01-\uFF60])(?:[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9\uDD50-\uDD59]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD83A[\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(i.textContent)))||l&&A(i.parentElement)||(t.parentNode.insertBefore(c.createElement("viv-ts-thin-sp"),t),F=!0),!(r&&/(?!(?:[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]))(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])(?:[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD803[\uDD24-\uDD27\uDEAB\uDEAC\uDF46-\uDF50\uDF82-\uDF85]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC70\uDC73\uDC74\uDC7F-\uDC82\uDCB0-\uDCBA\uDCC2\uDD00-\uDD02\uDD27-\uDD34\uDD45\uDD46\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDDC9-\uDDCC\uDDCE\uDDCF\uDE2C-\uDE37\uDE3E\uDEDF-\uDEEA\uDF00-\uDF03\uDF3B\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC35-\uDC46\uDC5E\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDDDC\uDDDD\uDE30-\uDE40\uDEAB-\uDEB7\uDF1D-\uDF2B]|\uD806[\uDC2C-\uDC3A\uDD30-\uDD35\uDD37\uDD38\uDD3B-\uDD3E\uDD40\uDD42\uDD43\uDDD1-\uDDD7\uDDDA-\uDDE0\uDDE4\uDE01-\uDE0A\uDE33-\uDE39\uDE3B-\uDE3E\uDE47\uDE51-\uDE5B\uDE8A-\uDE99]|\uD807[\uDC2F-\uDC36\uDC38-\uDC3F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD31-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD45\uDD47\uDD8A-\uDD8E\uDD90\uDD91\uDD93-\uDD97\uDEF3-\uDEF6]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF4F\uDF51-\uDF87\uDF8F-\uDF92\uDFE4\uDFF0\uDFF1]|\uD82F[\uDC9D\uDC9E]|\uD833[\uDF00-\uDF2D\uDF30-\uDF46]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD30-\uDD36\uDEAE\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD4A]|\uDB40[\uDD00-\uDDEF])*$/.test(h)&&(o.ideographAlpha&&/^(?!(?:[\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u3005\u3007\u3021-\u3029\u3038-\u303B\u3041-\u30FF\u31C0-\u31FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFA6D\uFA70-\uFAD9\uFF01-\uFF60]|\uD81B[\uDFE2\uDFE3\uDFF0\uDFF1]|[\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]))(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/.test(r.textContent)||o.ideographNumeric&&/^(?![\uFF01-\uFF60])(?:[0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD801[\uDCA0-\uDCA9]|\uD803[\uDD30-\uDD39]|\uD804[\uDC66-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF39]|\uD806[\uDCE0-\uDCE9\uDD50-\uDD59]|\uD807[\uDC50-\uDC59\uDD50-\uDD59\uDDA0-\uDDA9]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD83A[\uDD50-\uDD59]|\uD83E[\uDFF0-\uDFF9])/.test(r.textContent)))||l&&A(r.parentElement)||(t.parentNode.insertBefore(c.createElement("viv-ts-thin-sp"),t.nextSibling),F=!0)),(d||F)&&(this.textSpacingProcessed||(this.initTextPolyfillCss(c.head),this.textSpacingProcessed=!0))},u.initTextPolyfillCss=function(t){var e=t.ownerDocument.createElement("style");e.textContent=Jn,t.appendChild(e)},u.registerHooks=function(){p(e.HOOKS.POLYFILLED_INHERITED_PROPS,this.getPolyfilledInheritedProps.bind(this)),p(e.HOOKS.PREPROCESS_SINGLE_DOCUMENT,this.preprocessSingleDocument.bind(this)),p(e.HOOKS.POST_LAYOUT_BLOCK,this.postLayoutBlock.bind(this))},t}())).registerHooks();var Bl=function(t,e){this.layoutResult=void 0,this.penalty=void 0,this.layoutResult=t,this.penalty=e};function wl(t){return t.vertical?t.width:t.height}function yl(t,e){t.vertical?t.width=e:t.height=e}var Nl=function(){function t(t,e,u){this.layoutContainer=void 0,this.columnGenerator=void 0,this.regionPageFloatLayoutContext=void 0,this.originalContainerBlockSize=void 0,this.layoutContainer=t,this.columnGenerator=e,this.regionPageFloatLayoutContext=u,this.originalContainerBlockSize=wl(t)}var e=t.prototype;return e.balanceColumns=function(t){var e=this,u=Pn("ColumnBalancer#balanceColumns");this.preBalance(t),this.savePageFloatLayoutContexts(t),this.layoutContainer.clear();var n=[this.createTrialResult(t)];return u.loopWithFrame((function(t){e.hasNextCandidate(n)?(e.updateCondition(n),e.columnGenerator().then((function(u){e.savePageFloatLayoutContexts(u),e.layoutContainer.clear(),u?(n.push(e.createTrialResult(u)),t.continueLoop()):t.breakLoop()}))):t.breakLoop()})).then((function(){var t=n.reduce((function(t,e){return e.penalty<t.penalty?e:t}),n[0]);e.restoreContents(t.layoutResult),e.postBalance(),u.finish(t.layoutResult)})),u.result()},e.createTrialResult=function(t){var e=this.calculatePenalty(t);return new Bl(t,e)},e.preBalance=function(t){},e.postBalance=function(){yl(this.layoutContainer,this.originalContainerBlockSize)},e.savePageFloatLayoutContexts=function(t){var e=this.regionPageFloatLayoutContext.detachChildren();t&&(t.columnPageFloatLayoutContexts=e)},e.restoreContents=function(t){var e=this.layoutContainer.element;t.columns.forEach((function(t){e.appendChild(t.element)})),this.regionPageFloatLayoutContext.attachChildren(t.columnPageFloatLayoutContexts)},t}();function bl(t){var e=t[t.length-1];if(0===e.penalty)return!1;var u=t[t.length-2];if(u&&e.penalty>=u.penalty)return!1;var n=e.layoutResult.columns;return Math.max.apply(null,n.map((function(t){return t.computedBlockSize})))>Math.max.apply(null,n.map((function(t){return t.getMaxBlockSizeOfPageFloats()})))+1}function Sl(t,e){var u=Math.max.apply(null,t[t.length-1].layoutResult.columns.map((function(t){return isNaN(t.blockDistanceToBlockEndFloats)?t.computedBlockSize:t.computedBlockSize-t.blockDistanceToBlockEndFloats+1})))-1;u<wl(e)?yl(e,u):yl(e,wl(e)-1)}var Tl=function(t){function e(e,u,n,i){var r;return(r=t.call(this,n,e,u)||this).columnCount=void 0,r.originalPosition=null,r.foundUpperBound=!1,r.columnCount=i,r}T(e,t);var u=e.prototype;return u.preBalance=function(t){var e=t.columns.reduce((function(t,e){return t+e.computedBlockSize}),0);yl(this.layoutContainer,e/this.columnCount),this.originalPosition=t.position},u.checkPosition=function(t){return this.originalPosition?this.originalPosition.isSamePosition(t):null===t},u.calculatePenalty=function(t){if(!this.checkPosition(t.position))return 1/0;var e=t.columns;return xl(e)?1/0:Math.max.apply(null,e.map((function(t){return t.computedBlockSize})))},u.hasNextCandidate=function(t){if(1===t.length)return!0;if(this.foundUpperBound)return bl(t);var e=t[t.length-1];return this.checkPosition(e.layoutResult.position)&&!xl(e.layoutResult.columns)?(this.foundUpperBound=!0,!0):wl(this.layoutContainer)<this.originalContainerBlockSize},u.updateCondition=function(t){if(this.foundUpperBound)Sl(t,this.layoutContainer);else{var e=Math.min(this.originalContainerBlockSize,wl(this.layoutContainer)+.1*this.originalContainerBlockSize);yl(this.layoutContainer,e)}},e}(Nl);function xl(t){if(t.length<=1)return!1;var e=t[t.length-1].computedBlockSize;return t.slice(0,t.length-1).every((function(t){return e>t.computedBlockSize}))}var Il,Pl=function(t){function e(e,u,n){return t.call(this,n,e,u)||this}T(e,t);var u=e.prototype;return u.calculatePenalty=function(t){if(t.columns.every((function(t){return 0===t.computedBlockSize})))return 1/0;var e,u,n=t.columns.filter((function(t){return!t.pageBreakType})).map((function(t){return t.computedBlockSize}));return u=ml(e=n),ml(e.map((function(t){var e=t-u;return e*e})))},u.hasNextCandidate=function(t){return bl(t)},u.updateCondition=function(t){Sl(t,this.layoutContainer)},e}(Nl),Rl=function(t,e,u){this.endStuckFixed=void 0,this.endFixed=void 0,this.endSlipped=void 0,this.endStuckFixed=t,this.endFixed=e,this.endSlipped=u},Ll=function(){function t(){this.map=[]}var e=t.prototype;return e.getMaxFixed=function(){return 0==this.map.length?0:this.map[this.map.length-1].endFixed},e.getMaxSlipped=function(){return 0==this.map.length?0:this.map[this.map.length-1].endSlipped},e.addStuckRange=function(t){if(0==this.map.length)this.map.push(new Rl(t,t,t));else{var e=this.map[this.map.length-1],u=e.endSlipped+t-e.endFixed;e.endFixed==e.endStuckFixed?(e.endFixed=t,e.endStuckFixed=t,e.endSlipped=u):this.map.push(new Rl(t,t,u))}},e.addSlippedRange=function(t){0==this.map.length?this.map.push(new Rl(t,0,0)):this.map[this.map.length-1].endFixed=t},e.slippedByFixed=function(t){var e=this,u=ct(this.map.length,(function(u){return t<=e.map[u].endFixed})),n=this.map[u];return n.endSlipped-Math.max(0,n.endStuckFixed-t)},e.fixedBySlipped=function(t){var e=this,u=ct(this.map.length,(function(u){return t<=e.map[u].endSlipped})),n=this.map[u];return n.endStuckFixed-(n.endSlipped-t)},t}(),Ol=function(){function t(e,u,n,i,r,o,a,s){if(this.context=void 0,this.style=void 0,this.offset=void 0,this.isRoot=void 0,this.flowChunk=void 0,this.atBlockStart=void 0,this.atFlowStart=void 0,this.isParentBoxDisplayed=void 0,this.flowName=void 0,this.isBlockValue=null,this.hasBoxValue=null,this.styleValues={},this.beforeBox=null,this.afterBox=null,this.breakBefore=null,this.context=e,this.style=u,this.offset=n,this.isRoot=i,this.flowChunk=r,this.atBlockStart=o,this.atFlowStart=a,this.isParentBoxDisplayed=s,this.flowName=r.flowName,this.hasBox()){var l=u._pseudos;if(l&&l.before){var D=new t(e,l.before,n,!1,r,this.isBlock(),a,!0);mr(D.styleValue("content"))&&(this.beforeBox=D,this.breakBefore=D.breakBefore)}}this.breakBefore=Va(this.getBreakValue("before"),this.breakBefore),this.atFlowStart&&Oa(this.breakBefore)&&(r.breakBefore=Va(r.breakBefore,this.breakBefore))}var e=t.prototype;return e.buildAfterPseudoElementBox=function(e,u,n){if(this.hasBox()){var i=this.style._pseudos;if(i&&i.after){var r=new t(this.context,i.after,e,!1,this.flowChunk,u,n,!0);mr(r.styleValue("content"))&&(this.afterBox=r)}}},e.styleValue=function(t,e){if(!(t in this.styleValues)){var u=this.style[t];this.styleValues[t]=u?u.evaluate(this.context,t):e||null}return this.styleValues[t]},e.displayValue=function(){return this.styleValue("display",uu.inline)},e.isBlock=function(){if(null===this.isBlockValue){var t=this.displayValue(),e=this.styleValue("position"),u=this.styleValue("float");this.isBlockValue=ns(t,e,u,this.isRoot)}return this.isBlockValue},e.hasBox=function(){return null===this.hasBoxValue&&(this.hasBoxValue=this.isParentBoxDisplayed&&this.displayValue()!==uu.none),this.hasBoxValue},e.getBreakValue=function(t){var e=null;if(this.isBlock()){var u=this.styleValue("break-"+t);u&&(e=u.toString())}return e},t}(),kl=function(){function t(t){this.context=void 0,this.stack=[],this.atBlockStart=!0,this.atFlowStart=!0,this.atStartStack=[],this.context=t}var e=t.prototype;return e.empty=function(){return 0===this.stack.length},e.lastBox=function(){return this.stack[this.stack.length-1]},e.lastFlowName=function(){var t=this.lastBox();return t?t.flowChunk.flowName:null},e.isCurrentBoxDisplayed=function(){return this.stack.every((function(t){return t.displayValue()!==uu.none}))},e.push=function(t,e,u,n){var i=this.lastBox();n&&i&&n.flowName!==i.flowName&&this.atStartStack.push({atBlockStart:this.atBlockStart,atFlowStart:this.atFlowStart});var r=n||i.flowChunk,o=this.atFlowStart||!!n,a=this.isCurrentBoxDisplayed(),s=new Ol(this.context,t,e,u,r,o||this.atBlockStart,o,a);return this.stack.push(s),this.atBlockStart=s.hasBox()?!s.beforeBox&&s.isBlock():this.atBlockStart,this.atFlowStart=s.hasBox()?!s.beforeBox&&o:this.atFlowStart,s},e.encounteredTextNode=function(t){var e=this.lastBox();t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.CDATA_SECTION_NODE||!this.atBlockStart&&!this.atFlowStart||!e.hasBox()||ur(t,er(e.styleValue("white-space",uu.normal).toString()))||(this.atBlockStart=!1,this.atFlowStart=!1)},e.pop=function(t){var e=this.stack.pop();if(e.buildAfterPseudoElementBox(t,this.atBlockStart,this.atFlowStart),this.atFlowStart&&e.afterBox){var u=e.afterBox.getBreakValue("before");e.flowChunk.breakBefore=Va(e.flowChunk.breakBefore,u)}var n=this.lastBox();if(n)if(n.flowName===e.flowName)e.hasBox()&&(this.atBlockStart=this.atFlowStart=!1);else{var i=this.atStartStack.pop();this.atBlockStart=i.atBlockStart,this.atFlowStart=i.atFlowStart}return e},e.nearestBlockStartOffset=function(t){if(!t.atBlockStart)return t.offset;var e=this.stack.length-1,u=this.stack[e];for(u===t&&(e--,u=this.stack[e]);e>=0;){if(u.flowName!==t.flowName)return t.offset;if(!u.atBlockStart)return u.offset;if(u.isRoot)return u.offset;t=u,u=this.stack[--e]}throw new Error("No block start offset found!")},t}(),_l=function(){function t(t,e,u,n,i,r,o,a){this.xmldoc=void 0,this.scope=void 0,this.context=void 0,this.primaryFlows=void 0,this.validatorSet=void 0,this.counterListener=void 0,this.root=void 0,this.cascadeHolder=void 0,this.last=void 0,this.rootStyle={},this.styleMap={},this.flows={},this.flowChunks=[],this.flowListener=null,this.flowToReach=null,this.idToReach=null,this.cascade=void 0,this.offsetMap=void 0,this.primary=!0,this.primaryStack=[],this.rootBackgroundAssigned=!1,this.rootLayoutAssigned=!1,this.lastOffset=void 0,this.breakBeforeValues={},this.boxStack=void 0,this.bodyReached=!0,this.xmldoc=t,this.scope=u,this.context=n,this.primaryFlows=i,this.validatorSet=r,this.counterListener=o,this.root=t.root,this.cascadeHolder=e,this.last=this.root,this.cascade=e.createInstance(n,o,a,t.lang),this.offsetMap=new Ll;var s=t.getElementOffset(this.root);this.lastOffset=s,this.boxStack=new kl(n),this.offsetMap.addStuckRange(s);var l=this.getAttrStyle(this.root);this.cascade.pushElement(this.root,l,s),this.postprocessTopStyle(l,!1),this.root.namespaceURI===X.XHTML&&(this.bodyReached=!1),this.primaryStack.push(!0),this.styleMap={},this.styleMap["e"+s]=l,this.lastOffset++,this.replayFlowElementsFromOffset(-1)}var e=t.prototype;return e.hasProp=function(t,e,u){var n=t[u];return n&&n.evaluate(this.context)!==e[u]},e.transferPropsToRoot=function(t,e){for(var u in e){var n=t[u];if(n)this.rootStyle[u]=n,delete t[u];else{var i=e[u];i&&(this.rootStyle[u]=new Lr(i,33554432))}}},e.postprocessTopStyle=function(t,e){var u=this;if(["writing-mode","direction"].forEach((function(n){!t[n]||e&&u.rootStyle[n]||(u.rootStyle[n]=t[n])})),!this.rootBackgroundAssigned){var n=this.hasProp(t,this.validatorSet.backgroundProps,"background-color")?t["background-color"].evaluate(this.context):null,i=this.hasProp(t,this.validatorSet.backgroundProps,"background-image")?t["background-image"].evaluate(this.context):null;(n&&n!==uu.inherit||i&&i!==uu.inherit)&&(this.transferPropsToRoot(t,this.validatorSet.backgroundProps),this.rootBackgroundAssigned=!0)}if(!this.rootLayoutAssigned)for(var r=0;r<Ml.length;r++)if(this.hasProp(t,this.validatorSet.layoutProps,Ml[r])){this.transferPropsToRoot(t,this.validatorSet.layoutProps),this.rootLayoutAssigned=!0;break}if(!e){var o=t["font-size"],a=!0;if(o){var s=o.evaluate(this.context),l=s.num;switch(s.unit){case"em":case"rem":l*=this.context.initialFontSize;break;case"ex":l*=this.context.initialFontSize*zt.ex/zt.em;break;case"%":l*=this.context.initialFontSize/100;break;default:var D=zt[s.unit];D&&(l*=D),a=!1}this.context.rootFontSize=l,this.context.isRelativeRootFontSize=a}}},e.getTopContainerStyle=function(){for(var t=0;!this.bodyReached&&this.styleUntil(t+=5e3,0)!=Number.POSITIVE_INFINITY;);return this.rootStyle},e.getAttrStyle=function(t){if(t.style instanceof CSSStyleDeclaration){var e=t.getAttribute("style");if(e)return function(t,e,u,n){var i=new ua(t,e),r=new Sn(n,i);try{!function(t,e,u){new Si(ci,t,e,u).runParser(Number.POSITIVE_INFINITY,!1,!0,!1,!1)}(r,i,u)}catch(t){c.warn(t,"Style attribute parse error:")}return i.elementStyle}(this.scope,this.validatorSet,this.xmldoc.url,e)}return{}},e.getReachedOffset=function(){return this.lastOffset},e.replayFlowElementsFromOffset=function(t){if(!(t>=this.lastOffset)){var e=this.context,u=this.xmldoc.getElementOffset(this.root);if(t<u){var n=this.getStyle(this.root,!1),i=Vr(n,"flow-into"),r=i?i.evaluate(e,"flow-into").toString():"body",o=this.encounteredFlowElement(r,n,this.root,u);this.boxStack.empty()&&this.boxStack.push(n,u,!0,o)}var a=this.xmldoc.getNodeByOffset(t),s=this.xmldoc.getNodeOffset(a,0,!1);if(!(s>=this.lastOffset))for(;;){if(1!=a.nodeType)s+=a.textContent.length;else{var l=a,D=this.getStyle(l,!1),h=D["flow-into"];if(h){var c=h.evaluate(e,"flow-into").toString();this.encounteredFlowElement(c,D,l,s)}s++}if(s>=this.lastOffset)break;var d=a.firstChild;if(null==d)for(;!(d=a.nextSibling);)if((a=a.parentNode)===this.root)return;a=d}}},e.resetFlowChunkStream=function(t){this.flowListener=t;for(var e=0;e<this.flowChunks.length;e++)this.flowListener.encounteredFlowChunk(this.flowChunks[e],this.flows[this.flowChunks[e].flowName])},e.styleUntilFlowIsReached=function(t){this.flowToReach=t;for(var e=0;null!=this.flowToReach&&this.styleUntil(e+=5e3,0)!=Number.POSITIVE_INFINITY;);},e.styleUntilIdIsReached=function(t){if(t){this.idToReach=t;for(var e=0;this.idToReach&&this.styleUntil(e+=5e3,0)!==Number.POSITIVE_INFINITY;);this.idToReach=null}},e.encounteredFlowElement=function(t,e,u,n){var i=0,r=Number.POSITIVE_INFINITY,o=!1,a=!1,s=!1,l=e["flow-options"];if(l){var D=function(t){if(t){var e=new Iu;try{return t.visit(e),e.propSet}catch(t){c.warn(t,"toSet:")}}return{}}(l.evaluate(this.context,"flow-options"));o=!!D.exclusive,a=!!D.static,s=!!D.last}var h=e["flow-linger"];h&&(r=Ru(h.evaluate(this.context,"flow-linger"),Number.POSITIVE_INFINITY));var d=e["flow-priority"];d&&(i=Ru(d.evaluate(this.context,"flow-priority"),0));var f=this.breakBeforeValues[n]||null,p=this.flows[t];if(!p){var E=this.boxStack.lastFlowName();p=this.flows[t]=new nr(t,E)}var C=new ir(t,u,n,i,r,o,a,s,f);return this.flowChunks.push(C),this.flowToReach==t&&(this.flowToReach=null),this.flowListener&&this.flowListener.encounteredFlowChunk(C,p),C},e.registerForcedBreakOffset=function(t,e,u){if(Oa(t)){var n=this.flows[u].forcedBreakOffsets;(0===n.length||n[n.length-1]<e)&&n.push(e)}this.breakBeforeValues[e]=Va(this.breakBeforeValues[e],t)},e.styleUntil=function(t,e){var u=-1;if(t<=this.lastOffset&&(u=this.offsetMap.slippedByFixed(t)+e)<this.offsetMap.getMaxSlipped())return this.offsetMap.fixedBySlipped(u);if(null==this.last)return Number.POSITIVE_INFINITY;for(var n=this.context;;){var i=this.last.firstChild;if(null==i)for(;;){if(1==this.last.nodeType){this.cascade.popElement(this.last),this.primary=this.primaryStack.pop();var r=this.boxStack.pop(this.lastOffset),o=null;if(r.afterBox){var a=r.afterBox.getBreakValue("before");this.registerForcedBreakOffset(a,r.afterBox.atBlockStart?this.boxStack.nearestBlockStartOffset(r):r.afterBox.offset,r.flowName),o=r.afterBox.getBreakValue("after")}o=Va(o,r.getBreakValue("after")),this.registerForcedBreakOffset(o,this.lastOffset,r.flowName)}if(i=this.last.nextSibling)break;if(this.last=this.last.parentNode,this.last===this.root)return this.last=null,t<this.lastOffset&&(u<0&&(u=this.offsetMap.slippedByFixed(t)+e),u<=this.offsetMap.getMaxSlipped())?this.offsetMap.fixedBySlipped(u):Number.POSITIVE_INFINITY}if(this.last=i,1!=this.last.nodeType)this.lastOffset+=this.last.textContent.length,this.boxStack.encounteredTextNode(this.last),this.primary?this.offsetMap.addStuckRange(this.lastOffset):this.offsetMap.addSlippedRange(this.lastOffset);else{var s=this.last,l=this.getAttrStyle(s);this.primaryStack.push(this.primary),this.cascade.pushElement(s,l,this.lastOffset);var D=s.getAttribute("id")||s.getAttributeNS(X.XML,"id");D&&D===this.idToReach&&(this.idToReach=null),this.bodyReached||"body"!=s.localName||s.parentNode!=this.root||(this.postprocessTopStyle(l,!0),this.bodyReached=!0);var h=void 0,c=l["flow-into"];if(c){var d=c.evaluate(n,"flow-into").toString(),f=this.encounteredFlowElement(d,l,s,this.lastOffset);this.primary=!!this.primaryFlows[d],h=this.boxStack.push(l,this.lastOffset,s===this.root,f)}else h=this.boxStack.push(l,this.lastOffset,s===this.root),s===this.xmldoc.body&&(h.breakBefore=Va(h.flowChunk.breakBefore,h.breakBefore));var p=this.boxStack.nearestBlockStartOffset(h);if(0===p){var E,C=null==(E=l.page)?void 0:E.value.toString();C&&"auto"!==C.toLowerCase()&&(this.cascade.firstPageType=C)}if(this.registerForcedBreakOffset(h.breakBefore,p,h.flowName),h.beforeBox){var F=h.beforeBox.getBreakValue("after");this.registerForcedBreakOffset(F,h.beforeBox.atBlockStart?p:h.offset,h.flowName)}if(this.primary&&h.displayValue()===uu.none&&(this.primary=!1),this.styleMap["e"+this.lastOffset]=l,this.lastOffset++,this.primary?this.offsetMap.addStuckRange(this.lastOffset):this.offsetMap.addSlippedRange(this.lastOffset),this.bodyReached&&0===p)continue;if(t<this.lastOffset&&(u<0&&(u=this.offsetMap.slippedByFixed(t)+e),u<=this.offsetMap.getMaxSlipped()))return this.offsetMap.fixedBySlipped(u)}}},e.getStyle=function(t,e){var u=this.xmldoc.getElementOffset(t),n="e"+u;return e&&(u=this.xmldoc.getNodeOffset(t,0,!0)),this.lastOffset<=u&&this.styleUntil(u,0),this.styleMap[n]},e.processContent=function(t,e){},t}(),Ml=["column-count","column-width","column-fill"],Ul=function(){function t(t){this.validator=void 0,this.success=null,this.failure=null,this.code=0,this.validator=t}var e=t.prototype;return e.isSpecial=function(){return 0!=this.code},e.markAsStartGroup=function(){this.code=-1},e.isStartGroup=function(){return-1==this.code},e.markAsEndGroup=function(){this.code=-2},e.isEndGroup=function(){return-2==this.code},e.markAsStartAlternate=function(t){this.code=2*t+1},e.isStartAlternate=function(){return this.code>0&&this.code%2!=0},e.markAsEndAlternate=function(t){this.code=2*t+2},e.isEndAlternate=function(){return this.code>0&&this.code%2==0},e.getAlternate=function(){return Math.floor((this.code-1)/2)},t}(),Vl=function(t,e){this.where=void 0,this.success=void 0,this.what=-1,this.where=t,this.success=e};!function(t){t[t.FOLLOW=1]="FOLLOW",t[t.OPTIONAL=2]="OPTIONAL",t[t.REPEATED=3]="REPEATED",t[t.ALTERNATE=4]="ALTERNATE"}(Il||(Il={}));var Hl=function(){function t(){this.nodes=[],this.connections=[],this.match=[],this.nomatch=[],this.error=[],this.emptyHead=!0}var e=t.prototype;return e.connect=function(t,e){for(var u=0;u<t.length;u++)this.connections[t[u]].what=e;t.splice(0,t.length)},e.clone=function(){for(var e,u,n,i=new t,r=0;r<this.nodes.length;r++){var o=this.nodes[r],a=new Ul(o.validator);a.code=o.code,i.nodes.push(a)}for(var s=0;s<this.connections.length;s++){var l=this.connections[s],D=new Vl(l.where,l.success);D.what=l.what,i.connections.push(D)}return(e=i.match).push.apply(e,this.match),(u=i.nomatch).push.apply(u,this.nomatch),(n=i.error).push.apply(n,this.error),i},e.addSpecialToArr=function(t,e,u){var n=this.nodes.length,i=new Ul(Wl);u>=0?e?i.markAsStartAlternate(u):i.markAsEndAlternate(u):e?i.markAsStartGroup():i.markAsEndGroup(),this.nodes.push(i),this.connect(t,n);var r=new Vl(n,!0),o=new Vl(n,!1);t.push(this.connections.length),this.connections.push(o),t.push(this.connections.length),this.connections.push(r)},e.endSpecialGroup=function(){for(var t=[this.match,this.nomatch,this.error],e=0;e<t.length;e++)this.addSpecialToArr(t[e],!1,-1)},e.startSpecialGroup=function(){if(this.nodes.length)throw new Error("invalid call");this.addSpecialToArr(this.match,!0,-1)},e.endClause=function(t){this.addSpecialToArr(this.match,!1,t)},e.startClause=function(t){if(this.nodes.length)throw new Error("invalid call");var e=new Ul(Wl);e.markAsStartAlternate(t),this.nodes.push(e);var u=new Vl(0,!0),n=new Vl(0,!1);this.nomatch.push(this.connections.length),this.connections.push(n),this.match.push(this.connections.length),this.connections.push(u)},e.addPrimitive=function(t){var e=this.nodes.length;this.nodes.push(new Ul(t));var u=new Vl(e,!0),n=new Vl(e,!1);this.connect(this.match,e),this.emptyHead?(this.nomatch.push(this.connections.length),this.emptyHead=!1):this.error.push(this.connections.length),this.connections.push(n),this.match.push(this.connections.length),this.connections.push(u)},e.isSimple=function(){return 1==this.nodes.length&&!this.nodes[0].isSpecial()},e.isPrimitive=function(){return this.isSimple()&&this.nodes[0].validator instanceof Gl},e.addGroup=function(t,e){if(0!=t.nodes.length){var u=this.nodes.length;if(e==Il.ALTERNATE&&1==u&&t.isPrimitive()&&this.isPrimitive())this.nodes[0].validator=this.nodes[0].validator.combine(t.nodes[0].validator);else{for(var n=0;n<t.nodes.length;n++)this.nodes.push(t.nodes[n]);e==Il.ALTERNATE?(this.emptyHead=!0,this.connect(this.nomatch,u)):this.connect(this.match,u);for(var i=this.connections.length,r=0;r<t.connections.length;r++){var o=t.connections[r];o.where+=u,o.what>=0&&(o.what+=u),this.connections.push(o)}for(var a=0;a<t.match.length;a++)this.match.push(t.match[a]+i);if(e==Il.REPEATED&&this.connect(this.match,u),e==Il.OPTIONAL||e==Il.REPEATED)for(var s=0;s<t.nomatch.length;s++)this.match.push(t.nomatch[s]+i);else if(this.emptyHead){for(var l=0;l<t.nomatch.length;l++)this.nomatch.push(t.nomatch[l]+i);this.emptyHead=t.emptyHead}else for(var D=0;D<t.nomatch.length;D++)this.error.push(t.nomatch[D]+i);for(var h=0;h<t.error.length;h++)this.error.push(t.error[h]+i);t.nodes=null,t.connections=null}}},e.finish=function(t,e){var u=this.nodes.length;this.nodes.push(t),this.nodes.push(e),this.connect(this.match,u),this.connect(this.nomatch,u+1),this.connect(this.error,u+1);for(var n,i=_(this.connections);!(n=i()).done;){var r=n.value;r.success?this.nodes[r.where].success=this.nodes[r.what]:this.nodes[r.where].failure=this.nodes[r.what]}for(var o=0;o<u;o++)if(null==this.nodes[o].failure||null==this.nodes[o].success)throw new Error("Invalid validator state");return this.nodes[0]},t}(),zl=function(t){function e(){return t.call(this)||this}return T(e,t),e.prototype.validateForShorthand=function(t,e){var u=t[e].visit(this);return u?[u]:null},e}(Pe),Gl=function(t){function e(e,u,n){var i;return(i=t.call(this)||this).allowed=void 0,i.idents=void 0,i.units=void 0,i.allowed=e,i.idents=u,i.units=n,i}T(e,t);var u=e.prototype;return u.visitEmpty=function(t){return 1&this.allowed?t:null},u.visitSlash=function(t){return 2048&this.allowed?t:null},u.visitStr=function(t){return 2&this.allowed?t:null},u.visitIdent=function(t){return this.idents[t.name.toLowerCase()]||(4&this.allowed?t:null)},u.visitNumeric=function(t){return 0!=t.num||512&this.allowed?t.num<0&&!(256&this.allowed)?null:this.units[t.unit]?t:null:"%"==t.unit&&1024&this.allowed?t:null},u.visitNum=function(t){return 0==t.num?512&this.allowed?t:null:t.num<=0&&!(256&this.allowed)?null:16&this.allowed?t:null},u.visitInt=function(t){return 0==t.num?512&this.allowed?t:null:t.num<=0&&!(256&this.allowed)?null:48&this.allowed?t:this.idents[""+t.num]||null},u.visitColor=function(t){return 64&this.allowed?t:null},u.visitURL=function(t){return 128&this.allowed?t:null},u.visitURange=function(t){return 4096&this.allowed?t:null},u.visitSpaceList=function(t){return null},u.visitCommaList=function(t){return null},u.visitFunc=function(t){return null},u.visitExpr=function(t){return 2046&this.allowed?t:null},u.combine=function(t){var u={},n={};for(var i in this.idents)u[i]=this.idents[i];for(var r in t.idents)u[r]=t.idents[r];for(var o in this.units)n[o]=this.units[o];for(var a in t.units)n[a]=t.units[a];return new e(this.allowed|t.allowed,u,n)},e}(zl),Xl={},Wl=new Gl(0,Xl,Xl),jl=function(t){function e(e){var u;return(u=t.call(this)||this).successTerminal=void 0,u.failureTerminal=void 0,u.first=void 0,u.successTerminal=new Ul(null),u.failureTerminal=new Ul(null),u.first=e.finish(u.successTerminal,u.failureTerminal),u}T(e,t);var u=e.prototype;return u.validateList=function(t,e,u){for(var n=e?[]:t,i=this.first,r=u,o=null,a=null;i!==this.successTerminal&&i!==this.failureTerminal;)if(r>=t.length)i=i.failure;else{var s=t[r],l=s;if(i.isSpecial()){var D=!0;i.isStartGroup()?(o?o.push(a):o=[a],a=[]):i.isEndGroup()?a=o.length>0?o.pop():null:i.isEndAlternate()?a[i.getAlternate()]="taken":D=null==a[i.getAlternate()],i=D?i.success:i.failure}else{if(0==r&&!e&&i.validator instanceof Kl&&this instanceof Kl){if(l=new $e(t).visit(i.validator)){r=t.length,i=i.success;continue}}else if(0==r&&!e&&i.validator instanceof Yl&&this instanceof Kl){if(l=new Qe(t).visit(i.validator)){r=t.length,i=i.success;continue}}else l=s.visit(i.validator);if(!l){i=i.failure;continue}if(l!==s&&t===n){n=[];for(var h=0;h<r;h++)n[h]=t[h]}t!==n&&(n[r-u]=l),r++,i=i.success}}return i===this.successTerminal&&(e?n.length>0:r==t.length)?n:null},u.validateSingle=function(t){for(var e=null,u=this.first;u!==this.successTerminal&&u!==this.failureTerminal;)t?u.isSpecial()?u=u.success:(e=t.visit(u.validator))?(t=null,u=u.success):u=u.failure:u=u.failure;return u===this.successTerminal?e:null},u.visitEmpty=function(t){return this.validateSingle(t)},u.visitSlash=function(t){return this.validateSingle(t)},u.visitStr=function(t){return this.validateSingle(t)},u.visitIdent=function(t){return this.validateSingle(t)},u.visitNumeric=function(t){return this.validateSingle(t)},u.visitNum=function(t){return this.validateSingle(t)},u.visitInt=function(t){return this.validateSingle(t)},u.visitColor=function(t){return this.validateSingle(t)},u.visitURL=function(t){return this.validateSingle(t)},u.visitURange=function(t){return this.validateSingle(t)},u.visitSpaceList=function(t){return null},u.visitCommaList=function(t){return null},u.visitFunc=function(t){return this.validateSingle(t)},u.visitExpr=function(t){return null},e}(zl),Kl=function(t){function e(e){return t.call(this,e)||this}T(e,t);var u=e.prototype;return u.visitSpaceList=function(t){var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new $e(e):null},u.visitCommaList=function(t){for(var e=this.first,u=!1;e;){if(e.validator instanceof Yl){u=!0;break}e=e.failure}if(u){var n=this.validateList(t.values,!1,0);return n===t.values?t:n?new Qe(n):null}return null},u.validateForShorthand=function(t,e){return this.validateList(t,!0,e)},e}(jl),Yl=function(t){function e(e){return t.call(this,e)||this}T(e,t);var u=e.prototype;return u.visitSpaceList=function(t){return this.validateSingle(t)},u.visitCommaList=function(t){var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new Qe(e):null},u.validateForShorthand=function(t,e){for(var u,n=this.first;n!==this.failureTerminal;){if(u=n.validator.validateForShorthand(t,e))return u;n=n.failure}return null},e}(jl),ql=function(t){function e(e,u){var n;return(n=t.call(this,u)||this).name=void 0,n.name=e,n}T(e,t);var u=e.prototype;return u.validateSingle=function(t){return null},u.visitFunc=function(t){if(t.name.toLowerCase()!=this.name)return null;var e=this.validateList(t.values,!1,0);return e===t.values?t:e?new Ze(t.name,e):null},e}(jl),$l=function(){function t(){}var e=t.prototype;return e.tryParse=function(t,e,u){return e},e.success=function(t,e){},t}(),Ql=function(t){function e(e,u){var n;return(n=t.call(this)||this).name=void 0,n.validator=void 0,n.name=u,n.validator=e.validators[n.name],n}T(e,t);var u=e.prototype;return u.tryParse=function(t,e,u){if(u.values[this.name])return e;var n=this.validator.validateForShorthand(t,e);if(n){var i=n.length,r=i>1?new $e(n):n[0];return this.success(r,u),e+i}return e},u.success=function(t,e){e.values[this.name]=t},e}($l),Zl=function(t){function e(e,u){var n;return(n=t.call(this,e,u[0])||this).names=void 0,n.names=u,n}return T(e,t),e.prototype.success=function(t,e){for(var u=0;u<this.names.length;u++)e.values[this.names[u]]=t},e}(Ql),Jl=function(t){function e(e,u){var n;return(n=t.call(this)||this).nodes=void 0,n.slash=void 0,n.nodes=e,n.slash=u,n}return T(e,t),e.prototype.tryParse=function(t,e,u){var n=e;if(this.slash){if(t[e]!=Me)return n;if(++e==t.length)return n}var i=this.nodes[0].tryParse(t,e,u);if(i==e)return n;e=i;for(var r=1;r<this.nodes.length&&e<t.length&&(i=this.nodes[r].tryParse(t,e,u))!=e;r++)e=i;return e},e}($l),tD=function(t){function e(){for(var e,u=arguments.length,n=new Array(u),i=0;i<u;i++)n[i]=arguments[i];return(e=t.call.apply(t,[this].concat(n))||this).syntax=null,e.propList=null,e.error=!1,e.values={},e.validatorSet=null,e}T(e,t);var u=e.prototype;return u.setOwner=function(t){this.validatorSet=t},u.syntaxNodeForProperty=function(t){return new Ql(this.validatorSet,t)},u.clone=function(){var t=new this.constructor;return t.syntax=this.syntax,t.propList=this.propList,t.validatorSet=this.validatorSet,t},u.init=function(t,e){this.syntax=t,this.propList=e},u.finish=function(t,e){if(!this.error){for(var u,n=_(this.propList);!(u=n()).done;){var i=u.value;e.simpleProperty(i,this.values[i]||this.validatorSet.defaultValues[i],t)}return!0}return!1},u.propagateInherit=function(t,e){for(var u,n=_(this.propList);!(u=n()).done;)e.simpleProperty(u.value,uu.inherit,t)},u.validateList=function(t){return this.error=!0,0},u.validateSingle=function(t){return this.validateList([t]),null},u.visitEmpty=function(t){return this.validateSingle(t)},u.visitStr=function(t){return this.validateSingle(t)},u.visitIdent=function(t){return this.validateSingle(t)},u.visitNumeric=function(t){return this.validateSingle(t)},u.visitNum=function(t){return this.validateSingle(t)},u.visitInt=function(t){return this.validateSingle(t)},u.visitColor=function(t){return this.validateSingle(t)},u.visitURL=function(t){return this.validateSingle(t)},u.visitSpaceList=function(t){return this.validateList(t.values),null},u.visitCommaList=function(t){return this.error=!0,null},u.visitFunc=function(t){return this.validateSingle(t)},u.visitExpr=function(t){return this.error=!0,null},e}(Pe),eD=function(t){function e(){return t.call(this)||this}return T(e,t),e.prototype.validateList=function(t){for(var e=0,u=0;e<t.length;){var n=this.syntax[u].tryParse(t,e,this);if(n>e)e=n,u=0;else if(++u==this.syntax.length){this.error=!0;break}}return e},e}(tD),uD=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.validateList=function(t){if(t.length>this.syntax.length||0==t.length)return this.error=!0,0;for(var e=0;e<this.syntax.length;e++){for(var u=e;u>=t.length;)u=1==u?0:u-2;if(this.syntax[e].tryParse(t,u,this)!=u+1)return this.error=!0,0}return t.length},u.createSyntaxNode=function(){return new Zl(this.validatorSet,this.propList)},e}(tD),nD=function(t){function e(){return t.call(this)||this}return T(e,t),e.prototype.validateList=function(t){for(var e=t.length,u=0;u<t.length;u++)if(t[u]===Me){e=u;break}if(e>this.syntax.length||0==t.length)return this.error=!0,0;for(var n=0;n<this.syntax.length;n++){for(var i=n;i>=e;)i=1==i?0:i-2;var r=void 0;if(e+1<t.length)for(r=e+n+1;r>=t.length;)r-=r==e+2?1:2;else r=i;if(2!=this.syntax[n].tryParse([t[i],t[r]],0,this))return this.error=!0,0}return t.length},e}(tD),iD=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.mergeIn=function(t,e){for(var u,n=_(this.propList);!(u=n()).done;){var i=u.value,r=e[i]||this.validatorSet.defaultValues[i],o=t[i];o||(t[i]=o=[]),o.push(r)}},u.visitCommaList=function(t){for(var e={},u=0;u<t.values.length;u++)if(this.values={},t.values[u]instanceof Qe?this.error=!0:(t.values[u].visit(this),this.mergeIn(e,this.values),this.values["background-color"]&&u!=t.values.length-1&&(this.error=!0)),this.error)return null;for(var n in this.values={},e)this.values[n]="background-color"==n?e[n].pop():new Qe(e[n]);return null},e}(eD),rD=function(t){function e(){return t.call(this)||this}T(e,t);var u=e.prototype;return u.init=function(e,u){t.prototype.init.call(this,e,u),this.propList.push("font-family","line-height","font-size","font-stretch","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian")},u.validateList=function(e){var u=t.prototype.validateList.call(this,e),n=this.values["font-variant_css2"];n&&(delete this.values["font-variant_css2"],this.values["font-variant-caps"]=n);var i=this.values["font-stretch_css3"];if(i&&(delete this.values["font-stretch_css3"],this.values["font-stretch"]=i),u+2>e.length)return this.error=!0,u;this.error=!1;var r=this.validatorSet.validators;if(!e[u].visit(r["font-size"]))return this.error=!0,u;if(this.values["font-size"]=e[u++],e[u]===Me){if(2+ ++u>e.length)return this.error=!0,u;if(!e[u].visit(r["line-height"]))return this.error=!0,u;this.values["line-height"]=e[u++]}var o=u==e.length-1?e[u]:new $e(e.slice(u,e.length));return o.visit(r["font-family"])?(this.values["font-family"]=o,e.length):(this.error=!0,u)},u.visitCommaList=function(t){if(t.values[0].visit(this),this.error)return null;for(var e=[this.values["font-family"]],u=1;u<t.values.length;u++)e.push(t.values[u]);var n=new Qe(e);return n.visit(this.validatorSet.validators["font-family"])?this.values["font-family"]=n:this.error=!0,null},u.visitIdent=function(t){var e=this.validatorSet.systemFonts[t.name];if(e)for(var u in e)this.values[u]=e[u];else this.error=!0;return null},e}(eD),oD={SIMPLE:eD,INSETS:uD,INSETS_SLASH:nD,COMMA:iD,FONT:rD},aD=function(){function t(){this.validators={},this.prefixes={},this.defaultValues={},this.namedValidators={},this.systemFonts={},this.shorthands={},this.layoutProps={},this.backgroundProps={}}var e=t.prototype;return e.addReplacement=function(t,e){var u;if(e.type==Vu.NUMERIC)u=new Ge(e.num,e.text);else if(e.type==Vu.HASH)u=ri(e.text);else{if(e.type!=Vu.IDENT)throw new Error("unexpected replacement");u=ze(e.text)}if(t.isPrimitive()){var n=t.nodes[0].validator.idents;for(var i in n)n[i]=u;return t}throw new Error("unexpected replacement")},e.newGroup=function(t,e){var u,n=new Hl;if("||"==t){for(var i=0;i<e.length;i++){var r=new Hl;r.startClause(i),r.addGroup(e[i],Il.FOLLOW),r.endClause(i),n.addGroup(r,0==i?Il.FOLLOW:Il.ALTERNATE)}var o=new Hl;return o.startSpecialGroup(),o.addGroup(n,Il.REPEATED),o.endSpecialGroup(),o}switch(t){case" ":u=Il.FOLLOW;break;case"|":case"||":u=Il.ALTERNATE;break;default:throw new Error("unexpected op")}for(var a=0;a<e.length;a++)n.addGroup(e[a],0==a?Il.FOLLOW:u);return n},e.addCounts=function(t,e,u){for(var n=new Hl,i=0;i<e;i++)n.addGroup(t.clone(),Il.FOLLOW);if(u==Number.POSITIVE_INFINITY)n.addGroup(t,Il.REPEATED);else for(var r=e;r<u;r++)n.addGroup(t.clone(),Il.OPTIONAL);return n},e.primitive=function(t){var e=new Hl;return e.addPrimitive(t),e},e.newFunc=function(t,e){var u;switch(t){case"COMMA":u=new Yl(e);break;case"SPACE":u=new Kl(e);break;default:u=new ql(t.toLowerCase(),e)}return this.primitive(u)},e.initBuiltInValidators=function(){this.namedValidators.HASHCOLOR=this.primitive(new Gl(64,Xl,Xl)),this.namedValidators.POS_INT=this.primitive(new Gl(32,Xl,Xl)),this.namedValidators.POS_NUM=this.primitive(new Gl(16,Xl,Xl)),this.namedValidators.POS_PERCENTAGE=this.primitive(new Gl(8,Xl,{"%":ke})),this.namedValidators.NEGATIVE=this.primitive(new Gl(256,Xl,Xl)),this.namedValidators.ZERO=this.primitive(new Gl(512,Xl,Xl)),this.namedValidators.ZERO_PERCENTAGE=this.primitive(new Gl(1024,Xl,Xl)),this.namedValidators.POS_LENGTH=this.primitive(new Gl(8,Xl,{em:ke,ex:ke,ch:ke,rem:ke,vw:ke,vh:ke,vi:ke,vb:ke,vmin:ke,vmax:ke,pvw:ke,pvh:ke,pvi:ke,pvb:ke,pvmin:ke,pvmax:ke,cm:ke,mm:ke,in:ke,px:ke,pt:ke,pc:ke,q:ke})),this.namedValidators.POS_ANGLE=this.primitive(new Gl(8,Xl,{deg:ke,grad:ke,rad:ke,turn:ke})),this.namedValidators.POS_TIME=this.primitive(new Gl(8,Xl,{s:ke,ms:ke})),this.namedValidators.FREQUENCY=this.primitive(new Gl(8,Xl,{Hz:ke,kHz:ke})),this.namedValidators.RESOLUTION=this.primitive(new Gl(8,Xl,{dpi:ke,dpcm:ke,dppx:ke})),this.namedValidators.URI=this.primitive(new Gl(128,Xl,Xl)),this.namedValidators.URANGE=this.primitive(new Gl(4096,Xl,Xl)),this.namedValidators.IDENT=this.primitive(new Gl(4,Xl,Xl)),this.namedValidators.STRING=this.primitive(new Gl(2,Xl,Xl)),this.namedValidators.SLASH=this.primitive(new Gl(2048,Xl,Xl));var t={"font-family":ze("sans-serif")};this.systemFonts.caption=t,this.systemFonts.icon=t,this.systemFonts.menu=t,this.systemFonts["message-box"]=t,this.systemFonts["small-caption"]=t,this.systemFonts["status-bar"]=t},e.isBuiltIn=function(t){return!!t.match(/^[A-Z_0-9]+$/)},e.readNameAndPrefixes=function(t,e){var u=t.token();if(u.type==Vu.EOF)return null;var n={"":!0};if(u.type==Vu.O_BRK){do{if(t.consume(),(u=t.token()).type!=Vu.IDENT)throw new Error("Prefix name expected");n[u.text]=!0,t.consume(),u=t.token()}while(u.type==Vu.COMMA);if(u.type!=Vu.C_BRK)throw new Error("']' expected");t.consume(),u=t.token()}if(u.type!=Vu.IDENT)throw new Error("Property name expected");if(2==e?"SHORTHANDS"==u.text:"DEFAULTS"==u.text)return t.consume(),null;var i=u.text;if(t.consume(),2!=e){if(t.token().type!=Vu.EQ)throw new Error("'=' expected");this.isBuiltIn(i)||(this.prefixes[i]=n)}else if(t.token().type!=Vu.COLON)throw new Error("':' expected");return i},e.parseValidators=function(t){for(var e=this,u=function(){var u=e.readNameAndPrefixes(t,1);if(!u)return{v:void 0};for(var n=[],i=[],r="",o=void 0,a=!0,s=function(){if(0==n.length)throw new Error("No values");return 1==n.length?n[0]:e.newGroup(r,n)},l=function(t){if(a)throw new Error("'"+t+"': unexpected");if(r&&r!=t)throw new Error("mixed operators: '"+t+"' and '"+r+"'");r=t,a=!0},D=null;!D;){t.consume();var h=t.token();switch(h.type){case Vu.IDENT:if(a||l(" "),e.isBuiltIn(h.text)){var c=e.namedValidators[h.text];if(!c)throw new Error("'"+h.text+"' unexpected");n.push(c.clone())}else{var d={};d[h.text.toLowerCase()]=ze(h.text),n.push(e.primitive(new Gl(0,d,Xl)))}a=!1;break;case Vu.INT:var f={};f[""+h.num]=new We(h.num),n.push(e.primitive(new Gl(0,f,Xl))),a=!1;break;case Vu.BAR:l("|");break;case Vu.BAR_BAR:l("||");break;case Vu.O_BRK:a||l(" "),i.push({vals:n,op:r,b:"["}),r="",n=[],a=!0;break;case Vu.FUNC:a||l(" "),i.push({vals:n,op:r,b:"(",fn:h.text}),r="",n=[],a=!0;break;case Vu.C_BRK:o=s();var p=i.pop();if("["!=p.b)throw new Error("']' unexpected");(n=p.vals).push(o),r=p.op,a=!1;break;case Vu.C_PAR:o=s();var E=i.pop();if("("!=E.b)throw new Error("')' unexpected");(n=E.vals).push(e.newFunc(E.fn,o)),r=E.op,a=!1;break;case Vu.COLON:if(a)throw new Error("':' unexpected");t.consume(),n.push(e.addReplacement(n.pop(),t.token()));break;case Vu.QMARK:if(a)throw new Error("'?' unexpected");n.push(e.addCounts(n.pop(),0,1));break;case Vu.STAR:if(a)throw new Error("'*' unexpected");n.push(e.addCounts(n.pop(),0,Number.POSITIVE_INFINITY));break;case Vu.PLUS:if(a)throw new Error("'+' unexpected");n.push(e.addCounts(n.pop(),1,Number.POSITIVE_INFINITY));break;case Vu.O_BRC:if(t.consume(),(h=t.token()).type!=Vu.INT)throw new Error("<int> expected");var C=h.num,F=C;if(t.consume(),(h=t.token()).type==Vu.COMMA){if(t.consume(),(h=t.token()).type!=Vu.INT)throw new Error("<int> expected");F=h.num,t.consume(),h=t.token()}if(h.type!=Vu.C_BRC)throw new Error("'}' expected");n.push(e.addCounts(n.pop(),C,F));break;case Vu.SEMICOL:if(D=s(),i.length>0)throw new Error("unclosed '"+i.pop().b+"'");break;default:throw new Error("unexpected token")}}t.consume(),e.isBuiltIn(u)?e.namedValidators[u]=D:e.validators[u]=D.isSimple()?D.nodes[0].validator:new Kl(D)};;){var n=u();if("object"==typeof n)return n.v}},e.parseDefaults=function(t){for(;;){var e=this.readNameAndPrefixes(t,2);if(!e)return;for(var u=[];;){t.consume();var n=t.token();if(n.type==Vu.SEMICOL){t.consume();break}switch(n.type){case Vu.IDENT:u.push(ze(n.text));break;case Vu.NUM:u.push(new Xe(n.num));break;case Vu.INT:u.push(new We(n.num));break;case Vu.NUMERIC:u.push(new Ge(n.num,n.text));break;default:throw new Error("unexpected token")}}this.defaultValues[e]=u.length>1?new $e(u):u[0]}},e.parseShorthands=function(t){for(;;){var e=this.readNameAndPrefixes(t,3);if(!e)return;var u=t.nthToken(1),n=void 0;u.type==Vu.IDENT&&oD[u.text]?(n=new oD[u.text],t.consume()):n=new eD,n.setOwner(this);for(var i=!1,r=[],o=!1,a=[],s=[];!i;)switch(t.consume(),(u=t.token()).type){case Vu.IDENT:if(this.validators[u.text])r.push(n.syntaxNodeForProperty(u.text)),u.text.includes("_")||s.push(u.text);else{if(!(this.shorthands[u.text]instanceof uD))throw new Error("'"+u.text+"' is neither a simple property nor an inset shorthand");var l=this.shorthands[u.text];r.push(l.createSyntaxNode()),s.push.apply(s,l.propList)}break;case Vu.SLASH:if(r.length>0||o)throw new Error("unexpected slash");o=!0;break;case Vu.O_BRK:a.push({slash:o,syntax:r}),r=[],o=!1;break;case Vu.C_BRK:var D=new Jl(r,o),h=a.pop();o=h.slash,(r=h.syntax).push(D);break;case Vu.SEMICOL:i=!0,t.consume();break;default:throw new Error("unexpected token")}n.init(r,s),this.shorthands[e]=n}},e.parse=function(t){var e=new Sn(t,null);this.parseValidators(e),this.parseDefaults(e),this.parseShorthands(e),this.backgroundProps=this.makePropSet(["background"]),this.layoutProps=this.makePropSet(["margin","border","padding","columns","column-gap","column-rule","column-fill"])},e.makePropSet=function(t){for(var e,u={},n=_(t);!(e=n()).done;)for(var i,r=e.value,o=this.shorthands[r],a=_(o?o.propList:[r]);!(i=a()).done;){var s=i.value,l=this.defaultValues[s];l?u[s]=l:c.warn("Unknown property in makePropSet:",s)}return u},e.validatePropertyAndHandleShorthand=function(t,e,u,n){var i="",r=t,o=(t=t.toLowerCase()).match(/^-([a-z]+)-([-a-z0-9]+)$/);o&&(i=o[1],t=o[2]);var a=this.prefixes[t];if(a&&a[i]){var s=this.validators[t];if(s){var l=e===uu.inherit||e.isExpr()?e:e.visit(s);l?n.simpleProperty(t,l,u):n.invalidPropertyValue(r,e)}else{var D=this.shorthands[t].clone();e===uu.inherit?D.propagateInherit(u,n):(e.visit(D),D.finish(u,n)||n.invalidPropertyValue(r,e))}}else n.unknownProperty(r,e)},t}();function sD(){var t=new aD;return t.initBuiltInValidators(),t.parse(qn),t}var lD={"font-style":uu.normal,"font-stretch":uu.normal,"font-weight":uu.normal,"unicode-range":au};function DD(t,e){var u={};for(var n in t)u[n]=Vr(t,n).evaluate(e,n);return function(t){for(var e in lD)t[e]||(t[e]=lD[e])}(u),u}(new Date).valueOf();var hD=function(){function t(t){this.properties=void 0,this.fontTraitKey=void 0,this.src=void 0,this.blobURLs=[],this.blobs=[],this.family=void 0,this.properties=t,this.fontTraitKey=function(t){var e=new it;for(var u in lD)e.append(" "),e.append(t[u].toString());return e.toString()}(this.properties),this.src=this.properties.src?this.properties.src.toString():null;var e=this.properties["font-family"];this.family=e?e.stringValue():null}var e=t.prototype;return e.traitsEqual=function(t){return this.fontTraitKey==t.fontTraitKey},e.makeAtRule=function(t,e){var u=new it;for(var n in u.append("@font-face {\n font-family: "),u.append(this.family),u.append(";\n "),lD)u.append(n),u.append(": "),this.properties[n].appendTo(u,!0),u.append(";\n ");if(e){u.append('src: url("');var i=(window.URL||window.webkitURL).createObjectURL(e);u.append(i),this.blobURLs.push(i),this.blobs.push(e),u.append('")')}else u.append("src: "),u.append(t);return u.append(";\n}\n"),u.toString()},t}(),cD=function(){function t(t){this.deobfuscator=void 0,this.familyMap={},this.deobfuscator=t}var e=t.prototype;return e.registerFamily=function(t,e){var u=t.family,n=this.familyMap[u],i=e.family;if(n){if(n!=i)throw new Error("E_FONT_FAMILY_INCONSISTENT "+t.family)}else this.familyMap[u]=i},e.filterFontFamily=function(t){if(t instanceof Qe){for(var e,u=[],n=_(t.values);!(e=n()).done;){var i=e.value,r=this.familyMap[i.stringValue()];r&&u.push(ze(r)),u.push(i)}return new Qe(u)}var o=this.familyMap[t.stringValue()];return o?new Qe([ze(o),t]):t},t}(),dD=function(){function t(t,e,u){this.head=void 0,this.body=void 0,this.srcURLMap={},this.familyPrefix=void 0,this.familyCounter=0,this.head=t,this.body=e,this.familyPrefix=u||"Fnt_"}var e=t.prototype;return e.getViewFontFamily=function(t,e){var u=t.family,n=e.familyMap[u];return n||(n=this.familyPrefix+ ++this.familyCounter,e.familyMap[u]=n,n)},e.initFont=function(t,e,u){var n=Pn("initFont"),i=t.src,r={};for(var o in lD)r[o]=t.properties[o];var a=this.getViewFontFamily(t,u);r["font-family"]=ze(a);var s=new hD(r),l=this.head.ownerDocument.createElement("style");return l.textContent=s.makeAtRule(i,e),this.head.appendChild(l),c.debug("Load font:",i),n.finish(s),n.result()},e.loadFont=function(t,e){var u=this,n=t.src,i=t.family+";"+n,r=this.srcURLMap[i];return r?r.piggyback((function(u){var i=u;i.traitsEqual(t)?(e.registerFamily(t,i),c.debug("Found already-loaded font:",n)):c.warn("E_FONT_FACE_INCOMPATIBLE",t.src)})):(r=new Gn((function(){var i=Pn("loadFont"),r=e.deobfuscator?e.deobfuscator(n):null;return r?ti(n,jn.BLOB).then((function(n){n.responseBlob?r(n.responseBlob).then((function(n){u.initFont(t,n,e).thenFinish(i)})):i.finish(null)})):u.initFont(t,null,e).thenFinish(i),i.result()}),"loadFont "+n),this.srcURLMap[i]=r,r.start()),r},e.findOrLoadFonts=function(t,e){for(var u,n=this,i=[],r=_(t);!(u=r()).done;){var o=u.value;o.src&&o.family?i.push(this.loadFont(o,e)):c.warn("E_FONT_FACE_INVALID")}return Xn(i).thenAsync((function(){return n.waitFontLoading()}))},e.waitFontLoading=function(){var t=this.head.ownerDocument.fonts,e=0;if(t.forEach((function(t){"unloaded"===t.status&&(e++,t.load())})),0===e)return Rn(!0);var u=Pn("waitFontLoading");return u.loop((function(){return u.sleep(20).thenAsync((function(){return Rn("loading"===t.status)}))})).thenFinish(u),u.result()},t}(),fD=1,pD=function(){function t(t,e,u,n,i){this.name=void 0,this.pseudoName=void 0,this.classes=void 0,this.parent=void 0,this.specified={},this.children=[],this.pageMaster=null,this.index=0,this.key=void 0,this._scope=void 0,this.name=e,this.pseudoName=u,this.classes=n,this.parent=i,this._scope=t,this.key="p"+fD++,i&&(this.index=i.children.length,i.children.push(this))}var e=t.prototype;return e.createInstance=function(t){throw new Error("E_UNEXPECTED_CALL")},e.clone=function(t){throw new Error("E_UNEXPECTED_CALL")},e.copySpecified=function(t){var e=this.specified,u=t.specified;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(u[n]=e[n])},e.cloneChildren=function(t){for(var e=0;e<this.children.length;e++)this.children[e].clone({parent:t})},S(t,[{key:"scope",get:function(){return this._scope}}]),t}(),ED=function(t){function e(e){var u;return(u=t.call(this,e,null,null,[],null)||this).specified.width=new Lr(iu,0),u.specified.height=new Lr(ru,0),u}return T(e,t),e}(pD),CD=function(t){function e(e,u){var n;(n=t.call(this,e,(function(t,e){var u=t.match(/^([^.]+)\.([^.]+)$/);if(u){var n=i.pageMaster.keyMap[u[1]];if(n){var r=this.lookupInstance(n);if(r)return e?r.resolveFunc(u[2]):r.resolveName(u[2])}}return null}))||this).pageMaster=void 0,n.pageMaster=u;var i=O(n);return n}return T(e,t),e}(Vt),FD=function(t){function e(e,u,n,i,r,o,a){var s;return(s=t.call(this,e,u,n,i,r)||this).condition=void 0,s.specificity=void 0,s.keyMap={},s.condition=o,s.specificity=a,e instanceof CD||(s._scope=new CD(e,O(s))),s.pageMaster=O(s),s.specified.width=new Lr(iu,0),s.specified.height=new Lr(ru,0),s.specified["wrap-flow"]=new Lr(uu.auto,0),s.specified.position=new Lr(uu.relative,0),s.specified.overflow=new Lr(uu.visible,0),s}T(e,t);var u=e.prototype;return u.createInstance=function(t){return new LD(t,this)},u.clone=function(t){var u=new e(this.scope,this.name,t.pseudoName||this.pseudoName,this.classes,this.parent,this.condition,this.specificity);return this.copySpecified(u),this.cloneChildren(u),u},u.resetScope=function(){this.scope.pageMaster=this},e}(pD),AD=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,n,i,r)||this).pageMaster=r.pageMaster,u&&(o.pageMaster.keyMap[u]=o.key),o.specified["wrap-flow"]=new Lr(uu.auto,0),o}T(e,t);var u=e.prototype;return u.createInstance=function(t){return new OD(t,this)},u.clone=function(t){var u=new e(t.parent.scope,this.name,this.pseudoName,this.classes,t.parent);return this.copySpecified(u),this.cloneChildren(u),u},e}(pD),gD=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,n,i,r)||this).pageMaster=r.pageMaster,u&&(o.pageMaster.keyMap[u]=o.key),o}T(e,t);var u=e.prototype;return u.createInstance=function(t){return new kD(t,this)},u.clone=function(t){var u=new e(t.parent.scope,this.name,this.pseudoName,this.classes,t.parent);return this.copySpecified(u),this.cloneChildren(u),u},e}(pD);function vD(t,e,u){return e&&e!==uu.auto?e.toExpr(t,u):null}function mD(t,e,u){return e&&e!==uu.auto?e.toExpr(t,u):t.zero}function BD(t,e,u){return e?e===uu.auto?null:e.toExpr(t,u):t.zero}function wD(t,e,u,n){return e&&u!==uu.none?e.toExpr(t,n):t.zero}function yD(t,e,u){return e?e===uu._true?t._true:e===uu._false?t._false:e.toExpr(t,t.zero):u}var ND=function(){function t(t,e){this.parentInstance=void 0,this.pageBox=void 0,this.cascaded={},this.style={},this.autoWidth=null,this.autoHeight=null,this.children=[],this.isAutoWidth=!1,this.isAutoHeight=!1,this.isTopDependentOnAutoHeight=!1,this.isRightDependentOnAutoWidth=!1,this.calculatedWidth=0,this.calculatedHeight=0,this.pageMasterInstance=null,this.namedValues={},this.namedFuncs={},this.vertical=!1,this.rtl=!1,this.suppressEmptyBoxGeneration=!1,this.parentInstance=t,this.pageBox=e,t&&t.children.push(this)}var e=t.prototype;return e.reset=function(){this.calculatedWidth=0,this.calculatedHeight=0},e.addNamedValues=function(t,e){var u=this.resolveName(t),n=this.resolveName(e);if(!u||!n)throw new Error("E_INTERNAL");return Se(this.pageBox.scope,u,n)},e.resolveName=function(t){var e=this.namedValues[t];if(e)return e;var u=this.style[t];switch(u&&(e=u.toExpr(this.pageBox.scope,this.pageBox.scope.zero)),t){case"margin-left-edge":e=this.resolveName("left");break;case"margin-top-edge":e=this.resolveName("top");break;case"margin-right-edge":e=this.addNamedValues("border-right-edge","margin-right");break;case"margin-bottom-edge":e=this.addNamedValues("border-bottom-edge","margin-bottom");break;case"border-left-edge":e=this.addNamedValues("margin-left-edge","margin-left");break;case"border-top-edge":e=this.addNamedValues("margin-top-edge","margin-top");break;case"border-right-edge":e=this.addNamedValues("padding-right-edge","border-right-width");break;case"border-bottom-edge":e=this.addNamedValues("padding-bottom-edge","border-bottom-width");break;case"padding-left-edge":e=this.addNamedValues("border-left-edge","border-left-width");break;case"padding-top-edge":e=this.addNamedValues("border-top-edge","border-top-width");break;case"padding-right-edge":e=this.addNamedValues("right-edge","padding-right");break;case"padding-bottom-edge":e=this.addNamedValues("bottom-edge","padding-bottom");break;case"left-edge":e=this.addNamedValues("padding-left-edge","padding-left");break;case"top-edge":e=this.addNamedValues("padding-top-edge","padding-top");break;case"right-edge":e=this.addNamedValues("left-edge","width");break;case"bottom-edge":e=this.addNamedValues("top-edge","height")}if(!e){var n;if("extent"==t)n=this.vertical?"width":"height";else if("measure"==t)n=this.vertical?"height":"width";else{var i=this.vertical?xr:Ir;for(var r in n=t,i)n=n.replace(r,i[r])}n!=t&&(e=this.resolveName(n))}return e&&(this.namedValues[t]=e),e},e.resolveFunc=function(t){var e=this.namedFuncs[t];if(e)return e;if("columns"===t){var u=this.pageBox.scope,n=new Ne(u,0),i=this.resolveName("column-count"),r=this.resolveName("column-width"),o=this.resolveName("column-gap");e=Te(u,xe(u,new ve(u,"min",[n,i]),Se(u,r,o)),o)}return e&&(this.namedFuncs[t]=e),e},e.initEnabled=function(){var t=this.pageBox.scope,e=this.style,u=yD(t,e.enabled,t._true),n=vD(t,e.page,t.zero);if(n){var i=new Fe(t,"page-number");u=be(t,u,new De(t,n,i))}var r=vD(t,e["min-page-width"],t.zero);r&&(u=be(t,u,new le(t,new Fe(t,"page-width"),r)));var o=vD(t,e["min-page-height"],t.zero);o&&(u=be(t,u,new le(t,new Fe(t,"page-height"),o))),u=this.boxSpecificEnabled(u),e.enabled=new Je(u)},e.boxSpecificEnabled=function(t){return t},e.initHorizontal=function(){var t=this.pageBox.scope,e=this.style,u=this.parentInstance?this.parentInstance.style.width.toExpr(t,null):null,n=vD(t,e.left,u),i=vD(t,e["margin-left"],u),r=wD(t,e["border-left-width"],e["border-left-style"],u),o=mD(t,e["padding-left"],u),a=vD(t,e.width,u),s=vD(t,e["max-width"],u),l=mD(t,e["padding-right"],u),D=wD(t,e["border-right-width"],e["border-right-style"],u),h=vD(t,e["margin-right"],u),c=vD(t,e.right,u),d=Se(t,r,o),f=Se(t,r,l);if(n&&c&&a){var p=Te(t,u,Se(t,a,Se(t,Se(t,n,d),f)));i?h?c=Te(t,p,h):h=Te(t,p,Se(t,c,i)):(p=Te(t,p,c),h?i=Te(t,p,h):h=i=xe(t,p,new Be(t,.5)))}else{i||(i=t.zero),h||(h=t.zero),n||c||a||(n=t.zero),n||a?n||c?a||c||(a=this.autoWidth,this.isAutoWidth=!0):n=t.zero:(a=this.autoWidth,this.isAutoWidth=!0);var E=Te(t,u,Se(t,Se(t,i,d),Se(t,h,f)));this.isAutoWidth&&(s||(s=Te(t,E,n||c)),this.vertical||!vD(t,e["column-width"],null)&&!vD(t,e["column-count"],null)||(a=s,this.isAutoWidth=!1)),n?a?c||(c=Te(t,E,Se(t,n,a))):a=Te(t,E,Se(t,n,c)):n=Te(t,E,Se(t,c,a))}var C=mD(t,e["snap-width"]||(this.parentInstance?this.parentInstance.style["snap-width"]:null),u);e.left=new Je(n),e["margin-left"]=new Je(i),e["border-left-width"]=new Je(r),e["padding-left"]=new Je(o),e.width=new Je(a),e["max-width"]=new Je(s||a),e["padding-right"]=new Je(l),e["border-right-width"]=new Je(D),e["margin-right"]=new Je(h),e.right=new Je(c),e["snap-width"]=new Je(C)},e.initVertical=function(){var t=this.pageBox.scope,e=this.style,u=this.parentInstance?this.parentInstance.style.width.toExpr(t,null):null,n=this.parentInstance?this.parentInstance.style.height.toExpr(t,null):null,i=vD(t,e.top,n),r=vD(t,e["margin-top"],u),o=wD(t,e["border-top-width"],e["border-top-style"],u),a=mD(t,e["padding-top"],u),s=vD(t,e.height,n),l=vD(t,e["max-height"],n),D=mD(t,e["padding-bottom"],u),h=wD(t,e["border-bottom-width"],e["border-bottom-style"],u),c=vD(t,e["margin-bottom"],u),d=vD(t,e.bottom,n),f=Se(t,o,a),p=Se(t,h,D);if(i&&d&&s){var E=Te(t,n,Se(t,s,Se(t,Se(t,i,f),p)));r?c?d=Te(t,E,r):c=Te(t,E,Se(t,d,r)):(E=Te(t,E,d),c?r=Te(t,E,c):c=r=xe(t,E,new Be(t,.5)))}else{r||(r=t.zero),c||(c=t.zero),i||d||s||(i=t.zero),i||s?i||d?s||d||(s=this.autoHeight,this.isAutoHeight=!0):i=t.zero:(s=this.autoHeight,this.isAutoHeight=!0);var C=Te(t,n,Se(t,Se(t,r,f),Se(t,c,p)));this.isAutoHeight&&(l||(l=Te(t,C,i||d)),this.vertical&&(vD(t,e["column-width"],null)||vD(t,e["column-count"],null))&&(s=l,this.isAutoHeight=!1)),i?s?d||(d=Te(t,C,Se(t,i,s))):s=Te(t,C,Se(t,d,i)):i=Te(t,C,Se(t,d,s))}var F=mD(t,e["snap-height"]||(this.parentInstance?this.parentInstance.style["snap-height"]:null),u);e.top=new Je(i),e["margin-top"]=new Je(r),e["border-top-width"]=new Je(o),e["padding-top"]=new Je(a),e.height=new Je(s),e["max-height"]=new Je(l||s),e["padding-bottom"]=new Je(D),e["border-bottom-width"]=new Je(h),e["margin-bottom"]=new Je(c),e.bottom=new Je(d),e["snap-height"]=new Je(F)},e.initColumns=function(){var t=this.pageBox.scope,e=this.style,u=vD(t,e[this.vertical?"height":"width"],null),n=vD(t,e["column-width"],u),i=vD(t,e["column-count"],null),r=function(t,e,u){return e&&e!==uu.normal?e.toExpr(t,null):null}(t,e["column-gap"]);r||(r=new Ce(t,1,"em")),n&&!i&&(i=new ve(t,"floor",[Ie(t,Se(t,u,r),Se(t,n,r))]),i=new ve(t,"max",[t.one,i])),i||(i=t.one),n=Te(t,Ie(t,Se(t,u,r),i),r),e["column-width"]=new Je(n),e["column-count"]=new Je(i),e["column-gap"]=new Je(r)},e.depends=function(t,e,u){return this.style[t].toExpr(this.pageBox.scope,null).depend(e,u)},e.init=function(t){var e=this;t.registerInstance(this.pageBox.key,this);var u=this.pageBox.scope,n=this.style,i=this.parentInstance?this.parentInstance.getActiveRegions(t):null,r=aa(this.cascaded,t,i,!1);this.vertical=ra(r,t,!!this.parentInstance&&this.parentInstance.vertical),this.rtl=oa(r,t,!!this.parentInstance&&this.parentInstance.rtl),Da(r,n,this.vertical,this.rtl,(function(t,e){return e.value})),this.autoWidth=new ge(u,(function(){return e.calculatedWidth}),"autoWidth"),this.autoHeight=new ge(u,(function(){return e.calculatedHeight}),"autoHeight"),this.initHorizontal(),this.initVertical(),this.initColumns(),this.initEnabled()},e.getProp=function(t,e){var u=this.style[e];return u&&(u=Li(t,u,e)),u},e.getPropAsNumber=function(t,e){var u=this.style[e];return u&&(u=Li(t,u,e)),tu(u,t)},e.getSpecial=function(t,e){var u=Wr(this.cascaded,e);if(u){for(var n=[],i=0;i<u.length;i++){var r=u[i].evaluate(t,"");r&&r!==ke&&n.push(r)}if(n.length)return n}return null},e.getActiveRegions=function(t){var e=this.getSpecial(t,"region-id");if(e){for(var u=[],n=0;n<e.length;n++)u[n]=e[n].toString();return u}return null},e.propagateProperty=function(t,e,u,n){this.propagatePropertyToElement(t,e.element,u,n)},e.propagatePropertyToElement=function(t,e,u,n){var i=this.getProp(t,u);i&&(i.isNumeric()&&Gt(i.unit)&&(i=eu(i,t)),"font-family"===u&&(i=n.filterFontFamily(i)),et(e,u,i.toString()))},e.propagateDelayedProperty=function(t,e,u,n){var i=this.getProp(t,u);i&&n.push(new $i(e.element,u,i))},e.assignLeftPosition=function(t,e){var u=this.getPropAsNumber(t,"left"),n=this.getPropAsNumber(t,"margin-left"),i=this.getPropAsNumber(t,"padding-left"),r=this.getPropAsNumber(t,"border-left-width"),o=this.getPropAsNumber(t,"width");e.setHorizontalPosition(u,o),et(e.element,"margin-left",n+"px"),et(e.element,"padding-left",i+"px"),et(e.element,"border-left-width",r+"px"),e.marginLeft=n,e.borderLeft=r,e.paddingLeft=i},e.assignRightPosition=function(t,e){var u=this.getPropAsNumber(t,"right"),n=this.getPropAsNumber(t,"snap-height"),i=this.getPropAsNumber(t,"margin-right"),r=this.getPropAsNumber(t,"padding-right"),o=this.getPropAsNumber(t,"border-right-width");if(et(e.element,"margin-right",i+"px"),et(e.element,"padding-right",r+"px"),et(e.element,"border-right-width",o+"px"),e.marginRight=i,e.borderRight=o,this.vertical&&n>0){var a=u+e.getInsetRight(),s=a-Math.floor(a/n)*n;s>0&&(e.snapOffsetX=n-s,r+=e.snapOffsetX)}e.paddingRight=r,e.snapWidth=n},e.assignTopPosition=function(t,e){var u=this.getPropAsNumber(t,"snap-height"),n=this.getPropAsNumber(t,"top"),i=this.getPropAsNumber(t,"margin-top"),r=this.getPropAsNumber(t,"padding-top"),o=this.getPropAsNumber(t,"border-top-width");if(e.top=n,e.marginTop=i,e.borderTop=o,e.snapHeight=u,!this.vertical&&u>0){var a=n+e.getInsetTop(),s=a-Math.floor(a/u)*u;s>0&&(e.snapOffsetY=u-s,r+=e.snapOffsetY)}e.paddingTop=r,et(e.element,"top",n+"px"),et(e.element,"margin-top",i+"px"),et(e.element,"padding-top",r+"px"),et(e.element,"border-top-width",o+"px")},e.assignBottomPosition=function(t,e){var u=this.getPropAsNumber(t,"margin-bottom"),n=this.getPropAsNumber(t,"padding-bottom"),i=this.getPropAsNumber(t,"border-bottom-width"),r=this.getPropAsNumber(t,"height")-e.snapOffsetY;et(e.element,"height",r+"px"),et(e.element,"margin-bottom",u+"px"),et(e.element,"padding-bottom",n+"px"),et(e.element,"border-bottom-width",i+"px"),e.height=r-e.snapOffsetY,e.marginBottom=u,e.borderBottom=i,e.paddingBottom=n},e.assignBeforePosition=function(t,e){this.vertical?this.assignRightPosition(t,e):this.assignTopPosition(t,e)},e.assignAfterPosition=function(t,e){this.vertical?this.assignLeftPosition(t,e):this.assignBottomPosition(t,e)},e.assignStartEndPosition=function(t,e){this.vertical?(this.assignTopPosition(t,e),this.assignBottomPosition(t,e)):(this.assignRightPosition(t,e),this.assignLeftPosition(t,e))},e.sizeWithMaxHeight=function(t,e){et(e.element,"border-top-width","0px");var u=this.getPropAsNumber(t,"max-height");this.isTopDependentOnAutoHeight?e.setVerticalPosition(0,u):(this.assignTopPosition(t,e),e.height=u-=e.snapOffsetY,et(e.element,"height",u+"px"))},e.sizeWithMaxWidth=function(t,e){et(e.element,"border-left-width","0px");var u=this.getPropAsNumber(t,"max-width");if(this.isRightDependentOnAutoWidth)e.setHorizontalPosition(0,u);else{this.assignRightPosition(t,e),e.width=u-=e.snapOffsetX;var n=this.getPropAsNumber(t,"right");et(e.element,"right",n+"px"),et(e.element,"width",u+"px")}},e.prepareContainer=function(t,e,u,n,i){this.parentInstance&&this.vertical==this.parentInstance.vertical||et(e.element,"writing-mode",this.vertical?"vertical-rl":"horizontal-tb"),(this.vertical?this.isAutoWidth:this.isAutoHeight)?this.vertical?this.sizeWithMaxWidth(t,e):this.sizeWithMaxHeight(t,e):(this.assignBeforePosition(t,e),this.assignAfterPosition(t,e)),(this.vertical?this.isAutoHeight:this.isAutoWidth)?this.vertical?this.sizeWithMaxHeight(t,e):this.sizeWithMaxWidth(t,e):this.assignStartEndPosition(t,e);for(var r=0;r<bD.length;r++)this.propagateProperty(t,e,bD[r],n)},e.transferContentProps=function(t,e,u,n){for(var i=0;i<TD.length;i++)this.propagateProperty(t,e,TD[i],n)},e.transferSinglUriContentProps=function(t,e,u){for(var n=0;n<xD.length;n++)this.propagatePropertyToElement(t,e,xD[n],u)},e.finishContainer=function(t,e,u,n,i,r,o){this.vertical?this.calculatedWidth=e.computedBlockSize+e.snapOffsetX:this.calculatedHeight=e.computedBlockSize+e.snapOffsetY;var a=(this.vertical||!n)&&this.isAutoHeight,s=(!this.vertical||!n)&&this.isAutoWidth,l=null;if((s||a)&&(s&&et(e.element,"width","auto"),a&&et(e.element,"height","auto"),l=r.getElementClientRect(n?n.element:e.element),s&&(this.calculatedWidth=Math.ceil(l.right-l.left-e.paddingLeft-e.borderLeft-e.paddingRight-e.borderRight),this.vertical&&(this.calculatedWidth+=e.snapOffsetX)),a&&(this.calculatedHeight=l.bottom-l.top-e.paddingTop-e.borderTop-e.paddingBottom-e.borderBottom,this.vertical||(this.calculatedHeight+=e.snapOffsetY))),(this.vertical?this.isAutoHeight:this.isAutoWidth)&&this.assignStartEndPosition(t,e),(this.vertical?this.isAutoWidth:this.isAutoHeight)&&((this.vertical?this.isRightDependentOnAutoWidth:this.isTopDependentOnAutoHeight)&&this.assignBeforePosition(t,e),this.assignAfterPosition(t,e)),i>1){var D=this.getPropAsNumber(t,"column-rule-width"),h=this.getProp(t,"column-rule-style"),c=this.getProp(t,"column-rule-color");if(D>0&&h&&h!=uu.none&&c!=uu.transparent)for(var d=this.getPropAsNumber(t,"column-gap"),f=this.vertical?e.height:e.width,p=this.vertical?"border-top":"border-left",E=1;E<i;E++){var C=(f+d)*E/i-d/2+e.paddingLeft-D/2,F=e.height+e.paddingTop+e.paddingBottom,A=e.element.ownerDocument.createElement("div");et(A,"position","absolute"),et(A,this.vertical?"left":"top","0px"),et(A,this.vertical?"top":"left",C+"px"),et(A,this.vertical?"height":"width","0px"),et(A,this.vertical?"width":"height",F+"px"),et(A,p,D+"px "+h.toString()+(c?" "+c.toString():"")),e.element.insertBefore(A,e.element.firstChild)}}for(var g=0;g<SD.length;g++)this.propagateProperty(t,e,SD[g],o);for(var v=0;v<ID.length;v++)this.propagateDelayedProperty(t,e,ID[v],u.delayedItems)},e.applyCascadeAndInit=function(t,e){var u=this.cascaded,n=this.pageBox.specified;for(var i in n)Mr(i)&&Hr(u,i,Vr(n,i));if(this.pageBox.pseudoName==PD)for(var r in e)(r.match(/^background-/)||"writing-mode"==r)&&(u[r]=e[r]);if("layout-host"==this.pageBox.pseudoName)for(var o in e)o.match(/^background-/)||"writing-mode"==o||(u[o]=e[o]);t.pushRule(this.pageBox.classes,null,u),u.content&&(u.content=u.content.filterValue(new Mo(t,null,t.counterResolver))),this.init(t.context);for(var a,s=_(this.pageBox.children);!(a=s()).done;)a.value.createInstance(this).applyCascadeAndInit(t,e);t.popRule()},e.resolveAutoSizing=function(t){this.isAutoWidth&&(this.isRightDependentOnAutoWidth=this.depends("right",this.autoWidth,t)||this.depends("margin-right",this.autoWidth,t)||this.depends("border-right-width",this.autoWidth,t)||this.depends("padding-right",this.autoWidth,t)),this.isAutoHeight&&(this.isTopDependentOnAutoHeight=this.depends("top",this.autoHeight,t)||this.depends("margin-top",this.autoHeight,t)||this.depends("border-top-width",this.autoHeight,t)||this.depends("padding-top",this.autoHeight,t));for(var e,u=_(this.children);!(e=u()).done;)e.value.resolveAutoSizing(t)},t}(),bD=["border-left-style","border-right-style","border-top-style","border-bottom-style","border-left-color","border-right-color","border-top-color","border-bottom-color","outline-style","outline-color","outline-width","overflow","visibility"],SD=["border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-image-source","border-image-slice","border-image-width","border-image-outset","border-image-repeat","background-attachment","background-color","background-image","background-repeat","background-position","background-clip","background-origin","background-size","opacity","z-index","background-blend-mode","isolation","mix-blend-mode","filter"],TD=["color","font-family","font-size","font-style","font-weight","line-height","letter-spacing","text-align","text-decoration","text-indent","text-transform","white-space","word-spacing","font-feature-settings","font-kerning","font-size-adjust","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-stretch","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-shadow","text-underline-position"],xD=["width","height","image-resolution","object-fit","object-position"],ID=["transform","transform-origin"],PD="background-host",RD=function(t){function e(e){return t.call(this,null,e)||this}return T(e,t),e.prototype.applyCascadeAndInit=function(e,u){t.prototype.applyCascadeAndInit.call(this,e,u),this.children.sort((function(t,e){return e.pageBox.specificity-t.pageBox.specificity||t.pageBox.index-e.pageBox.index}))},e}(ND),LD=function(t){function e(e,u){var n;return(n=t.call(this,e,u)||this).pageMasterInstance=O(n),n}T(e,t);var u=e.prototype;return u.boxSpecificEnabled=function(t){var e=this.pageBox.pageMaster;return e.condition&&(t=be(e.scope,t,e.condition)),t},u.adjustPageLayout=function(t,e,u){},e}(ND),OD=function(t){function e(e,u){var n;return(n=t.call(this,e,u)||this).pageMasterInstance=e.pageMasterInstance,n}return T(e,t),e}(ND),kD=function(t){function e(e,u){var n;return(n=t.call(this,e,u)||this).pageMasterInstance=e.pageMasterInstance,n}T(e,t);var u=e.prototype;return u.processPartitionList=function(t,e,u){var n=null;if(e instanceof He&&(n=[e]),e instanceof Qe&&(n=e.values),n)for(var i=this.pageBox.scope,r=0;r<n.length;r++)if(n[r]instanceof He){var o=Mt(n[r].name,"enabled"),a=new Fe(i,o);u&&(a=new Zt(i,a)),t=be(i,t,a)}return t},u.boxSpecificEnabled=function(t){var e=this.pageBox.scope,u=this.style,n=yD(e,u.required,e._false)!==e._false;if(n||this.isAutoHeight){var i=function(t,e,u){return e?e.toExpr(t,t.zero):new Be(t,"body")}(e,u["flow-from"]);t=be(e,t,new ve(e,"has-content",[i]))}if(t=this.processPartitionList(t,u["required-partitions"],!1),t=this.processPartitionList(t,u["conflicting-partitions"],!0),n){var r=this.pageMasterInstance.style.enabled,o=r?r.toExpr(e,null):e._true;o=be(e,o,t),this.pageMasterInstance.style.enabled=new Je(o)}return t},u.prepareContainer=function(e,u,n,i,r){et(u.element,"overflow","hidden"),t.prototype.prepareContainer.call(this,e,u,n,i,r)},e}(ND),_D=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e,u,!1)||this).target=void 0,r.validatorSet=void 0,r.target=n,r.validatorSet=i,r}T(e,t);var u=e.prototype;return u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},u.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},u.simpleProperty=function(t,e,u){this.target.specified[t]=new Lr(e,u?50331648:67108864)},e}(Di),MD=function(t){function e(e,u,n,i){return t.call(this,e,u,n,i)||this}return T(e,t),e}(_D),UD=function(t){function e(e,u,n,i){var r;return r=t.call(this,e,u,n,i)||this,n.specified.width=new Lr(nu,0),n.specified.height=new Lr(nu,0),r}T(e,t);var u=e.prototype;return u.startPartitionRule=function(t,e,u){var n=new gD(this.scope,t,e,u,this.target),i=new MD(this.scope,this.owner,n,this.validatorSet);this.owner.pushHandler(i)},u.startPartitionGroupRule=function(t,u,n){var i=new AD(this.scope,t,u,n,this.target),r=new e(this.scope,this.owner,i,this.validatorSet);this.owner.pushHandler(r)},e}(_D),VD=function(t){function e(e,u,n,i){return t.call(this,e,u,n,i)||this}T(e,t);var u=e.prototype;return u.startPartitionRule=function(t,e,u){var n=new gD(this.scope,t,e,u,this.target),i=new MD(this.scope,this.owner,n,this.validatorSet);this.owner.pushHandler(i)},u.startPartitionGroupRule=function(t,e,u){var n=new AD(this.scope,t,e,u,this.target),i=new UD(this.scope,this.owner,n,this.validatorSet);this.owner.pushHandler(i)},e}(_D);function HD(t){var u=t["writing-mode"],n=t.direction;return n=n&&n.value,(u=u&&u.value)===uu.vertical_lr||u!==uu.vertical_rl&&n!==uu.rtl?e.PageProgression.LTR:e.PageProgression.RTL}var zD,GD,XD={a10:{width:new Ge(26,"mm"),height:new Ge(37,"mm")},a9:{width:new Ge(37,"mm"),height:new Ge(52,"mm")},a8:{width:new Ge(52,"mm"),height:new Ge(74,"mm")},a7:{width:new Ge(74,"mm"),height:new Ge(105,"mm")},a6:{width:new Ge(105,"mm"),height:new Ge(148,"mm")},a5:{width:new Ge(148,"mm"),height:new Ge(210,"mm")},a4:{width:new Ge(210,"mm"),height:new Ge(297,"mm")},a3:{width:new Ge(297,"mm"),height:new Ge(420,"mm")},a2:{width:new Ge(420,"mm"),height:new Ge(594,"mm")},a1:{width:new Ge(594,"mm"),height:new Ge(841,"mm")},a0:{width:new Ge(841,"mm"),height:new Ge(1189,"mm")},b10:{width:new Ge(31,"mm"),height:new Ge(44,"mm")},b9:{width:new Ge(44,"mm"),height:new Ge(62,"mm")},b8:{width:new Ge(62,"mm"),height:new Ge(88,"mm")},b7:{width:new Ge(88,"mm"),height:new Ge(125,"mm")},b6:{width:new Ge(125,"mm"),height:new Ge(176,"mm")},b5:{width:new Ge(176,"mm"),height:new Ge(250,"mm")},b4:{width:new Ge(250,"mm"),height:new Ge(353,"mm")},b3:{width:new Ge(353,"mm"),height:new Ge(500,"mm")},b2:{width:new Ge(500,"mm"),height:new Ge(707,"mm")},b1:{width:new Ge(707,"mm"),height:new Ge(1e3,"mm")},b0:{width:new Ge(1e3,"mm"),height:new Ge(1414,"mm")},c10:{width:new Ge(28,"mm"),height:new Ge(40,"mm")},c9:{width:new Ge(40,"mm"),height:new Ge(57,"mm")},c8:{width:new Ge(57,"mm"),height:new Ge(81,"mm")},c7:{width:new Ge(81,"mm"),height:new Ge(114,"mm")},c6:{width:new Ge(114,"mm"),height:new Ge(162,"mm")},c5:{width:new Ge(162,"mm"),height:new Ge(229,"mm")},c4:{width:new Ge(229,"mm"),height:new Ge(324,"mm")},c3:{width:new Ge(324,"mm"),height:new Ge(458,"mm")},c2:{width:new Ge(458,"mm"),height:new Ge(648,"mm")},c1:{width:new Ge(648,"mm"),height:new Ge(917,"mm")},c0:{width:new Ge(917,"mm"),height:new Ge(1297,"mm")},"jis-b10":{width:new Ge(32,"mm"),height:new Ge(45,"mm")},"jis-b9":{width:new Ge(45,"mm"),height:new Ge(64,"mm")},"jis-b8":{width:new Ge(64,"mm"),height:new Ge(91,"mm")},"jis-b7":{width:new Ge(91,"mm"),height:new Ge(128,"mm")},"jis-b6":{width:new Ge(128,"mm"),height:new Ge(182,"mm")},"jis-b5":{width:new Ge(182,"mm"),height:new Ge(257,"mm")},"jis-b4":{width:new Ge(257,"mm"),height:new Ge(364,"mm")},"jis-b3":{width:new Ge(364,"mm"),height:new Ge(515,"mm")},"jis-b2":{width:new Ge(515,"mm"),height:new Ge(728,"mm")},"jis-b1":{width:new Ge(728,"mm"),height:new Ge(1030,"mm")},"jis-b0":{width:new Ge(1030,"mm"),height:new Ge(1456,"mm")},letter:{width:new Ge(8.5,"in"),height:new Ge(11,"in")},legal:{width:new Ge(8.5,"in"),height:new Ge(14,"in")},ledger:{width:new Ge(11,"in"),height:new Ge(17,"in")}},WD=new Ge(.24,"pt"),jD=new Ge(3,"mm"),KD=new Ge(10,"mm"),YD=new Ge(13,"mm");function qD(t){var e={width:iu,height:ru,bleed:ou,bleedOffset:ou},u=t.size;if(u&&u.value!==uu.auto){var n,i,r=u.value;if(r.isSpaceList()?(n=r.values[0],i=r.values[1]):(n=r,i=null),n.isNumeric())e.width=n,e.height=i||n;else{var o=n.name&&XD[n.name.toLowerCase()];o&&(i&&i===uu.landscape?(e.width=o.height,e.height=o.width):(e.width=o.width,e.height=o.height))}}var a=t.marks;a&&a.value!==uu.none&&(e.bleedOffset=YD);var s=t.bleed;return s&&s.value!==uu.auto?s.value&&s.value.isNumeric()&&(e.bleed=s.value):a&&(a.value.isSpaceList()?a.value.values.some((function(t){return t===uu.crop})):a.value===uu.crop)&&(e.bleed=new Ge(6,"pt")),e}function $D(t,e){var u={},n=t.bleed.num*e.queryUnitSize(t.bleed.unit,!1),i=t.bleedOffset.num*e.queryUnitSize(t.bleedOffset.unit,!1),r=n+i,o=t.width;u.pageWidth=o===iu?e.pref.defaultPaperSize?e.pref.defaultPaperSize.width*e.queryUnitSize("px",!1):(e.pref.spreadView?Math.floor(e.viewportWidth/2)-e.pref.pageBorder:e.viewportWidth)-2*r:o.num*e.queryUnitSize(o.unit,!1);var a=t.height;return u.pageHeight=a===ru?e.pref.defaultPaperSize?e.pref.defaultPaperSize.height*e.queryUnitSize("px",!1):e.viewportHeight-2*r:a.num*e.queryUnitSize(a.unit,!1),u.bleed=n,u.bleedOffset=i,u.cropOffset=r,u}function QD(t,e,u){var n=t.createElementNS(X.SVG,"svg");return n.setAttribute("width",e),n.setAttribute("height",u),n.style.position="absolute",n}function ZD(t,e,u){var n=t.createElementNS(X.SVG,u=u||"polyline");return n.setAttribute("stroke","black"),n.setAttribute("stroke-width",e),n.setAttribute("fill","none"),n}!function(t){t.TOP_LEFT="top left",t.TOP_RIGHT="top right",t.BOTTOM_LEFT="bottom left",t.BOTTOM_RIGHT="bottom right"}(zD||(zD={})),function(t){t.TOP="top",t.BOTTOM="bottom",t.LEFT="left",t.RIGHT="right"}(GD||(GD={}));var JD,th,eh=(JD={width:!0,height:!0,"block-size":!0,"inline-size":!0,margin:!0,padding:!0,border:!0,outline:!0,"outline-width":!0,"outline-style":!0,"outline-color":!0},["left","right","top","bottom","before","after","start","end","block-start","block-end","inline-start","inline-end"].forEach((function(t){JD["margin-"+t]=!0,JD["padding-"+t]=!0,JD["border-"+t+"-width"]=!0,JD["border-"+t+"-style"]=!0,JD["border-"+t+"-color"]=!0})),JD);!function(t){t.START="start",t.CENTER="center",t.END="end"}(th||(th={}));var uh,nh={"top-left-corner":{order:1,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!0,isInRightColumn:!0,positionAlongVariableDimension:null},"top-left":{order:2,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:th.START},"top-center":{order:3,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:th.CENTER},"top-right":{order:4,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:th.END},"top-right-corner":{order:5,isInTopRow:!0,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:null},"right-top":{order:6,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:th.START},"right-middle":{order:7,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:th.CENTER},"right-bottom":{order:8,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:th.END},"bottom-right-corner":{order:9,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!1,isInRightColumn:!0,positionAlongVariableDimension:null},"bottom-right":{order:10,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:th.END},"bottom-center":{order:11,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:th.CENTER},"bottom-left":{order:12,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!1,isInRightColumn:!1,positionAlongVariableDimension:th.START},"bottom-left-corner":{order:13,isInTopRow:!1,isInBottomRow:!0,isInLeftColumn:!0,isInRightColumn:!1,positionAlongVariableDimension:null},"left-bottom":{order:14,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!0,isInRightColumn:!1,positionAlongVariableDimension:th.END},"left-middle":{order:15,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!0,isInRightColumn:!1,positionAlongVariableDimension:th.CENTER},"left-top":{order:16,isInTopRow:!1,isInBottomRow:!1,isInLeftColumn:!0,isInRightColumn:!1,positionAlongVariableDimension:th.START}},ih=(uh=nh,Object.keys(uh).sort((function(t,e){return uh[t].order-uh[e].order}))),rh=function(t){function e(e,u,n){var i;(i=t.call(this,e,null,"vivliostyle-page-rule-master",[],u,null,0)||this).bodyPartitionKey=void 0,i.pageMarginBoxes={};var r=qD(n),o=new oh(i.scope,O(i),n,r);return i.bodyPartitionKey=o.key,i.createPageMarginBoxes(n),i.applySpecified(n,r),i}T(e,t);var u=e.prototype;return u.createPageMarginBoxes=function(t){var e=this,u=t._marginBoxes;u&&ih.forEach((function(n){u[n]&&(e.pageMarginBoxes[n]=new ah(e.scope,e,n,t))}))},u.applySpecified=function(t,e){for(var u in this.specified.position=new Lr(uu.relative,0),this.specified.width=new Lr(e.width,0),this.specified.height=new Lr(e.height,0),t)eh[u]||"background-clip"===u||(this.specified[u]=t[u])},u.createInstance=function(t){return new sh(t,this)},e}(FD),oh=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e,null,null,[],u)||this).pageSize=void 0,r.pageSize=i,r.specified["z-index"]=new Lr(new We(0),0),r.applySpecified(n),r}T(e,t);var u=e.prototype;return u.applySpecified=function(t){for(var e in this.specified["flow-from"]=new Lr(ze("body"),0),this.specified.position=new Lr(uu.absolute,0),this.specified.overflow=new Lr(uu.visible,0),eh)eh.hasOwnProperty(e)&&(this.specified[e]=t[e])},u.createInstance=function(t){return new ch(t,this)},e}(gD),ah=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e,null,null,[],u)||this).marginBoxName=void 0,r.marginBoxName=n,r.applySpecified(i),r}T(e,t);var u=e.prototype;return u.applySpecified=function(t){var e=t._marginBoxes[this.marginBoxName];for(var u in t){var n=e[u];(Br[u]||n&&n.value===uu.inherit)&&(this.specified[u]=t[u])}for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var r=e[i];r&&r.value!==uu.inherit&&(this.specified[i]=r)}},u.createInstance=function(t){return new dh(t,this)},e}(gD),sh=function(t){function e(e,u){var n;return(n=t.call(this,e,u)||this).pageAreaDimension=null,n.pageMarginBoxInstances={},n}T(e,t);var u=e.prototype;return u.applyCascadeAndInit=function(e,u){var n=this.cascaded;for(var i in u)if(Object.prototype.hasOwnProperty.call(u,i))switch(i){case"writing-mode":case"direction":n[i]=u[i]}t.prototype.applyCascadeAndInit.call(this,e,u)},u.initHorizontal=function(){var t=this.style;t.left=ou,t["margin-left"]=ou,t["border-left-width"]=ou,t["padding-left"]=ou,t["padding-right"]=ou,t["border-right-width"]=ou,t["margin-right"]=ou,t.right=ou},u.initVertical=function(){var t=this.style;t.top=ou,t["margin-top"]=ou,t["border-top-width"]=ou,t["padding-top"]=ou,t["padding-bottom"]=ou,t["border-bottom-width"]=ou,t["margin-bottom"]=ou,t.bottom=ou},u.setPageAreaDimension=function(t){this.pageAreaDimension=t;var e=this.style;e.width=new Je(t.borderBoxWidth),e.height=new Je(t.borderBoxHeight),e["padding-left"]=new Je(t.marginLeft),e["padding-right"]=new Je(t.marginRight),e["padding-top"]=new Je(t.marginTop),e["padding-bottom"]=new Je(t.marginBottom)},u.adjustPageLayout=function(t,e,u){var n=e.marginBoxes,i={start:this.pageAreaDimension.marginLeft,end:this.pageAreaDimension.marginRight,extent:this.pageAreaDimension.borderBoxWidth},r={start:this.pageAreaDimension.marginTop,end:this.pageAreaDimension.marginBottom,extent:this.pageAreaDimension.borderBoxHeight};this.sizeMarginBoxesAlongVariableDimension(n.top,!0,i,t,u),this.sizeMarginBoxesAlongVariableDimension(n.bottom,!0,i,t,u),this.sizeMarginBoxesAlongVariableDimension(n.left,!1,r,t,u),this.sizeMarginBoxesAlongVariableDimension(n.right,!1,r,t,u)},u.sizeMarginBoxesAlongVariableDimension=function(t,e,u,n,i){var r=th.START,o=th.CENTER,a=th.END,s=this.pageBox.scope,l={},D={},h={};for(var c in t){var d=nh[c];if(d){var f=t[c],p=this.pageMarginBoxInstances[c],E=new lh(f,p.style,e,s,i);l[d.positionAlongVariableDimension]=f,D[d.positionAlongVariableDimension]=p,h[d.positionAlongVariableDimension]=E}}var C={start:u.start.evaluate(n),end:u.end.evaluate(n),extent:u.extent.evaluate(n)},F=this.getSizesOfMarginBoxesAlongVariableDimension(h,C.extent),A=!1,g={};Object.keys(l).forEach((function(t){var r=t,o=vD(s,D[r].style[e?"max-width":"max-height"],u.extent);if(o){var a=o.evaluate(n);if(F[r]>a){var c=h[r]=new hh(l[r],D[r].style,e,s,i,a);g[r]=c.getOuterSize(),A=!0}}})),A&&(F=this.getSizesOfMarginBoxesAlongVariableDimension(h,C.extent),A=!1,[r,o,a].forEach((function(t){F[t]=g[t]||F[t]})));var v={};Object.keys(l).forEach((function(t){var r=t,o=vD(s,D[r].style[e?"min-width":"min-height"],u.extent);if(o){var a=o.evaluate(n);if(F[r]<a){var c=h[r]=new hh(l[r],D[r].style,e,s,i,a);v[r]=c.getOuterSize(),A=!0}}})),A&&(F=this.getSizesOfMarginBoxesAlongVariableDimension(h,C.extent),[r,o,a].forEach((function(t){F[t]=v[t]||F[t]})));var m=C.start+C.extent,B=C.start+(C.start+C.extent);[r,o,a].forEach((function(t){var u=F[t];if(u){var n=l[t],i=0;switch(t){case r:i=e?n.left:n.top;break;case o:i=(B-u)/2;break;case a:i=m-u}e?n.setHorizontalPosition(i,u-n.getInsetLeft()-n.getInsetRight()):n.setVerticalPosition(i,u-n.getInsetTop()-n.getInsetBottom())}}))},u.getSizesOfMarginBoxesAlongVariableDimension=function(t,e){var u=t[th.START],n=t[th.CENTER],i=t[th.END],r={};if(n){var o=[u,i].filter((function(t){return t})),a=o.length?new Dh(o):null,s=this.distributeAutoMarginBoxSizes(n,a,e);s.xSize&&(r[th.CENTER]=s.xSize);var l=(e-(s.xSize||n.getOuterSize()))/2;u&&u.hasAutoSize()&&(r[th.START]=l),i&&i.hasAutoSize()&&(r[th.END]=l)}else{var D=this.distributeAutoMarginBoxSizes(u,i,e);D.xSize&&(r[th.START]=D.xSize),D.ySize&&(r[th.END]=D.ySize)}return r},u.distributeAutoMarginBoxSizes=function(t,e,u){var n={xSize:null,ySize:null};if(t&&e)if(t.hasAutoSize()&&e.hasAutoSize()){var i=t.getOuterMaxContentSize(),r=e.getOuterMaxContentSize();if(i>0&&r>0){var o=i+r;if(o<u)n.xSize=u*i/o;else{var a=t.getOuterMinContentSize(),s=a+e.getOuterMinContentSize();s<u?n.xSize=a+(u-s)*(i-a)/(o-s):s>0&&(n.xSize=u*a/s)}n.xSize>0&&(n.ySize=u-n.xSize)}else i>0?n.xSize=u:r>0&&(n.ySize=u)}else t.hasAutoSize()?n.xSize=Math.max(u-e.getOuterSize(),0):e.hasAutoSize()&&(n.ySize=Math.max(u-t.getOuterSize(),0));else t?t.hasAutoSize()&&(n.xSize=u):e&&e.hasAutoSize()&&(n.ySize=u);return n},u.prepareContainer=function(e,u,n,i,r){t.prototype.prepareContainer.call(this,e,u,n,i,r),u.element.setAttribute("data-vivliostyle-page-box",!0)},e}(LD),lh=function(){function t(t,e,u,n,i){this.container=void 0,this.isHorizontal=void 0,this.clientLayout=void 0,this.hasAutoSize_=void 0,this.size=null,this.container=t,this.isHorizontal=u,this.clientLayout=i,this.hasAutoSize_=!vD(n,e[u?"width":"height"],new Ce(n,0,"px"))}var e=t.prototype;return e.hasAutoSize=function(){return this.hasAutoSize_},e.getSize=function(){return this.size||(this.size=ga(this.clientLayout,this.container.element,this.isHorizontal?[Fa.MAX_CONTENT_WIDTH,Fa.MIN_CONTENT_WIDTH]:[Fa.MAX_CONTENT_HEIGHT,Fa.MIN_CONTENT_HEIGHT])),this.size},e.getOuterMaxContentSize=function(){var t=this.getSize();return this.isHorizontal?this.container.getInsetLeft()+t[Fa.MAX_CONTENT_WIDTH]+this.container.getInsetRight():this.container.getInsetTop()+t[Fa.MAX_CONTENT_HEIGHT]+this.container.getInsetBottom()},e.getOuterMinContentSize=function(){var t=this.getSize();return this.isHorizontal?this.container.getInsetLeft()+t[Fa.MIN_CONTENT_WIDTH]+this.container.getInsetRight():this.container.getInsetTop()+t[Fa.MIN_CONTENT_HEIGHT]+this.container.getInsetBottom()},e.getOuterSize=function(){return this.isHorizontal?this.container.getInsetLeft()+this.container.width+this.container.getInsetRight():this.container.getInsetTop()+this.container.height+this.container.getInsetBottom()},t}(),Dh=function(){function t(t){this.params=void 0,this.params=t}var e=t.prototype;return e.hasAutoSize=function(){return this.params.some((function(t){return t.hasAutoSize()}))},e.getOuterMaxContentSize=function(){var t=this.params.map((function(t){return t.getOuterMaxContentSize()}));return Math.max.apply(null,t)*t.length},e.getOuterMinContentSize=function(){var t=this.params.map((function(t){return t.getOuterMinContentSize()}));return Math.max.apply(null,t)*t.length},e.getOuterSize=function(){var t=this.params.map((function(t){return t.getOuterSize()}));return Math.max.apply(null,t)*t.length},t}(),hh=function(t){function e(e,u,n,i,r,o){var a;return(a=t.call(this,e,u,n,i,r)||this).fixedSize=void 0,a.fixedSize=o,a}T(e,t);var u=e.prototype;return u.hasAutoSize=function(){return!1},u.getOuterMaxContentSize=function(){return this.getOuterSize()},u.getOuterMinContentSize=function(){return this.getOuterSize()},u.getOuterSize=function(){return this.isHorizontal?this.container.getInsetLeft()+this.fixedSize+this.container.getInsetRight():this.container.getInsetTop()+this.fixedSize+this.container.getInsetBottom()},e}(lh),ch=function(t){function e(e,u){var n;return(n=t.call(this,e,u)||this).borderBoxWidth=null,n.borderBoxHeight=null,n.marginTop=null,n.marginRight=null,n.marginBottom=null,n.marginLeft=null,n}T(e,t);var u=e.prototype;return u.applyCascadeAndInit=function(e,u){var n=this.cascaded;for(var i in u)Object.prototype.hasOwnProperty.call(u,i)&&(i.match(/^column.*$/)||i.match(/^background-/))&&(n[i]=u[i]);t.prototype.applyCascadeAndInit.call(this,e,u),this.parentInstance.setPageAreaDimension({borderBoxWidth:this.borderBoxWidth,borderBoxHeight:this.borderBoxHeight,marginTop:this.marginTop,marginRight:this.marginRight,marginBottom:this.marginBottom,marginLeft:this.marginLeft})},u.initHorizontal=function(){var t=this.resolvePageBoxDimensions({start:"left",end:"right",extent:"width"});this.borderBoxWidth=t.borderBoxExtent,this.marginLeft=t.marginStart,this.marginRight=t.marginEnd},u.initVertical=function(){var t=this.resolvePageBoxDimensions({start:"top",end:"bottom",extent:"height"});this.borderBoxHeight=t.borderBoxExtent,this.marginTop=t.marginStart,this.marginBottom=t.marginEnd},u.resolvePageBoxDimensions=function(t){var e=this.style,u=this.pageBox.scope,n=t.start,i=t.end,r=t.extent,o=this.pageBox.pageSize[r].toExpr(u,null),a=vD(u,e[r],o),s=vD(u,e["margin-"+n],o),l=vD(u,e["margin-"+i],o),D=mD(u,e["padding-"+n],o),h=mD(u,e["padding-"+i],o),c=wD(u,e["border-"+n+"-width"],e["border-"+n+"-style"],o),d=wD(u,e["border-"+i+"-width"],e["border-"+i+"-style"],o),f=Te(u,o,Se(u,Se(u,c,D),Se(u,d,h)));return a?(f=Te(u,f,a),s||l?s?l=Te(u,f,s):s=Te(u,f,l):l=s=xe(u,f,new Be(u,.5))):(s||(s=u.zero),l||(l=u.zero),a=Te(u,f,Se(u,s,l))),e[n]=new Je(s),e[i]=new Je(l),e["margin-"+n]=ou,e["margin-"+i]=ou,e["padding-"+n]=new Je(D),e["padding-"+i]=new Je(h),e["border-"+n+"-width"]=new Je(c),e["border-"+i+"-width"]=new Je(d),e[r]=new Je(a),e["max-"+r]=new Je(a),{borderBoxExtent:Te(u,o,Se(u,s,l)),marginStart:s,marginEnd:l}},u.prepareContainer=function(e,u,n,i,r){t.prototype.prepareContainer.call(this,e,u,n,i,r),n.pageAreaElement=u.element,e.pageAreaWidth=parseFloat(n.pageAreaElement.style.width),e.pageAreaHeight=parseFloat(n.pageAreaElement.style.height)},e}(kD),dh=function(t){function e(e,u){var n;(n=t.call(this,e,u)||this).boxInfo=void 0,n.suppressEmptyBoxGeneration=!0;var i=u.marginBoxName;return n.boxInfo=nh[i],e.pageMarginBoxInstances[i]=O(n),n}T(e,t);var u=e.prototype;return u.prepareContainer=function(e,u,n,i,r){this.applyVerticalAlign(e,u.element),t.prototype.prepareContainer.call(this,e,u,n,i,r)},u.applyVerticalAlign=function(t,e){et(e,"display","flex");var u=this.getProp(t,"vertical-align"),n=null;u===ze("middle")?n="center":u===ze("top")?n="flex-start":u===ze("bottom")&&(n="flex-end"),n&&(et(e,"flex-flow",this.vertical?"row":"column"),et(e,"justify-content",n))},u.positionAlongVariableDimension=function(t,e){var u=this.style,n=this.pageBox.scope,i=t.start,r=t.end,o="left"===i,a=o?e.borderBoxWidth:e.borderBoxHeight,s=vD(n,u[t.extent],a),l=o?e.marginLeft:e.marginTop;if(this.boxInfo.positionAlongVariableDimension===th.START)u[i]=new Je(l);else if(s){var D=mD(n,u["margin-"+i],a),h=mD(n,u["margin-"+r],a),c=mD(n,u["padding-"+i],a),d=mD(n,u["padding-"+r],a),f=wD(n,u["border-"+i+"-width"],u["border-"+i+"-style"],a),p=wD(n,u["border-"+r+"-width"],u["border-"+r+"-style"],a),E=Se(n,s,Se(n,Se(n,c,d),Se(n,Se(n,f,p),Se(n,D,h))));switch(this.boxInfo.positionAlongVariableDimension){case th.CENTER:u[i]=new Je(Se(n,l,Ie(n,Te(n,a,E),new Be(n,2))));break;case th.END:u[i]=new Je(Te(n,Se(n,l,a),E))}}},u.positionAndSizeAlongFixedDimension=function(t,e){var u=this.style,n=this.pageBox.scope,i=t.inside,r=t.outside,o=t.extent,a=e["margin"+r.charAt(0).toUpperCase()+r.substring(1)],s=BD(n,u["margin-"+i],a),l=BD(n,u["margin-"+r],a),D=mD(n,u["padding-"+i],a),h=mD(n,u["padding-"+r],a),c=wD(n,u["border-"+i+"-width"],u["border-"+i+"-style"],a),d=wD(n,u["border-"+r+"-width"],u["border-"+r+"-style"],a),f=vD(n,u[o],a),p=null;function E(t){if(p)return p;p={extent:f?f.evaluate(t):null,marginInside:s?s.evaluate(t):null,marginOutside:l?l.evaluate(t):null};var e=a.evaluate(t),u=0;return[c,D,h,d].forEach((function(e){e&&(u+=e.evaluate(t))})),(null===p.marginInside||null===p.marginOutside)&&u+p.extent+p.marginInside+p.marginOutside>e&&(null===p.marginInside&&(p.marginInside=0),null===p.marginOutside&&(p.marginOutside=0)),null!==p.extent&&null!==p.marginInside&&null!==p.marginOutside&&(p.marginOutside=null),null===p.extent&&null!==p.marginInside&&null!==p.marginOutside?p.extent=e-u-p.marginInside-p.marginOutside:null!==p.extent&&null===p.marginInside&&null!==p.marginOutside?p.marginInside=e-u-p.extent-p.marginOutside:null!==p.extent&&null!==p.marginInside&&null===p.marginOutside?p.marginOutside=e-u-p.extent-p.marginInside:null===p.extent?(p.marginInside=p.marginOutside=0,p.extent=e-u):p.marginInside=p.marginOutside=(e-u-p.extent)/2,p}u[o]=new Je(new ge(n,(function(){var t=E(this).extent;return null===t?0:t}),o)),u["margin-"+i]=new Je(new ge(n,(function(){var t=E(this).marginInside;return null===t?0:t}),"margin-"+i)),u["margin-"+r]=new Je(new ge(n,(function(){var t=E(this).marginOutside;return null===t?0:t}),"margin-"+r)),"left"===i?u.left=new Je(Se(n,e.marginLeft,e.borderBoxWidth)):"top"===i&&(u.top=new Je(Se(n,e.marginTop,e.borderBoxHeight)))},u.initHorizontal=function(){var t=this.parentInstance.pageAreaDimension;this.boxInfo.isInLeftColumn?this.positionAndSizeAlongFixedDimension({inside:"right",outside:"left",extent:"width"},t):this.boxInfo.isInRightColumn?this.positionAndSizeAlongFixedDimension({inside:"left",outside:"right",extent:"width"},t):this.positionAlongVariableDimension({start:"left",end:"right",extent:"width"},t)},u.initVertical=function(){var t=this.parentInstance.pageAreaDimension;this.boxInfo.isInTopRow?this.positionAndSizeAlongFixedDimension({inside:"bottom",outside:"top",extent:"height"},t):this.boxInfo.isInBottomRow?this.positionAndSizeAlongFixedDimension({inside:"top",outside:"bottom",extent:"height"},t):this.positionAlongVariableDimension({start:"top",end:"bottom",extent:"height"},t)},u.finishContainer=function(e,u,n,i,r,o,a){t.prototype.finishContainer.call(this,e,u,n,i,r,o,a);var s=n.marginBoxes,l=this.pageBox.marginBoxName,D=this.boxInfo;D.isInLeftColumn||D.isInRightColumn?D.isInTopRow||D.isInBottomRow||(D.isInLeftColumn?s.left[l]=u:D.isInRightColumn&&(s.right[l]=u)):D.isInTopRow?s.top[l]=u:D.isInBottomRow&&(s.bottom[l]=u)},e}(kD),fh=function(){function t(t,e,u,n,i){this.cascadeInstance=void 0,this.pageScope=void 0,this.rootPageBoxInstance=void 0,this.context=void 0,this.docElementStyle=void 0,this.pageMasterCache={},this.cascadeInstance=t,this.pageScope=e,this.rootPageBoxInstance=u,this.context=n,this.docElementStyle=i,this.definePageProgression()}var u=t.prototype;return u.definePageProgression=function(){var t=this.pageScope,u=this.context,n=u.isVersoFirstPage,i=new Fe(t,"page-number"),r=new De(t,new Ee(t,i,new Be(t,2)),n?t.one:t.zero);t.defineName("recto-page",new Zt(t,r)),t.defineName("verso-page",r),(u.pageProgression||HD(this.docElementStyle))===e.PageProgression.LTR?(t.defineName("left-page",r),t.defineName("right-page",new Zt(t,r))):(t.defineName("left-page",new Zt(t,r)),t.defineName("right-page",r))},u.getCascadedPageStyle=function(t){var e={};return this.cascadeInstance.pushRule([],t,e),this.cascadeInstance.popRule(),e},u.getPageRulePageMaster=function(t,e){var u=t.pageBox;if(0===Object.keys(e).length)return u.resetScope(),t;var n=this.makeCacheKey(e,u),i=this.pageMasterCache[n];return i||(i=u.pseudoName===PD?this.generatePageRuleMaster(e):this.generateCascadedPageMaster(e,u),this.pageMasterCache[n]=i),i.pageBox.resetScope(),i},u.makeCacheKey=function(t,e){var u=this.makeCascadeValueObjectKey(t);return e.key+"^"+u},u.makeCascadeValueObjectKey=function(t){var e=[];for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var n,i=t[u];n=i instanceof Lr?""+i.value:this.makeCascadeValueObjectKey(i),e.push(u+n+(i.priority||""))}return e.sort().join("^")},u.generatePageRuleMaster=function(t){var e=new rh(this.pageScope,this.rootPageBoxInstance.pageBox,t).createInstance(this.rootPageBoxInstance);return e.applyCascadeAndInit(this.cascadeInstance,this.docElementStyle),e.resolveAutoSizing(this.context),e},u.generateCascadedPageMaster=function(t,e){var u=e.clone({pseudoName:"vivliostyle-page-rule-master"}),n=u.specified,i=t.size;if(i){var r=qD(t),o=i.priority;n.width=kr(this.context,n.width,new Lr(r.width,o)),n.height=kr(this.context,n.height,new Lr(r.height,o))}["counter-reset","counter-increment"].forEach((function(e){n[e]&&(t[e]=n[e])}));var a=u.createInstance(this.rootPageBoxInstance);return a.applyCascadeAndInit(this.cascadeInstance,this.docElementStyle),a.resolveAutoSizing(this.context),a},t}(),ph=function(t){function e(e){var u;return(u=t.call(this)||this).pageType=void 0,u.pageType=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){t.currentPageType===this.pageType&&this.chained.apply(t)},u.getPriority=function(){return 3},u.makePrimary=function(t){return this.chained&&t.insertInTable(t.pagetypes,this.pageType,this.chained),!0},e}(eo),Eh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){1===new Fe(this.scope,"page-number").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 2},e}(eo),Ch=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){new Fe(this.scope,"blank-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 2},e}(eo),Fh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){new Fe(this.scope,"left-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(eo),Ah=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){new Fe(this.scope,"right-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(eo),gh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){new Fe(this.scope,"recto-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(eo),vh=function(t){function e(e){var u;return(u=t.call(this)||this).scope=void 0,u.scope=e,u}T(e,t);var u=e.prototype;return u.apply=function(t){new Fe(this.scope,"verso-page").evaluate(t.context)&&this.chained.apply(t)},u.getPriority=function(){return 1},e}(eo),mh=function(t){function e(e,u,n){var i;return(i=t.call(this,u,n)||this).scope=void 0,i.a=void 0,i.b=void 0,i.scope=e,i.a=u,i.b=n,i}T(e,t);var u=e.prototype;return u.apply=function(t){var e=t.context,u=e.layoutPositionAtPageStart.page;e.blankPageAtStart&&u--,u&&this.matchANPlusB(u)&&this.chained.apply(t)},u.getPriority=function(){return 2},e}(Eo),Bh=function(t){function e(e,u){return t.call(this,e,u,null,null,null)||this}return T(e,t),e.prototype.apply=function(t){!function(t,e,u,n,i){Kr(t,e,u,n,null,null,null);var r=u._marginBoxes;if(r){var o=Gr(e,"_marginBoxes");for(var a in r)if(r.hasOwnProperty(a)){var s=o[a];s||(o[a]=s={}),Kr(t,s,r[a],n,null,null,null)}}}(t.context,t.currentStyle,this.style,this.specificity)},e}(to),wh=function(t){function e(e,u,n,i,r){var o;return(o=t.call(this,e,u,null==n?void 0:n.condition,n,null,i,!1)||this).pageProps=void 0,o.currentPageSelectors=[],o.currentNamedPageSelector="",o.currentPseudoPageClassSelectors=[],o.pageProps=r,o}T(e,t);var u=e.prototype;return u.startPageRule=function(){this.startSelectorRule()},u.tagSelector=function(t,e){this.currentNamedPageSelector=e,e&&(this.chain.push(new ph(e)),this.specificity+=65536)},u.pseudoclassSelector=function(t,e){if(t=t.toLowerCase(),e)if("nth"===t){var u=e[0],n=e[1];this.currentPseudoPageClassSelectors.push(":"+t+"("+u+"n"+(n<0?n:"+"+n)+")"),this.chain.push(new mh(this.scope,u,n)),this.specificity+=256}else this.reportAndSkip("E_INVALID_PAGE_SELECTOR :"+t+"("+e.join("")+")");else switch(this.currentPseudoPageClassSelectors.push(":"+t),t){case"first":this.chain.push(new Eh(this.scope)),this.specificity+=256;break;case"blank":this.chain.push(new Ch(this.scope)),this.specificity+=256;break;case"left":this.chain.push(new Fh(this.scope)),this.specificity+=1;break;case"right":this.chain.push(new Ah(this.scope)),this.specificity+=1;break;case"recto":this.chain.push(new gh(this.scope)),this.specificity+=1;break;case"verso":this.chain.push(new vh(this.scope)),this.specificity+=1;break;default:this.reportAndSkip("E_INVALID_PAGE_SELECTOR :"+t)}},u.finishSelector=function(){var t;t=this.currentNamedPageSelector||this.currentPseudoPageClassSelectors.length?[this.currentNamedPageSelector].concat(this.currentPseudoPageClassSelectors.sort()):null,this.currentPageSelectors.push({selectors:t,specificity:this.specificity}),this.currentNamedPageSelector="",this.currentPseudoPageClassSelectors=[]},u.nextSelector=function(){this.finishSelector(),t.prototype.nextSelector.call(this)},u.startRuleBody=function(){this.finishSelector(),t.prototype.startRuleBody.call(this)},u.simpleProperty=function(e,u,n){if("bleed"!==e&&"marks"!==e||this.currentPageSelectors.some((function(t){return null===t.selectors}))){t.prototype.simpleProperty.call(this,e,u,n);var i=Vr(this.elementStyle,e),r=this.pageProps;if("bleed"===e||"marks"===e)r[""]||(r[""]={}),Object.keys(r).forEach((function(t){Hr(r[t],e,i)}));else if("size"===e){var o=r[""];this.currentPageSelectors.forEach((function(t){var u=new Lr(i.value,i.priority+t.specificity),n=t.selectors?t.selectors.join(""):"",a=r[n];if(a){var s=Vr(a,e);u=s?kr(null,u,s):u,Hr(a,e,u)}else Hr(a=r[n]={},e,u),o&&["bleed","marks"].forEach((function(t){o[t]&&Hr(a,t,o[t])}))}))}}},u.insertNonPrimary=function(t){this.cascade.insertInTable(this.cascade.pagetypes,"*",t)},u.makeApplyRuleAction=function(t){return new Bh(this.elementStyle,t)},u.startPageMarginBoxRule=function(t){var e=Gr(this.elementStyle,"_marginBoxes"),u=e[t];u||(e[t]=u={});var n=new yh(this.scope,this.owner,this.validatorSet,u);this.owner.pushHandler(n)},e}($o),yh=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e,u,!1)||this).validatorSet=void 0,r.boxStyle=void 0,r.validatorSet=n,r.boxStyle=i,r}T(e,t);var u=e.prototype;return u.property=function(t,e,u){this.validatorSet.validatePropertyAndHandleShorthand(t,e,u,this)},u.invalidPropertyValue=function(t,e){this.report("E_INVALID_PROPERTY_VALUE "+t+": "+e.toString())},u.unknownProperty=function(t,e){this.report("E_INVALID_PROPERTY "+t+": "+e.toString())},u.simpleProperty=function(t,e,u){var n=u?this.getImportantSpecificity():this.getBaseSpecificity(),i=new Lr(e,n);Hr(this.boxStyle,t,i)},e}(Di),Nh=!0,bh=[];function Sh(t,e){return t===e||(t.src||e.src?t.src===e.src:t.textContent===e.textContent)}function Th(t,e,u){if(!Nh)return Rn(!1);if((null==u||!u.inHead)&&(null==u||!u.atEnd)&&Array.from(t.ownerDocument.querySelectorAll("body > script:not(:not(script, link, style) ~ *)")).includes(t))return Rn(!1);var n=t.textContent,i=t.src,r="module"===t.type,o=(r||i)&&t.async,a=r&&!o||i&&t.defer,s=!(null!=u&&u.atEnd)&&((null==u?void 0:u.forceDefer)||a||o);if(xh(e)||(e.onload=null),s)return bh.some((function(e){return Sh(e,t)}))||bh.push(t),Rn(!0);if(i.includes("/mathjax")){var l,D,h=e.document.head.querySelector("script[src*='MathJax.js']:not([data-vivliostyle-scripting])");if(h)if(i.includes("/mathjax@3"))e.document.head.removeChild(h),null!=(l=e.MathJax)&&null!=(D=l.version)&&D.startsWith("2.")&&delete e.MathJax;else if(i.includes("/MathJax.js"))return Rn(!0)}for(var d,f=_(e.document.head.getElementsByTagName("script"));!(d=f()).done;){var p=d.value;p.hasAttribute("data-vivliostyle-scripting")&&Sh(p,t)&&e.document.head.removeChild(p)}var E=e.document.createElement("script");E.textContent=n,i&&(E.src=i),E.async=o,E.defer=a,E.setAttribute("data-vivliostyle-scripting","true");for(var C,F=_(t.attributes);!(C=F()).done;){var A=C.value;["src","async","defer"].includes(A.name)||E.setAttribute(A.name,A.value)}if(c.debug("script:",i),i){var g=Wn(E);return e.document.head.appendChild(E),Xn([g])}return e.document.head.appendChild(E),Rn(!0)}function xh(t){return!!Nh&&(bh.length>0||!!t.document.head.querySelector("script[data-vivliostyle-scripting]"))}var Ih=function(t,e,u){return t.replace(/[uU][rR][lL]\(\s*"((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^"\r\n])+)"/gm,(function(t,n){return'url("'+u.transformURL(n,e)+'"'})).replace(/[uU][rR][lL]\(\s*'((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^'\r\n])+)'/gm,(function(t,n){return"url('"+u.transformURL(n,e)+"'"})).replace(/[uU][rR][lL]\(\s*((\\([^0-9a-fA-F]+|[0-9a-fA-F]+\s*)|[^"'\r\n\)\s])+)/gm,(function(t,n){return"url("+u.transformURL(n,e)}))},Ph={},Rh={"text-indent":"0px","margin-top":"0px","padding-top":"0px","border-top-width":"0px","border-top-style":"none","border-top-color":"transparent","border-top-left-radius":"0px","border-top-right-radius":"0px"},Lh={"text-indent":"0px","margin-right":"0px","padding-right":"0px","border-right-width":"0px","border-right-style":"none","border-right-color":"transparent","border-top-right-radius":"0px","border-bottom-right-radius":"0px"},Oh={"margin-top":"0px"},kh={"margin-right":"0px"},_h=function(t){function u(e,u,n,i,r,o,a,s,l,D,h,c,d){var f;return(f=t.call(this)||this).flowName=void 0,f.context=void 0,f.viewport=void 0,f.styler=void 0,f.regionIds=void 0,f.xmldoc=void 0,f.docFaces=void 0,f.footnoteStyle=void 0,f.stylerProducer=void 0,f.page=void 0,f.customRenderer=void 0,f.fallbackMap=void 0,f.documentURLTransformer=void 0,f.document=void 0,f.exprContentListener=void 0,f.nodeContext=null,f.viewRoot=null,f.isFootnote=!1,f.sourceNode=null,f.offsetInNode=0,f.viewNode=null,f.flowName=e,f.context=u,f.viewport=n,f.styler=i,f.regionIds=r,f.xmldoc=o,f.docFaces=a,f.footnoteStyle=s,f.stylerProducer=l,f.page=D,f.customRenderer=h,f.fallbackMap=c,f.documentURLTransformer=d,f.document=n.document,f.exprContentListener=i.counterListener.getExprContentListener(),f}T(u,t);var n=u.prototype;return n.clone=function(){return new u(this.flowName,this.context,this.viewport,this.styler,this.regionIds,this.xmldoc,this.docFaces,this.footnoteStyle,this.stylerProducer,this.page,this.customRenderer,this.fallbackMap,this.documentURLTransformer)},n.createPseudoelementShadow=function(t,e,u,n,i,r,o,a){var s=this.getPseudoMap(u,this.regionIds,this.isFootnote,this.nodeContext,r);if(!s)return a;for(var l,D=[],h=ps.createElementNS(X.SHADOW,"root"),c=h,d=_(Es);!(l=d()).done;){var f=l.value,p=void 0;if(f){if(!s[f])continue;if(!("footnote-marker"!=f||e&&this.isFootnote))continue;if(f.match(/^first-/)){var E=n.display;if(!E||E===uu.inline)continue}if("before"===f||"after"===f){var C=s[f].content;if(!C||C===uu.normal||C===uu.none)continue}D.push(f),Fs(p=ps.createElementNS(X.XHTML,"span"),f)}else p=ps.createElementNS(X.SHADOW,"content");c.appendChild(p),f.match(/^first-/)&&(c=p)}if(!D.length)return a;var F=new As(t,u,i,r,this.exprContentListener);return new cr(t,h,null,o,a,hr.ROOTLESS,F)},n.getPseudoMap=function(t,e,u,n,i){var r=zr(t,"_pseudos");if(!r)return null;var o={},a=function(t){var n=o[t]={};la(n,r[t],i),ia(n,i,r[t]),sa(r[t],e,u,(function(t,e){la(n,e,i),na(e,(function(t){la(n,t,i)}))}))};for(var s in r)a(s);return o},n.createRefShadow=function(t,e,u,n,i){var r=this,o=Pn("createRefShadow");return this.xmldoc.store.load(t).then((function(a){var s=a;if(s){var l=s.getElement(t);if(l){var D=r.stylerProducer.getStylerForDoc(s);i=new cr(u,l,s,n,i,e,D)}}o.finish(i)})),o.result()},n.createShadows=function(t,e,u,n,i,r,o){var a=this,s=Pn("createShadows"),l=n.template;return(l instanceof Ke?this.createRefShadow(l.url,hr.ROOTLESS,t,o,null):Rn(null)).then((function(l){var D=null;if(t.namespaceURI==X.SHADOW&&"include"==t.localName){var h=t.getAttribute("href"),c=null;h?c=o?o.xmldoc:a.xmldoc:o&&(h=o.owner.namespaceURI==X.XHTML?o.owner.getAttribute("href"):o.owner.getAttributeNS(X.XLINK,"href"),c=o.parentShadow?o.parentShadow.xmldoc:a.xmldoc),h&&(h=K(h,c.url),D=a.createRefShadow(h,hr.ROOTED,t,o,l))}null==D&&(D=Rn(l));var d=null;D.then((function(e){if(n.display===uu.table_cell){var u=K("user-agent.xml#table-cell",W);d=a.createRefShadow(u,hr.ROOTLESS,t,o,e)}else d=Rn(e)})),d.then((function(l){l=a.createPseudoelementShadow(t,e,u,n,i,r,o,l),s.finish(l)}))})),s.result()},n.setViewRoot=function(t,e){this.viewRoot=t,this.isFootnote=e},n.computeStyle=function(t,e,u,n){var i=this,r=this.context,o=aa(u,r,this.regionIds,this.isFootnote);t=ra(o,r,t),e=oa(o,r,e),Da(o,n,t,e,(function(t,e){var u=e.evaluate(r,t);return"font-family"==t&&(u=i.docFaces.filterFontFamily(u)),u}));var a=us(n.display||uu.inline,n.position,n.float,this.sourceNode===this.xmldoc.root);return["display","position","float"].forEach((function(t){a[t]&&(n[t]=a[t])})),t},n.inheritFromSourceParent=function(t){for(var e=this.nodeContext.sourceNode,u=[],n=null,i=this.nodeContext.shadowContext,r=-1;e&&1==e.nodeType;){var o=i&&i.root==e;if(!o||i.type==hr.ROOTLESS){var a=(i?i.styler:this.styler).getStyle(e,!1);u.push(a),n=n||nt(e)}o?(e=i.owner,i=i.parentShadow):(e=e.parentNode,r++)}for(var s=this.context.isRelativeRootFontSize?this.context.initialFontSize:this.context.queryUnitSize("em",0===r),l={"font-size":new Lr(new Ge(s,"px"),0)},D=new qr(l,this.context),h=u.length-1;h>=0;--h){var c=u[h],d=[];for(var f in c)Ur(f)&&d.push(f);d.sort(lu);for(var p=0,E=d;p<E.length;p++){var C=E[p];D.setPropName(C);var F=Vr(c,C);F.value!==uu.inherit&&(l[C]=F.filterValue(D))}}for(var A in t)Ur(A)||(l[A]=t[A]);return{lang:n,elementStyle:l}},n.resolveURL=function(t){return t=K(t,this.xmldoc.url),this.fallbackMap[t]||t},n.inheritLangAttribute=function(){this.nodeContext.lang=nt(this.nodeContext.sourceNode)||this.nodeContext.parent&&this.nodeContext.parent.lang||this.nodeContext.lang},n.transferPolyfilledInheritedProps=function(t){var u=C(e.HOOKS.POLYFILLED_INHERITED_PROPS).reduce((function(t,e){return t.concat(e())}),[].concat(wr)).filter((function(e){return t[e]}));if(u.length){var n=this.nodeContext.inheritedProps;if(this.nodeContext.parent)for(var i in n=this.nodeContext.inheritedProps={},this.nodeContext.parent.inheritedProps)n[i]=this.nodeContext.parent.inheritedProps[i];u.forEach((function(e){var u=t[e];if(u){if(u instanceof We)n[e]=u.num;else if(u instanceof He)n[e]=u.name;else if(u instanceof Ge){var i=u;switch(i.unit){case"dpi":case"dpcm":case"dppx":n[e]=i.num*zt[i.unit]}}else n[e]=u;delete t[e]}}))}},n.resolveFormattingContext=function(t,u,n,i,r,o){for(var a=C(e.HOOKS.RESOLVE_FORMATTING_CONTEXT),s=0;s<a.length;s++){var l=a[s](t,u,n,i,r,o);if(l)return void(t.formattingContext=l)}},n.createElementView=function(t,e){var u=this,n=!0,i=Pn("createElementView"),r=this.sourceNode,o=this.nodeContext.shadowContext?this.nodeContext.shadowContext.styler:this.styler,a=o.getStyle(r,!1);if(!this.nodeContext.shadowContext){var s=this.xmldoc.getElementOffset(r);Mi.registerFragmentIndex(s,this.nodeContext.fragmentIndex,0)}var l={};if(!this.nodeContext.parent){var D=this.inheritFromSourceParent(a);a=D.elementStyle,this.nodeContext.lang=D.lang}var h=a["float-reference"]&&function(t){switch(t){case"inline":return va.INLINE;case"column":return va.COLUMN;case"region":return va.REGION;case"page":return va.PAGE;default:throw new Error("Unknown float-reference: "+t)}}(a["float-reference"].value.toString());if(this.nodeContext.parent&&h&&ma(h)){var d=this.inheritFromSourceParent(a);a=d.elementStyle,this.nodeContext.lang=d.lang}this.nodeContext.vertical=this.computeStyle(this.nodeContext.vertical,"rtl"===this.nodeContext.direction,a,l),o.processContent(r,l),this.transferPolyfilledInheritedProps(l),this.inheritLangAttribute(),l.direction&&(this.nodeContext.direction=l.direction.toString());var f=l["flow-into"];if(f&&f.toString()!=this.flowName)return i.finish(!1),i.result();if(Nh&&r instanceof HTMLScriptElement)return Th(r,this.viewport.window).thenFinish(i),i.result();var p=l.display;if(p===uu.none)return i.finish(!1),i.result();var E=null==this.nodeContext.parent;return this.nodeContext.flexContainer=p===uu.flex,this.createShadows(r,E,a,l,o,this.context,this.nodeContext.shadowContext).then((function(s){u.nodeContext.nodeShadow=s;var D=l.position,d=l.float,f=l.clear,C=u.nodeContext.vertical?uu.vertical_rl:uu.horizontal_tb,F=u.nodeContext.parent?u.nodeContext.parent.vertical?uu.vertical_rl:uu.horizontal_tb:C,A=function(t){return"true"===t.getAttribute("data-vivliostyle-flow-root")}(r);u.nodeContext.establishesBFC=function(t,e,u,n,i,r,o){return i=i||r||uu.horizontal_tb,!!o||!!u&&u!==uu.none||es(e)||t===uu.inline_block||t===uu.table_cell||t===uu.table_caption||t==uu.flex||(t===uu.block||t===uu.list_item)&&!!n&&n!==uu.visible||!!r&&i!==r}(p,D,d,l.overflow,C,F,A),u.nodeContext.containingBlockForAbsolute=function(t){return t===uu.relative||t===uu.absolute||t===uu.fixed}(D),!u.nodeContext.isInsideBFC()||d===uu.footnote||h&&ma(h)||(d=null,f=null);var g=d===uu.left||d===uu.right||d===uu.top||d===uu.bottom||d===uu.inline_start||d===uu.inline_end||d===uu.block_start||d===uu.block_end||d===uu.snap_block||d===uu.footnote;d&&(delete l.float,d===uu.footnote&&(u.isFootnote?(g=!1,l.display=uu.block):l.display=uu.inline)),f&&(f===uu.inherit&&u.nodeContext.parent&&u.nodeContext.parent.clearSide&&(f=ze(u.nodeContext.parent.clearSide)),f!==uu.left&&f!==uu.right&&f!==uu.top&&f!==uu.bottom&&f!==uu.both&&f!==uu.all&&f!==uu.same||(delete l.clear,l.display&&l.display!=uu.inline&&(u.nodeContext.clearSide=f.toString())));var v=p===uu.list_item&&l["ua-list-item-count"];if((g||l["break-inside"]&&l["break-inside"]!==uu.auto)&&u.nodeContext.breakPenalty++,p&&p!==uu.inline&&is(p)&&u.nodeContext.breakPenalty++,u.nodeContext.inline=!g&&!p||is(p)||function(t){switch(t.toString()){case"ruby-base":case"ruby-text":case"ruby-base-container":case"ruby-text-container":return!0;default:return!1}}(p),u.nodeContext.display=p?p.toString():"inline",u.nodeContext.floatSide=g?d.toString():null,u.nodeContext.floatReference=h||va.INLINE,u.nodeContext.floatMinWrapBlock=l["float-min-wrap-block"]||null,u.nodeContext.columnSpan=l["column-span"],!u.nodeContext.inline){var m,B=l["break-after"];B&&(u.nodeContext.breakAfter=B.toString());var w=l["break-before"];w&&(u.nodeContext.breakBefore=w.toString());var y=(null==(m=l.page)?void 0:m.toString())||null;y&&"auto"!==y.toLowerCase()?u.nodeContext.pageType=y:y=u.nodeContext.pageType,u.styler.cascade.currentPageType!==y&&(u.isAtForcedBreak()||(u.nodeContext.breakBefore="page"),u.styler.cascade.previousPageType=u.styler.cascade.currentPageType,u.styler.cascade.currentPageType=y)}u.nodeContext.verticalAlign=l["vertical-align"]&&l["vertical-align"].toString()||"baseline",u.nodeContext.captionSide=l["caption-side"]&&l["caption-side"].toString()||"top";var N=l["border-collapse"];if(!N||N===ze("separate")){var b,S,T=l["border-spacing"];T&&(T.isSpaceList()?(b=T.values[0],S=T.values[1]):b=S=T,b.isNumeric()&&(u.nodeContext.inlineBorderSpacing=tu(b,u.context)),S.isNumeric()&&(u.nodeContext.blockBorderSpacing=tu(S,u.context)))}u.nodeContext.footnotePolicy=l["footnote-policy"];var x=l["x-first-pseudo"];x&&(u.nodeContext.firstPseudo=new fr(u.nodeContext.parent?u.nodeContext.parent.firstPseudo:null,x.num)),u.nodeContext.inline||u.processAfterIfcontinues(r,a,o,u.context);var I=l["white-space"];if(I){var P=er(I.toString());null!==P&&(u.nodeContext.whitespace=P)}var R=l["hyphenate-character"];R&&R!==uu.auto&&(u.nodeContext.hyphenateCharacter=R.str);var L=l["overflow-wrap"];u.nodeContext.breakWord=l["word-break"]===uu.break_all||l["line-break"]===uu.anywhere||L===uu.break_word||L===uu.anywhere,u.resolveFormattingContext(u.nodeContext,t,p,D,d,E),u.nodeContext.parent&&u.nodeContext.parent.formattingContext&&(t=u.nodeContext.parent.formattingContext.isFirstTime(u.nodeContext,t)),u.nodeContext.inline||(u.nodeContext.repeatOnBreak=u.processRepeatOnBreak(l),u.findAndProcessRepeatingElements(r,o));var O=!1,k=[],_=r.namespaceURI,M=r.localName;if(_==X.XHTML)"html"==M||"body"==M||"script"==M||"link"==M||"meta"==M?M="div":"vide_"==M?M="video":"audi_"==M?M="audio":"object"==M&&(O=!!u.customRenderer),r.getAttribute("data-adapt-pseudo")&&a.content&&a.content.value&&a.content.value.url&&(M="img");else if(_==X.epub)M="span",_=X.XHTML;else if(_==X.NCX)if(_=X.XHTML,"ncx"==M||"navPoint"==M)M="div";else if("navLabel"==M){M="span";var U=r.parentNode;if(U){for(var V=null,H=U.firstChild;H;H=H.nextSibling)if(1==H.nodeType&&H.namespaceURI==X.NCX&&"content"==H.localName){V=H.getAttribute("src");break}V&&(M="a",(r=r.ownerDocument.createElementNS(_,"a")).setAttribute("href",V))}}else M="span";else _==X.SHADOW?(_=X.XHTML,M=u.nodeContext.inline?"span":"div"):O=!!u.customRenderer;if(v)t?M="li":(M="div",l.display=p=uu.block);else if("body"==M||"li"==M)M="div";else if("q"==M)M="span";else if("a"==M){var z=l["hyperlink-processing"];z&&"normal"!=z.toString()&&(M="span")}l.behavior&&"none"!=l.behavior.toString()&&u.customRenderer&&(O=!0),r.dataset&&"true"===r.getAttribute("data-math-typeset")&&(O=!0),(O?u.customRenderer(r,u.nodeContext.parent?u.nodeContext.parent.viewNode:null,l):Rn(null)).then((function(o){var a;o?O&&(n="true"==o.getAttribute("data-adapt-process-children")):o=u.createElement(_,M),"a"==M&&o.addEventListener("click",u.page.hrefHandler,!1),"iframe"==o.localName&&o.namespaceURI==X.XHTML&&(a=o).addEventListener("load",(function(){a.contentWindow.navigator.epubReadingSystem={name:"adapt",version:"0.1",layoutStyle:"paginated",hasFeature:function(t,e){return"mouse-events"===t}}}),!1);for(var s=u.nodeContext.inheritedProps["image-resolution"],D=[],h=l.width,d=l.height,f=r.getAttribute("width"),p=r.getAttribute("height"),E=h===uu.auto||!h&&!f,C=d===uu.auto||!d&&!p,F=r.attributes,A=F.length,g=null,m=0;m<A;m++){var B=F[m],w=B.namespaceURI,y=B.localName,N=B.nodeValue;if(w){if("http://www.w3.org/2000/xmlns/"==w)continue;w==X.XLINK&&"href"==y&&(N=u.resolveURL(N))}else{if(!Nh&&y.match(/^on/))continue;if("style"==y)continue;if(("id"==y||"name"==y)&&t){var b=u.documentURLTransformer.transformFragment(N,u.xmldoc.url);!Nh||o.namespaceURI===X.SVG&&"svg"!==o.localName||o.ownerDocument.getElementById(N)?o.setAttribute(y,b):(o.setAttribute(y,N),o.setAttribute("data-vivliostyle-id",b)),u.page.registerElementWithId(o,b);continue}if("src"==y||"href"==y||"poster"==y?(N=u.resolveURL(N),"href"===y&&(N=u.documentURLTransformer.transformURL(N,u.xmldoc.url))):"srcset"==y&&(N=N.split(",").map((function(t){return u.resolveURL(t.trim())})).join(",")),"poster"===y&&"video"===M&&_===X.XHTML&&E&&C){var S=new Image,T=Wn(S,N);k.push(T),D.push({image:S,element:o,fetcher:T})}}if(_==X.SVG&&/^[A-Z\-]+$/.test(y)&&(y=y.toLowerCase()),u.isSVGUrlAttribute(y)&&(N=Ih(N,u.xmldoc.url,u.documentURLTransformer)),w){var x=Ph[w];x&&(y=x+":"+y)}if("src"!=y||w||"img"!=M&&"input"!=M||_!=X.XHTML)if("href"==y&&"image"==M&&_==X.SVG&&w==X.XLINK)u.page.fetchers.push(Wn(o,N));else if(w)o.setAttributeNS(w,y,N);else try{o.setAttribute(y,N)}catch(t){c.warn(t)}else g=N}if(g){var I="input"===M?new Image:o,P=Wn(I,g);I!==o&&(o.src=g),E||C?(E&&C&&s&&1!==s&&D.push({image:I,element:o,fetcher:P}),k.push(P)):u.page.fetchers.push(P)}delete l.content;var R=l["list-style-image"];if(R&&R instanceof Ke){var L=R.url;k.push(Wn(new Image,L))}if(u.preprocessElementStyle(l),u.applyComputedStyles(o,l),!u.nodeContext.inline){var U=null;if(t?e&&!u.isAtForcedBreak()&&(U=u.nodeContext.vertical?kh:Oh):U="clone"!==u.nodeContext.inheritedProps["box-decoration-break"]?u.nodeContext.vertical?Lh:Rh:u.nodeContext.vertical?kh:Oh,U)for(var V in U)("text-indent"!==V||u.isParagraph(r))&&et(o,V,U[V])}v&&o.setAttribute("value",l["ua-list-item-count"].stringValue()),u.viewNode=o,k.length?Xn(k).then((function(){s>0&&u.modifyElemDimensionWithImageResolution(D,s,l,u.nodeContext.vertical),i.finish(n)})):i.timeSlice().then((function(){i.finish(n)}))}))})),i.result()},n.isParagraph=function(t){switch(t.localName){case"p":return!0;case"html":case"body":case"main":case"article":case"section":return!1}for(var e={a:!0,abbr:!0,b:!0,bdi:!0,bdo:!0,cite:!0,code:!0,data:!0,del:!0,dfn:!0,em:!0,i:!0,ins:!0,kbd:!0,mark:!0,q:!0,ruby:!0,s:!0,samp:!0,small:!0,span:!0,strong:!0,sub:!0,sup:!0,time:!0,u:!0,var:!0},u=t.firstChild;u;u=u.nextSibling)switch(u.nodeType){case Node.TEXT_NODE:if(u.nodeValue.trim().length>0)return!0;break;case Node.ELEMENT_NODE:if(e[u.localName])return!0}return!1},n.isAtForcedBreak=function(){for(var t=this.nodeContext;t&&!t.after;t=t.parent){if(Oa(t.breakBefore))return!0;if(t.parent&&t.parent.sourceNode.firstElementChild!==t.sourceNode)break}return!1},n.processAfterIfcontinues=function(t,e,u,n){var i=this.getPseudoMap(e,this.regionIds,this.isFootnote,this.nodeContext,n);if(i&&i["after-if-continues"]&&i["after-if-continues"].content){var r=new As(t,e,u,n,this.exprContentListener);this.nodeContext.afterIfContinues=new vs(t,r)}},n.isSVGUrlAttribute=function(t){return u.SVG_URL_ATTRIBUTES.includes(t.toLowerCase())},n.modifyElemDimensionWithImageResolution=function(t,e,u,n){var i=this;t.forEach((function(t){if("load"===t.fetcher.get().get()){var r=t.image,o=r.width/e,a=r.height/e,s=t.element;if(o>0&&a>0)if(u["box-sizing"]===uu.border_box&&(u["border-left-style"]!==uu.none&&(o+=tu(u["border-left-width"],i.context)),u["border-right-style"]!==uu.none&&(o+=tu(u["border-right-width"],i.context)),u["border-top-style"]!==uu.none&&(a+=tu(u["border-top-width"],i.context)),u["border-bottom-style"]!==uu.none&&(a+=tu(u["border-bottom-width"],i.context))),e>1){var l=u["max-width"]||uu.none,D=u["max-height"]||uu.none;if(l===uu.none&&D===uu.none)et(s,"max-width",o+"px");else if(l!==uu.none&&D===uu.none)et(s,"width",o+"px");else if(l===uu.none&&D!==uu.none)et(s,"height",a+"px");else{l.isNumeric(),D.isNumeric();var h=D;"%"!==l.unit?et(s,"max-width",Math.min(o,tu(l,i.context))+"px"):"%"!==h.unit?et(s,"max-height",Math.min(a,tu(h,i.context))+"px"):n?et(s,"height",a+"px"):et(s,"width",o+"px")}}else if(e<1){var c=u["min-width"]||ou,d=u["min-height"]||ou;c.isNumeric(),c.isNumeric();var f=c,p=d;0===f.num&&0===p.num?et(s,"min-width",o+"px"):0!==f.num&&0===p.num?et(s,"width",o+"px"):0===f.num&&0!==p.num?et(s,"height",a+"px"):"%"!==f.unit?et(s,"min-width",Math.max(o,tu(f,i.context))+"px"):"%"!==p.unit?et(s,"min-height",Math.max(a,tu(p,i.context))+"px"):n?et(s,"height",a+"px"):et(s,"width",o+"px")}}}))},n.preprocessElementStyle=function(t){var u=this;C(e.HOOKS.PREPROCESS_ELEMENT_STYLE).forEach((function(e){e(u.nodeContext,t)}))},n.findAndProcessRepeatingElements=function(t,e){for(var u=t.firstChild;u;u=u.nextSibling)if(1===u.nodeType){var n={},i=e.getStyle(u,!1);if(this.computeStyle(this.nodeContext.vertical,"rtl"===this.nodeContext.direction,i,n),this.processRepeatOnBreak(n)){if(this.nodeContext.formattingContext instanceof ks&&!this.nodeContext.belongsTo(this.nodeContext.formattingContext))return;var r=this.nodeContext.parent;return this.nodeContext.formattingContext=new ks(r&&r.formattingContext,this.nodeContext.sourceNode),void this.nodeContext.formattingContext.initializeRepetitiveElements(this.nodeContext.vertical)}}},n.processRepeatOnBreak=function(t){var e=t["repeat-on-break"];return e!==uu.none&&(e===uu.auto&&(e=t.display===uu.table_header_group?uu.header:t.display===uu.table_footer_group?uu.footer:uu.none),e&&e!==uu.none)?e.toString():null},n.createTextNodeView=function(){var t=this,e=Pn("createTextNodeView");return this.preprocessTextContent().then((function(){var u=t.offsetInNode||0,n=ji(t.nodeContext.preprocessedTextContent).substr(u);t.viewNode=document.createTextNode(n),e.finish(!0)})),e.result()},n.preprocessTextContent=function(){var t,u=this;if(null!=this.nodeContext.preprocessedTextContent)return Rn(!0);var n=t=this.sourceNode.textContent,i=Pn("preprocessTextContent"),r=C(e.HOOKS.PREPROCESS_TEXT_CONTENT),a=0;return i.loop((function(){return a>=r.length?Rn(!1):r[a++](u.nodeContext,n).thenAsync((function(t){return n=t,Rn(!0)}))})).then((function(){u.nodeContext.preprocessedTextContent=o.default(t,n,0),i.finish(!0)})),i.result()},n.createNodeView=function(t,e){var u,n=this,i=Pn("createNodeView"),r=!0;return 1==this.sourceNode.nodeType?u=this.createElementView(t,e):8==this.sourceNode.nodeType?(this.viewNode=null,u=Rn(!0)):u=this.createTextNodeView(),u.then((function(t){if(r=t,n.nodeContext.viewNode=n.viewNode,n.viewNode){var e=n.nodeContext.parent?n.nodeContext.parent.viewNode:n.viewRoot;e&&e.appendChild(n.viewNode)}i.finish(r)})),i.result()},n.setCurrent=function(t,e,u){return this.nodeContext=t,t?(this.sourceNode=t.sourceNode,this.offsetInNode=t.offsetInNode):(this.sourceNode=null,this.offsetInNode=-1),this.viewNode=null,this.nodeContext?this.createNodeView(e,!!u):Rn(!0)},n.processShadowContent=function(t){if(null==t.shadowContext||"content"!=t.sourceNode.localName||t.sourceNode.namespaceURI!=X.SHADOW)return t;var e,u,n=t.boxOffset,i=t.shadowContext,r=t.parent,o=i.subShadow||i.parentShadow;i.subShadow?(e=i.root,(u=i.type)==hr.ROOTLESS&&(e=e.firstChild)):(e=i.owner.firstChild,u=hr.ROOTLESS);var a=t.sourceNode.nextSibling;if(a?(t.sourceNode=a,t.resetView()):t.shadowSibling?t=t.shadowSibling:e?t=null:(t=t.parent.modify()).after=!0,e){var s=new pr(e,r,n);return s.shadowContext=o,s.shadowType=u,s.shadowSibling=t,s}return t.boxOffset=n,t},n.nextPositionInTree=function(t){var e=t.boxOffset+1;if(t.after){if(!t.parent)return null;if(t.shadowType!=hr.ROOTED){var u=t.sourceNode.nextSibling;if(u)return(t=t.modify()).boxOffset=e,t.sourceNode=u,t.resetView(),this.processShadowContent(t)}return t.shadowSibling?((t=t.shadowSibling.modify()).boxOffset=e,t):((t=t.parent.modify()).boxOffset=e,t.after=!0,t)}if(t.nodeShadow){var n=t.nodeShadow.root;if(t.nodeShadow.type==hr.ROOTLESS&&(n=n.firstChild),n){var i=new pr(n,t,e);return i.shadowContext=t.nodeShadow,i.shadowType=t.nodeShadow.type,this.processShadowContent(i)}}var r=t.sourceNode.firstChild;return r?this.processShadowContent(new pr(r,t,e)):(1!=t.sourceNode.nodeType&&(e+=ji(t.preprocessedTextContent).length-1-t.offsetInNode),(t=t.modify()).boxOffset=e,t.after=!0,t)},n.isTransclusion=function(t,e,u){var n=Vr(e,"hyperlink-processing");if(!n)return!1;var i=n.evaluate(this.context,"hyperlink-processing");return!!i&&i.toString()==u},n.nextInTree=function(t,e){var u=this,n=this.nextPositionInTree(t);if(!n||n.after)return Rn(n);var i=Pn("nextInTree");return this.setCurrent(n,!0,e).then((function(t){n.viewNode&&t||((n=n.modify()).after=!0,n.viewNode||(n.inline=!0)),u.dispatchEvent({type:"nextInTree",nodeContext:n}),i.finish(n)})),i.result()},n.addImageFetchers=function(t){if(t instanceof Qe)for(var e=t.values,u=0;u<e.length;u++)this.addImageFetchers(e[u]);else if(t instanceof Ke){var n=t.url;this.page.fetchers.push(Wn(new Image,n))}},n.applyComputedStyles=function(t,e){var u,n,i,r=e["background-image"];r&&this.addImageFetchers(r);var o=e.position===uu.relative,a=null===(null==(u=this.nodeContext)?void 0:u.parent)&&null===(null==(n=this.sourceNode)?void 0:n.parentElement)&&!(null==(i=this.viewRoot)||!i.parentElement);for(var s in e)if(!Uh[s]){var l=e[s];l&&l!==ke&&((l=l.visit(new Mu(this.xmldoc.url,this.documentURLTransformer))).isNumeric()&&Gt(l.unit)&&(l=eu(l,this.context)),Yi[s]||o&&qi[s]?this.page.delayedItems.push(new $i(t,s,l)):"rt"===t.localName&&"font-size"===s&&this.fixRubyTextFontSize(t,l)||(a&&this.page.pageAreaElement&&Ur(s)?et(this.page.pageAreaElement.parentElement,s,l.toString()):et(t,s,l.toString())))}},n.fixRubyTextFontSize=function(t,e){if(!/Chrome/.test(navigator.userAgent))return!1;if(!e.isNumeric())return!1;var u,n=e;if("%"===n.unit||"em"===n.unit){var i,r,o=null==(i=this.nodeContext)||null==(r=i.parent)?void 0:r.viewNode;u=(o&&parseFloat(this.viewport.window.getComputedStyle(o).fontSize))*n.num/("%"===n.unit?100:1)}else u=eu(n,this.context).num;if(!u)return!1;if(u>=10)return!1;if(!(t instanceof HTMLElement&&"zoom"in t.style))return!1;var a=u/10;return et(t,"font-size","10px"),et(t,"zoom",""+a),!0},n.applyPseudoelementStyle=function(t,e,u){if(!t.after){var n=(t.shadowContext?t.shadowContext.styler:this.styler).getStyle(this.sourceNode,!1),i=zr(n,"_pseudos");if(i&&(n=i[e])){var r={};t.vertical=this.computeStyle(t.vertical,"rtl"===t.direction,n,r);var o=r.content;mr(o)&&(o.visit(new vr(u,this.context,o,this.exprContentListener)),delete r.content),this.applyComputedStyles(u,r)}}},n.peelOff=function(t,e){var u=this,n=Pn("peelOff"),i=t.firstPseudo,r=t.offsetInNode,o=t.after;if(e>0)t.viewNode.textContent=t.viewNode.textContent.substr(0,e),r+=e;else if(!o&&t.viewNode&&0==r){var a=t.viewNode.parentNode;a&&a.removeChild(t.viewNode)}for(var s=t.boxOffset+e,l=[];t.firstPseudo===i;)l.push(t),t=t.parent;var D=l.pop(),h=D.shadowSibling;return n.loop((function(){for(;l.length>0;){D=l.pop(),t=new pr(D.sourceNode,t,s),0==l.length&&(t.offsetInNode=r,t.after=o),t.shadowType=D.shadowType,t.shadowContext=D.shadowContext,t.nodeShadow=D.nodeShadow,t.shadowSibling=D.shadowSibling?D.shadowSibling:h,h=null;var e=u.setCurrent(t,!1);if(e.isPending())return e}return Rn(!1)})).then((function(){n.finish(t)})),n.result()},n.createElement=function(t,e){return t==X.XHTML?this.document.createElement(e):this.document.createElementNS(t,e)},n.applyFootnoteStyle=function(t,e,u){var n={},i=zr(this.footnoteStyle,"_pseudos");if(t=this.computeStyle(t,e,this.footnoteStyle,n),i&&i.before){var r={},o=this.createElement(X.XHTML,"span");Fs(o,"before"),u.appendChild(o),this.computeStyle(t,e,i.before,r),delete r.content,this.applyComputedStyles(o,r)}return delete n.content,this.applyComputedStyles(u,n),t},n.processFragmentedBlockEdge=function(t){t&&t.walkUpBlocks((function(t){var e=t.inheritedProps["box-decoration-break"];if(!e||"slice"===e){var u=t.viewNode;t.vertical?(et(u,"padding-left","0"),et(u,"border-left","none"),et(u,"border-top-left-radius","0"),et(u,"border-bottom-left-radius","0")):(et(u,"padding-bottom","0"),et(u,"border-bottom","none"),et(u,"border-bottom-left-radius","0"),et(u,"border-bottom-right-radius","0"))}}))},n.convertLengthToPx=function(t,e,u){var n=t.num,i=t.unit;if(function(t){switch(t.toLowerCase()){case"em":case"ex":case"rem":return!0;default:return!1}}(i)){for(var r=e;r&&1!==r.nodeType;)r=r.parentNode;return $r(t,parseFloat(u.getElementComputedStyle(r)["font-size"]),this.context).num}var o=this.context.queryUnitSize(i,!1);return o?n*o:t},n.isSameNodePositionStep=function(t,e){if(t.shadowContext){if(!e.shadowContext)return!1;var u=1===e.node.nodeType?e.node:e.node.parentElement;return t.shadowContext.owner===e.shadowContext.owner&&Cs(1===t.node.nodeType?t.node:t.node.parentElement)===Cs(u)}return t.node===e.node},n.isSameNodePosition=function(t,e){var u=this;return t.offsetInNode===e.offsetInNode&&t.after==e.after&&t.steps.length===e.steps.length&&t.steps.every((function(t,n){return u.isSameNodePositionStep(t,e.steps[n])}))},n.isPseudoelement=function(t){return!!Cs(t)},u}(Et);_h.SVG_URL_ATTRIBUTES=["color-profile","clip-path","cursor","filter","marker","marker-start","marker-end","marker-mid","fill","stroke","mask"];var Mh,Uh={"box-decoration-break":!0,"float-min-wrap-block":!0,"float-reference":!0,"flow-into":!0,"flow-linger":!0,"flow-options":!0,"flow-priority":!0,"footnote-policy":!0,page:!0},Vh=function(){function t(t){this.layoutBox=void 0,this.window=void 0,this.layoutBox=t.layoutBox,this.window=t.window}var e=t.prototype;return e.subtractOffsets=function(t,e){var u=e.left,n=e.top;return{left:t.left-u,top:t.top-n,right:t.right-u,bottom:t.bottom-n,width:t.width,height:t.height}},e.getRangeClientRects=function(t){var e=this,u=t.getClientRects(),n=this.layoutBox.getBoundingClientRect();return Array.from(u).map((function(t){return e.subtractOffsets(t,n)}))},e.getElementClientRect=function(t){var e=t.getBoundingClientRect();if(0===e.left&&0===e.top&&0===e.right&&0===e.bottom)return e;var u=this.layoutBox.getBoundingClientRect();return this.subtractOffsets(e,u)},e.getElementComputedStyle=function(t){return this.window.getComputedStyle(t,null)},t}(),Hh=function(){function t(t,e,u,n,i){this.window=void 0,this.fontSize=void 0,this.document=void 0,this.root=void 0,this.outerZoomBox=void 0,this.contentContainer=void 0,this.layoutBox=void 0,this.width=void 0,this.height=void 0,this.window=t,this.fontSize=e,this.document=t.document,this.root=u||this.document.body;var r=this.root.firstElementChild;r||((r=this.document.createElement("div")).setAttribute("data-vivliostyle-outer-zoom-box","true"),this.root.appendChild(r));var o=r.firstElementChild;o||((o=this.document.createElement("div")).setAttribute("data-vivliostyle-spread-container","true"),r.appendChild(o));var a=r.nextElementSibling;a||((a=this.document.createElement("div")).setAttribute("data-vivliostyle-layout-box","true"),this.root.appendChild(a)),this.outerZoomBox=r,this.contentContainer=o,this.layoutBox=a;var s=new Vh(this).getElementComputedStyle(this.root);this.width=n||parseFloat(s.width)||t.innerWidth,this.height=i||parseFloat(s.height)||t.innerHeight}var e=t.prototype;return e.resetZoom=function(){et(this.outerZoomBox,"width",""),et(this.outerZoomBox,"height",""),et(this.contentContainer,"width",""),et(this.contentContainer,"height",""),et(this.contentContainer,"transform","")},e.zoom=function(t,e,u){et(this.outerZoomBox,"width",t*u+"px"),et(this.outerZoomBox,"height",e*u+"px"),et(this.contentContainer,"width",t+"px"),et(this.contentContainer,"height",e+"px"),et(this.contentContainer,"transform","scale("+u+")")},e.clear=function(){for(var t=this.root;t.lastChild;)t.removeChild(t.lastChild)},t}(),zh=function(){function t(t,e,u){this.store=void 0,this.url=void 0,this.document=void 0,this.lang=null,this.totalOffset=-1,this.root=void 0,this.body=void 0,this.head=void 0,this.last=void 0,this.lastOffset=1,this.idMap=void 0,this.store=t,this.url=e,this.document=u,this.root=u.documentElement;var n=null,i=null;if(this.root.namespaceURI==X.XHTML){for(var r=this.root.firstChild;r;r=r.nextSibling)if(1==r.nodeType){var o=r;if(o.namespaceURI==X.XHTML)switch(o.localName){case"head":i=o;break;case"body":n=o}}this.lang=this.root.getAttribute("lang")}this.body=n,this.head=i,this.last=this.root,this.last.setAttribute("data-adapt-eloff","0")}var e=t.prototype;return e.doc=function(){return new jh([this.document])},e.getElementOffset=function(t){var e=t.getAttribute("data-adapt-eloff");if(e)return parseInt(e,10);for(var u=this.lastOffset,n=this.last;n!=t;){var i=n.firstChild;if(!i)for(;!(i=n.nextSibling);)if(null==(n=n.parentNode))throw new Error("Internal error");n=i,1==i.nodeType?(i.setAttribute("data-adapt-eloff",u.toString()),++u):u+=i.textContent.length}return this.lastOffset=u,this.last=t,u-1},e.getNodeOffset=function(t,e,u){var n=0,i=t,r=null;if(1==i.nodeType){if(!u)return this.getElementOffset(i)}else{if(n=e,!(r=i.previousSibling))return n+=1,this.getElementOffset(i=i.parentNode)+n;i=r}for(;;){for(;i.lastChild;)i=i.lastChild;if(1==i.nodeType)break;if(n+=i.textContent.length,!(r=i.previousSibling)){i=i.parentNode;break}i=r}return n+=1,this.getElementOffset(i)+n},e.getTotalOffset=function(){return this.totalOffset<0&&(this.totalOffset=this.getNodeOffset(this.root,0,!0)),this.totalOffset},e.getNodeByOffset=function(t){for(var e,u=this,n=this.root,i=function(){if((e=u.getElementOffset(n))>=t)return{v:n};var i=n.children;if(!i)return"break";var r=ct(i.length,(function(e){return u.getElementOffset(i[e])>t}));if(0==r)return"break";n=i[r-1]};;){var r=i();if("break"===r)break;if("object"==typeof r)return r.v}for(var o=e+1,a=n,s=a.firstChild||a.nextSibling,l=null;;){if(s){if(1==s.nodeType)break;if(l=a=s,(o+=s.textContent.length)>t&&!/^\s*$/.test(s.textContent))break}else if(!(a=a.parentNode))break;s=a.nextSibling}return s&&l&&/^\s*$/.test(l.textContent)&&(l=s),l||n},e.buildIdMap=function(t){var e=t.getAttribute("id");e&&!this.idMap[e]&&(this.idMap[e]=t);var u=t.getAttributeNS(X.XML,"id");u&&!this.idMap[u]&&(this.idMap[u]=t);for(var n=t.firstElementChild;n;n=n.nextElementSibling)this.buildIdMap(n)},e.getElement=function(t){var e=t.match(/([^#]*)#(.+)$/);if(!e||e[1]&&e[1]!=this.url)return null;var u=e[2],n=this.document.getElementById(u);return!n&&this.document.getElementsByName&&(n=this.document.getElementsByName(u)[0]),n||(this.idMap||(this.idMap={},this.buildIdMap(this.document.documentElement)),n=this.idMap[u]),n},t}();function Gh(t,e,u){var n,i=u||new DOMParser;try{n=i.parseFromString(t,e)}catch(t){}if(!n)return null;var r=n.documentElement,o="parsererror";if(r.localName===o)return null;for(var a=r.firstElementChild;a;a=a.nextElementSibling)if(a.localName===o)return null;return n}function Xh(t,e){var u=t.responseXML;if(!u){var n=new DOMParser,i=t.responseText;if(i){var r=function(t){var e=t.contentType;if(e){for(var u=Object.keys(Mh),n=0;n<u.length;n++)if(Mh[u[n]]===e)return e;if(e.match(/\+xml$/))return Mh.APPLICATION_XML}var i=t.url.match(/\.([^./]+)$/);if(i)switch(i[1]){case"html":case"htm":return Mh.TEXT_HTML;case"xhtml":case"xht":return Mh.APPLICATION_XHTML_XML;case"svg":case"svgz":return Mh.IMAGE_SVG_XML;case"opf":case"xml":return Mh.APPLICATION_XML}return null}(t);if((u=Gh(i,r||Mh.APPLICATION_XML,n))&&!r){var o=u.documentElement;"html"!==o.localName.toLowerCase()||o.namespaceURI?"svg"===o.localName.toLowerCase()&&u.contentType!==Mh.IMAGE_SVG_XML&&(u=Gh(i,Mh.IMAGE_SVG_XML,n)):u=Gh(i,Mh.TEXT_HTML,n)}u||(u=Gh(i,Mh.TEXT_HTML,n))}}return Rn(u?new zh(e,t.url,u):null)}!function(t){t.TEXT_HTML="text/html",t.TEXT_XML="text/xml",t.APPLICATION_XML="application/xml",t.APPLICATION_XHTML_XML="application/xhtml+xml",t.IMAGE_SVG_XML="image/svg+xml"}(Mh||(Mh={}));var Wh=new(function(){function t(t){this.fn=void 0,this.fn=t}var e=t.prototype;return e.check=function(t){return this.fn(t)},e.withAttribute=function(e,u){var n=this;return new t((function(t){return n.check(t)&&1==t.nodeType&&t.getAttribute(e)==u}))},e.withChild=function(e,u){var n=this;return new t((function(t){if(!n.check(t))return!1;var i=new jh([t]);return i=i.child(e),u&&(i=i.predicate(u)),i.size()>0}))},t}())((function(t){return!0})),jh=function(){function t(t){this.nodes=void 0,this.nodes=t}var e=t.prototype;return e.asArray=function(){return this.nodes},e.size=function(){return this.nodes.length},e.predicate=function(e){for(var u,n=[],i=_(this.nodes);!(u=i()).done;){var r=u.value;e.check(r)&&n.push(r)}return new t(n)},e.forEachNode=function(e){for(var u=[],n=function(t){u.push(t)},i=0;i<this.nodes.length;i++)e(this.nodes[i],n);return new t(u)},e.forEach=function(t){for(var e=[],u=0;u<this.nodes.length;u++)e.push(t(this.nodes[u]));return e},e.forEachNonNull=function(t){for(var e=[],u=0;u<this.nodes.length;u++){var n=t(this.nodes[u]);null!=n&&e.push(n)}return e},e.child=function(t){return this.forEachNode((function(e,u){for(var n=e.firstChild;n;n=n.nextSibling)1==n.nodeType&&n.localName==t&&u(n)}))},e.childElements=function(){return this.forEachNode((function(t,e){for(var u=t.firstChild;u;u=u.nextSibling)1==u.nodeType&&e(u)}))},e.attribute=function(t){return this.forEachNonNull((function(e){return 1==e.nodeType?e.getAttribute(t):null}))},e.textContent=function(){return this.forEach((function(t){return t.textContent}))},t}(),Kh=new Gn((function(){var t=Pn("uaStylesheetBase"),e=sD(),u=K("user-agent-base.css",W),n=new $o(null,null,null,null,null,e,!0);return n.startStylesheet(ui.USER_AGENT),qo=n.cascade,xi(Zn,n,u,null,null).thenFinish(t),t.result()}),"uaStylesheetBaseFetcher"),Yh=function(){function t(t,e,u,n,i,r,o,a,s,l){this.store=void 0,this.rootScope=void 0,this.pageScope=void 0,this.cascade=void 0,this.rootBox=void 0,this.fontFaces=void 0,this.footnoteProps=void 0,this.flowProps=void 0,this.viewportProps=void 0,this.pageProps=void 0,this.fontDeobfuscator=void 0,this.validatorSet=void 0,this.store=t,this.rootScope=e,this.pageScope=u,this.cascade=n,this.rootBox=i,this.fontFaces=r,this.footnoteProps=o,this.flowProps=a,this.viewportProps=s,this.pageProps=l,this.fontDeobfuscator=t.fontDeobfuscator,this.validatorSet=t.validatorSet,this.pageScope.defineBuiltIn("has-content",(function(t){var e=this,u=e.currentLayoutPosition,n=u.firstFlowChunkOfFlow(t=t);return e.matchPageSide(u.startSideOfFlow(t))&&u.hasContent(t,e.lookupOffset)&&!!n&&!e.flowChunkIsAfterParentFlowForcedBreak(n)})),this.pageScope.defineName("page-number",new ge(this.pageScope,(function(){return this.pageNumberOffset+this.currentLayoutPosition.page}),"page-number")),this.pageScope.defineName("blank-page",new ge(this.pageScope,(function(){var t=this.currentLayoutPosition;return null==t?void 0:t.isBlankPage}),"blank-page"))}return t.prototype.sizeViewport=function(t,e,u,n){if(this.viewportProps.length){var i=new Xt(this.rootScope,t,e,u),r=function(t,e){for(var u={},n=0;n<e.length;n++)Kr(t,u,e[n],0,null,null,null);return u}(i,this.viewportProps),o=r.width,a=r.height,s=r["text-zoom"],l=1;if(o&&a||s){var D=zt.em;if((s?s.evaluate(i,"text-zoom"):null)===uu.scale&&(l=D/u,u=D,t*=l,e*=l),o&&a){var h=tu(o.evaluate(i,"width"),i),c=tu(a.evaluate(i,"height"),i);if(h>0&&c>0)return{width:n&&n.spreadView?2*(h+n.pageBorder):h,height:c,fontSize:u}}}}return{width:t,height:e,fontSize:u}},t}(),qh=function(t){function u(e,u,n,i,r,o,a,s,l,D,h,c,d){var f;for(var p in(f=t.call(this,e.rootScope,i.width,i.height,i.fontSize)||this).style=void 0,f.xmldoc=void 0,f.viewport=void 0,f.clientLayout=void 0,f.fontMapper=void 0,f.customRenderer=void 0,f.fallbackMap=void 0,f.pageNumberOffset=void 0,f.documentURLTransformer=void 0,f.counterStore=void 0,f.lang=void 0,f.primaryFlows={body:!0},f.rootPageBoxInstance=null,f.styler=null,f.stylerMap=null,f.currentLayoutPosition=null,f.layoutPositionAtPageStart=null,f.lookupOffset=0,f.faces=void 0,f.pageBoxInstances={},f.pageManager=null,f.rootPageFloatLayoutContext=void 0,f.pageBreaks={},f.pageProgression=null,f.isVersoFirstPage=!1,f.blankPageAtStart=!1,f.pageSheetSize={},f.pageSheetHeight=0,f.pageSheetWidth=0,f.style=e,f.xmldoc=u,f.viewport=i,f.clientLayout=r,f.fontMapper=o,f.customRenderer=a,f.fallbackMap=s,f.pageNumberOffset=l,f.documentURLTransformer=D,f.counterStore=h,f.lang=u.lang||n,f.faces=new cD(f.style.fontDeobfuscator),f.rootPageFloatLayoutContext=new ba(null,null,null,null,null,null,null),f.pageProgression=c||null,f.isVersoFirstPage=!!d,e.flowProps){var E=Vr(e.flowProps[p],"flow-consume");E&&(E.evaluate(O(f),"flow-consume")==uu.all?f.primaryFlows[p]=!0:delete f.primaryFlows[p])}return f}T(u,t);var n=u.prototype;return n.init=function(){var t=this,e=Pn("StyleInstance.init"),u=this.counterStore.createCounterListener(this.xmldoc.url),n=this.counterStore.createCounterResolver(this.xmldoc.url,this.style.rootScope,this.style.pageScope);this.styler=new _l(this.xmldoc,this.style.cascade,this.style.rootScope,this,this.primaryFlows,this.style.validatorSet,u,n),n.setStyler(this.styler),this.styler.resetFlowChunkStream(this),this.stylerMap={},this.stylerMap[this.xmldoc.url]=this.styler;var i=this.styler.getTopContainerStyle();this.pageProgression||(this.pageProgression=HD(i)),this.matchStartPageSide(this.styler.breakBeforeValues[0])||(0===this.pageNumberOffset?this.isVersoFirstPage=!0:this.blankPageAtStart=!0),this.rootPageBoxInstance=new RD(this.style.rootBox);var r=this.style.cascade.createInstance(this,u,n,this.lang);this.styler.cascade.currentPageType=this.styler.cascade.firstPageType,this.rootPageBoxInstance.applyCascadeAndInit(r,i),this.rootPageBoxInstance.resolveAutoSizing(this),this.pageManager=new fh(r,this.style.pageScope,this.rootPageBoxInstance,this,i);for(var o,a=[],s=_(this.style.fontFaces);!(o=s()).done;){var l=o.value;if(!l.condition||l.condition.evaluate(this)){var D=DD(l.properties,this),h=new hD(D);a.push(h)}}this.fontMapper.findOrLoadFonts(a,this.faces).then((function(){(function(t,e,u){if(!Nh)return Rn(!1);var n=Array.from(t.querySelectorAll("head > script, body > script:not(:not(script, link, style) ~ *)"));if(0===n.length)return Rn(!1);var i=n.some((function(t){return!(t.async||t.defer||"module"===t.type)})),r=i?function(t,e,u){var n,i=null!=(n=e.document.querySelector("[data-vivliostyle-textcontent]"))?n:e.document.createElement("div");return i.style.position="fixed",i.style.fontSize="0",i.setAttribute("data-vivliostyle-textcontent","true"),i.setAttribute("aria-hidden","true"),i.style.fontFamily=function(t){for(var e={},u=0,n=Object.values(t.styleMap);u<n.length;u++){var i,r=null==(i=n[u]["font-family"])?void 0:i.value;if(r)if(r.values)for(var o,a=_(r.values);!(o=a()).done;)e[o.value.stringValue()]=!0;else e[r.stringValue()]=!0}return Object.keys(e).join(",")}(u),i.textContent=t.documentElement.textContent,e.document.body.appendChild(i),i}(t,e,u):null,o=e.document.fonts,a=e.$,s=!1,l=Pn("loadScripts");return l.loop((function(){if(0===n.length)return i?l.sleep(20).thenAsync((function(){var t,u;return"loading"===o.status||e.document.documentElement.classList.contains("wf-loading")||null!=(t=e.FontJSON)&&t.Font&&null!=(u=e.ret)&&u.readyState&&e.ret.readyState<4?Rn(!0):Rn(!1)})):Rn(!1);var t=n.shift();return Th(t,e,{inHead:!0,forceDefer:s}).thenAsync((function(){return s||e.$===a||(bh.push(t),s=!0),0===n.length&&i&&(c.debug("dispatchEvent: DOMContentLoaded (document)"),e.document.dispatchEvent(new Event("DOMContentLoaded"))),Rn(!0)}))})).then((function(){r&&r.remove(),l.finish(!0)})),l.result()})(t.xmldoc.document,t.viewport.window,t.styler).thenFinish(e)}));var d=this.style.pageProps;return Object.keys(d).forEach((function(e){var u=$D(qD(d[e]),t);t.pageSheetSize[e]={width:u.pageWidth+2*u.cropOffset,height:u.pageHeight+2*u.cropOffset}})),e.result()},n.matchStartPageSide=function(t){var u=this.pageNumberOffset%2==(this.isVersoFirstPage?1:0),n=this.pageProgression==e.PageProgression.LTR;switch(t){case"left":return u!==n;case"right":return u===n;case"recto":return u;case"verso":return!u;default:return!0}},n.getStylerForDoc=function(t){var e=this.stylerMap[t.url];if(!e){var u=this.style.store.getStyleForDoc(t),n=new Xt(u.rootScope,this.pageWidth(),this.pageHeight(),this.initialFontSize),i=this.counterStore.createCounterListener(t.url),r=this.counterStore.createCounterResolver(t.url,u.rootScope,u.pageScope);e=new _l(t,u.cascade,u.rootScope,n,this.primaryFlows,u.validatorSet,i,r),this.stylerMap[t.url]=e}return e},n.registerInstance=function(t,e){this.pageBoxInstances[t]=e},n.lookupInstance=function(t){return this.pageBoxInstances[t]},n.encounteredFlowChunk=function(t,e){var u=this.currentLayoutPosition;if(u){u.flows[t.flowName]?e=u.flows[t.flowName]:u.flows[t.flowName]=e;var n=u.flowPositions[t.flowName];n||(n=new Fr,u.flowPositions[t.flowName]=n);var i=new Er({steps:[{node:t.element,shadowType:hr.NONE,shadowContext:null,nodeShadow:null,shadowSibling:null,formattingContext:null,fragmentIndex:0}],offsetInNode:0,after:!1,preprocessedTextContent:null}),r=new Cr(i,t);n.positions.push(r)}},n.evalSupportsTest=function(t,e,u){if(u)return!1;if(!t)return!1;var n=!0,i=new(function(){function t(){}var e=t.prototype;return e.unknownProperty=function(t,e){n=!1},e.invalidPropertyValue=function(t,e){n=!1},e.simpleProperty=function(t,e,u){},t}()),r=Pi(this.style.rootScope,new Sn(e,null),"");return!!r&&(this.xmldoc.store.validatorSet.validatePropertyAndHandleShorthand(t,r,!1,i),n)},n.getConsumedOffset=function(t){for(var e=Number.POSITIVE_INFINITY,u=0;u<t.positions.length;u++){for(var n=t.positions[u].chunkPosition.primary,i=n.steps[0].node,r=n.offsetInNode,o=n.after,a=0;i.ownerDocument!=this.xmldoc.document;)a++,i=n.steps[a].node,o=!1,r=0;var s=this.xmldoc.getNodeOffset(i,r,o);s<e&&(e=s)}return e},n.getPosition=function(t,e){if(!t)return 0;var u=Number.POSITIVE_INFINITY;for(var n in this.primaryFlows){var i=t.flowPositions[n];if(e||i&&0!=i.positions.length||!this.currentLayoutPosition||(this.styler.styleUntilFlowIsReached(n),i=this.currentLayoutPosition.flowPositions[n],t!=this.currentLayoutPosition&&i&&(i=i.clone(),t.flowPositions[n]=i)),i){var r=this.getConsumedOffset(i);r<u&&(u=r)}}return u},n.dumpLocation=function(t){for(var e in c.debug("Location - page",this.currentLayoutPosition.page),c.debug(" current:",t),c.debug(" lookup:",this.lookupOffset),this.currentLayoutPosition.flowPositions)for(var u,n=_(this.currentLayoutPosition.flowPositions[e].positions);!(u=n()).done;)c.debug(" Chunk",e+":",u.value.flowChunk.startOffset)},n.matchPageSide=function(t){switch(t){case"left":case"right":case"recto":case"verso":return new Fe(this.style.pageScope,t+"-page").evaluate(this);default:return!0}},n.updateStartSide=function(t){for(var e in t.flowPositions){var u=t.flowPositions[e];if(u&&u.positions.length>0){var n=u.positions[0].flowChunk;if(this.getConsumedOffset(u)===n.startOffset){var i=u.positions[0].flowChunk.breakBefore,r=za(u.startSide);u.startSide=Ha(Va(r,i))}}}},n.selectPageMaster=function(t){var e=this.currentLayoutPosition,u=this.getPosition(e);if(u==Number.POSITIVE_INFINITY)return null;for(var n,i=this.rootPageBoxInstance.children,r=0;r<i.length;r++)if("vivliostyle-page-rule-master"!==(n=i[r]).pageBox.pseudoName){var o=1,a=n.getProp(this,"utilization");a&&a.isNum()&&(o=a.num);var s=this.queryUnitSize("em",!1),l=this.pageWidth()*this.pageHeight(),D=Math.ceil(o*l/(s*s));this.lookupOffset=this.styler.styleUntil(u,D),this.updateStartSide(e),this.layoutPositionAtPageStart=e.clone(),this.initLingering(),this.clearScope(this.style.pageScope);var h=n.getProp(this,"enabled");if(!h||h===uu._true){if(1===e.page&&this.blankPageAtStart){n.style={};var c=t.size;t={},c&&(t.size=c)}return this.pageManager.getPageRulePageMaster(n,t)}}throw new Error("No enabled page masters")},n.flowChunkIsAfterParentFlowForcedBreak=function(t){var e=this.layoutPositionAtPageStart.flows,u=e[t.flowName].parentFlowName;if(u){var n=t.startOffset,i=e[u].forcedBreakOffsets;if(!i.length||n<i[0])return!1;var r=ct(i.length,(function(t){return i[t]>n}))-1,o=i[r],a=this.layoutPositionAtPageStart.flowPositions[u],s=this.getConsumedOffset(a);return!(o<s)&&(s<o||!this.matchPageSide(a.startSide))}return!1},n.setFormattingContextToColumn=function(t,e){var u=this.currentLayoutPosition.flows[e];u.formattingContext||(u.formattingContext=new as(null)),t.flowRootFormattingContext=u.formattingContext},n.layoutDeferredPageFloats=function(t){var e=t.pageFloatLayoutContext,u=e.getDeferredPageFloatContinuations();if(u.length&&"page"===u[0].float.floatReference){var n=u[0].float.nodePosition.steps[0].node,i=n&&this.xmldoc.getNodeOffset(n,0,!1),r=this.layoutPositionAtPageStart.flowPositions.body,o=r&&this.getConsumedOffset(r);if(null!=i&&null!=o&&i>o)return Rn(!0)}var a=Pn("layoutDeferredPageFloats"),s=!1,l=0;return a.loopWithFrame((function(n){if(l!==u.length){var i=u[l++],r=i.float,o=(new Ta).findByFloat(r),a=o.findPageFloatFragment(r,e);if(!a||!a.hasFloat(r))return e.isForbidden(r)||e.hasPrecedingFloatsDeferredToNext(r)?(e.deferPageFloat(i),void n.breakLoop()):void t.layoutPageFloatInner(i,o,null,a).then((function(t){if(t){var u=e.parent.isInvalidated();u?n.breakLoop():(e.isInvalidated()&&!u&&(s=!0,e.validate()),n.continueLoop())}else n.breakLoop()}));n.continueLoop()}else n.breakLoop()})).then((function(){s&&e.invalidate(),a.finish(!0)})),a.result()},n.getLastAfterPositionIfDeferredFloatsExists=function(t,e){var u;return t.pageFloatLayoutContext.getPageFloatContinuationsDeferredToNext().length>0&&t.lastAfterPosition?(e?(u=e.clone()).primary=t.lastAfterPosition:u=new Er(t.lastAfterPosition),u):null},n.layoutColumn=function(t,e){var u=this,n=this.currentLayoutPosition.flowPositions[e];if(!n||!this.matchPageSide(n.startSide))return Rn(!0);n.startSide="any",this.setFormattingContextToColumn(t,e),t.init(),this.primaryFlows[e]&&t.bands.length>0&&(t.forceNonfitting=!1);var i=Pn("layoutColumn");return this.layoutDeferredPageFloats(t).then((function(){if(t.pageFloatLayoutContext.isInvalidated())i.finish(!0);else{var r=[],o=[],a=!0;i.loopWithFrame((function(i){if(t.pageFloatLayoutContext.hasContinuingFloatFragmentsInFlow(e))i.breakLoop();else{for(var s=function(){for(var e=0;o.includes(e);)e++;var s=n.positions[e];if(s.flowChunk.startOffset>u.lookupOffset||u.flowChunkIsAfterParentFlowForcedBreak(s.flowChunk))return"break";for(var l=e+1;l<n.positions.length;l++)if(!o.includes(l)){var D=n.positions[l];if(D.flowChunk.startOffset>u.lookupOffset||u.flowChunkIsAfterParentFlowForcedBreak(D.flowChunk))break;D.flowChunk.isBetter(s.flowChunk)&&(s=D,e=l)}var h=s.flowChunk,c=!0;return t.layout(s.chunkPosition,a,n.breakAfter).then((function(l){if(t.pageFloatLayoutContext.isInvalidated())i.breakLoop();else{if(a=!1,s.flowChunk.repeated&&(null===l||h.exclusive)&&r.push(e),h.exclusive)return o.push(e),void i.breakLoop();var D=!!l||!!t.pageBreakType,d=u.getLastAfterPositionIfDeferredFloatsExists(t,l);t.pageBreakType&&d?(s.chunkPosition=d,n.breakAfter=t.pageBreakType,t.pageBreakType=null):(o.push(e),(l||d)&&(s.chunkPosition=l||d,r.push(e)),t.pageBreakType&&(n.startSide=Ha(t.pageBreakType))),D?i.breakLoop():(t.forceNonfitting=!1,c?c=!1:i.continueLoop())}})),c?(c=!1,{v:void 0}):void 0};n.positions.length-o.length>0;){var l=s();if("break"===l)break;if("object"==typeof l)return l.v}i.breakLoop()}})).then((function(){if(!t.pageFloatLayoutContext.isInvalidated()){n.positions=n.positions.filter((function(t,e){return r.includes(e)||!o.includes(e)})),"column"===n.breakAfter&&(n.breakAfter=null),t.saveDistanceToBlockEndFloats();var e=t.pageFloatLayoutContext.getMaxReachedAfterEdge();t.updateMaxReachedAfterEdge(e)}i.finish(!0)}))}})),i.result()},n.createLayoutConstraint=function(t){var e=this.counterStore.createLayoutConstraint(this.currentLayoutPosition.page-1);return new bs([e].concat(t.getLayoutConstraints()))},n.createAndLayoutColumn=function(t,e,u,n,i,r,o,a,s,l,D,h,c,d){var f,p=this,E=t.vertical?t.isAutoWidth&&t.isRightDependentOnAutoWidth:t.isAutoHeight&&t.isTopDependentOnAutoHeight,C=i.element,F=new ba(a,va.COLUMN,null,o,null,null,null),A=this.currentLayoutPosition.clone(),g=Pn("createAndLayoutColumn");return g.loopWithFrame((function(t){var g=p.createLayoutConstraint(F);if(s>1){var v=p.viewport.document.createElement("div");if(et(v,"position","absolute"),C.appendChild(v),(f=new Ts(v,c,p.clientLayout,g,F)).forceNonfitting=d,f.vertical=i.vertical,f.snapHeight=i.snapHeight,f.snapWidth=i.snapWidth,i.vertical){var m=r*(D+l)+i.paddingTop,B=parseFloat(C.style.width);f.setHorizontalPosition(i.paddingLeft+B-i.width,i.width),f.setVerticalPosition(m,D)}else{var w=r*(D+l)+i.paddingLeft;f.setVerticalPosition(i.paddingTop,i.height),f.setHorizontalPosition(w,D)}f.originX=e,f.originY=u}else(f=new Ts(C,c,p.clientLayout,g,F)).copyFrom(i);f.exclusions=E?[]:n.concat(),f.innerShape=h,F.setContainer(f),f.width>=0?p.layoutColumn(f,o).then((function(){F.isInvalidated()||F.finish(),f.pageFloatLayoutContext.isInvalidated()&&!a.isInvalidated()?(f.pageFloatLayoutContext.validate(),p.currentLayoutPosition=A.clone(),f.element!==C&&C.removeChild(f.element),t.continueLoop()):t.breakLoop()})):(F.finish(),t.breakLoop())})).then((function(){g.finish(f)})),g.result()},n.setPagePageFloatLayoutContextContainer=function(t,e,u){(e instanceof ch||e instanceof LD&&!(e instanceof sh))&&t.setContainer(u)},n.getRegionPageFloatLayoutContext=function(t,e,u,n){var i=e.getProp(this,"writing-mode")||null,r=e.getProp(this,"direction")||null;return new ba(t,va.REGION,u,n,null,i,r)},n.layoutFlowColumnsWithBalancing=function(t,e,u,n,i,r,o,a,s){var l=this,D=this.currentLayoutPosition.clone(),h=this.getRegionPageFloatLayoutContext(r,e,o,a),c=!0,d=function(){return l.currentLayoutPosition=D.clone(),l.layoutFlowColumns(t,e,u,n,i,r,h,o,a,s,c).thenAsync((function(t){return Rn(t?{columns:t,position:l.currentLayoutPosition}:null)}))};return d().thenAsync((function(t){if(!t)return Rn(null);if(s<=1)return Rn(t.columns);var u=e.getProp(l,"column-fill")||uu.balance,n=function(t,e,u,n,i,r,o){if(e===uu.auto)return null;var a=r[r.length-1];return 0===o.positions.length||a&&a.pageBreakType?new Tl(u,n,i,t):e===uu.balance_all?new Pl(u,n,i):null}(s,u,d,h,o,t.columns,l.currentLayoutPosition.flowPositions[a]);return n?(c=!1,r.lock(),h.lock(),n.balanceColumns(t).thenAsync((function(t){return r.unlock(),r.validate(),h.unlock(),l.currentLayoutPosition=t.position,Rn(t.columns)}))):Rn(t.columns)}))},n.layoutFlowColumns=function(t,e,u,n,i,r,o,a,s,l,D){var h=this,c=Pn("layoutFlowColumns"),d=this.currentLayoutPosition.clone(),f=e.getPropAsNumber(this,"column-gap"),p=l>1?e.getPropAsNumber(this,"column-width"):a.width,E=e.getActiveRegions(this),C=Ou(e.getProp(this,"shape-inside"),0,0,a.width,a.height,this),F=new _h(s,this,this.viewport,this.styler,E,this.xmldoc,this.faces,this.style.footnoteProps,this,t,this.customRenderer,this.fallbackMap,this.documentURLTransformer),A=0,g=null,v=[];return c.loopWithFrame((function(t){h.createAndLayoutColumn(e,u,n,i,a,A++,s,o,l,f,p,C,F,D).then((function(e){return r.isInvalidated()?(v=null,void t.breakLoop()):(!(e.pageBreakType&&"column"!==e.pageBreakType)&&A!==l||o.isInvalidated()||o.finish(),o.isInvalidated()?(A=0,h.currentLayoutPosition=d.clone(),o.validate(),void(o.isLocked()?(v=null,t.breakLoop()):t.continueLoop())):(v[A-1]=g=e,g.pageBreakType&&"column"!=g.pageBreakType&&(A=l,"region"!=g.pageBreakType&&(h.pageBreaks[s]=!0)),void(A<l?t.continueLoop():t.breakLoop())))}))})).then((function(){c.finish(v)})),c.result()},n.layoutContainer=function(t,e,u,n,i,r,o){var a=this;e.reset();var s=e.getProp(this,"enabled");if(s&&s!==uu._true)return Rn(!0);var l=Pn("layoutContainer"),D=e.getProp(this,"wrap-flow")===uu.auto,h=e.getProp(this,"flow-from"),c=this.viewport.document.createElement("div"),d=e.getProp(this,"position");et(c,"position",d?d.name:"absolute");var f=e instanceof sh;e instanceof kD?u.appendChild(c):u.insertBefore(c,u.firstChild);var p,E=new gr(c);E.vertical=e.vertical,E.exclusions=r,e.prepareContainer(this,E,t,this.faces,this.clientLayout),E.originX=n,E.originY=i,n+=E.left+E.marginLeft+E.borderLeft,i+=E.top+E.marginTop+E.borderTop,this.setPagePageFloatLayoutContextContainer(o,e,E);var C=!1;if(h&&h.isIdent())if(this.pageBreaks[h.toString()])o.isInvalidated()||e.finishContainer(this,E,t,null,1,this.clientLayout,this.faces),p=Rn(!0);else{var F=Pn("layoutContainer.inner"),A=h.toString(),g=e.getPropAsNumber(this,"column-count");this.layoutFlowColumnsWithBalancing(t,e,n,i,r,o,E,A,g).then((function(u){if(!o.isInvalidated()){var n=u[0];n.element===c&&(E=n),E.computedBlockSize=Math.max.apply(null,u.map((function(t){return t.computedBlockSize}))),e.finishContainer(a,E,t,n,g,a.clientLayout,a.faces);var i=a.currentLayoutPosition.flowPositions[A];i&&"region"===i.breakAfter&&(i.breakAfter=null)}F.finish(!0)})),p=F.result()}else{var v=e.getProp(this,"content");if(v&&mr(v)){var m="span";v.url&&(m="img");var B=this.viewport.document.createElement(m);v.visit(new vr(B,this,v,this.counterStore.getExprContentListener())),c.appendChild(B),"img"==m&&e.transferSinglUriContentProps(this,B,this.faces),e.transferContentProps(this,E,t,this.faces)}else e.suppressEmptyBoxGeneration&&(u.removeChild(c),C=!0);C||e.finishContainer(this,E,t,null,1,this.clientLayout,this.faces),p=Rn(!0)}return p.then((function(){if(o.isInvalidated())l.finish(!0);else{if(!e.isAutoHeight||Math.floor(E.computedBlockSize)>0){if(!C&&!D){var s=e.getProp(a,"shape-outside"),h=E.getOuterShape(s,a);r.push(h)}}else if(0==e.children.length)return u.removeChild(c),void l.finish(!0);var d=f?0:e.children.length-1;l.loop((function(){for(;d>=0&&d<e.children.length;){var u=e.children[f?d++:d--],s=a.layoutContainer(t,u,c,n,i,r,o);if(s.isPending())return s.thenAsync((function(){return Rn(!o.isInvalidated())}));if(o.isInvalidated())break}return Rn(!1)})).then((function(){l.finish(!0)}))}})),l.result()},n.processLinger=function(){var t=this.currentLayoutPosition.page;for(var e in this.currentLayoutPosition.flowPositions)for(var u=this.currentLayoutPosition.flowPositions[e],n=u.positions.length-1;n>=0;n--){var i=u.positions[n];i.flowChunk.startPage>=0&&i.flowChunk.startPage+i.flowChunk.linger-1<=t&&u.positions.splice(n,1)}},n.initLingering=function(){var t=this.currentLayoutPosition.page;for(var e in this.currentLayoutPosition.flowPositions)for(var u=this.currentLayoutPosition.flowPositions[e],n=u.positions.length-1;n>=0;n--){var i=u.positions[n];i.flowChunk.startPage<0&&i.flowChunk.startOffset<this.lookupOffset&&(i.flowChunk.startPage=t)}},n.noMorePrimaryFlows=function(t){for(var e in this.primaryFlows){var u=t.flowPositions[e];if(u&&u.positions.length>0)return!1}return!0},n.layoutNextPage=function(t,u){var n,i,r=this,o=t.container===t.bleedBox;this.pageBreaks={},u?(this.currentLayoutPosition=u.clone(),this.styler.replayFlowElementsFromOffset(u.highestSeenOffset)):(this.currentLayoutPosition=new Ar,this.styler.replayFlowElementsFromOffset(-1)),this.lang&&t.bleedBox.setAttribute("lang",this.lang),(u=this.currentLayoutPosition).page++;var a=null==(n=u.flowPositions.body)?void 0:n.startSide;u.isBlankPage=a&&"any"!==a&&this.matchPageSide(a),t.isBlankPage=u.isBlankPage,this.clearScope(this.style.pageScope),this.layoutPositionAtPageStart=u.clone();var s=o?{}:this.pageManager.getCascadedPageStyle(null!=(i=t.isBlankPage?this.styler.cascade.previousPageType:this.styler.cascade.currentPageType)?i:""),l=this.selectPageMaster(s);if(!l)return Rn(null);var D=0;if(!o){t.setAutoPageWidth(l.pageBox.specified.width.value===iu),t.setAutoPageHeight(l.pageBox.specified.height.value===ru),this.counterStore.setCurrentPage(t),this.counterStore.updatePageCounters(s,this);var h=$D(qD(s),this);this.setPageSizeAndBleed(h,t),function(t,e,u,n){var i=!1,r=!1,o=t.marks;if(o){var a=o.value;a.isSpaceList()?a.values.forEach((function(t){t===uu.crop?i=!0:t===uu.cross&&(r=!0)})):a===uu.crop?i=!0:a===uu.cross&&(r=!0)}if(i||r){var s=u.container,l=s.ownerDocument,D=e.bleed,h=tu(WD,n),c=tu(jD,n),d=tu(KD,n);if(D){var f=t["background-color"];f&&f.value&&(u.bleedBox.style.backgroundColor=f.value.stringValue())}i&&Object.keys(zD).forEach((function(t){var e=function(t,e,u,n,i,r){var o=n;o<=i+2*zt.mm&&(o=i+n/2);var a=Math.max(n,o),s=i+a+u/2,l=QD(t,s,s),D=[[0,i+n],[n,i+n],[n,i+n-o]],h=D.map((function(t){return[t[1],t[0]]}));e!==zD.TOP_RIGHT&&e!==zD.BOTTOM_RIGHT||(D=D.map((function(t){return[i+a-t[0],t[1]]})),h=h.map((function(t){return[i+a-t[0],t[1]]}))),e!==zD.BOTTOM_LEFT&&e!==zD.BOTTOM_RIGHT||(D=D.map((function(t){return[t[0],i+a-t[1]]})),h=h.map((function(t){return[t[0],i+a-t[1]]})));var c=ZD(t,u);c.setAttribute("points",D.map((function(t){return t.join(",")})).join(" ")),l.appendChild(c);var d=ZD(t,u);return d.setAttribute("points",h.map((function(t){return t.join(",")})).join(" ")),l.appendChild(d),e.split(" ").forEach((function(t){l.style[t]=r+"px"})),l}(l,zD[t],h,d,D,c);s.appendChild(e)})),r&&Object.keys(GD).forEach((function(t){var e=function(t,e,u,n,i){var r,o,a=2*n;e===GD.TOP||e===GD.BOTTOM?(r=a,o=n):(r=n,o=a);var s=QD(t,r,o),l=ZD(t,u);l.setAttribute("points","0,"+o/2+" "+r+","+o/2),s.appendChild(l);var D=ZD(t,u);D.setAttribute("points",r/2+",0 "+r/2+","+o),s.appendChild(D);var h,c=ZD(t,u,"circle");switch(c.setAttribute("cx",r/2),c.setAttribute("cy",o/2),c.setAttribute("r",n/4),s.appendChild(c),e){case GD.TOP:h=GD.BOTTOM;break;case GD.BOTTOM:h=GD.TOP;break;case GD.LEFT:h=GD.RIGHT;break;case GD.RIGHT:h=GD.LEFT}return Object.keys(GD).forEach((function(t){var u=GD[t];u===e?s.style[u]=i+"px":u!==h&&(s.style[u]="0",s.style["margin-"+u]="auto")})),s}(l,GD[t],h,d,c);s.appendChild(e)}))}}(s,h,t,this),D=h.bleedOffset+h.bleed}var c=!o&&l.getProp(this,"writing-mode")||uu.horizontal_tb;this.pageVertical=c!=uu.horizontal_tb;var d=l.getProp(this,"direction")||uu.ltr,f=new ba(this.rootPageFloatLayoutContext,va.PAGE,null,null,null,c,d),p=Pn("layoutNextPage");return p.loopWithFrame((function(e){r.layoutContainer(t,l,t.bleedBox,D,D,[],f).then((function(){f.isInvalidated()||f.finish(),f.isInvalidated()?(r.currentLayoutPosition=r.layoutPositionAtPageStart.clone(),f.validate(),e.continueLoop()):e.breakLoop()}))})).then((function(){if(l.adjustPageLayout(r,t,r.clientLayout),!o){var n=new Fe(l.pageBox.scope,"left-page");t.side=n.evaluate(r)?e.PageSide.LEFT:e.PageSide.RIGHT,r.processLinger(),u=r.currentLayoutPosition,Object.keys(u.flowPositions).forEach((function(t){var e=u.flowPositions[t],n=e.breakAfter;!n||"page"!==n&&r.matchPageSide(n)||(e.breakAfter=null)}))}r.currentLayoutPosition=r.layoutPositionAtPageStart=null,u.highestSeenOffset=r.styler.getReachedOffset();var i=r.style.store.getTriggersForDoc(r.xmldoc);t.finish(i,r.clientLayout),r.noMorePrimaryFlows(u)&&(u=null),p.finish(u)})),p.result()},n.setPageSizeAndBleed=function(t,e){this.actualPageWidth=t.pageWidth,this.actualPageHeight=t.pageHeight,this.pageSheetWidth=t.pageWidth+2*t.cropOffset,this.pageSheetHeight=t.pageHeight+2*t.cropOffset,e.container.style.width=this.pageSheetWidth+"px",e.container.style.height=this.pageSheetHeight+"px",e.bleedBox.style.left=t.bleedOffset+"px",e.bleedBox.style.right=t.bleedOffset+"px",e.bleedBox.style.top=t.bleedOffset+"px",e.bleedBox.style.bottom=t.bleedOffset+"px",e.bleedBox.style.padding=t.bleed+"px",e.bleedBox.style.paddingTop=t.bleed+.01+"px"},u}(Xt),$h=function(t){function e(e,u,n,i){var r;return(r=t.call(this,e.rootScope,e,u,n,i,e.validatorSet,!n)||this).masterHandler=void 0,r.insideRegion=!1,r.masterHandler=e,r}T(e,t);var u=e.prototype;return u.startPageTemplateRule=function(){},u.startPageMasterRule=function(t,e,u){var n=new FD(this.masterHandler.pageScope,t,e,u,this.masterHandler.rootBox,this.condition,this.owner.getBaseSpecificity());this.masterHandler.pushHandler(new VD(n.scope,this.masterHandler,n,this.validatorSet))},u.startWhenRule=function(t){var u=t.expr;null!=this.condition&&(u=be(this.scope,this.condition,u)),this.masterHandler.pushHandler(new e(this.masterHandler,u,this,this.regionId))},u.startDefineRule=function(){this.masterHandler.pushHandler(new ta(this.scope,this.owner))},u.startFontFaceRule=function(){var t={};this.masterHandler.fontFaces.push({properties:t,condition:this.condition}),this.masterHandler.pushHandler(new ea(this.scope,this.owner,null,t,this.masterHandler.validatorSet))},u.startFlowRule=function(t){var e=this.masterHandler.flowProps[t];e||(this.masterHandler.flowProps[t]=e={}),this.masterHandler.pushHandler(new ea(this.scope,this.owner,null,e,this.masterHandler.validatorSet))},u.startViewportRule=function(){var t={};this.masterHandler.viewportProps.push(t),this.masterHandler.pushHandler(new ea(this.scope,this.owner,this.condition,t,this.masterHandler.validatorSet))},u.startFootnoteRule=function(t){var e=this.masterHandler.footnoteProps;if(t){var u=Gr(e,"_pseudos");(e=u[t])||(u[t]=e={})}this.masterHandler.pushHandler(new ea(this.scope,this.owner,null,e,this.masterHandler.validatorSet))},u.startRegionRule=function(){this.insideRegion=!0,this.startSelectorRule()},u.startPageRule=function(){var t=new wh(this.masterHandler.pageScope,this.masterHandler,this,this.validatorSet,this.masterHandler.pageProps);this.masterHandler.pushHandler(t),t.startPageRule()},u.startRuleBody=function(){if($o.prototype.startRuleBody.call(this),this.insideRegion){this.insideRegion=!1;var t="R"+this.masterHandler.regionCount++;this.special("region-id",ze(t)),this.endRule();var u=new e(this.masterHandler,this.condition,this,t);this.masterHandler.pushHandler(u),u.startRuleBody()}},e}($o);function Qh(t){var e=t.getAttribute("content");if(!e)return"";for(var u,n={};null!=(u=e.match(/^,?\s*([-A-Za-z_.][-A-Za-z_0-9.]*)\s*=\s*([-+A-Za-z_0-9.]*)\s*/));)e=e.substr(u[0].length),n[u[1]]=u[2];var i=n.width-0,r=n.height-0;return i&&r?"@-epubx-viewport{width:"+i+"px;height:"+r+"px;}":""}var Zh=function(t){function e(e){var u;return(u=t.call(this)||this).validatorSet=void 0,u.rootScope=void 0,u.pageScope=void 0,u.rootBox=void 0,u.cascadeParserHandler=void 0,u.regionCount=0,u.fontFaces=[],u.footnoteProps={},u.flowProps={},u.viewportProps=[],u.pageProps={},u.validatorSet=e,u.rootScope=new Vt(null),u.pageScope=new Vt(u.rootScope),u.rootBox=new ED(u.rootScope),u.cascadeParserHandler=new $h(O(u),null,null,null),u.slave=u.cascadeParserHandler,u}return T(e,t),e.prototype.error=function(t,e){c.warn("CSS parser:",t)},e}(si);function Jh(t,e){return e.parseOPSResource(t)}var tc=function(t){function u(e){var u;return(u=t.call(this,Jh,jn.DOCUMENT)||this).fontDeobfuscator=void 0,u.styleByKey={},u.styleFetcherByKey={},u.styleByDocURL={},u.triggersByDocURL={},u.validatorSet=null,u.styleSheets=[],u.triggerSingleDocumentPreprocessing=!1,u.fontDeobfuscator=e,u}T(u,t);var n=u.prototype;return n.init=function(t,e){var u=this;this.setStyleSheets(t,e);var n=K("user-agent.xml",W),i=Pn("OPSDocStore.init");return this.validatorSet=sD(),Kh.get().then((function(){u.load(n).then((function(){u.triggerSingleDocumentPreprocessing=!0,i.finish(!0)}))})),i.result()},n.getStyleForDoc=function(t){return this.styleByDocURL[t.url]},n.getTriggersForDoc=function(t){return this.triggersByDocURL[t.url]},n.setStyleSheets=function(t,e){this.clearStyleSheets(),t&&t.forEach(this.addAuthorStyleSheet,this),e&&e.forEach(this.addUserStyleSheet,this)},n.clearStyleSheets=function(){this.styleSheets.splice(0)},n.addAuthorStyleSheet=function(t){var e=t.url;e&&(e=K(Y(e),z)),this.styleSheets.push({url:e,text:t.text,flavor:ui.AUTHOR,classes:null,media:null})},n.addUserStyleSheet=function(t){var e=t.url;e&&(e=K(Y(e),z)),this.styleSheets.push({url:e,text:t.text,flavor:ui.USER,classes:null,media:null})},n.parseOPSResource=function(t){var u=this,n=Pn("OPSDocStore.load"),i=t.url,r=i.endsWith("?viv-toc-box");return Xh(t,this).then((function(t){if(t){if(u.triggerSingleDocumentPreprocessing)for(var o=C(e.HOOKS.PREPROCESS_SINGLE_DOCUMENT),a=0;a<o.length;a++)try{o[a](t.document)}catch(t){c.warn("Error during single document preprocessing:",t)}for(var s=[],l=t.document.getElementsByTagNameNS(X.epub,"trigger"),D=0;D<l.length;D++){var h=l[D],d=h.getAttributeNS(X.EV,"observer"),f=h.getAttributeNS(X.EV,"event"),p=h.getAttribute("action"),E=h.getAttribute("ref");d&&f&&p&&E&&s.push({observer:d,event:f,action:p,ref:E})}u.triggersByDocURL[i]=s;var F=[],A=K("user-agent-page.css",W);if(F.push({url:A,text:Qn,flavor:ui.USER_AGENT,classes:null,media:null}),!r){for(var g,v=_(t.document.querySelectorAll("style, link, meta"));!(g=v()).done;){var m=g.value,B=m.localName;if(m.namespaceURI==X.XHTML)if("style"==B){var w=m.getAttribute("class"),y=m.getAttribute("media"),N=m.getAttribute("title");F.push({url:i,text:m.textContent,flavor:ui.AUTHOR,classes:N?w:null,media:y})}else if("link"==B){var b=m.getAttribute("rel"),S=m.getAttribute("class"),T=m.getAttribute("media");if("stylesheet"==b||"alternate stylesheet"==b&&S){var x=m.getAttribute("href");x=K(x,i);var I=m.getAttribute("title");F.push({url:x,text:null,classes:I?S:null,media:T,flavor:ui.AUTHOR})}}else"meta"==B&&"viewport"==m.getAttribute("name")&&F.push({url:i,text:Qh(m),flavor:ui.AUTHOR,classes:null,media:null})}for(var P=0;P<u.styleSheets.length;P++)F.push(u.styleSheets[P])}for(var R="",L=0;L<F.length;L++)R+=F[L].url,R+="^",F[L].text&&(R+=F[L].text),R+="^";var O=u.styleByKey[R];if(O)return u.styleByDocURL[i]=O,void n.finish(t);var k=u.styleFetcherByKey[R];k||(k=new Gn((function(){var t=Pn("fetchStylesheet"),e=0,n=new Zh(u.validatorSet);return t.loop((function(){if(e<F.length){var t=F[e++];return n.startStylesheet(t.flavor),null!==t.text?xi(t.text,n,t.url,t.classes,t.media).thenReturn(!0):Ii(t.url,n,t.classes,t.media)}return Rn(!1)})).then((function(){var e=n.cascadeParserHandler.finish();O=new Yh(u,n.rootScope,n.pageScope,e,n.rootBox,n.fontFaces,n.footnoteProps,n.flowProps,n.viewportProps,n.pageProps),u.styleByKey[R]=O,delete u.styleFetcherByKey[R],t.finish(O)})),t.result()}),"FetchStylesheet "+i),u.styleFetcherByKey[R]=k,k.start()),k.get().then((function(e){u.styleByDocURL[i]=e,n.finish(t)}))}else n.finish(null)})),n.result()},u}(ni);function ec(t){return String.fromCharCode(t>>>24&255,t>>>16&255,t>>>8&255,255&t)}function uc(t){return(255&t.charCodeAt(0))<<24|(255&t.charCodeAt(1))<<16|(255&t.charCodeAt(2))<<8|255&t.charCodeAt(3)}function nc(t){var e=new it;e.append(t);var u=55-t.length&63;for(e.append("€");u>0;)u--,e.append("\0");e.append("\0\0\0\0"),e.append(ec(8*t.length)),t=e.toString();for(var n,i=[1732584193,4023233417,2562383102,271733878,3285377520],r=[],o=0;o<t.length;o+=64){for(n=0;n<16;n++)r[n]=uc(t.substr(o+4*n,4));for(;n<80;n++){var a=r[n-3]^r[n-8]^r[n-14]^r[n-16];r[n]=a<<1|a>>>31}var s=i[0],l=i[1],D=i[2],h=i[3],c=i[4],d=void 0;for(n=0;n<80;n++)d=n<20?1518500249+(l&D|~l&h):n<40?1859775393+(l^D^h):n<60?2400959708+(l&D|l&h|D&h):3395469782+(l^D^h),d+=(s<<5|s>>>27)+c+r[n],c=h,h=D,D=l<<30|l>>>2,l=s,s=d;i[0]=i[0]+s|0,i[1]=i[1]+l|0,i[2]=i[2]+D|0,i[3]=i[3]+h|0,i[4]=i[4]+c|0}return i}var ic=function(){function t(t,e,u,n,i,r,o,a,s,l){this.store=void 0,this.url=void 0,this.lang=void 0,this.clientLayout=void 0,this.fontMapper=void 0,this.rendererFactory=void 0,this.fallbackMap=void 0,this.documentURLTransformer=void 0,this.counterStore=void 0,this.pref=void 0,this.page=null,this.instance=null,this.store=t,this.url=e,this.lang=u,this.clientLayout=n,this.fontMapper=i,this.rendererFactory=o,this.fallbackMap=a,this.documentURLTransformer=s,this.counterStore=l,this.pref=Pt(r),this.pref.spreadView=!1}var e=t.prototype;return e.setAutoHeight=function(t,e){if(0!=e--)for(var u=t.firstChild;u;u=u.nextSibling)if(1==u.nodeType){var n=u;"auto"!=ut(n,"height","auto")&&(et(n,"height","auto"),this.setAutoHeight(n,e)),"absolute"==ut(n,"position","static")&&(et(n,"position","relative"),this.setAutoHeight(n,e))}},e.makeCustomRenderer=function(t){var e=this.rendererFactory.makeCustomRenderer(t);return function(t,u,n){var i=n.behavior;if(i)switch(i.toString()){case"body-child":t.querySelector("[role=doc-toc], [role=directory], nav li a, .toc, #toc")||(n.display=uu.none);break;case"toc-node-anchor":n.color=uu.inherit,n["text-decoration"]=uu.none;break;case"toc-node":n.display=uu.block,n.margin=ou,n.padding=ou,n["padding-inline-start"]=new Ge(1.25,"em");break;case"toc-node-first-child":n.display=uu.inline_block,n.margin=new Ge(.2,"em"),n["vertical-align"]=uu.top,n.color=uu.inherit,n["text-decoration"]=uu.none}if(!i||"toc-node"!=i.toString()&&"toc-container"!=i.toString())return e(t,u,n);var r=t.firstChild;r&&1!==r.nodeType&&""===r.textContent.trim()&&t.replaceChild(t.ownerDocument.createComment(r.textContent),r);var o=u.getAttribute("data-adapt-class");if("toc-node"==o){var a=u.firstChild;"▸"!=a.textContent&&(a.textContent="▸",et(a,"cursor","pointer"),a.addEventListener("click",rc,!1),a.setAttribute("role","button"),a.setAttribute("aria-expanded","false"),u.setAttribute("aria-expanded","false"),"0px"!==u.style.height&&(a.tabIndex=0))}var s=u.ownerDocument.createElement("div");if(s.setAttribute("data-adapt-process-children","true"),"toc-node"==i.toString()){var l=u.ownerDocument.createElement("div");if(l.textContent="▹",et(l,"margin","0.2em 0 0 -1em"),et(l,"margin-inline-start","-1em"),et(l,"margin-inline-end","0"),et(l,"display","inline-block"),et(l,"width","1em"),et(l,"text-align","center"),et(l,"vertical-align","top"),et(l,"cursor","default"),et(l,"font-family","Menlo,sans-serif"),s.appendChild(l),et(s,"overflow","hidden"),s.setAttribute("data-adapt-class","toc-node"),s.setAttribute("role","treeitem"),"toc-node"==o||"toc-container"==o){et(s,"height","0px");var D=t.firstElementChild;D&&"a"===D.localName&&(D.tabIndex=-1)}else u.setAttribute("role","tree")}else"toc-node"==o&&(s.setAttribute("data-adapt-class","toc-container"),s.setAttribute("role","group"),s.setAttribute("aria-hidden","true"));return Rn(s)}},e.showTOC=function(t,e,u,n,i){var r=this;if(this.page)return Rn(this.page);var o=Pn("showTOC"),a=new Ji(t,t);return this.page=a,this.store.load(this.url+"?viv-toc-box").then((function(n){for(var s,l=_(n.document.querySelectorAll("[role=doc-toc], [role=directory], nav, .toc, #toc"));!(s=l()).done;){var D=s.value;D.hasAttribute("hidden")&&D.removeAttribute("hidden")}var h=r.store.getStyleForDoc(n),c=h.sizeViewport(u,1e5,i);e=new Hh(e.window,c.fontSize,e.root,c.width,c.height);var d=r.makeCustomRenderer(n),f=new qh(h,n,r.lang,e,r.clientLayout,r.fontMapper,d,r.fallbackMap,0,r.documentURLTransformer,r.counterStore);r.instance=f,f.pref=r.pref,f.init().then((function(){f.layoutNextPage(a,null).then((function(){Array.from(a.container.querySelectorAll("[data-vivliostyle-toc-box]>*>*>*>*>*[style*='display: none']")).forEach((function(t){t.setAttribute("aria-hidden","true"),t.setAttribute("hidden","hidden")})),r.setAutoHeight(t,2),o.finish(a)}))}))})),o.result()},e.hideTOC=function(){this.page&&(this.page.container.style.visibility="hidden",this.page.container.setAttribute("aria-hidden","true"))},e.isTOCVisible=function(){return!!this.page&&"visible"===this.page.container.style.visibility},e.getTOC=function(){if(!this.page)return[];function t(t){if(!t)return[];var u=t.querySelectorAll(":scope > [role=treeitem] > a[href]");return Array.from(u).map(e)}function e(e){return{id:new URL(e.href).hash.match(/^#?(.*)$/)[1],title:e.innerText,children:t(e.parentElement.querySelector("[role=group]"))}}return t(this.page.container.querySelector("[role=tree]"))},t}();function rc(t){var e=t.target,u="▸"==e.textContent;e.textContent=u?"▾":"▸";var n=e.parentNode;e.setAttribute("aria-expanded",u?"true":"false"),n.setAttribute("aria-expanded",u?"true":"false");for(var i=n.firstChild;i;){if(1===i.nodeType){var r=i,o=r.getAttribute("data-adapt-class");if("toc-container"===o){if(r.setAttribute("aria-hidden",u?"false":"true"),r.firstChild){i=r.firstChild;continue}}else if("toc-node"===o&&(r.style.height=u?"auto":"0px",r.children.length>=2&&(r.children[1].tabIndex=u?0:-1),r.children.length>=3&&(r.children[0].tabIndex=u?0:-1,!u))){var a=r.children[0];if("▾"==a.textContent){a.textContent="▸",a.setAttribute("aria-expanded","false"),r.setAttribute("aria-expanded","false"),i=r.children[2];continue}}}for(;!i.nextSibling&&i.parentNode!==n;)i=i.parentNode;i=i.nextSibling}t.stopPropagation()}var oc=function(t){function e(){var e;return(e=t.call(this,null)||this).plainXMLStore=void 0,e.jsonStore=void 0,e.opfByURL={},e.primaryOPFByEPubURL={},e.deobfuscators={},e.documents={},e.fontDeobfuscator=e.makeDeobfuscatorFactory(),e.plainXMLStore=new ni(Xh,jn.DOCUMENT),e.jsonStore=new ni(ii,jn.TEXT),e}T(e,t);var u=e.prototype;return u.makeDeobfuscatorFactory=function(){var t=this;return function(e){return t.deobfuscators[e]}},u.loadAsPlainXML=function(t,e,u){return this.plainXMLStore.load(t,e,u)},u.startLoadingAsPlainXML=function(t){this.plainXMLStore.fetch(t)},u.loadAsJSON=function(t,e,u){return this.jsonStore.load(t,e,u)},u.startLoadingAsJSON=function(t){this.jsonStore.fetch(t)},u.loadPubDoc=function(t,e){var u=this,n=Pn("loadPubDoc");return ti(t,null,"HEAD").then((function(i){if(i.status>=400)u.loadEPUBDoc(t,e).then((function(e){e?n.finish(e):(c.error("Failed to fetch a source document from "+t+" ("+i.status+(i.statusText?" "+i.statusText:"")+")"),n.finish(null))}));else if(i.status||i.responseXML||i.responseText||i.responseBlob||i.contentType||/\/[^/.]+(?:[#?]|$)/.test(t)&&(t=t.replace(/([#?]|$)/,"/$1")),"application/oebps-package+xml"==i.contentType||/\.opf(?:[#?]|$)/.test(t)){var r=t.match(/^((?:.*\/)?)([^/]*)$/);u.loadOPF(r[1],r[2],e).thenFinish(n)}else"application/ld+json"==i.contentType||"application/webpub+json"==i.contentType||"application/audiobook+json"==i.contentType||"application/json"==i.contentType||/\.json(?:ld)?(?:[#?]|$)/.test(t)?u.loadAsJSON(t,!0).then((function(e){if(!e)return u.reportLoadError(t),void n.finish(null);var i=new Ec(u,t);i.initWithWebPubManifest(e,void 0,t).then((function(){n.finish(i)}))})):u.loadWebPub(t).then((function(i){i?n.finish(i):u.loadEPUBDoc(t,e).then((function(e){e?n.finish(e):(c.error("Failed to load "+t+"."),n.finish(null))}))}))})),n.result()},u.loadEPUBDoc=function(t,e){var u=this,n=Pn("loadEPUBDoc");return t.endsWith("/")||(t+="/"),e&&this.startLoadingAsJSON(t+"?r=list"),this.startLoadingAsPlainXML(t+"META-INF/encryption.xml"),this.loadAsPlainXML(t+"META-INF/container.xml").then((function(i){if(i)for(var r,o=_(i.doc().child("container").child("rootfiles").child("rootfile").attribute("full-path"));!(r=o()).done;){var a=r.value;if(a)return void u.loadOPF(t,a,e).thenFinish(n)}n.finish(null)})),n.result()},u.loadOPF=function(t,e,u){var n=this,i=t+e,r=this.opfByURL[i];if(r)return Rn(r);var o=Pn("loadOPF");return this.loadAsPlainXML(i,!0,"Failed to fetch EPUB OPF "+i).then((function(e){e?n.loadAsPlainXML(t+"META-INF/encryption.xml").then((function(a){(u?n.loadAsJSON(t+"?r=list"):Rn(null)).then((function(u){(r=new Ec(n,t)).initWithXMLDoc(e,a,u,t+"?r=manifest").then((function(){n.opfByURL[i]=r,n.primaryOPFByEPubURL[t]=r,o.finish(r)}))}))})):n.reportLoadError(i)})),o.result()},u.loadWebPub=function(t){var e=this,u=Pn("loadWebPub");return this.load(t).then((function(n){if(n)if(n.document.querySelector("a[href='META-INF/'],a[href$='/META-INF/']"))u.finish(null);else{var i=n.document,r=new Ec(e,t);i.body&&i.body.setAttribute("data-vivliostyle-primary-entry",!0);var o=i.querySelector("link[rel='publication'],link[rel='manifest'][type='application/webpub+json']");if(o){var a=o.getAttribute("href");if(/^#/.test(a)){var s=V(i.getElementById(a.substr(1)).textContent);r.initWithWebPubManifest(s,i).then((function(){u.finish(r)}))}else{var l=K(o.getAttribute("href"),t);e.loadAsJSON(l,!0,"Failed to fetch Publication Manifest "+l).then((function(t){r.initWithWebPubManifest(t,i,l).then((function(){u.finish(r)}))}))}}else r.initWithWebPubManifest({},i).then((function(){r.xhtmlToc&&r.xhtmlToc.src===n.url&&(i.querySelector("[role=doc-toc], [role=directory], nav, .toc, #toc")||(r.xhtmlToc=null)),u.finish(r)}))}else e.reportLoadError(t)})),u.result()},u.addDocument=function(t,e){var u=Pn("EPUBDocStore.load"),n=H(t);return(this.documents[n]=this.parseOPSResource({status:200,statusText:"",url:n,contentType:e.contentType,responseText:null,responseXML:e,responseBlob:null})).thenFinish(u),u.result()},u.reportLoadError=function(t){var e,u=this,n=function(t){return t.replace(/([^:/?#]|^)[/?#].*/,"$1")};t.startsWith("data:")?c.error("Failed to load "+t+". Invalid data."):t.startsWith("http:")&&z.startsWith("https:")?c.error("Failed to load "+t+'. Mixed Content ("http:" content on "https:" context) is not allowed.'):(e=n(t))===n(z)||Object.keys(u.resources).find((function(t){return u.resources[t]&&n(t)===e}))||/\.(xhtml|xht|xml|opf)$/i.test(t)?c.error("Failed to load "+t+". The target resource is invalid."):c.error("Failed to load "+t+". This may be caused by the server not allowing cross-origin resource sharing (CORS).")},u.load=function(e){var u=this,n=H(e),i=this.documents[n];if(i)return i.isPending()?i:Rn(i.get());var r=Pn("EPUBDocStore.load");return(i=t.prototype.load.call(this,n,!0,"Failed to fetch a source document from "+n)).then((function(t){t?r.finish(t):u.reportLoadError(n)})),r.result()},e}(tc),ac=function(){function t(){this.id=null,this.src="",this.mediaType=null,this.title=null,this.itemRefElement=null,this.spineIndex=-1,this.compressedSize=0,this.compressed=null,this.epage=0,this.epageCount=0,this.startPage=null,this.skipPagesBefore=null,this.itemProperties=void 0,this.itemProperties=U}var e=t.prototype;return e.initWithElement=function(t,e){this.id=t.getAttribute("id"),this.src=K(t.getAttribute("href"),e),this.mediaType=t.getAttribute("media-type");var u=t.getAttribute("properties");u&&(this.itemProperties=function(t){for(var e={},u=0;u<t.length;u++)e[t[u]]=!0;return e}(u.split(/\s+/)))},e.initWithParam=function(t){this.spineIndex=t.index,this.id="item"+(t.index+1),this.src=t.url,this.startPage=t.startPage,this.skipPagesBefore=t.skipPagesBefore},t}();function sc(t){return t.id}var lc={dcterms:"http://purl.org/dc/terms/",marc:"http://id.loc.gov/vocabulary/",media:"http://www.idpf.org/epub/vocab/overlays/#",rendition:"http://www.idpf.org/vocab/rendition/#",onix:"http://www.editeur.org/ONIX/book/codelists/current.html#",xsd:"http://www.w3.org/2001/XMLSchema#",opf:"http://www.idpf.org/2007/opf"},Dc="http://idpf.org/epub/vocab/package/meta/#",hc={language:lc.dcterms+"language",title:lc.dcterms+"title",creator:lc.dcterms+"creator",layout:lc.rendition+"layout",titleType:Dc+"title-type",displaySeq:Dc+"display-seq",alternateScript:Dc+"alternate-script",role:Dc+"role"};function cc(t,e){var u={};return function(n,i){var r,o,a,s,l,D=n.r||u,h=i.r||u;if(t==hc.title&&(a="main"==(null==(s=D[hc.titleType])?void 0:s[0].v))!=("main"==(null==(l=h[hc.titleType])?void 0:l[0].v)))return a?-1:1;var c=parseInt(null==(r=D[hc.displaySeq])?void 0:r[0].v,10);isNaN(c)&&(c=Number.MAX_VALUE);var d,f,p=parseInt(null==(o=h[hc.displaySeq])?void 0:o[0].v,10);return isNaN(p)&&(p=Number.MAX_VALUE),c!=p?c-p:t!=hc.language&&e&&(a=(null==(d=D[hc.language]||D[hc.alternateScript])?void 0:d[0].v)==e)!=((null==(f=h[hc.language]||h[hc.alternateScript])?void 0:f[0].v)==e)?a?-1:1:n.o-i.o}}function dc(){var t=window.MathJax;return t?t.Hub:null}var fc,pc={"application/xhtml+xml":!0,"image/jpeg":!0,"image/png":!0,"image/svg+xml":!0,"image/gif":!0,"audio/mp3":!0},Ec=function(){function t(t,e){this.store=void 0,this.pubURL=void 0,this.opfXML=null,this.encXML=null,this.items=null,this.spine=null,this.itemMap=null,this.itemMapByPath=null,this.uid=null,this.bindings={},this.lang=null,this.epageCount=0,this.prePaginated=!1,this.epageIsRenderedPage=!0,this.epageCountCallback=null,this.metadata={},this.ncxToc=null,this.xhtmlToc=null,this.cover=null,this.fallbackMap={},this.pageProgression=null,this.documentURLTransformer=void 0,this.store=t,this.pubURL=e,this.documentURLTransformer=this.createDocumentURLTransformer(),dc()&&(yr[X.MATHML]=!0)}var e=t.prototype;return e.createDocumentURLTransformer=function(){var t=this,e=function(){function e(){}var u=e.prototype;return u.transformFragment=function(t,e){return"viv-id-"+Dt(e+(t?"#"+t:""),":")},u.transformURL=function(e,u){var n=e.match(/^([^#]*)#?(.*)$/);if(n){var i=n[1]||u,r=decodeURIComponent(n[2]);if(i&&t.items.some((function(t){return t.src===i})))return"#"+this.transformFragment(r,i)}return e},u.restoreURL=function(t){"#"===t.charAt(0)&&(t=t.substring(1)),0===t.indexOf("viv-id-")&&(t=t.substring("viv-id-".length));var e=function(t,e){e="string"==typeof e?e:"\\u";var u=new RegExp(ht(e)+"[0-9a-fA-F]{4}","g");return t.replace(u,(function(t){return function(t,e){return 0===t.indexOf(e="string"==typeof e?e:"\\u")?String.fromCharCode(parseInt(t.substring(e.length),16)):t}(t,e)}))}(t,":").match(/^([^#]*)#?(.*)$/);return e?[e[1],e[2]]:[]},e}();return new e},e.getMetadata=function(){return this.metadata},e.getPathFromURL=function(t){if(t.startsWith("data:"))return t===this.pubURL?"":t;if(this.pubURL){var e=K("",this.pubURL);return t===e||t+"/"===e?"":("/"!=e.charAt(e.length-1)&&(e+="/"),t.substr(0,e.length)==e?decodeURIComponent(t.substr(e.length)):null)}return t},e.initWithXMLDoc=function(t,e,u,n){var i=this;this.opfXML=t,this.encXML=e;var r=t.doc().child("package"),o=r.attribute("unique-identifier")[0];if(o){var a=t.getElement(t.url+"#"+o);a&&(this.uid=a.textContent.replace(/[ \n\r\t]/g,""))}var l={};for(var D in this.items=r.child("manifest").child("item").asArray().map((function(e){var u=new ac,n=e;u.initWithElement(n,t.url);var r=n.getAttribute("fallback");return r&&!pc[u.mediaType]&&(l[u.src]=r),!i.xhtmlToc&&u.itemProperties.nav&&(i.xhtmlToc=u),!i.cover&&u.itemProperties["cover-image"]&&(i.cover=u),u})),this.itemMap=ft(this.items,sc),this.itemMapByPath=ft(this.items,(function(t){return i.getPathFromURL(t.src)})),l)for(var h=D;;){var c=this.itemMap[l[h]];if(!c)break;if(pc[c.mediaType]){this.fallbackMap[D]=c.src;break}h=c.src}this.spine=r.child("spine").child("itemref").asArray().map((function(t,e){var u=t,n=u.getAttribute("idref"),r=i.itemMap[n];return r&&(r.itemRefElement=u,r.spineIndex=e),r}));var d=r.child("spine").attribute("toc")[0];d&&(this.ncxToc=this.itemMap[d]);var f=r.child("spine").attribute("page-progression-direction")[0];f&&(this.pageProgression=s(f));for(var p=e?e.doc().child("encryption").child("EncryptedData").predicate(Wh.withChild("EncryptionMethod",Wh.withAttribute("Algorithm","http://www.idpf.org/2008/embedding"))).child("CipherData").child("CipherReference").attribute("URI"):[],E=r.child("bindings").child("mediaType").asArray(),C=0;C<E.length;C++){var F=E[C].getAttribute("handler"),A=E[C].getAttribute("media-type");A&&F&&this.itemMap[F]&&(this.bindings[A]=this.itemMap[F].src)}if(this.metadata=function(t,e){var u;if(e){for(var n in u={},lc)u[n]=lc[n];for(var i;null!=(i=e.match(/^\s*([A-Z_a-z\u007F-\uFFFF][-.A-Z_a-z0-9\u007F-\uFFFF]*):\s*(\S+)/));)e=e.substr(i[0].length),u[i[1]]=i[2]}else u=lc;var r=function(t){if(t){var e=t.match(/^\s*(([^:]*):)?(\S+)\s*$/);if(e){var n=e[2]?u[e[2]]:Dc;if(n)return n+e[3]}}return null},o=1,a=t.childElements().forEachNonNull((function(t){if("meta"==t.localName){var e=r(t.getAttribute("property"));if(e)return{name:e,value:t.textContent,id:t.getAttribute("id"),order:o++,refines:t.getAttribute("refines"),lang:null,scheme:r(t.getAttribute("scheme")),role:null}}else if(t.namespaceURI==X.DC)return{name:lc.dcterms+t.localName,order:o++,lang:t.getAttribute("xml:lang"),value:t.textContent,id:t.getAttribute("id"),refines:null,scheme:null,role:t.getAttribute("role")||t.getAttribute("opf:role")};return null})),s=pt(a,(function(t){return t.refines})),l=function t(e){return function(e,u){var n={};for(var i in e)n[i]=e[i].map((function(e){var u={v:e.value,o:e.order};e.scheme&&(u.s=e.scheme);var n=s["#"+e.id]||[];if(n.length||e.lang||e.role){e.lang&&n.push({name:hc.language,value:e.lang,lang:null,id:null,refines:e.id,scheme:null,order:e.order,role:null}),e.role&&n.push({name:hc.role,value:e.role,lang:null,id:null,refines:e.id,scheme:null,order:e.order,role:null});var i=pt(n,(function(t){return t.name}));u.r=t(i)}return u}));return n}(e)}(pt(a,(function(t){return t.refines?null:t.name}))),D=null;return l[hc.language]&&(D=l[hc.language][0].v),function t(e){for(var u in e){var n=e[u];n.sort(cc(u,D));for(var i=0;i<n.length;i++){var r=n[i].r;r&&t(r)}}}(l),l}(r.child("metadata"),r.attribute("prefix")[0]),this.metadata[hc.language]&&(this.lang=this.metadata[hc.language][0].v),this.metadata[hc.layout]&&(this.prePaginated="pre-paginated"===this.metadata[hc.layout][0].v),!u){if(p.length>0&&this.uid)for(var g=function(t){var e=function(t){for(var e,u=[],n=_(nc(t));!(e=n()).done;){var i=e.value;u.push(i>>>24&255,i>>>16&255,i>>>8&255,255&i)}return u}(t);return function(t){var u,n,i=Pn("deobfuscator");return t.slice?(u=t.slice(0,1040),n=t.slice(1040,t.size)):(u=t.webkitSlice(0,1040),n=t.webkitSlice(1040,t.size-1040)),function(t){var e=Pn("readBlob"),u=new FileReader,n=e.suspend(u);return u.addEventListener("load",(function(){n.schedule(u.result)}),!1),u.readAsArrayBuffer(t),e.result()}(u).then((function(t){for(var u=new DataView(t),r=0;r<u.byteLength;r++){var o=u.getUint8(r);u.setUint8(r,o^=e[r%20])}i.finish(ei([u,n]))})),i.result()}}(this.uid),v=0;v<p.length;v++)this.store.deobfuscators[this.pubURL+p[v]]=g;return this.prePaginated&&this.assignAutoPages(),Rn(!0)}var m=new it,B={};if(p.length>0&&this.uid)for(var w="1040:"+function(t){for(var e=function(t){for(var e=nc(t),u=new it,n=0;n<e.length;n++)u.append(ec(e[n]));return u.toString()}(t),u=new it,n=0;n<e.length;n++)u.append((256|e.charCodeAt(n)).toString(16).substr(1));return u.toString()}(this.uid),y=0;y<p.length;y++)B[p[y]]=w;for(var N=0;N<u.length;N++){var b=u[N],S=b.n;if(S){var T=decodeURIComponent(S),x=this.itemMapByPath[T],I=null;x&&(x.compressed=0!=b.m,x.compressedSize=b.c,x.mediaType&&(I=x.mediaType.replace(/\s+/g,"")));var P=B[T];(I||P)&&(m.append(S),m.append(" "),m.append(I||"application/octet-stream"),P&&(m.append(" "),m.append(P)),m.append("\n"))}}return this.assignAutoPages(),ti(n,jn.DEFAULT,"POST",m.toString(),"text/plain")},e.assignAutoPages=function(){for(var t,e=0,u=_(this.spine);!(t=u()).done;){var n=t.value,i=this.prePaginated?1:Math.ceil(n.compressedSize/1024);n.epage=e,n.epageCount=i,e+=i}this.epageCount=e,this.epageCountCallback&&this.epageCountCallback(this.epageCount)},e.setEPageCountMode=function(t){this.epageIsRenderedPage=t||this.prePaginated},e.countEPages=function(t){var e=this;if(this.epageCountCallback=t,this.epageIsRenderedPage)return this.prePaginated&&0==this.epageCount&&this.assignAutoPages(),Rn(!0);var u=0,n=0,i=Pn("countEPages");return i.loopWithFrame((function(t){if(n!==e.spine.length){var i=e.spine[n++];i.epage=u,e.store.load(i.src).then((function(n){var r=1800,o=n.lang||e.lang;o&&o.match(/^(ja|ko|zh)/)&&(r/=3),i.epageCount=Math.ceil(n.getTotalOffset()/r),e.epageCount=u+=i.epageCount,e.epageCountCallback&&e.epageCountCallback(e.epageCount),t.continueLoop()}))}else t.breakLoop()})).thenFinish(i),i.result()},e.initWithChapters=function(t,e){var u=this;this.itemMap={},this.itemMapByPath={},this.items=[],this.spine=this.items;var n=this.opfXML=new zh(null,"",(new DOMParser).parseFromString("<spine></spine>","text/xml"));return t.forEach((function(t){var e=new ac;e.initWithParam(t);var i=n.document.createElement("itemref");i.setAttribute("idref",e.id),n.root.appendChild(i),e.itemRefElement=i,u.itemMap[e.id]=e;var r=u.getPathFromURL(t.url);null==r&&(r=t.url),u.itemMapByPath[r]=e,u.items.push(e)})),e?this.store.addDocument(t[0].url,e):Rn(null)},e.initWithWebPubManifest=function(t,e,u){var n=this;t.readingProgression&&(this.pageProgression=t.readingProgression),void 0===this.metadata&&(this.metadata={});var i=e&&e.title||t.name||t.metadata&&t.metadata.title;i&&(this.metadata[hc.title]=[{v:i}]);var r=this.getPathFromURL(this.pubURL);if(!t.readingOrder&&e&&null!==r){t.readingOrder=[encodeURI(r)];for(var o,a=_(e.querySelectorAll("[role=doc-toc] a[href],[role=directory] a[href],nav li a[href],.toc a[href],#toc a[href]"));!(o=a()).done;){var s=o.value.getAttribute("href");if(!/^(https?:)?\/\//.test(s)&&!/\.(jpe?g|png|gif|pdf|svg|mml)([#?]|$)/.test(s)){var l=H(K(s,this.pubURL)),D=this.getPathFromURL(l),h=null!==D?encodeURI(D):l;-1==t.readingOrder.indexOf(h)&&t.readingOrder.push(h)}}}var c=[],d=0,f=-1;[t.readingOrder,t.resources].forEach((function(e){e instanceof Array&&e.forEach((function(e){var i=t.readingOrder.includes(e),r="string"==typeof e?e:e.url||e.href,o="string"==typeof e?"":e.encodingFormat||e.href&&e.type||"";if(i||"text/html"===o||"application/xhtml+xml"===o||/(^|\/)([^/]+\.(x?html|htm|xht)|[^/.]*)([#?]|$)/.test(r)){var a=u?u.replace(/\/[^/]+$/,"/"):n.pubURL,s={url:K(Y(r),a),index:d++,startPage:null,skipPagesBefore:null};"contents"===e.rel&&-1===f&&(f=s.index),c.push(s)}}))}));var p=Pn("initWithWebPubManifest");return this.initWithChapters(c).then((function(){var t;-1!==f&&(n.xhtmlToc=n.items[f]),n.xhtmlToc||(n.xhtmlToc=u?null==(t=n.items)?void 0:t[0]:n.itemMapByPath[r]),p.finish(!0)})),p.result()},e.getCFI=function(t,e){var u=this.spine[t],n=Pn("getCFI");return this.store.load(u.src).then((function(t){var i=t.getNodeByOffset(e),r=null;if(i){var o=t.getNodeOffset(i,0,!1),a=e-o,s=new It;s.prependPathFromNode(i,a,!1,null),u.itemRefElement&&s.prependPathFromNode(u.itemRefElement,0,!1,null),r=s.toString()}n.finish(r)})),n.result()},e.resolveFragment=function(t){var e=this;return Ln("resolveFragment",(function(u){if(t){var n,i=new It;if(i.fromString(t),e.opfXML){var r=i.navigate(e.opfXML.document);if(1!=r.node.nodeType||r.after||!r.ref)return void u.finish(null);var o=r.node,a=o.getAttribute("idref");if("itemref"!=o.localName||!a||!e.itemMap[a])return void u.finish(null);n=e.itemMap[a],i=r.ref}else n=e.spine[0];e.store.load(n.src).then((function(t){var e=i.navigate(t.document),r=t.getNodeOffset(e.node,e.offset,e.after);u.finish({spineIndex:n.spineIndex,offsetInItem:r,pageIndex:-1})}))}else u.finish(null)}),(function(e,u){c.warn(u,"Cannot resolve fragment:",t),e.finish(null)}))},e.resolveEPage=function(t){var e=this;return Ln("resolveEPage",(function(u){if(t<=0)u.finish({spineIndex:0,offsetInItem:0,pageIndex:-1});else if(e.epageIsRenderedPage){var n=e.spine.findIndex((function(e){return 0==e.epage&&0==e.epageCount||e.epage<=t&&e.epage+e.epageCount>t}));-1==n&&(n=e.spine.length-1);var i=e.spine[n];i&&0!=i.epageCount||(i=e.spine[--n]);var r=Math.floor(t-i.epage);u.finish({spineIndex:n,offsetInItem:-1,pageIndex:r})}else{var o=ct(e.spine.length,(function(u){var n=e.spine[u];return n.epage+n.epageCount>t}));o==e.spine.length&&o--;var a=e.spine[o];e.store.load(a.src).then((function(e){(t-=a.epage)>a.epageCount&&(t=a.epageCount);var n=0;if(t>0){var i=e.getTotalOffset();(n=Math.round(i*t/a.epageCount))==i&&n--}u.finish({spineIndex:o,offsetInItem:n,pageIndex:-1})}))}}),(function(e,u){c.warn(u,"Cannot resolve epage:",t),e.finish(null)}))},e.getEPageFromPosition=function(t){var e=this.spine[t.spineIndex];if(this.epageIsRenderedPage)return Rn(e.epage+t.pageIndex);if(t.offsetInItem<=0)return Rn(e.epage);var u=Pn("getEPage");return this.store.load(e.src).then((function(n){var i=n.getTotalOffset(),r=Math.min(i,t.offsetInItem);u.finish(e.epage+r*e.epageCount/i)})),u.result()},t}(),Cc=function(t,e){return{page:t,position:{spineIndex:t.spineIndex,pageIndex:e,offsetInItem:t.offset}}},Fc=function(){function t(t,e,u,n,i){this.opf=void 0,this.viewport=void 0,this.fontMapper=void 0,this.pageSheetSizeReporter=void 0,this.spineItems=[],this.spineItemLoadingContinuations=[],this.pref=void 0,this.clientLayout=void 0,this.counterStore=void 0,this.tocAutohide=!1,this.tocView=void 0,this.opf=t,this.viewport=e,this.fontMapper=u,this.pageSheetSizeReporter=i,this.pref=Pt(n),this.clientLayout=new Vh(e),this.counterStore=new Xu(t.documentURLTransformer)}var u=t.prototype;return u.getPage=function(t){var e=this.spineItems[t.spineIndex];return e?e.pages[t.pageIndex]:null},u.getCurrentPageProgression=function(t){if(this.opf.pageProgression)return this.opf.pageProgression;var e=this.spineItems[t?t.spineIndex:0];return e?e.instance.pageProgression:null},u.finishPageContainer=function(t,e,u){e.container.style.display="none",e.container.style.visibility="visible",e.container.style.position="",e.container.style.top="",e.container.style.left="",e.container.setAttribute("data-vivliostyle-page-side",e.side);var n=t.pages[u];if(e.isFirstPage=0==t.item.spineIndex&&0==u,t.pages[u]=e,this.opf.epageIsRenderedPage){if(0==u&&t.item.spineIndex>0){var i=this.opf.spine[t.item.spineIndex-1];t.item.epage=i.epage+i.epageCount}t.item.epageCount=t.pages.length,this.opf.epageCount=this.opf.spine.reduce((function(t,e){return t+e.epageCount}),0),this.opf.epageCountCallback&&this.opf.epageCountCallback(this.opf.epageCount)}if(n)t.instance.viewport.contentContainer.replaceChild(e.container,n.container),n.dispatchEvent({type:"replaced",target:null,currentTarget:null,preventDefault:null,newPage:e});else{var r=null;if(u>0)r=t.pages[u-1].container.nextElementSibling;else for(var o=t.item.spineIndex+1;o<this.spineItems.length;o++){var a=this.spineItems[o];if(a&&a.pages[0]){r=a.pages[0].container;break}}t.instance.viewport.contentContainer.insertBefore(e.container,r)}this.pageSheetSizeReporter({width:t.instance.pageSheetWidth,height:t.instance.pageSheetHeight},t.instance.pageSheetSize,t.item.spineIndex,t.instance.pageNumberOffset+u)},u.renderSinglePage=function(t,e){var u=this,n=Pn("renderSinglePage"),i=this.makePage(t,e);return t.instance.layoutNextPage(i,e).then((function(r){var o=(e=r)?e.page-1:t.layoutPositions.length-1;u.finishPageContainer(t,i,o),u.counterStore.finishPage(i.spineIndex,o);var a=null;if(e){var s=t.layoutPositions[e.page];t.layoutPositions[e.page]=e,s&&t.pages[e.page]&&(e.isSamePosition(s)||(a=u.renderSinglePage(t,e)))}a||(a=Rn(!0)),a.then((function(){var r=u.counterStore.getUnresolvedRefsToPage(i),a=0;n.loopWithFrame((function(t){if(++a>r.length)t.breakLoop();else{var e=r[a-1];e.refs=e.refs.filter((function(t){return!t.isResolved()})),0!==e.refs.length?u.getPageViewItem(e.spineIndex).then((function(n){n?(u.counterStore.pushPageCounters(e.pageCounters),u.counterStore.pushReferencesToSolve(e.refs),u.renderSinglePage(n,n.layoutPositions[e.pageIndex]).then((function(e){u.counterStore.popPageCounters(),u.counterStore.popReferencesToSolve();var n=e.pageAndPosition.position;n.spineIndex===i.spineIndex&&n.pageIndex===o&&(i=e.pageAndPosition.page),t.continueLoop()}))):t.continueLoop()})):t.continueLoop()}})).then((function(){i.container.parentElement||(i=t.pages[o]),i.isLastPage=!e&&t.item.spineIndex===u.opf.spine.length-1,i.isLastPage&&u.counterStore.finishLastPage(u.viewport),n.finish({pageAndPosition:Cc(i,o),nextLayoutPosition:e})}))}))})),n.result()},u.normalizeSeekPosition=function(t,e){var u=t.pageIndex,n=-1;if(u<0){n=t.offsetInItem;var i=ct(e.layoutPositions.length,(function(t){return e.instance.getPosition(e.layoutPositions[t],!0)>n}));u=i===e.layoutPositions.length?e.complete?e.layoutPositions.length-1:Number.POSITIVE_INFINITY:i-1}else u===Number.POSITIVE_INFINITY&&-1!==t.offsetInItem&&(n=t.offsetInItem);return{spineIndex:t.spineIndex,pageIndex:u,offsetInItem:n}},u.findPage=function(t,e){var u=this,n=Pn("findPage");return this.getPageViewItem(t.spineIndex).then((function(i){if(i){var r,o=null;n.loopWithFrame((function(a){var s=u.normalizeSeekPosition(t,i);(o=i.pages[r=s.pageIndex])?a.breakLoop():i.complete?(o=i.pages[r=i.layoutPositions.length-1],a.breakLoop()):e?u.renderPage(s).then((function(t){t&&(o=t.page,r=t.position.pageIndex),a.breakLoop()})):n.sleep(100).then((function(){a.continueLoop()}))})).then((function(){n.finish(Cc(o,r))}))}else n.finish(null)})),n.result()},u.renderPage=function(t){var e=this,u=Pn("renderPage");return this.getPageViewItem(t.spineIndex).then((function(n){if(n){var i=e.normalizeSeekPosition(t,n),r=i.pageIndex,o=i.offsetInItem,a=n.pages[r];a?u.finish(Cc(a,r)):u.loopWithFrame((function(t){if(r<n.layoutPositions.length)t.breakLoop();else{if(n.complete)return r=n.layoutPositions.length-1,void t.breakLoop();var u=n.layoutPositions[n.layoutPositions.length-1];e.renderSinglePage(n,u).then((function(e){var i=e.pageAndPosition.page;if(u=e.nextLayoutPosition){if(o>=0&&n.instance.getPosition(u)>o)return a=i,r=n.layoutPositions.length-2,void t.breakLoop();t.continueLoop()}else a=i,r=e.pageAndPosition.position.pageIndex,n.complete=!0,t.breakLoop()}))}})).then((function(){var t=n.layoutPositions[r];(a=a||n.pages[r])?u.finish(Cc(a,r)):e.renderSinglePage(n,t).then((function(t){t.nextLayoutPosition||(n.complete=!0),u.finish(t.pageAndPosition)}))}))}else u.finish(null)})),u.result()},u.renderAllPages=function(){return this.renderPagesUpto({spineIndex:this.opf.spine.length-1,pageIndex:Number.POSITIVE_INFINITY,offsetInItem:-1},!1)},u.renderPagesUpto=function(t,e){var u=this,n=Pn("renderPagesUpto");t||(t={spineIndex:0,pageIndex:0,offsetInItem:0});var i,r=t.spineIndex,o=t.pageIndex,a=0;return e&&(a=r),n.loopWithFrame((function(e){u.renderPage({spineIndex:a,pageIndex:a===r?o:Number.POSITIVE_INFINITY,offsetInItem:a===r?t.offsetInItem:-1}).then((function(t){i=t,++a>r?e.breakLoop():e.continueLoop()}))})).then((function(){n.finish(i)})),n.result()},u.firstPage=function(t,e){return this.findPage({spineIndex:0,pageIndex:0,offsetInItem:-1},e)},u.lastPage=function(t,e){return this.findPage({spineIndex:this.opf.spine.length-1,pageIndex:Number.POSITIVE_INFINITY,offsetInItem:-1},e)},u.nextPage=function(t,e){var u=this,n=t.spineIndex,i=t.pageIndex,r=Pn("nextPage");return this.getPageViewItem(n).then((function(t){if(t){if(t.complete&&i==t.layoutPositions.length-1){if(n>=u.opf.spine.length-1)return void r.finish(null);n++,i=0;var o=u.spineItems[n],a=o&&o.pages[0],s=t.pages[t.pages.length-1];a&&s&&a.side==s.side&&(o.pages.forEach((function(t){t.container&&t.container.remove()})),u.spineItems[n]=null,u.spineItemLoadingContinuations[n]=null)}else i++;u.findPage({spineIndex:n,pageIndex:i,offsetInItem:-1},e).thenFinish(r)}else r.finish(null)})),r.result()},u.previousPage=function(t,e){var u=t.spineIndex,n=t.pageIndex;if(0==n){if(0==u)return Rn(null);u--,n=Number.POSITIVE_INFINITY}else n--;return this.findPage({spineIndex:u,pageIndex:n,offsetInItem:-1},e)},u.isRectoPage=function(t,u){var n=t.side===e.PageSide.LEFT,i=this.getCurrentPageProgression(u)===e.PageProgression.LTR;return!n&&i||n&&!i},u.getSpread=function(t,u){var n=this,i=Pn("getCurrentSpread"),r=this.getPage(t);if(!r)return Rn({left:null,right:null});var o=r.side===e.PageSide.LEFT;return(this.isRectoPage(r,t)?this.previousPage(t,u):this.nextPage(t,u)).then((function(e){var u=n.getPage(t),r=e&&e.page;r&&r.side===u.side&&(r=null),i.finish(o?{left:u,right:r}:{left:r,right:u})})),i.result()},u.nextSpread=function(t,e){var u=this,n=this.getPage(t);if(!n)return Rn(null);var i=this.isRectoPage(n,t),r=this.nextPage(t,e);return i?r:r.thenAsync((function(t){if(t){if(t.page.side===n.side)return r;var i=u.nextPage(t.position,e);return i.thenAsync((function(t){return t?i:r}))}return Rn(null)}))},u.previousSpread=function(t,e){var u=this,n=this.getPage(t);if(!n)return Rn(null);var i=this.isRectoPage(n,t),r=this.previousPage(t,e),o=n.container.previousElementSibling;return i?r.thenAsync((function(t){return t?t.page.side===n.side||t.page.container!==o?r:u.previousPage(t.position,e):Rn(null)})):r},u.navigateToEPage=function(t,e,u){var n=this,i=Pn("navigateToEPage");return this.opf.resolveEPage(t).then((function(t){t?n.findPage(t,u).thenFinish(i):i.finish(null)})),i.result()},u.navigateToFragment=function(t,e,u){var n=this,i=Pn("navigateToCFI");return this.opf.resolveFragment(t).then((function(t){t?n.findPage(t,u).thenFinish(i):i.finish(null)})),i.result()},u.navigateTo=function(t,e,u){var n=this;c.debug("Navigate to",t);var i=this.opf.getPathFromURL(H(t));if(!i){if(this.opf.opfXML&&t.match(/^#epubcfi\(/))i=this.opf.getPathFromURL(this.opf.opfXML.url);else if("#"===t.charAt(0)){var r=this.opf.documentURLTransformer.restoreURL(t);this.opf.opfXML?null==(i=this.opf.getPathFromURL(r[0]))&&(i=r[0]):i=r[0],t=r[0]+(r[1]?"#"+r[1]:"")}if(null==i)return Rn(null)}var o=this.opf.itemMapByPath[i];if(!o){if(this.opf.opfXML&&i==this.opf.getPathFromURL(this.opf.opfXML.url)){var a=t.indexOf("#");if(a>=0)return this.navigateToFragment(t.substr(a+1),e,u)}return Rn(null)}var s=Pn("navigateTo");return this.getPageViewItem(o.spineIndex).then((function(e){if(e){var i=e.xmldoc.getElement(t);n.findPage({spineIndex:o.spineIndex,pageIndex:-1,offsetInItem:i?e.xmldoc.getElementOffset(i):0},u).thenFinish(s)}else s.finish(null)})),s.result()},u.makePage=function(t,u){var n=t.instance.viewport,i=n.document.createElement("div");i.setAttribute("data-vivliostyle-page-container","true"),i.setAttribute("role","region"),i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.columnCount="1",i.style.height="99999999px",e.isDebug||(i.style.visibility="hidden",i.setAttribute("aria-hidden","true")),n.layoutBox.appendChild(i);var r=n.document.createElement("div");r.setAttribute("data-vivliostyle-bleed-box","true"),i.appendChild(r);var o=new Ji(i,r);if(o.spineIndex=t.item.spineIndex,o.position=u,o.offset=t.instance.getPosition(u),0===o.offset){var a=this.opf.documentURLTransformer.transformFragment("",t.item.src);r.setAttribute("id",a),o.registerElementWithId(r,a)}if(n!==this.viewport){var s=Ot(this.viewport.width,this.viewport.height,n.width,n.height),l=Pi(null,new Sn(s,null),"");o.delayedItems.push(new $i(i,"transform",l))}return o},u.makeObjectView=function(t,e,u,n){var i=e.getAttribute("data"),r=null;if(i){i=K(i,t.url);var o=e.getAttribute("media-type");if(!o){var a=this.opf.getPathFromURL(i);if(a){var s=this.opf.itemMapByPath[a];s&&(o=s.mediaType)}}if(o){var l=this.opf.bindings[o];if(l){(r=this.viewport.document.createElement("iframe")).style.border="none";var D=st(i),h=st(o),c=new it;c.append(l),c.append("?src="),c.append(D),c.append("&type="),c.append(h);for(var d=e.firstChild;d;d=d.nextSibling)if(1==d.nodeType){var f=d;if("param"==f.localName&&f.namespaceURI==X.XHTML){var p=f.getAttribute("name"),E=f.getAttribute("value");p&&E&&(c.append("&"),c.append(encodeURIComponent(p)),c.append("="),c.append(encodeURIComponent(E)))}}r.setAttribute("src",c.toString());var C=e.getAttribute("width");C&&r.setAttribute("width",C);var F=e.getAttribute("height");F&&r.setAttribute("height",F)}}}return r||(r=this.viewport.document.createElement("span")).setAttribute("data-adapt-process-children","true"),Rn(r)},u.makeMathJaxView=function(t,e,u,n){var i=dc();if(i){var r=u.ownerDocument,o=r.createElement("span");u.appendChild(o);var a=r.importNode(e,!0);this.resolveURLsInMathML(a,t),o.appendChild(a);var s=i.queue;s.Push(["Typeset",i,o]);var l=Pn("makeMathJaxView"),D=l.suspend();return s.Push((function(){D.schedule(o)})),l.result()}return Rn(null)},u.resolveURLsInMathML=function(t,e){if(null!=t){if(1===t.nodeType&&"mglyph"===t.tagName)for(var u=0,n=Array.from(t.attributes);u<n.length;u++){var i=n[u];if("src"===i.name){var r=K(i.nodeValue,e.url);i.namespaceURI?t.setAttributeNS(i.namespaceURI,i.name,r):t.setAttribute(i.name,r)}}t.firstChild&&this.resolveURLsInMathML(t.firstChild,e),t.nextSibling&&this.resolveURLsInMathML(t.nextSibling,e)}},u.makeCustomRenderer=function(t){var e=this;return function(u,n,i){return"object"==u.localName&&u.namespaceURI==X.XHTML?e.makeObjectView(t,u,n,i):u.namespaceURI==X.MATHML||u.dataset&&"true"==u.dataset.mathTypeset?e.makeMathJaxView(t,u,n,i):Rn(null)}},u.getPageViewItem=function(t){var e=this;if(-1===t||t>=this.opf.spine.length)return Rn(null);var u=this.spineItems[t];if(u)return Rn(u);var n=Pn("getPageViewItem"),i=this.spineItemLoadingContinuations[t];if(i){var r=n.suspend();return i.push(r),n.result()}i=this.spineItemLoadingContinuations[t]=[];var o=this.opf.spine[t],a=this.opf.store;return a.load(o.src).then((function(r){var s,l=o.itemRefElement.getAttribute("properties");l&&r.root.setAttribute("data-vivliostyle-epub-spine-properties",l),o.title=r.document.title;var D=a.getStyleForDoc(r),h=e.makeCustomRenderer(r),c=e.viewport,d=D.sizeViewport(c.width,c.height,c.fontSize,e.pref);d.width==c.width&&d.height==c.height&&d.fontSize==c.fontSize||(c=new Hh(c.window,d.fontSize,c.root,d.width,d.height));var f,p,E=null==(s=e.spineItems[0])?void 0:s.instance.isVersoFirstPage,C=e.spineItems[t-1];if(null!==o.startPage)p=f=o.startPage-1;else{if(!(t>0)||C&&C.complete){f=C?C.instance.pageNumberOffset+C.pages.length:0;var F=e.counterStore.currentPageCounters.page;p=F&&F.length?F[F.length-1]:f}else f=o.epage||t,e.opf.prePaginated||f%2!=(E?1:0)||f++,p=f;null!==o.skipPagesBefore&&(f+=o.skipPagesBefore,p+=o.skipPagesBefore)}e.counterStore.forceSetPageCounter(p);var A=new qh(D,r,e.opf.lang,c,e.clientLayout,e.fontMapper,h,e.opf.fallbackMap,f,e.opf.documentURLTransformer,e.counterStore,e.opf.pageProgression,E);A.pref=e.pref;var g=e.opf.metadata&&e.opf.metadata[hc.title];A.pubTitle=g&&g[0]&&g[0].v||"",A.docTitle=o.title||"",A.init().then((function(){e.spineItems[t]=u={item:o,xmldoc:r,instance:A,layoutPositions:[null],pages:[],complete:!1},n.finish(u),i.forEach((function(t){t.schedule(u)}))}))})),n.result()},u.removeRenderedPages=function(){for(var t,e=_(this.spineItems);!(t=e()).done;){var u=t.value;u&&u.pages.splice(0)}this.viewport.clear()},u.hasAutoSizedPages=function(){for(var t,e=_(this.spineItems);!(t=e()).done;){var u=t.value;if(u)for(var n,i=_(u.pages);!(n=i()).done;){var r=n.value;if(r.isAutoPageWidth&&r.isAutoPageHeight)return!0}}return!1},u.hasPages=function(){return this.spineItems.some((function(t){return t&&t.pages.length>0}))},u.showTOC=function(t){var e=this.opf,u=e.xhtmlToc||e.ncxToc;if(this.tocAutohide=t,!u)return Rn(null);if(this.tocView&&this.tocView.page)return this.tocView.page.container.style.visibility="visible",this.tocView.page.container.setAttribute("aria-hidden","false"),Rn(this.tocView.page);var n=Pn("showTOC");this.tocView||(this.tocView=new ic(e.store,u.src,e.lang,this.clientLayout,this.fontMapper,this.pref,this,e.fallbackMap,e.documentURLTransformer,this.counterStore));var i=this.viewport,r=Math.min(350,Math.round(.67*i.width)-16),o=i.height-6,a=i.document.createElement("div");return i.root.appendChild(a),a.style.visibility="hidden",a.style.width=r+10+"px",a.style.maxHeight=o+"px",a.setAttribute("data-vivliostyle-toc-box","true"),a.setAttribute("role","navigation"),this.tocView.showTOC(a,i,r,o,this.viewport.fontSize).then((function(t){a.style.visibility="visible",a.setAttribute("aria-hidden","false"),n.finish(t)})),n.result()},u.hideTOC=function(){this.tocView&&this.tocView.hideTOC()},u.isTOCVisible=function(){return!!this.tocView&&this.tocView.isTOCVisible()},t}();!function(t){t.SINGLE_PAGE="singlePage",t.SPREAD="spread",t.AUTO_SPREAD="autoSpread"}(fc||(fc={}));var Ac,gc=function(){function t(t,u,n,i){var r=this;this.window=void 0,this.viewportElement=void 0,this.instanceId=void 0,this.callbackFn=void 0,this.fontMapper=void 0,this.kick=void 0,this.sendCommand=void 0,this.resizeListener=void 0,this.hyperlinkListener=void 0,this.pageRuleStyleElement=void 0,this.pageSheetSizeAlreadySet=!1,this.renderTask=null,this.actions=void 0,this.readyState=void 0,this.packageURL=void 0,this.opf=void 0,this.haveZipMetadata=void 0,this.touchActive=void 0,this.touchX=void 0,this.touchY=void 0,this.needResize=void 0,this.needRefresh=void 0,this.viewportSize=void 0,this.currentPage=void 0,this.currentSpread=void 0,this.pagePosition=void 0,this.fontSize=void 0,this.zoom=void 0,this.fitToScreen=void 0,this.pageViewMode=void 0,this.waitForLoading=void 0,this.renderAllPages=void 0,this.pref=void 0,this.pageSizes=void 0,this.viewport=void 0,this.opfView=void 0,this.window=t,this.viewportElement=u,this.instanceId=n,this.callbackFn=i,u.setAttribute("data-vivliostyle-viewer-viewport",!0),e.isDebug&&u.setAttribute("data-vivliostyle-debug",!0),u.setAttribute("data-vivliostyle-viewer-status","loading");var o=t.document;this.fontMapper=new dD(o.head,u),this.init(),this.kick=function(){},this.sendCommand=function(){},this.resizeListener=function(){r.needResize=!0,r.kick()},this.pageReplacedListener=this.pageReplacedListener.bind(this),this.hyperlinkListener=function(t){},this.pageRuleStyleElement=o.getElementById("vivliostyle-page-rules"),this.actions={loadPublication:this.loadPublication,loadXML:this.loadXML,configure:this.configure,moveTo:this.moveTo,toc:this.showTOC},this.addLogListeners()}var u=t.prototype;return u.init=function(){this.readyState=e.ReadyState.LOADING,this.packageURL=[],this.opf=null,this.haveZipMetadata=!1,this.touchActive=!1,this.touchX=0,this.touchY=0,this.needResize=!1,this.needRefresh=!1,this.viewportSize=null,this.currentPage=null,this.currentSpread=null,this.pagePosition=null,this.fontSize=16,this.zoom=1,this.fitToScreen=!1,this.pageViewMode=fc.SINGLE_PAGE,this.waitForLoading=!1,this.renderAllPages=!0,this.pref={fontFamily:"serif",lineHeight:1.25,margin:8,hyphenate:!1,columnWidth:25,horizontal:!1,nightMode:!1,spreadView:!1,pageBorder:1,enabledMediaTypes:{vivliostyle:!0,print:!0},defaultPaperSize:void 0},this.pageSizes=[]},u.addLogListeners=function(){var t=this,e=r;c.addListener(e.DEBUG,(function(e){t.callback({t:"debug",content:e})})),c.addListener(e.INFO,(function(e){t.callback({t:"info",content:e})})),c.addListener(e.WARN,(function(e){t.callback({t:"warn",content:e})})),c.addListener(e.ERROR,(function(e){t.callback({t:"error",content:e})}))},u.callback=function(t){t.i=this.instanceId,this.callbackFn(t)},u.setReadyState=function(t){this.readyState!==t&&(this.readyState=t,this.viewportElement.setAttribute("data-vivliostyle-viewer-status",t),this.callback({t:"readystatechange"}))},u.loadPublication=function(t){var u=this;y.registerStartTiming("beforeRender"),this.setReadyState(e.ReadyState.LOADING);var n=t.url,i=t.fragment,r=!!t.zipmeta,o=t.authorStyleSheet,a=t.userStyleSheet;this.viewport=null;var s=Pn("loadPublication");return this.configure(t).then((function(){var t=new oc;t.init(o,a).then((function(){var e=K(Y(n),u.window.location.href);u.packageURL=[e],t.loadPubDoc(e,r).then((function(t){t?(u.opf=t,u.render(i).then((function(){s.finish(!0)}))):s.finish(!1)}))}))})),s.result()},u.loadXML=function(t){var u=this;y.registerStartTiming("beforeRender"),this.setReadyState(e.ReadyState.LOADING);var n=t.url,i=t.document,r=t.fragment,o=t.authorStyleSheet,a=t.userStyleSheet;this.viewport=null;var s=Pn("loadXML");return this.configure(t).then((function(){var t=new oc;t.init(o,a).then((function(){var e=n.map((function(t,e){return{url:K(Y(t.url),u.window.location.href),index:e,startPage:t.startPage,skipPagesBefore:t.skipPagesBefore}}));u.packageURL=e.map((function(t){return t.url})),u.opf=new Ec(t,""),u.opf.initWithChapters(e,i).then((function(){u.render(r).then((function(){s.finish(!0)}))}))}))})),s.result()},u.render=function(t){var e=this;return this.cancelRenderingTask(),(t?this.opf.resolveFragment(t).thenAsync((function(t){return e.pagePosition=t,Rn(!0)})):Rn(!0)).thenAsync((function(){return y.registerEndTiming("beforeRender"),e.resize()}))},u.resolveLength=function(t){var e,u=parseFloat(t);if("string"==typeof t&&(e=t.match(/[a-z]+$/))){var n=e[0];if("em"===n||"rem"===n)return u*this.fontSize;if("ex"===n)return u*zt.ex*this.fontSize/zt.em;var i=zt[n];if(i)return u*i}return u},u.configure=function(t){if("boolean"==typeof t.autoresize&&(t.autoresize?(this.viewportSize=null,this.window.addEventListener("resize",this.resizeListener,!1),this.needResize=!0):this.window.removeEventListener("resize",this.resizeListener,!1)),"number"==typeof t.fontSize){var e=t.fontSize;e>=5&&e<=72&&this.fontSize!=e&&(this.fontSize=e,this.needResize=!0)}if("object"==typeof t.viewport&&t.viewport){var u=t.viewport,n={marginLeft:this.resolveLength(u["margin-left"])||0,marginRight:this.resolveLength(u["margin-right"])||0,marginTop:this.resolveLength(u["margin-top"])||0,marginBottom:this.resolveLength(u["margin-bottom"])||0,width:this.resolveLength(u.width)||0,height:this.resolveLength(u.height)||0};(n.width>=200||n.height>=200)&&(this.window.removeEventListener("resize",this.resizeListener,!1),this.viewportSize=n,this.needResize=!0)}return"boolean"==typeof t.hyphenate&&(this.pref.hyphenate=t.hyphenate,this.needResize=!0),"boolean"==typeof t.horizontal&&(this.pref.horizontal=t.horizontal,this.needResize=!0),"boolean"==typeof t.nightMode&&(this.pref.nightMode=t.nightMode,this.needResize=!0),"number"==typeof t.lineHeight&&(this.pref.lineHeight=t.lineHeight,this.needResize=!0),"number"==typeof t.columnWidth&&(this.pref.columnWidth=t.columnWidth,this.needResize=!0),"string"==typeof t.fontFamily&&(this.pref.fontFamily=t.fontFamily,this.needResize=!0),"boolean"==typeof t.load&&(this.waitForLoading=t.load),"boolean"==typeof t.renderAllPages&&(this.renderAllPages=t.renderAllPages),"string"==typeof t.userAgentRootURL&&(G(t.userAgentRootURL.replace(/resources\/?$/,"")),j(t.userAgentRootURL)),"string"==typeof t.rootURL&&(G(t.rootURL),j(z+"resources/")),"string"==typeof t.pageViewMode&&t.pageViewMode!==this.pageViewMode&&(this.pageViewMode=t.pageViewMode,this.needResize=!0),"number"==typeof t.pageBorder&&t.pageBorder!==this.pref.pageBorder&&(this.viewport=null,this.pref.pageBorder=t.pageBorder,this.needResize=!0),"number"==typeof t.zoom&&t.zoom!==this.zoom&&(this.zoom=t.zoom,this.needRefresh=!0),"boolean"==typeof t.fitToScreen&&t.fitToScreen!==this.fitToScreen&&(this.fitToScreen=t.fitToScreen,this.needRefresh=!0),"object"==typeof t.defaultPaperSize&&"number"==typeof t.defaultPaperSize.width&&"number"==typeof t.defaultPaperSize.height&&(this.viewport=null,this.pref.defaultPaperSize=t.defaultPaperSize,this.needResize=!0),"boolean"==typeof t.allowScripts&&t.allowScripts!==Nh&&(Nh=t.allowScripts,this.needRefresh=!0),this.configurePlugins(t),Rn(!0)},u.configurePlugins=function(t){var u=this;C(e.HOOKS.CONFIGURATION).forEach((function(e){var n=e(t);u.needResize=n.needResize||u.needResize,u.needRefresh=n.needRefresh||u.needRefresh}))},u.pageReplacedListener=function(t){var e=this.currentPage,u=this.currentSpread,n=t.target;u?u.left!==n&&u.right!==n||this.showCurrent(t.newPage):e===t.target&&this.showCurrent(t.newPage)},u.forCurrentPages=function(t){var e=[];this.currentPage&&e.push(this.currentPage),this.currentSpread&&(e.push(this.currentSpread.left),e.push(this.currentSpread.right)),e.forEach((function(e){e&&t(e)}))},u.removePageListeners=function(){var t=this;this.forCurrentPages((function(e){e.removeEventListener("hyperlink",t.hyperlinkListener,!1),e.removeEventListener("replaced",t.pageReplacedListener,!1)}))},u.hidePages=function(){this.removePageListeners(),this.forCurrentPages((function(t){et(t.container,"display","none"),t.container.setAttribute("aria-hidden","true")})),this.currentPage=null,this.currentSpread=null},u.showSinglePage=function(t){t.addEventListener("hyperlink",this.hyperlinkListener,!1),t.addEventListener("replaced",this.pageReplacedListener,!1),et(t.container,"visibility","visible"),et(t.container,"display","block"),t.container.setAttribute("aria-hidden","false")},u.showPage=function(t){this.hidePages(),this.currentPage=t,t.container.style.marginLeft="",t.container.style.marginRight="",this.showSinglePage(t)},u.showSpread=function(t){if(this.hidePages(),this.currentSpread=t,t.left&&t.right){var e=parseFloat(t.left.container.style.width),u=parseFloat(t.right.container.style.width);e&&u&&e!==u&&(e<u?t.left.container.style.marginLeft=u-e+"px":t.right.container.style.marginRight=e-u+"px")}t.left&&(this.showSinglePage(t.left),t.right?t.left.container.removeAttribute("data-vivliostyle-unpaired-page"):t.left.container.setAttribute("data-vivliostyle-unpaired-page",!0)),t.right&&(this.showSinglePage(t.right),t.left?t.right.container.removeAttribute("data-vivliostyle-unpaired-page"):t.right.container.setAttribute("data-vivliostyle-unpaired-page",!0))},u.reportPosition=function(){var t=this,e=Pn("reportPosition");return this.opf.getCFI(this.pagePosition.spineIndex,this.pagePosition.offsetInItem).then((function(u){var n=t.currentPage;(t.waitForLoading&&n.fetchers.length>0?Xn(n.fetchers):Rn(!0)).then((function(){t.sendLocationNotification(n,u).thenFinish(e)}))})),e.result()},u.createViewport=function(){var t=this.viewportElement;if(this.viewportSize){var e=this.viewportSize;return t.style.marginLeft=e.marginLeft+"px",t.style.marginRight=e.marginRight+"px",t.style.marginTop=e.marginTop+"px",t.style.marginBottom=e.marginBottom+"px",new Hh(this.window,this.fontSize,t,e.width,e.height)}return new Hh(this.window,this.fontSize,t)},u.resolveSpreadView=function(t){switch(this.pageViewMode){case fc.SINGLE_PAGE:return!1;case fc.SPREAD:return!0;default:return t.width/t.height>=1.45&&t.width>800}},u.updateSpreadView=function(t){this.pref.spreadView=t,this.viewportElement.setAttribute("data-vivliostyle-spread-view",t.toString())},u.sizeIsGood=function(){var t=this.createViewport(),e=this.resolveSpreadView(t),u=this.pref.spreadView!==e;return this.updateSpreadView(e),!(this.viewportSize||!this.viewport||this.viewport.fontSize!=this.fontSize||(u||t.width!=this.viewport.width||t.height!=this.viewport.height)&&(u||t.width!=this.viewport.width||t.height==this.viewport.height||!/Android|iPhone|iPad|iPod/.test(navigator.userAgent))&&(!this.opfView||!this.opfView.hasPages()||this.opfView.hasAutoSizedPages()||(this.viewport.width=t.width,this.viewport.height=t.height,this.needRefresh=!0,0)))},u.setPageSize=function(t,e,u,n){this.pageSizes[n]=t,this.setPageSizePageRules(e,u,n)},u.setPageSizePageRules=function(t,e,u){if(!this.pageSheetSizeAlreadySet&&this.pageRuleStyleElement){var n="";Object.keys(t).forEach((function(e){n+="@page "+e+"{margin:0;size:";var u=t[e];n+=u.width+"px "+u.height+"px;}"})),this.pageRuleStyleElement.textContent=n,this.pageSheetSizeAlreadySet=!0}},u.removePageSizePageRules=function(){this.pageRuleStyleElement&&(this.pageRuleStyleElement.textContent="",this.pageSheetSizeAlreadySet=!1)},u.reset=function(){var t=!1,e=!1;this.opfView&&(t=this.opfView.isTOCVisible(),e=this.opfView.tocAutohide,this.opfView.hideTOC(),this.opfView.removeRenderedPages()),this.removePageSizePageRules(),this.viewport=this.createViewport(),this.viewport.resetZoom(),this.opfView=new Fc(this.opf,this.viewport,this.fontMapper,this.pref,this.setPageSize.bind(this)),t&&this.sendCommand({a:"toc",v:"show",autohide:e})},u.showCurrent=function(t,u){var n=this;return this.needRefresh=!1,this.removePageListeners(),this.pref.spreadView?this.opfView.getSpread(this.pagePosition,u).thenAsync((function(u){return n.showSpread(u),n.setSpreadZoom(u),n.currentPage=t.side===e.PageSide.LEFT?u.left:u.right,Rn(null)})):(this.showPage(t),this.setPageZoom(t),this.currentPage=t,Rn(null))},u.setPageZoom=function(t){var e=this.getAdjustedZoomFactor(t.dimensions);this.viewport.zoom(t.dimensions.width,t.dimensions.height,e)},u.setSpreadZoom=function(t){var e=this.getSpreadDimensions(t);this.viewport.zoom(e.width,e.height,this.getAdjustedZoomFactor(e))},u.getAdjustedZoomFactor=function(t){return this.fitToScreen?this.calculateZoomFactorToFitInsideViewPort(t):this.zoom},u.getSpreadDimensions=function(t){var e=0,u=0;return t.left&&(e+=t.left.dimensions.width,u=t.left.dimensions.height),t.right&&(e+=t.right.dimensions.width,u=Math.max(u,t.right.dimensions.height)),t.left&&t.right&&(e+=2*this.pref.pageBorder,e+=Math.abs(t.left.dimensions.width-t.right.dimensions.width)),{width:e,height:u}},u.queryZoomFactor=function(t){if(!this.currentPage)throw new Error("no page exists.");var e;if(t===Ac.FIT_INSIDE_VIEWPORT)return e=this.pref.spreadView?this.getSpreadDimensions(this.currentSpread):this.currentPage.dimensions,this.calculateZoomFactorToFitInsideViewPort(e);throw new Error("unknown zoom type: "+t)},u.calculateZoomFactorToFitInsideViewPort=function(t){return Math.min(this.viewport.width/t.width,this.viewport.height/t.height)},u.cancelRenderingTask=function(){this.renderTask&&this.renderTask.interrupt(new vc),this.renderTask=null},u.resize=function(){var t=this;if(this.needResize=!1,this.needRefresh=!1,this.sizeIsGood())return Rn(!0);this.setReadyState(e.ReadyState.LOADING),this.cancelRenderingTask();var u=In().getScheduler().run((function(){return Ln("resize",(function(n){t.opf?(t.renderTask=u,y.registerStartTiming("render (resize)"),t.reset(),t.pagePosition&&(0==t.pagePosition.pageIndex&&0==t.pagePosition.offsetInItem||(t.pagePosition.pageIndex=-1)),t.opf.setEPageCountMode(t.renderAllPages),t.opfView.renderPagesUpto(t.pagePosition,!t.renderAllPages).then((function(i){i?(t.pagePosition=i.position,t.showCurrent(i.page,!0).then((function(){t.setReadyState(e.ReadyState.INTERACTIVE),t.opf.countEPages((function(e){var u={t:"nav",epageCount:e,first:t.currentPage.isFirstPage,last:t.currentPage.isLastPage,metadata:t.opf.metadata,docTitle:t.opf.spine[t.pagePosition.spineIndex].title};(t.currentPage.isFirstPage||0==t.pagePosition.pageIndex&&t.opf.spine[t.pagePosition.spineIndex].epage)&&(u.epage=t.opf.spine[t.pagePosition.spineIndex].epage),t.callback(u)})).then((function(){t.reportPosition().then((function(i){(t.renderAllPages?t.opfView.renderAllPages():Rn(null)).then((function(){t.renderTask===u&&(t.renderTask=null),y.registerEndTiming("render (resize)"),Nh&&xh(t.window)?function(t){if(!Nh)return Rn(!1);var e=Pn("loadScripts");return e.loop((function(){return 0===bh.length?Rn(!1):Th(bh.shift(),t,{atEnd:!0}).thenReturn(bh.length>0)})).then((function(){c.debug("dispatchEvent: DOMContentLoaded (window)"),t.dispatchEvent(new Event("DOMContentLoaded")),c.debug("dispatchEvent: load (window)"),t.dispatchEvent(new Event("load")),e.finish(!0)})),e.result()}(t.window).then((function(){t.renderAllPages&&t.setReadyState(e.ReadyState.COMPLETE),t.callback({t:"loaded"}),n.finish(i)})):(t.renderAllPages&&t.setReadyState(e.ReadyState.COMPLETE),t.callback({t:"loaded"}),n.finish(i))}))}))}))}))):n.finish(!1)}))):n.finish(!1)}),(function(t,e){if(!(e instanceof vc))throw e;y.registerEndTiming("render (resize)"),c.debug(e.message)}))}));return Rn(!0)},u.sendLocationNotification=function(t,e){var u=this,n=Pn("sendLocationNotification"),i={t:"nav",first:t.isFirstPage,last:t.isLastPage,metadata:this.opf.metadata,docTitle:this.opf.spine[t.spineIndex].title};return this.opf.getEPageFromPosition(this.pagePosition).then((function(t){i.epage=t,i.epageCount=u.opf.epageCount,e&&(i.cfi=e),u.callback(i),n.finish(!0)})),n.result()},u.getCurrentPageProgression=function(){return this.opfView?this.opfView.getCurrentPageProgression(this.pagePosition):null},u.moveTo=function(t){var u,n=this;if(this.readyState!==e.ReadyState.COMPLETE&&"next"!==t.where&&this.setReadyState(e.ReadyState.LOADING),"string"==typeof t.where){var i;switch(t.where){case"next":i=this.pref.spreadView?this.opfView.nextSpread:this.opfView.nextPage;break;case"previous":i=this.pref.spreadView?this.opfView.previousSpread:this.opfView.previousPage;break;case"last":i=this.opfView.lastPage;break;case"first":i=this.opfView.firstPage;break;default:return Rn(!0)}i&&(u=function(){return i.call(n.opfView,n.pagePosition,!n.renderAllPages)})}else if("number"==typeof t.epage){var r=t.epage;u=function(){return n.opfView.navigateToEPage(r,n.pagePosition,!n.renderAllPages)}}else{if("string"!=typeof t.url)return Rn(!0);var o=t.url;u=function(){return n.opfView.navigateTo(o,n.pagePosition,!n.renderAllPages)}}var a=Pn("moveTo");return u.call(this.opfView).then((function(t){var u;if(t){n.pagePosition=t.position;var i=Pn("moveTo.showCurrent");u=i.result(),n.showCurrent(t.page,!n.renderAllPages).then((function(){n.reportPosition().thenFinish(i)}))}else u=Rn(!0);u.then((function(t){n.readyState===e.ReadyState.LOADING&&n.setReadyState(e.ReadyState.INTERACTIVE),a.finish(t)}))})),a.result()},u.showTOC=function(t){var e=this,u=!!t.autohide,n=t.v,i=this.opfView.isTOCVisible(),r=u!=this.opfView.tocAutohide&&"hide"!=n;if(i){if("show"==n&&!r)return Rn(!0)}else if("hide"==n)return Rn(!0);if(i&&"show"!=n)return this.opfView.hideTOC(),Rn(!0);var o=Pn("showTOC");return this.opfView.showTOC(u).then((function(t){t&&(r&&(t.listeners={}),u&&t.addEventListener("hyperlink",(function(){e.opfView.hideTOC()}),!1),t.addEventListener("hyperlink",e.hyperlinkListener,!1)),o.finish(!0)})),o.result()},u.runCommand=function(t){var e=this,u=t.a||"";return Ln("runCommand",(function(n){var i=e.actions[u];i?i.call(e,t).then((function(){e.callback({t:"done",a:u}),n.finish(!0)})):(c.error("No such action:",u),n.finish(!0))}),(function(t,e){c.error(e,"Error during action:",u),t.finish(!0)}))},u.initEmbed=function(t){var e,u=this,n=mc(t),i=null,r=this;e=function(){var t=Pn("commandLoop"),e=In().getScheduler();return r.hyperlinkListener=function(t){var u=t,n="#"===u.href.charAt(0)||r.packageURL.some((function(t){return u.href.substr(0,t.length)==t}));if(n){t.preventDefault();var i={t:"hyperlink",href:u.href,internal:n};e.run((function(){return r.callback(i),Rn(!0)}))}},t.loopWithFrame((function(t){if(r.needResize)r.resize().then((function(){t.continueLoop()}));else if(r.needRefresh)r.currentPage&&r.showCurrent(r.currentPage,!0).then((function(){t.continueLoop()}));else if(n){var e=n;n=null,r.runCommand(e).then((function(){t.continueLoop()}))}else{var o=Pn("waitForCommand");i=o.suspend(u),o.result().then((function(){t.continueLoop()}))}})).thenFinish(t),t.result()},(Tn?Tn.getScheduler():xn||new kn(new On)).run(e,void 0),r.kick=function(){var t=i;t&&(i=null,t.schedule(!0))},r.sendCommand=function(t){return!n&&(n=mc(t),r.kick(),!0)},this.window.adapt_command=r.sendCommand},t}();(Ac||(Ac={})).FIT_INSIDE_VIEWPORT="fit inside viewport";var vc=function(t){function e(){var u;return(u=t.call(this)||this).name="RenderingCanceledError",u.message="Page rendering has been canceled",u.stack=void 0,Object.setPrototypeOf(O(u),e.prototype),u.stack=(new Error).stack,u}return T(e,t),e}(L(Error));function mc(t){return"string"==typeof t?V(t):t}var Bc=e.PageProgression;function wc(t){var e={};return Object.keys(t).forEach((function(u){var n=t[u];switch(u){case"autoResize":e.autoresize=n;break;case"pageBorderWidth":e.pageBorder=n;break;default:e[u]=n}})),e}var yc,Nc=function(){function t(t,e){this.settings=void 0,this.initialized=!1,this.adaptViewer_=void 0,this.options=void 0,this.eventTarget=void 0,this.readyState=void 0,this.settings=t,a(t.debug),this.adaptViewer_=new gc(t.window||window,t.viewportElement,"main",this.dispatcher.bind(this)),this.options={autoResize:!0,fontSize:16,pageBorderWidth:1,renderAllPages:!0,pageViewMode:fc.AUTO_SPREAD,zoom:1,fitToScreen:!1,defaultPaperSize:void 0,allowScripts:!0},e&&this.setOptions(e),this.eventTarget=new Et,Object.defineProperty(this,"readyState",{get:function(){return this.adaptViewer_.readyState}})}var u=t.prototype;return u.setOptions=function(t){var e=Object.assign({a:"configure"},wc(t));this.adaptViewer_.sendCommand(e),Object.assign(this.options,t)},u.dispatcher=function(t){var e={type:t.t},u=t;Object.keys(u).forEach((function(t){"t"!==t&&(e[t]=u[t])})),this.eventTarget.dispatchEvent(e)},u.addListener=function(t,e){this.eventTarget.addEventListener(t,e,!1)},u.removeListener=function(t,e){this.eventTarget.removeEventListener(t,e,!1)},u.loadDocument=function(t,e,u){t||this.eventTarget.dispatchEvent({type:"error",content:"No URL specified"}),this.loadDocumentOrPublication(t,null,e,u)},u.loadPublication=function(t,e,u){t||this.eventTarget.dispatchEvent({type:"error",content:"No URL specified"}),this.loadDocumentOrPublication(null,t,e,u)},u.loadDocumentOrPublication=function(t,e,u,n){var i=u||{};function r(t){return t?t.map((function(t){return{url:t.url||null,text:t.text||null}})):void 0}var o=r(i.authorStyleSheet),a=r(i.userStyleSheet);n&&Object.assign(this.options,n);var s=Object.assign({a:t?"loadXML":"loadPublication",userAgentRootURL:this.settings.userAgentRootURL,url:bc(t)||e,document:i.documentObject,fragment:i.fragment,authorStyleSheet:o,userStyleSheet:a},wc(this.options));this.initialized?this.adaptViewer_.sendCommand(s):(this.initialized=!0,this.adaptViewer_.initEmbed(s))},u.getCurrentPageProgression=function(){return this.adaptViewer_.getCurrentPageProgression()},u.resolveNavigation=function(t){switch(t){case e.Navigation.LEFT:return this.getCurrentPageProgression()===Bc.LTR?e.Navigation.PREVIOUS:e.Navigation.NEXT;case e.Navigation.RIGHT:return this.getCurrentPageProgression()===Bc.LTR?e.Navigation.NEXT:e.Navigation.PREVIOUS;default:return t}},u.navigateToPage=function(t,u){t===e.Navigation.EPAGE?this.adaptViewer_.sendCommand({a:"moveTo",epage:u}):this.adaptViewer_.sendCommand({a:"moveTo",where:this.resolveNavigation(t)})},u.navigateToInternalUrl=function(t){this.adaptViewer_.sendCommand({a:"moveTo",url:t})},u.isTOCVisible=function(){return this.adaptViewer_.opfView&&this.adaptViewer_.opfView.opf&&(this.adaptViewer_.opfView.opf.xhtmlToc||this.adaptViewer_.opfView.opf.ncxToc)?!!this.adaptViewer_.opfView.isTOCVisible():null},u.showTOC=function(t,e){this.adaptViewer_.sendCommand({a:"toc",v:null==t?"toggle":t?"show":"hide",autohide:e})},u.queryZoomFactor=function(t){return this.adaptViewer_.queryZoomFactor(t)},u.getPageSizes=function(){return this.adaptViewer_.pageSizes},u.getTOC=function(){var t,e;return null==(t=this.adaptViewer_.opfView)||null==(e=t.tocView)?void 0:e.getTOC()},u.getMetadata=function(){return this.adaptViewer_.opf.getMetadata()},u.getCover=function(){return this.adaptViewer_.opf.cover},t}();function bc(t){function e(t){return"number"==typeof t?t:null}function u(t){return"string"==typeof t?{url:t,startPage:null,skipPagesBefore:null}:{url:t.url,startPage:e(t.startPage),skipPagesBefore:e(t.skipPagesBefore)}}return Array.isArray(t)?t.map(u):t?[u(t)]:null}e.Navigation=void 0,(yc=e.Navigation||(e.Navigation={})).PREVIOUS="previous",yc.NEXT="next",yc.LEFT="left",yc.RIGHT="right",yc.FIRST="first",yc.LAST="last",yc.EPAGE="epage";var Sc=Ac,Tc=fc;y.forceRegisterEndTiming("load_vivliostyle");var xc=function(){function t(t,e){var u=e.title,n=void 0===u?"":u,i=e.printCallback,r=void 0===i?function(t){return t.print()}:i,o=e.hideIframe,a=void 0===o||o,s=e.removeIframe,l=void 0===s||s;this.htmlDoc=void 0,this.title=void 0,this.printCallback=void 0,this.hideIframe=void 0,this.removeIframe=void 0,this.iframe=void 0,this.iframeWin=void 0,this.window=void 0,this.htmlDoc=t,this.title=n,this.printCallback=r,this.hideIframe=a,this.removeIframe=l}var e=t.prototype;return e.init=function(){this.iframe=document.createElement("iframe"),this.hideIframe&&(this.iframe.style.width="0",this.iframe.style.height="0",this.iframe.style.borderWidth="0"),this.window=window,this.window.printInstance=this,this.iframe.srcdoc="\n <!DOCTYPE html>\n <html data-vivliostyle-paginated=\"true\">\n <head>\n <meta charset='utf-8'/>\n <meta name='viewport' content='width=device-width, initial-scale=1.0'/>\n <title>"+this.title+"</title>\n <style>"+Yn+"</style>\n <style>"+Kn+"</style>\n <style>\n html[data-vivliostyle-paginated] {\n width: 100%;\n height: 100%;\n }\n html[data-vivliostyle-paginated] body,\n html[data-vivliostyle-paginated] [data-vivliostyle-viewer-viewport] {\n width: 100% !important;\n height: 100% !important;\n }\n html[data-vivliostyle-paginated],\n html[data-vivliostyle-paginated] body {\n margin: 0;\n padding: 0;\n }\n </style>\n <style id='vivliostyle-page-rules'></style>\n </head>\n <body onload='parent.printInstance.runInIframe(window)'>\n <div id=\"vivliostyle-viewer-viewport\"></div>\n </body>\n </html>",document.body.appendChild(this.iframe)},e.runInIframe=function(t){var e=this;return this.iframeWin=t,this.preparePrint().then((function(){return e.browserPrint()})).then((function(){return e.cleanUp()}))},e.preparePrint=function(){this.iframeWin.document.title=this.title;var t=new Blob([this.htmlDoc],{type:"text/html"}),e=URL.createObjectURL(t),u=new Nc({viewportElement:this.iframeWin.document.body.firstElementChild,window:this.iframeWin,debug:!0},{defaultPaperSize:{width:794,height:1122}});return new Promise((function(t){u.addListener("readystatechange",(function(){"complete"===u.readyState&&t()})),u.loadDocument({url:e})}))},e.browserPrint=function(){this.printCallback(this.iframeWin)},e.cleanUp=function(){delete this.window.printInstance,this.removeIframe&&this.iframe.parentElement.removeChild(this.iframe)},t}();e.CoreViewer=Nc,e.PageViewMode=Tc,e.Profiler=A,e.TextPolyfillCss=Jn,e.UserAgentBaseCss=Zn,e.UserAgentPageCss=Qn,e.UserAgentXml=$n,e.ValidationTxt=qn,e.VivliostyleViewportCss=Yn,e.VivliostyleViewportScreenCss=Kn,e.ZoomType=Sc,e.getHooksForName=C,e.pageProgressionOf=s,e.plugin=F,e.printHTML=function(t,e){new xc(t,e).init()},e.profile=N,e.profiler=y,e.registerHook=p,e.removeHook=E,e.setDebug=a},h(c={exports:{}},c.exports),c.exports);f.isDebug,f.PageProgression,f.PageSide,f.ReadyState,f.HOOKS,f.Navigation,f.CoreViewer,f.PageViewMode,f.Profiler,f.TextPolyfillCss,f.UserAgentBaseCss,f.UserAgentPageCss,f.UserAgentXml,f.ValidationTxt,f.VivliostyleViewportCss,f.VivliostyleViewportScreenCss,f.ZoomType,f.getHooksForName,f.pageProgressionOf,f.plugin;var p=f.printHTML;f.profile,f.profiler,f.registerHook,f.removeHook,f.setDebug;export{p as printHTML};
10
10
  //# sourceMappingURL=index.es6.js.map