Module 244767

2,501 characters · in e76b0f3552014092.js
Dependencies
Required by (3)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(t,e,r){"use strict";var n=r(414501),i=r(387739),o=r(68055),a=r(617179),s=r(45069),u=r(225758),c=r(279998),l=r(661551),f=r(116740),p=r(396276),h=f.List,d=f.Record,g=f.Repeat;t.exports=function(t){function e(){return t.apply(this,arguments)||this}e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t;var r=e.prototype;return r.getEntityMap=function(){return s},r.getBlockMap=function(){return this.get("blockMap")},r.getSelectionBefore=function(){return this.get("selectionBefore")},r.getSelectionAfter=function(){return this.get("selectionAfter")},r.getBlockForKey=function(t){return this.getBlockMap().get(t)},r.getKeyBefore=function(t){return this.getBlockMap().reverse().keySeq().skipUntil(function(e){return e===t}).skip(1).first()},r.getKeyAfter=function(t){return this.getBlockMap().keySeq().skipUntil(function(e){return e===t}).skip(1).first()},r.getBlockAfter=function(t){return this.getBlockMap().skipUntil(function(e,r){return r===t}).skip(1).first()},r.getBlockBefore=function(t){return this.getBlockMap().reverse().skipUntil(function(e,r){return r===t}).skip(1).first()},r.getBlocksAsArray=function(){return this.getBlockMap().toArray()},r.getFirstBlock=function(){return this.getBlockMap().first()},r.getLastBlock=function(){return this.getBlockMap().last()},r.getPlainText=function(t){return this.getBlockMap().map(function(t){return t?t.getText():""}).join(t||"\n")},r.getLastCreatedEntityKey=function(){return s.__getLastCreatedEntityKey()},r.hasText=function(){var t=this.getBlockMap();return t.size>1||escape(t.first().getText()).replace(/%u200B/g,"").length>0},r.createEntity=function(t,e,r){return s.__create(t,e,r),this},r.mergeEntityData=function(t,e){return s.__mergeData(t,e),this},r.replaceEntityData=function(t,e){return s.__replaceData(t,e),this},r.addEntity=function(t){return s.__add(t),this},r.getEntity=function(t){return s.__get(t)},e.createFromBlockArray=function(t,r){var i=Array.isArray(t)?t:t.contentBlocks,o=n.createFromArray(i),a=o.isEmpty()?new u:u.createEmpty(o.first().getKey());return new e({blockMap:o,entityMap:r||s,selectionBefore:a,selectionAfter:a})},e.createFromText=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/\r\n?|\n/g,n=t.split(r).map(function(t){return t=p(t),new(l("draft_tree_data_support")?a:o)({key:c(),text:t,type:"unstyled",characterList:h(g(i.EMPTY,t.length))})});return e.createFromBlockArray(n)},e}(d({entityMap:null,blockMap:null,selectionBefore:null,selectionAfter:null}))}