tweb/public/2.67fe5109f1ffeaa937f9.chun...

2 lines
11 KiB
JavaScript
Raw Normal View History

2022-04-15 14:58:59 +02:00
(this.webpackJsonp=this.webpackJsonp||[]).push([[2],{104:function(t,e,i){"use strict";function n(t,e){return t.closest(`[${e}]`)}i.d(e,"a",(function(){return n}))},105:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"a",(function(){return a}));const n={bold:{match:'[style*="bold"], [style*="font-weight: 700"], [style*="font-weight: 600"], [style*="font-weight:700"], [style*="font-weight:600"], b, strong',entityName:"messageEntityBold"},underline:{match:'[style*="underline"], u, ins',entityName:"messageEntityUnderline"},italic:{match:'[style*="italic"], i, em',entityName:"messageEntityItalic"},monospace:{match:'[style*="monospace"], [face="monospace"], pre',entityName:"messageEntityPre"},strikethrough:{match:'[style*="line-through"], strike, del, s',entityName:"messageEntityStrike"},link:{match:"A:not(.follow)",entityName:"messageEntityTextUrl"},mentionName:{match:"A.follow",entityName:"messageEntityMentionName"},spoiler:{match:'[style*="spoiler"]',entityName:"messageEntitySpoiler"}},s=new Set(["DIV","P","BR","LI","SECTION","H6","H5","H4","H3","H2","H1","TR"]);function a(t,e,i,o,r,l,u={offset:0}){if(3===t.nodeType){let e=t.nodeValue;if(o===t?i.push(e.substr(0,r)+""+e.substr(r)):i.push(e),l&&e.length&&t.parentNode){const i=t.parentElement;for(const t in n){const s=n[t],a=i.closest(s.match+", [contenteditable]");null===(null==a?void 0:a.getAttribute("contenteditable"))&&("messageEntityTextUrl"===s.entityName?l.push({_:s.entityName,url:a.href,offset:u.offset,length:e.length}):"messageEntityMentionName"===s.entityName?l.push({_:s.entityName,offset:u.offset,length:e.length,user_id:a.dataset.follow.toUserId()}):l.push({_:s.entityName,offset:u.offset,length:e.length}))}}return void(u.offset+=e.length)}if(1!==t.nodeType)return;const c=o===t,h=s.has(t.tagName);if(h&&i.length)e.push(i.join("")),i.splice(0,i.length),++u.offset;else if(t instanceof HTMLImageElement){const e=t.alt;e&&(i.push(e),u.offset+=e.length)}c&&!r&&i.push("");const d=t.matches('[style*="table-cell"], th, td'),p=null==l?void 0:l.length;let m=t.firstChild;for(;m;)a(m,e,i,o,r,l,u),m=m.nextSibling;if(c&&r&&i.push(""),d&&t.nextSibling&&(i.push(" "),++u.offset,void 0!==p))for(let t=p,e=l.length;t<e;++t)++l[t].length;const f=i.length;h&&f&&(e.push(i.join("")),i.splice(0,f),++u.offset),f&&"P"===t.tagName&&t.nextSibling&&(e.push(""),++u.offset)}},114:function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(94);function s(t){return t.hasAttribute("contenteditable")||"INPUT"!==t.tagName?!Object(n.a)(t,!1).value.trim():!t.value.trim()}},184:function(t,e,i){"use strict";i.d(e,"a",(function(){return l}));var n=i(9),s=i(46),a=function(t,e,i,n){return new(i||(i=Promise))((function(s,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function r(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,r)}l((n=n.apply(t,e||[])).next())}))};var o=new class{constructor(){this.blobSupported=!0;try{Object(s.a)([],"")}catch(t){this.blobSupported=!1}}isAvailable(){return this.blobSupported}getFakeFileWriter(t,e,i){let n=new Uint8Array(e);return{write:(t,e)=>a(this,void 0,void 0,(function*(){if(!this.blobSupported)throw!1;n.set(t,e)})),truncate:()=>{n=new Uint8Array},trim:t=>{n=n.slice(0,t)},finalize:(e=!0)=>{const a=Object(s.a)(n,t);return e&&i&&i(a),a},getParts:()=>n,replaceParts:t=>{n=t}}}},r=function(t,e,i,n){return new(i||(i=Promise))((function(s,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function r(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,r)}l((n=n.apply(t,e||[])).next())}))};class l{constructor(t){this.dbName=t,this.useStorage=!0,n.a.test&&(this.dbName+="_test"),l.STORAGES.length&&(this.useStorage=l.STORAGES[0].useStorage),this.openDatabase(),l.STORAGES.push(this)}openDatabase(){var t;return null!==(t=this.openDbPromise)&&void 0!==t?t:this.openDbPromise=caches.open(this.dbName)}delete(t){return this.timeoutOperation(e=>e.delete("/"+t))}deleteAll(){return caches.dele
//# sourceMappingURL=2.67fe5109f1ffeaa937f9.chunk.js.map