// // Copyright 2020 FoxyUtils ehf. All rights reserved. // // This is a commercial product and requires a license to operate. // A trial license can be obtained at https://unidoc.io // // DO NOT EDIT: generated by unitwist Go source code obfuscator. // // Use of this source code is governed by the UniDoc End User License Agreement // terms that can be accessed at https://unidoc.io/eula/ package cmap ;import (_d "bufio";_ga "bytes";_ge "encoding/hex";_da "errors";_e "fmt";_dg "github.com/unidoc/unipdf/v3/common";_a "github.com/unidoc/unipdf/v3/core";_ee "github.com/unidoc/unipdf/v3/internal/cmap/bcmaps";_c "io";_fe "sort";_g "strconv";_b "strings";_ed "unicode/utf16";);type cmapFloat struct{_aag float64 };func (_ffbg *cMapParser )skipSpaces ()(int ,error ){_ffg :=0;for {_beef ,_aaf :=_ffbg ._afd .Peek (1);if _aaf !=nil {return 0,_aaf ;};if _a .IsWhiteSpace (_beef [0]){_ffbg ._afd .ReadByte ();_ffg ++;}else {break ;};};return _ffg ,nil ;};func (_bacc *cMapParser )parseName ()(cmapName ,error ){_agd :="";_dcb :=false ;for {_fgaa ,_bdfa :=_bacc ._afd .Peek (1);if _bdfa ==_c .EOF {break ;};if _bdfa !=nil {return cmapName {_agd },_bdfa ;};if !_dcb {if _fgaa [0]=='/'{_dcb =true ;_bacc ._afd .ReadByte ();}else {_dg .Log .Debug ("\u0045\u0052\u0052OR\u003a\u0020\u004e\u0061\u006d\u0065\u0020\u0073\u0074a\u0072t\u0069n\u0067 \u0077\u0069\u0074\u0068\u0020\u0025\u0073\u0020\u0028\u0025\u0020\u0078\u0029",_fgaa ,_fgaa );return cmapName {_agd },_e .Errorf ("\u0069n\u0076a\u006c\u0069\u0064\u0020\u006ea\u006d\u0065:\u0020\u0028\u0025\u0063\u0029",_fgaa [0]);};}else {if _a .IsWhiteSpace (_fgaa [0]){break ;}else if (_fgaa [0]=='/')||(_fgaa [0]=='[')||(_fgaa [0]=='(')||(_fgaa [0]==']')||(_fgaa [0]=='<')||(_fgaa [0]=='>'){break ;}else if _fgaa [0]=='#'{_edc ,_geaa :=_bacc ._afd .Peek (3);if _geaa !=nil {return cmapName {_agd },_geaa ;};_bacc ._afd .Discard (3);_caa ,_geaa :=_ge .DecodeString (string (_edc [1:3]));if _geaa !=nil {return cmapName {_agd },_geaa ;};_agd +=string (_caa );}else {_ceca ,_ :=_bacc ._afd .ReadByte ();_agd +=string (_ceca );};};};return cmapName {_agd },nil ;};type cmapArray struct{Array []cmapObject ;};const (_cc =4;MissingCodeRune ='\ufffd';MissingCodeString =string (MissingCodeRune ););func NewToUnicodeCMap (codeToRune map[CharCode ]rune )*CMap {_ce :=make (map[CharCode ]string ,len (codeToRune ));for _eb ,_gd :=range codeToRune {_ce [_eb ]=string (_gd );};cmap :=&CMap {_dc :"\u0041d\u006fb\u0065\u002d\u0049\u0064\u0065n\u0074\u0069t\u0079\u002d\u0055\u0043\u0053",_cbb :2,_edf :16,_bc :CIDSystemInfo {Registry :"\u0041\u0064\u006fb\u0065",Ordering :"\u0055\u0043\u0053",Supplement :0},_geff :[]Codespace {{Low :0,High :0xffff}},_fd :_ce ,_fec :make (map[string ]CharCode ,len (codeToRune )),_eefe :make (map[CharCode ]CharCode ,len (codeToRune )),_eg :make (map[CharCode ]CharCode ,len (codeToRune ))};cmap .computeInverseMappings ();return cmap ;};func (cmap *CMap )parseSystemInfo ()error {_gf :=false ;_cafd :=false ;_cbfg :="";_gaf :=false ;_bfa :=CIDSystemInfo {};for _eagf :=0;_eagf < 50&&!_gaf ;_eagf ++{_eefa ,_gcdc :=cmap .parseObject ();if _gcdc !=nil {return _gcdc ;};switch _gbd :=_eefa .(type ){case cmapDict :_ffea :=_gbd .Dict ;_cdb ,_bgc :=_ffea ["\u0052\u0065\u0067\u0069\u0073\u0074\u0072\u0079"];if !_bgc {_dg .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_eagg ,_bgc :=_cdb .(cmapString );if !_bgc {_dg .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_bfa .Registry =_eagg .String ;_cdb ,_bgc =_ffea ["\u004f\u0072\u0064\u0065\u0072\u0069\u006e\u0067"];if !_bgc {_dg .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_eagg ,_bgc =_cdb .(cmapString );if !_bgc {_dg .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_bfa .Ordering =_eagg .String ;_eda ,_bgc :=_ffea ["\u0053\u0075\u0070\u0070\u006c\u0065\u006d\u0065\u006e\u0074"];if !_bgc {_dg .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_bce ,_bgc :=_eda .(cmapInt );if !_bgc {_dg .Log .Debug ("\u0045\u0052\u0052\u004fR:\u0020\u0042\u0061\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006ef\u006f");return ErrBadCMap ;};_bfa .Supplement =int (_bce ._bfgd );_gaf =true ;case cmapOperand :switch _gbd .Operand {case "\u0062\u0065\u0067i\u006e":_gf =true ;case "\u0065\u006e\u0064":_gaf =true ;case "\u0064\u0065\u0066":_cafd =false ;};case cmapName :if _gf {_cbfg =_gbd .Name ;_cafd =true ;};case cmapString :if _cafd {switch _cbfg {case "\u0052\u0065\u0067\u0069\u0073\u0074\u0072\u0079":_bfa .Registry =_gbd .String ;case "\u004f\u0072\u0064\u0065\u0072\u0069\u006e\u0067":_bfa .Ordering =_gbd .String ;};};case cmapInt :if _cafd {switch _cbfg {case "\u0053\u0075\u0070\u0070\u006c\u0065\u006d\u0065\u006e\u0074":_bfa .Supplement =int (_gbd ._bfgd );};};};};if !_gaf {_dg .Log .Debug ("\u0045\u0052\u0052O\u0052\u003a\u0020\u0050\u0061\u0072\u0073\u0065\u0064\u0020\u0053\u0079\u0073\u0074\u0065\u006d\u0020\u0049\u006e\u0066\u006f\u0020\u0064\u0069\u0063\u0074\u0020\u0069\u006ec\u006f\u0072\u0072\u0065\u0063\u0074\u006c\u0079");return ErrBadCMap ;};cmap ._bc =_bfa ;return nil ;};func (cmap *CMap )CharcodeToCID (code CharCode )(CharCode ,bool ){_gcd ,_eea :=cmap ._eefe [code ];return _gcd ,_eea ;};func (_cd *CIDSystemInfo )String ()string {return _e .Sprintf ("\u0025\u0073\u002d\u0025\u0073\u002d\u0025\u0030\u0033\u0064",_cd .Registry ,_cd .Ordering ,_cd .Supplement );};func (cmap *CMap )parseCodespaceRange ()error {for {_dff ,_aab :=cmap .parseObject ();if _aab !=nil {if _aab ==_c .EOF {break ;};return _aab ;};_dddg ,_gbed :=_dff .(cmapHexString );if !_gbed {if _gfa ,_gagc :=_dff .(cmapOperand );_gagc {if _gfa .Operand ==_fgcg {return nil ;};return _da .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065d\u0020\u006fp\u0065\u0072\u0061\u006e\u0064");};};_dff ,_aab =cmap .parseObject ();if _aab !=nil {if _aab ==_c .EOF {break ;};return _aab ;};_gcgg ,_gbed :=_dff .(cmapHexString );if !_gbed {return _da .New ("\u006e\u006f\u006e-\u0068\u0065\u0078\u0020\u0068\u0069\u0067\u0068");};if len (_dddg ._fbg )!=len (_gcgg ._fbg ){return _da .New ("\u0075\u006e\u0065\u0071\u0075\u0061\u006c\u0020\u006e\u0075\u006d\u0062\u0065\u0072\u0020o\u0066 \u0062\u0079\u0074\u0065\u0073\u0020\u0069\u006e\u0020\u0072\u0061\u006e\u0067\u0065");};_gfe :=_afdb (_dddg );_gae :=_afdb (_gcgg );if _gae < _gfe {_dg .Log .Debug ("\u0045R\u0052\u004fR\u003a\u0020\u0042\u0061d\u0020\u0063\u006fd\u0065\u0073\u0070\u0061\u0063\u0065\u002e\u0020\u006cow\u003d\u0030\u0078%\u0030\u0032x\u0020\u0068\u0069\u0067\u0068\u003d0\u0078\u00250\u0032\u0078",_gfe ,_gae );return ErrBadCMap ;};_gece :=_gcgg ._bbab ;_dgd :=Codespace {NumBytes :_gece ,Low :_gfe ,High :_gae };cmap ._geff =append (cmap ._geff ,_dgd );_dg .Log .Trace ("\u0043\u006f\u0064e\u0073\u0070\u0061\u0063e\u0020\u006c\u006f\u0077\u003a\u0020\u0030x\u0025\u0058\u002c\u0020\u0068\u0069\u0067\u0068\u003a\u0020\u0030\u0078\u0025\u0058",_gfe ,_gae );};if len (cmap ._geff )==0{_dg .Log .Debug ("\u0045\u0052R\u004f\u0052\u003a\u0020\u004e\u006f\u0020\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0073\u0020\u0069\u006e\u0020\u0063ma\u0070\u002e");return ErrBadCMap ;};return nil ;};func (cmap *CMap )computeInverseMappings (){for _adb ,_bee :=range cmap ._eefe {if _dbd ,_cbe :=cmap ._eg [_bee ];!_cbe ||(_cbe &&_dbd > _adb ){cmap ._eg [_bee ]=_adb ;};};for _cfg ,_dca :=range cmap ._fd {if _gdg ,_abf :=cmap ._fec [_dca ];!_abf ||(_abf &&_gdg > _cfg ){cmap ._fec [_dca ]=_cfg ;};};_fe .Slice (cmap ._geff ,func (_dad ,_fc int )bool {return cmap ._geff [_dad ].Low < cmap ._geff [_fc ].Low });};func (_cccf *cMapParser )parseHexString ()(cmapHexString ,error ){_cccf ._afd .ReadByte ();_gfbg :=[]byte ("\u0030\u0031\u0032\u003345\u0036\u0037\u0038\u0039\u0061\u0062\u0063\u0064\u0065\u0066\u0041\u0042\u0043\u0044E\u0046");_eca :=_ga .Buffer {};for {_cccf .skipSpaces ();_edgc ,_egagd :=_cccf ._afd .Peek (1);if _egagd !=nil {return cmapHexString {},_egagd ;};if _edgc [0]=='>'{_cccf ._afd .ReadByte ();break ;};_fae ,_ :=_cccf ._afd .ReadByte ();if _ga .IndexByte (_gfbg ,_fae )>=0{_eca .WriteByte (_fae );};};if _eca .Len ()%2==1{_dg .Log .Debug ("\u0070\u0061rs\u0065\u0048\u0065x\u0053\u0074\u0072\u0069ng:\u0020ap\u0070\u0065\u006e\u0064\u0069\u006e\u0067 '\u0030\u0027\u0020\u0074\u006f\u0020\u0025#\u0071",_eca .String ());_eca .WriteByte ('0');};_gdaf :=_eca .Len ()/2;_adeg ,_ :=_ge .DecodeString (_eca .String ());return cmapHexString {_bbab :_gdaf ,_fbg :_adeg },nil ;};type cmapInt struct{_bfgd int64 };func (cmap *CMap )NBits ()int {return cmap ._edf };type cmapString struct{String string ;};func (cmap *CMap )parse ()error {var _ega cmapObject ;for {_fdde ,_egee :=cmap .parseObject ();if _egee !=nil {if _egee ==_c .EOF {break ;};_dg .Log .Debug ("\u0045\u0052\u0052OR\u003a\u0020\u0070\u0061\u0072\u0073\u0069\u006e\u0067\u0020\u0043\u004d\u0061\u0070\u003a\u0020\u0025\u0076",_egee );return _egee ;};switch _gceg :=_fdde .(type ){case cmapOperand :_caf :=_gceg ;switch _caf .Operand {case _fecbf :_dfcc :=cmap .parseCodespaceRange ();if _dfcc !=nil {return _dfcc ;};case _ebab :_cece :=cmap .parseCIDRange ();if _cece !=nil {return _cece ;};case _gea :_bbb :=cmap .parseBfchar ();if _bbb !=nil {return _bbb ;};case _fca :_gcc :=cmap .parseBfrange ();if _gcc !=nil {return _gcc ;};case _ade :if _ega ==nil {_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0075\u0073\u0065\u0063m\u0061\u0070\u0020\u0077\u0069\u0074\u0068\u0020\u006e\u006f \u0061\u0072\u0067");return ErrBadCMap ;};_ggf ,_ffb :=_ega .(cmapName );if !_ffb {_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a \u0075\u0073\u0065\u0063\u006d\u0061\u0070\u0020\u0061\u0072\u0067\u0020\u006eo\u0074\u0020\u0061\u0020\u006e\u0061\u006de\u0020\u0025\u0023\u0076",_ega );return ErrBadCMap ;};cmap ._edg =_ggf .Name ;case _gfad :_dab :=cmap .parseSystemInfo ();if _dab !=nil {return _dab ;};};case cmapName :_dfb :=_gceg ;switch _dfb .Name {case _gfad :_def :=cmap .parseSystemInfo ();if _def !=nil {return _def ;};case _agb :_gac :=cmap .parseName ();if _gac !=nil {return _gac ;};case _bfae :_ffbd :=cmap .parseType ();if _ffbd !=nil {return _ffbd ;};case _dgb :_bac :=cmap .parseVersion ();if _bac !=nil {return _bac ;};};};_ega =_fdde ;};return nil ;};type Codespace struct{NumBytes int ;Low CharCode ;High CharCode ;};func (cmap *CMap )Type ()int {return cmap ._cbb };func (_cccg *cMapParser )parseArray ()(cmapArray ,error ){_dcd :=cmapArray {};_dcd .Array =[]cmapObject {};_cccg ._afd .ReadByte ();for {_cccg .skipSpaces ();_cef ,_deff :=_cccg ._afd .Peek (1);if _deff !=nil {return _dcd ,_deff ;};if _cef [0]==']'{_cccg ._afd .ReadByte ();break ;};_bed ,_deff :=_cccg .parseObject ();if _deff !=nil {return _dcd ,_deff ;};_dcd .Array =append (_dcd .Array ,_bed );};return _dcd ,nil ;};func (cmap *CMap )parseBfchar ()error {for {_bbbg ,_geca :=cmap .parseObject ();if _geca !=nil {if _geca ==_c .EOF {break ;};return _geca ;};var _ddda CharCode ;switch _bgd :=_bbbg .(type ){case cmapOperand :if _bgd .Operand ==_acfa {return nil ;};return _da .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065d\u0020\u006fp\u0065\u0072\u0061\u006e\u0064");case cmapHexString :_ddda =_afdb (_bgd );default:return _da .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065\u0064\u0020\u0074\u0079\u0070\u0065");};_bbbg ,_geca =cmap .parseObject ();if _geca !=nil {if _geca ==_c .EOF {break ;};return _geca ;};var _egeg []rune ;switch _gff :=_bbbg .(type ){case cmapOperand :if _gff .Operand ==_acfa {return nil ;};_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0055\u006e\u0065x\u0070\u0065\u0063\u0074\u0065\u0064\u0020o\u0070\u0065\u0072\u0061\u006e\u0064\u002e\u0020\u0025\u0023\u0076",_gff );return ErrBadCMap ;case cmapHexString :_egeg =_ffbc (_gff );case cmapName :_dg .Log .Debug ("E\u0052\u0052\u004f\u0052\u003a\u0020U\u006e\u0065\u0078\u0070\u0065\u0063\u0074\u0065\u0064 \u006e\u0061\u006de\u002e \u0025\u0023\u0076",_gff );_egeg =[]rune {MissingCodeRune };default:_dg .Log .Debug ("E\u0052\u0052\u004f\u0052\u003a\u0020U\u006e\u0065\u0078\u0070\u0065\u0063\u0074\u0065\u0064 \u0074\u0079\u0070e\u002e \u0025\u0023\u0076",_bbbg );return ErrBadCMap ;};cmap ._fd [_ddda ]=string (_egeg );};return nil ;};func (cmap *CMap )BytesToCharcodes (data []byte )([]CharCode ,bool ){var _egb []CharCode ;if cmap ._edf ==8{for _ ,_abff :=range data {_egb =append (_egb ,CharCode (_abff ));};return _egb ,true ;};for _bca :=0;_bca < len (data );{_fad ,_bg ,_af :=cmap .matchCode (data [_bca :]);if !_af {_dg .Log .Debug ("\u0045\u0052R\u004f\u0052\u003a\u0020\u004e\u006f\u0020\u0063\u006f\u0064\u0065\u0020\u006d\u0061\u0074\u0063\u0068\u0020\u0061\u0074\u0020\u0069\u003d\u0025\u0064\u0020\u0062\u0079\u0074\u0065\u0073\u003d\u005b\u0025\u0020\u0030\u0032\u0078\u005d\u003d\u0025\u0023\u0071",_bca ,data ,string (data ));return _egb ,false ;};_egb =append (_egb ,_fad );_bca +=_bg ;};return _egb ,true ;};type fbRange struct{_fa CharCode ;_eef CharCode ;_db string ;};func (_bfc *cMapParser )parseOperand ()(cmapOperand ,error ){_gee :=cmapOperand {};_ffc :=_ga .Buffer {};for {_cbbe ,_dbab :=_bfc ._afd .Peek (1);if _dbab !=nil {if _dbab ==_c .EOF {break ;};return _gee ,_dbab ;};if _a .IsDelimiter (_cbbe [0]){break ;};if _a .IsWhiteSpace (_cbbe [0]){break ;};_fgcb ,_ :=_bfc ._afd .ReadByte ();_ffc .WriteByte (_fgcb );};if _ffc .Len ()==0{return _gee ,_e .Errorf ("\u0069\u006e\u0076al\u0069\u0064\u0020\u006f\u0070\u0065\u0072\u0061\u006e\u0064\u0020\u0028\u0065\u006d\u0070\u0074\u0079\u0029");};_gee .Operand =_ffc .String ();return _gee ,nil ;};func (cmap *CMap )inCodespace (_dbg CharCode ,_gdf int )bool {for _ ,_gag :=range cmap ._geff {if _gag .Low <=_dbg &&_dbg <=_gag .High &&_gdf ==_gag .NumBytes {return true ;};};return false ;};func (cmap *CMap )parseBfrange ()error {for {var _bcdc CharCode ;_cea ,_aef :=cmap .parseObject ();if _aef !=nil {if _aef ==_c .EOF {break ;};return _aef ;};switch _eede :=_cea .(type ){case cmapOperand :if _eede .Operand ==_decd {return nil ;};return _da .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065d\u0020\u006fp\u0065\u0072\u0061\u006e\u0064");case cmapHexString :_bcdc =_afdb (_eede );default:return _da .New ("\u0075n\u0065x\u0070\u0065\u0063\u0074\u0065\u0064\u0020\u0074\u0079\u0070\u0065");};var _gdb CharCode ;_cea ,_aef =cmap .parseObject ();if _aef !=nil {if _aef ==_c .EOF {break ;};return _aef ;};switch _bde :=_cea .(type ){case cmapOperand :_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a \u0049\u006d\u0063\u006f\u006d\u0070\u006c\u0065\u0074\u0065\u0020\u0062\u0066r\u0061\u006e\u0067\u0065\u0020\u0074\u0072i\u0070\u006c\u0065\u0074");return ErrBadCMap ;case cmapHexString :_gdb =_afdb (_bde );default:_dg .Log .Debug ("\u0045R\u0052\u004f\u0052\u003a \u0055\u006e\u0065\u0078\u0070e\u0063t\u0065d\u0020\u0074\u0079\u0070\u0065\u0020\u0025T",_cea );return ErrBadCMap ;};_cea ,_aef =cmap .parseObject ();if _aef !=nil {if _aef ==_c .EOF {break ;};return _aef ;};switch _eff :=_cea .(type ){case cmapArray :if len (_eff .Array )!=int (_gdb -_bcdc )+1{_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0049\u006e\u0076\u0061\u006c\u0069d\u0020\u006e\u0075\u006d\u0062\u0065r\u0020\u006f\u0066\u0020\u0069\u0074\u0065\u006d\u0073\u0020\u0069\u006e\u0020a\u0072\u0072\u0061\u0079");return ErrBadCMap ;};for _dffd :=_bcdc ;_dffd <=_gdb ;_dffd ++{_aeg :=_eff .Array [_dffd -_bcdc ];_gaac ,_cada :=_aeg .(cmapHexString );if !_cada {return _da .New ("\u006e\u006f\u006e-h\u0065\u0078\u0020\u0073\u0074\u0072\u0069\u006e\u0067\u0020\u0069\u006e\u0020\u0061\u0072\u0072\u0061\u0079");};_dba :=_ffbc (_gaac );cmap ._fd [_dffd ]=string (_dba );};case cmapHexString :_ecd :=_ffbc (_eff );_cfd :=len (_ecd );for _gda :=_bcdc ;_gda <=_gdb ;_gda ++{cmap ._fd [_gda ]=string (_ecd );_ecd [_cfd -1]++;};default:_dg .Log .Debug ("\u0045R\u0052\u004f\u0052\u003a \u0055\u006e\u0065\u0078\u0070e\u0063t\u0065d\u0020\u0074\u0079\u0070\u0065\u0020\u0025T",_cea );return ErrBadCMap ;};};return nil ;};func (cmap *CMap )Bytes ()[]byte {_dg .Log .Trace ("\u0063\u006d\u0061\u0070.B\u0079\u0074\u0065\u0073\u003a\u0020\u0063\u006d\u0061\u0070\u003d\u0025\u0073",cmap .String ());if len (cmap ._ac )> 0{return cmap ._ac ;};cmap ._ac =[]byte (_b .Join ([]string {_eac ,cmap .toBfData (),_bfg },"\u000a"));return cmap ._ac ;};func (cmap *CMap )CIDToCharcode (cid CharCode )(CharCode ,bool ){_cec ,_dge :=cmap ._eg [cid ];return _cec ,_dge ;};func (cmap *CMap )matchCode (_geffg []byte )(_ef CharCode ,_fga int ,_fab bool ){for _bdd :=0;_bdd < _cc ;_bdd ++{if _bdd < len (_geffg ){_ef =_ef <<8|CharCode (_geffg [_bdd ]);_fga ++;};_fab =cmap .inCodespace (_ef ,_bdd +1);if _fab {return _ef ,_fga ,true ;};};_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u004e\u006f\u0020\u0063o\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0020m\u0061t\u0063\u0068\u0065\u0073\u0020\u0062\u0079\u0074\u0065\u0073\u003d\u005b\u0025\u0020\u0030\u0032\u0078\u005d=\u0025\u0023\u0071\u0020\u0063\u006d\u0061\u0070\u003d\u0025\u0073",_geffg ,string (_geffg ),cmap );return 0,0,false ;};func (cmap *CMap )Name ()string {return cmap ._dc };func _dgc (_cdbe []byte )*cMapParser {_ebg :=cMapParser {};_efc :=_ga .NewBuffer (_cdbe );_ebg ._afd =_d .NewReader (_efc );return &_ebg ;};func _fed (_gfd ,_cgc int )int {if _gfd < _cgc {return _gfd ;};return _cgc ;};func (cmap *CMap )String ()string {_ggd :=cmap ._bc ;_deb :=[]string {_e .Sprintf ("\u006e\u0062\u0069\u0074\u0073\u003a\u0025\u0064",cmap ._edf ),_e .Sprintf ("\u0074y\u0070\u0065\u003a\u0025\u0064",cmap ._cbb )};if cmap ._de !=""{_deb =append (_deb ,_e .Sprintf ("\u0076\u0065\u0072\u0073\u0069\u006f\u006e\u003a\u0025\u0073",cmap ._de ));};if cmap ._edg !=""{_deb =append (_deb ,_e .Sprintf ("u\u0073\u0065\u0063\u006d\u0061\u0070\u003a\u0025\u0023\u0071",cmap ._edg ));};_deb =append (_deb ,_e .Sprintf ("\u0073\u0079\u0073\u0074\u0065\u006d\u0049\u006e\u0066\u006f\u003a\u0025\u0073",_ggd .String ()));if len (cmap ._geff )> 0{_deb =append (_deb ,_e .Sprintf ("\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0073\u003a\u0025\u0064",len (cmap ._geff )));};if len (cmap ._fd )> 0{_deb =append (_deb ,_e .Sprintf ("\u0063\u006fd\u0065\u0054\u006fU\u006e\u0069\u0063\u006f\u0064\u0065\u003a\u0025\u0064",len (cmap ._fd )));};return _e .Sprintf ("\u0043\u004d\u0041P\u007b\u0025\u0023\u0071\u0020\u0025\u0073\u007d",cmap ._dc ,_b .Join (_deb ,"\u0020"));};type cMapParser struct{_afd *_d .Reader };func (_ecc *cMapParser )parseNumber ()(cmapObject ,error ){_cfa ,_gecd :=_a .ParseNumber (_ecc ._afd );if _gecd !=nil {return nil ,_gecd ;};switch _dfed :=_cfa .(type ){case *_a .PdfObjectFloat :return cmapFloat {float64 (*_dfed )},nil ;case *_a .PdfObjectInteger :return cmapInt {int64 (*_dfed )},nil ;};return nil ,_e .Errorf ("\u0075n\u0068\u0061\u006e\u0064\u006c\u0065\u0064\u0020\u006e\u0075\u006db\u0065\u0072\u0020\u0074\u0079\u0070\u0065\u0020\u0025\u0054",_cfa );};func IsPredefinedCMap (name string )bool {return _ee .AssetExists (name )};func (cmap *CMap )CharcodeToUnicode (code CharCode )(string ,bool ){if _gce ,_fdd :=cmap ._fd [code ];_fdd {return _gce ,true ;};return MissingCodeString ,false ;};var (ErrBadCMap =_da .New ("\u0062\u0061\u0064\u0020\u0063\u006d\u0061\u0070");ErrBadCMapComment =_da .New ("c\u006f\u006d\u006d\u0065\u006e\u0074 \u0073\u0068\u006f\u0075\u006c\u0064\u0020\u0073\u0074a\u0072\u0074\u0020w\u0069t\u0068\u0020\u0025");ErrBadCMapDict =_da .New ("\u0069\u006e\u0076a\u006c\u0069\u0064\u0020\u0064\u0069\u0063\u0074"););func (_bdf *cMapParser )parseComment ()(string ,error ){var _cbg _ga .Buffer ;_ ,_eecf :=_bdf .skipSpaces ();if _eecf !=nil {return _cbg .String (),_eecf ;};_gbb :=true ;for {_acg ,_egfc :=_bdf ._afd .Peek (1);if _egfc !=nil {_dg .Log .Debug ("p\u0061r\u0073\u0065\u0043\u006f\u006d\u006d\u0065\u006et\u003a\u0020\u0065\u0072r=\u0025\u0076",_egfc );return _cbg .String (),_egfc ;};if _gbb &&_acg [0]!='%'{return _cbg .String (),ErrBadCMapComment ;};_gbb =false ;if (_acg [0]!='\r')&&(_acg [0]!='\n'){_acb ,_ :=_bdf ._afd .ReadByte ();_cbg .WriteByte (_acb );}else {break ;};};return _cbg .String (),nil ;};func _gdd (_dcg bool )*CMap {_fag :=16;if _dcg {_fag =8;};return &CMap {_edf :_fag ,_eefe :make (map[CharCode ]CharCode ),_eg :make (map[CharCode ]CharCode ),_fd :make (map[CharCode ]string ),_fec :make (map[string ]CharCode )};};func NewCIDSystemInfo (obj _a .PdfObject )(_cb CIDSystemInfo ,_ad error ){_dgg ,_ag :=_a .GetDict (obj );if !_ag {return CIDSystemInfo {},_a .ErrTypeError ;};_feb ,_ag :=_a .GetStringVal (_dgg .Get ("\u0052\u0065\u0067\u0069\u0073\u0074\u0072\u0079"));if !_ag {return CIDSystemInfo {},_a .ErrTypeError ;};_aa ,_ag :=_a .GetStringVal (_dgg .Get ("\u004f\u0072\u0064\u0065\u0072\u0069\u006e\u0067"));if !_ag {return CIDSystemInfo {},_a .ErrTypeError ;};_dag ,_ag :=_a .GetIntVal (_dgg .Get ("\u0053\u0075\u0070\u0070\u006c\u0065\u006d\u0065\u006e\u0074"));if !_ag {return CIDSystemInfo {},_a .ErrTypeError ;};return CIDSystemInfo {Registry :_feb ,Ordering :_aa ,Supplement :_dag },nil ;};func _abcd (_cdg string )rune {_ebc :=[]rune (_cdg );return _ebc [len (_ebc )-1]};func (cmap *CMap )parseVersion ()error {_fde :="";_acfe :=false ;for _gcg :=0;_gcg < 3&&!_acfe ;_gcg ++{_ccd ,_bbg :=cmap .parseObject ();if _bbg !=nil {return _bbg ;};switch _fac :=_ccd .(type ){case cmapOperand :switch _fac .Operand {case "\u0064\u0065\u0066":_acfe =true ;default:_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0070\u0061\u0072\u0073\u0065\u0056e\u0072\u0073\u0069\u006f\u006e\u003a \u0073\u0074\u0061\u0074\u0065\u0020\u0065\u0072\u0072\u006f\u0072\u002e\u0020o\u003d\u0025\u0023\u0076",_ccd );return ErrBadCMap ;};case cmapInt :_fde =_e .Sprintf ("\u0025\u0064",_fac ._bfgd );case cmapFloat :_fde =_e .Sprintf ("\u0025\u0066",_fac ._aag );case cmapString :_fde =_fac .String ;default:_dg .Log .Debug ("\u0045\u0052RO\u0052\u003a\u0020p\u0061\u0072\u0073\u0065Ver\u0073io\u006e\u003a\u0020\u0042\u0061\u0064\u0020ty\u0070\u0065\u002e\u0020\u006f\u003d\u0025#\u0076",_ccd );};};cmap ._de =_fde ;return nil ;};func LoadCmapFromData (data []byte ,isSimple bool )(*CMap ,error ){_dg .Log .Trace ("\u004c\u006fa\u0064\u0043\u006d\u0061\u0070\u0046\u0072\u006f\u006d\u0044\u0061\u0074\u0061\u003a\u0020\u0069\u0073\u0053\u0069\u006d\u0070\u006ce=\u0025\u0074",isSimple );cmap :=_gdd (isSimple );cmap .cMapParser =_dgc (data );_cf :=cmap .parse ();if _cf !=nil {return nil ,_cf ;};if len (cmap ._geff )==0{if cmap ._edg !=""{return cmap ,nil ;};_dg .Log .Debug ("\u0045\u0052R\u004f\u0052\u003a\u0020\u004e\u006f\u0020\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0073\u002e\u0020\u0063\u006d\u0061p=\u0025\u0073",cmap );return nil ,ErrBadCMap ;};cmap .computeInverseMappings ();return cmap ,nil ;};func (cmap *CMap )parseType ()error {_fgg :=0;_gacg :=false ;for _aea :=0;_aea < 3&&!_gacg ;_aea ++{_eec ,_dcgg :=cmap .parseObject ();if _dcgg !=nil {return _dcgg ;};switch _bae :=_eec .(type ){case cmapOperand :switch _bae .Operand {case "\u0064\u0065\u0066":_gacg =true ;default:_dg .Log .Error ("\u0070\u0061r\u0073\u0065\u0054\u0079\u0070\u0065\u003a\u0020\u0073\u0074\u0061\u0074\u0065\u0020\u0065\u0072\u0072\u006f\u0072\u002e\u0020\u006f=%\u0023\u0076",_eec );return ErrBadCMap ;};case cmapInt :_fgg =int (_bae ._bfgd );};};cmap ._cbb =_fgg ;return nil ;};func LoadPredefinedCMap (name string )(*CMap ,error ){cmap ,_fg :=_df (name );if _fg !=nil {return nil ,_fg ;};if cmap ._edg ==""{cmap .computeInverseMappings ();return cmap ,nil ;};_beg ,_fg :=_df (cmap ._edg );if _fg !=nil {return nil ,_fg ;};for _bege ,_ae :=range _beg ._eefe {if _ ,_fgc :=cmap ._eefe [_bege ];!_fgc {cmap ._eefe [_bege ]=_ae ;};};for _ ,_gg :=range _beg ._geff {cmap ._geff =append (cmap ._geff ,_gg );};cmap .computeInverseMappings ();return cmap ,nil ;};type cmapOperand struct{Operand string ;};func LoadCmapFromDataCID (data []byte )(*CMap ,error ){return LoadCmapFromData (data ,false )};func (_fbaa *cMapParser )parseObject ()(cmapObject ,error ){_fbaa .skipSpaces ();for {_gbaf ,_cab :=_fbaa ._afd .Peek (2);if _cab !=nil {return nil ,_cab ;};if _gbaf [0]=='%'{_fbaa .parseComment ();_fbaa .skipSpaces ();continue ;}else if _gbaf [0]=='/'{_adf ,_gfadc :=_fbaa .parseName ();return _adf ,_gfadc ;}else if _gbaf [0]=='('{_dcf ,_dce :=_fbaa .parseString ();return _dcf ,_dce ;}else if _gbaf [0]=='['{_fabg ,_afdd :=_fbaa .parseArray ();return _fabg ,_afdd ;}else if (_gbaf [0]=='<')&&(_gbaf [1]=='<'){_fddb ,_bfag :=_fbaa .parseDict ();return _fddb ,_bfag ;}else if _gbaf [0]=='<'{_agaf ,_aegf :=_fbaa .parseHexString ();return _agaf ,_aegf ;}else if _a .IsDecimalDigit (_gbaf [0])||(_gbaf [0]=='-'&&_a .IsDecimalDigit (_gbaf [1])){_ebcf ,_geb :=_fbaa .parseNumber ();if _geb !=nil {return nil ,_geb ;};return _ebcf ,nil ;}else {_fce ,_bbae :=_fbaa .parseOperand ();if _bbae !=nil {return nil ,_bbae ;};return _fce ,nil ;};};};func (_eaf *cMapParser )parseString ()(cmapString ,error ){_eaf ._afd .ReadByte ();_bfaa :=_ga .Buffer {};_bge :=1;for {_gde ,_dege :=_eaf ._afd .Peek (1);if _dege !=nil {return cmapString {_bfaa .String ()},_dege ;};if _gde [0]=='\\'{_eaf ._afd .ReadByte ();_gge ,_acc :=_eaf ._afd .ReadByte ();if _acc !=nil {return cmapString {_bfaa .String ()},_acc ;};if _a .IsOctalDigit (_gge ){_cagd ,_ddee :=_eaf ._afd .Peek (2);if _ddee !=nil {return cmapString {_bfaa .String ()},_ddee ;};var _ccfe []byte ;_ccfe =append (_ccfe ,_gge );for _ ,_bdb :=range _cagd {if _a .IsOctalDigit (_bdb ){_ccfe =append (_ccfe ,_bdb );}else {break ;};};_eaf ._afd .Discard (len (_ccfe )-1);_dg .Log .Trace ("\u004e\u0075\u006d\u0065ri\u0063\u0020\u0073\u0074\u0072\u0069\u006e\u0067\u0020\u0022\u0025\u0073\u0022",_ccfe );_efa ,_ddee :=_g .ParseUint (string (_ccfe ),8,32);if _ddee !=nil {return cmapString {_bfaa .String ()},_ddee ;};_bfaa .WriteByte (byte (_efa ));continue ;};switch _gge {case 'n':_bfaa .WriteByte ('\n');case 'r':_bfaa .WriteByte ('\r');case 't':_bfaa .WriteByte ('\t');case 'b':_bfaa .WriteByte ('\b');case 'f':_bfaa .WriteByte ('\f');case '(':_bfaa .WriteByte ('(');case ')':_bfaa .WriteByte (')');case '\\':_bfaa .WriteByte ('\\');};continue ;}else if _gde [0]=='('{_bge ++;}else if _gde [0]==')'{_bge --;if _bge ==0{_eaf ._afd .ReadByte ();break ;};};_egag ,_ :=_eaf ._afd .ReadByte ();_bfaa .WriteByte (_egag );};return cmapString {_bfaa .String ()},nil ;};func (cmap *CMap )CharcodeBytesToUnicode (data []byte )(string ,int ){_cdc ,_egf :=cmap .BytesToCharcodes (data );if !_egf {_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0043\u0068\u0061\u0072\u0063\u006f\u0064\u0065\u0042\u0079\u0074\u0065s\u0054\u006f\u0055\u006e\u0069\u0063\u006f\u0064\u0065\u002e\u0020\u004e\u006f\u0074\u0020\u0069n\u0020\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0073\u002e\u0020\u0064\u0061\u0074\u0061\u003d\u005b\u0025\u0020\u0030\u0032\u0078]\u0020\u0063\u006d\u0061\u0070=\u0025\u0073",data ,cmap );return "",0;};_gc :=make ([]string ,len (_cdc ));var _ged []CharCode ;for _dd ,_ccc :=range _cdc {_fba ,_agc :=cmap ._fd [_ccc ];if !_agc {_ged =append (_ged ,_ccc );_fba =MissingCodeString ;};_gc [_dd ]=_fba ;};_gaa :=_b .Join (_gc ,"");if len (_ged )> 0{_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020C\u0068\u0061\u0072c\u006f\u0064\u0065\u0042y\u0074\u0065\u0073\u0054\u006f\u0055\u006e\u0069\u0063\u006f\u0064\u0065\u002e\u0020\u004e\u006f\u0074\u0020\u0069\u006e\u0020\u006d\u0061\u0070\u002e\u000a"+"\u0009d\u0061t\u0061\u003d\u005b\u0025\u00200\u0032\u0078]\u003d\u0025\u0023\u0071\u000a"+"\u0009\u0063h\u0061\u0072\u0063o\u0064\u0065\u0073\u003d\u0025\u0030\u0032\u0078\u000a"+"\u0009\u006d\u0069\u0073\u0073\u0069\u006e\u0067\u003d\u0025\u0064\u0020%\u0030\u0032\u0078\u000a"+"\u0009\u0075\u006e\u0069\u0063\u006f\u0064\u0065\u003d`\u0025\u0073\u0060\u000a"+"\u0009\u0063\u006d\u0061\u0070\u003d\u0025\u0073",data ,string (data ),_cdc ,len (_ged ),_ged ,_gaa ,cmap );};return _gaa ,len (_ged );};func (_gced *cMapParser )parseDict ()(cmapDict ,error ){_dg .Log .Trace ("\u0052\u0065\u0061\u0064\u0069\u006e\u0067\u0020\u0050\u0044\u0046\u0020D\u0069\u0063\u0074\u0021");_ead :=_bbgf ();_afg ,_ :=_gced ._afd .ReadByte ();if _afg !='<'{return _ead ,ErrBadCMapDict ;};_afg ,_ =_gced ._afd .ReadByte ();if _afg !='<'{return _ead ,ErrBadCMapDict ;};for {_gced .skipSpaces ();_agba ,_fcb :=_gced ._afd .Peek (2);if _fcb !=nil {return _ead ,_fcb ;};if (_agba [0]=='>')&&(_agba [1]=='>'){_gced ._afd .ReadByte ();_gced ._afd .ReadByte ();break ;};_bged ,_fcb :=_gced .parseName ();_dg .Log .Trace ("\u004be\u0079\u003a\u0020\u0025\u0073",_bged .Name );if _fcb !=nil {_dg .Log .Debug ("\u0045\u0052R\u004f\u0052\u003a\u0020\u0052\u0065\u0074\u0075\u0072\u006e\u0069\u006e\u0067\u0020\u006e\u0061\u006d\u0065\u002e\u0020\u0065\u0072r=\u0025\u0076",_fcb );return _ead ,_fcb ;};_gced .skipSpaces ();_fdb ,_fcb :=_gced .parseObject ();if _fcb !=nil {return _ead ,_fcb ;};_ead .Dict [_bged .Name ]=_fdb ;_gced .skipSpaces ();_agba ,_fcb =_gced ._afd .Peek (3);if _fcb !=nil {return _ead ,_fcb ;};if string (_agba )=="\u0064\u0065\u0066"{_gced ._afd .Discard (3);};};return _ead ,nil ;};type CMap struct{*cMapParser ;_dc string ;_edf int ;_cbb int ;_de string ;_edg string ;_bc CIDSystemInfo ;_geff []Codespace ;_eefe map[CharCode ]CharCode ;_eg map[CharCode ]CharCode ;_fd map[CharCode ]string ;_fec map[string ]CharCode ;_ac []byte ;_fb *_a .PdfObjectStream ;};func (cmap *CMap )StringToCID (s string )(CharCode ,bool ){_dfd ,_dfc :=cmap ._fec [s ];return _dfd ,_dfc ;};type cmapName struct{Name string ;};type CIDSystemInfo struct{Registry string ;Ordering string ;Supplement int ;};type charRange struct{_ccb CharCode ;_gef CharCode ;};func _ddc (_fcef cmapHexString )rune {_fcda :=_ffbc (_fcef );if _agbf :=len (_fcda );_agbf ==0{_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0068\u0065\u0078\u0054o\u0052\u0075\u006e\u0065\u002e\u0020\u0045\u0078p\u0065c\u0074\u0065\u0064\u0020\u0061\u0074\u0020\u006c\u0065\u0061\u0073\u0074\u0020\u006f\u006e\u0065\u0020\u0072u\u006e\u0065\u0020\u0073\u0068\u0065\u0078\u003d\u0025\u0023\u0076",_fcef );return MissingCodeRune ;};if len (_fcda )> 1{_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a\u0020\u0068\u0065\u0078\u0054\u006f\u0052\u0075\u006e\u0065\u002e\u0020\u0045\u0078p\u0065\u0063\u0074\u0065\u0064\u0020\u0065\u0078\u0061\u0063\u0074\u006c\u0079\u0020\u006f\u006e\u0065\u0020\u0072\u0075\u006e\u0065\u0020\u0073\u0068\u0065\u0078\u003d\u0025\u0023v\u0020\u002d\u003e\u0020\u0025#\u0076",_fcef ,_fcda );};return _fcda [0];};type cmapDict struct{Dict map[string ]cmapObject ;};const (_gfad ="\u0043\u0049\u0044\u0053\u0079\u0073\u0074\u0065\u006d\u0049\u006e\u0066\u006f";_becg ="\u0062e\u0067\u0069\u006e\u0063\u006d\u0061p";_ceg ="\u0065n\u0064\u0063\u006d\u0061\u0070";_fecbf ="\u0062\u0065\u0067\u0069nc\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065\u0072\u0061\u006e\u0067\u0065";_fgcg ="\u0065\u006e\u0064\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065r\u0061\u006e\u0067\u0065";_gea ="b\u0065\u0067\u0069\u006e\u0062\u0066\u0063\u0068\u0061\u0072";_acfa ="\u0065n\u0064\u0062\u0066\u0063\u0068\u0061r";_fca ="\u0062\u0065\u0067i\u006e\u0062\u0066\u0072\u0061\u006e\u0067\u0065";_decd ="\u0065\u006e\u0064\u0062\u0066\u0072\u0061\u006e\u0067\u0065";_ebab ="\u0062\u0065\u0067\u0069\u006e\u0063\u0069\u0064\u0072\u0061\u006e\u0067\u0065";_dde ="e\u006e\u0064\u0063\u0069\u0064\u0072\u0061\u006e\u0067\u0065";_ade ="\u0075s\u0065\u0063\u006d\u0061\u0070";_agb ="\u0043\u004d\u0061\u0070\u004e\u0061\u006d\u0065";_bfae ="\u0043\u004d\u0061\u0070\u0054\u0079\u0070\u0065";_dgb ="C\u004d\u0061\u0070\u0056\u0065\u0072\u0073\u0069\u006f\u006e";);func (cmap *CMap )parseName ()error {_gbg :="";_bec :=false ;for _bgg :=0;_bgg < 20&&!_bec ;_bgg ++{_ecfc ,_daf :=cmap .parseObject ();if _daf !=nil {return _daf ;};switch _gefb :=_ecfc .(type ){case cmapOperand :switch _gefb .Operand {case "\u0064\u0065\u0066":_bec =true ;default:_dg .Log .Debug ("\u0070\u0061\u0072\u0073\u0065\u004e\u0061\u006d\u0065\u003a\u0020\u0053\u0074\u0061\u0074\u0065\u0020\u0065\u0072\u0072\u006f\u0072\u002e\u0020o\u003d\u0025\u0023\u0076\u0020n\u0061\u006de\u003d\u0025\u0023\u0071",_ecfc ,_gbg );if _gbg !=""{_gbg =_e .Sprintf ("\u0025\u0073\u0020%\u0073",_gbg ,_gefb .Operand );};_dg .Log .Debug ("\u0070\u0061\u0072\u0073\u0065\u004e\u0061\u006d\u0065\u003a \u0052\u0065\u0063\u006f\u0076\u0065\u0072e\u0064\u002e\u0020\u006e\u0061\u006d\u0065\u003d\u0025\u0023\u0071",_gbg );};case cmapName :_gbg =_gefb .Name ;};};if !_bec {_dg .Log .Debug ("\u0045R\u0052\u004f\u0052\u003a \u0070\u0061\u0072\u0073\u0065N\u0061m\u0065:\u0020\u004e\u006f\u0020\u0064\u0065\u0066 ");return ErrBadCMap ;};cmap ._dc =_gbg ;return nil ;};const (_dbf =100;_eac ="\u000a\u002f\u0043\u0049\u0044\u0049\u006e\u0069\u0074\u0020\u002f\u0050\u0072\u006fc\u0053\u0065\u0074\u0020\u0066\u0069\u006e\u0064\u0072es\u006fu\u0072c\u0065 \u0062\u0065\u0067\u0069\u006e\u000a\u0031\u0032\u0020\u0064\u0069\u0063\u0074\u0020\u0062\u0065\u0067\u0069n\u000a\u0062\u0065\u0067\u0069\u006e\u0063\u006d\u0061\u0070\n\u002f\u0043\u0049\u0044\u0053\u0079\u0073\u0074\u0065m\u0049\u006e\u0066\u006f\u0020\u003c\u003c\u0020\u002f\u0052\u0065\u0067\u0069\u0073t\u0072\u0079\u0020\u0028\u0041\u0064\u006f\u0062\u0065\u0029\u0020\u002f\u004f\u0072\u0064\u0065\u0072\u0069\u006e\u0067\u0020\u0028\u0055\u0043\u0053)\u0020\u002f\u0053\u0075\u0070p\u006c\u0065\u006d\u0065\u006et\u0020\u0030\u0020\u003e\u003e\u0020\u0064\u0065\u0066\u000a\u002f\u0043\u004d\u0061\u0070\u004e\u0061\u006d\u0065\u0020\u002f\u0041\u0064\u006f\u0062\u0065-\u0049\u0064\u0065\u006e\u0074\u0069\u0074\u0079\u002d\u0055\u0043\u0053\u0020\u0064\u0065\u0066\u000a\u002fC\u004d\u0061\u0070\u0054\u0079\u0070\u0065\u0020\u0032\u0020\u0064\u0065\u0066\u000a\u0031\u0020\u0062\u0065\u0067\u0069\u006e\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063e\u0072\u0061n\u0067\u0065\n\u003c\u0030\u0030\u0030\u0030\u003e\u0020<\u0046\u0046\u0046\u0046\u003e\u000a\u0065\u006e\u0064\u0063\u006f\u0064\u0065\u0073\u0070\u0061\u0063\u0065r\u0061\u006e\u0067\u0065\u000a";_bfg ="\u0065\u006e\u0064\u0063\u006d\u0061\u0070\u000a\u0043\u004d\u0061\u0070\u004e\u0061\u006d\u0065\u0020\u0063ur\u0072e\u006e\u0074\u0064\u0069\u0063\u0074\u0020\u002f\u0043\u004d\u0061\u0070 \u0064\u0065\u0066\u0069\u006e\u0065\u0072\u0065\u0073\u006f\u0075\u0072\u0063\u0065\u0020\u0070\u006fp\u000a\u0065\u006e\u0064\u000a\u0065\u006e\u0064\u000a";);func _ffbc (_ddb cmapHexString )[]rune {if len (_ddb ._fbg )==1{return []rune {rune (_ddb ._fbg [0])};};_fcab :=_ddb ._fbg ;if len (_fcab )%2!=0{_fcab =append (_fcab ,0);_dg .Log .Debug ("\u0045\u0052\u0052O\u0052\u003a\u0020\u0068\u0065\u0078\u0054\u006f\u0052\u0075\u006e\u0065\u0073\u002e\u0020\u0050\u0061\u0064\u0064\u0069\u006e\u0067\u0020\u0073\u0068\u0065\u0078\u003d\u0025#\u0076\u0020\u0074\u006f\u0020\u0025\u002b\u0076",_ddb ,_fcab );};_agae :=len (_fcab )>>1;_fbag :=make ([]uint16 ,_agae );for _abfa :=0;_abfa < _agae ;_abfa ++{_fbag [_abfa ]=uint16 (_fcab [_abfa <<1])<<8+uint16 (_fcab [_abfa <<1+1]);};_bccg :=_ed .Decode (_fbag );return _bccg ;};func _df (_ggg string )(*CMap ,error ){_acf ,_cee :=_ee .Asset (_ggg );if _cee !=nil {return nil ,_cee ;};return LoadCmapFromDataCID (_acf );};func _bbgf ()cmapDict {return cmapDict {Dict :map[string ]cmapObject {}}};func (cmap *CMap )Stream ()(*_a .PdfObjectStream ,error ){if cmap ._fb !=nil {return cmap ._fb ,nil ;};_gb ,_gba :=_a .MakeStream (cmap .Bytes (),_a .NewFlateEncoder ());if _gba !=nil {return nil ,_gba ;};cmap ._fb =_gb ;return cmap ._fb ,nil ;};func _ea (_ebce string )string {_bb :=[]rune (_ebce );_gbe :=make ([]string ,len (_bb ));for _dea ,_dbgd :=range _bb {_gbe [_dea ]=_e .Sprintf ("\u0025\u0030\u0034\u0078",_dbgd );};return _e .Sprintf ("\u003c\u0025\u0073\u003e",_b .Join (_gbe ,""));};type cmapHexString struct{_bbab int ;_fbg []byte ;};type cmapObject interface{};func (cmap *CMap )toBfData ()string {if len (cmap ._fd )==0{return "";};_bcf :=make ([]CharCode ,0,len (cmap ._fd ));for _fcf :=range cmap ._fd {_bcf =append (_bcf ,_fcf );};_fe .Slice (_bcf ,func (_fecb ,_cgd int )bool {return _bcf [_fecb ]< _bcf [_cgd ]});var _bda []charRange ;_cda :=charRange {_bcf [0],_bcf [0]};_fbe :=cmap ._fd [_bcf [0]];for _ ,_fcd :=range _bcf [1:]{_aga :=cmap ._fd [_fcd ];if _fcd ==_cda ._gef +1&&_abcd (_aga )==_abcd (_fbe )+1{_cda ._gef =_fcd ;}else {_bda =append (_bda ,_cda );_cda ._ccb ,_cda ._gef =_fcd ,_fcd ;};_fbe =_aga ;};_bda =append (_bda ,_cda );var _fff []CharCode ;var _bf []fbRange ;for _ ,_cde :=range _bda {if _cde ._ccb ==_cde ._gef {_fff =append (_fff ,_cde ._ccb );}else {_bf =append (_bf ,fbRange {_fa :_cde ._ccb ,_eef :_cde ._gef ,_db :cmap ._fd [_cde ._ccb ]});};};_dg .Log .Trace ("\u0063\u0068ar\u0052\u0061\u006eg\u0065\u0073\u003d\u0025d f\u0062Ch\u0061\u0072\u0073\u003d\u0025\u0064\u0020fb\u0052\u0061\u006e\u0067\u0065\u0073\u003d%\u0064",len (_bda ),len (_fff ),len (_bf ));var _deg []string ;if len (_fff )> 0{_fcc :=(len (_fff )+_dbf -1)/_dbf ;for _dac :=0;_dac < _fcc ;_dac ++{_bcd :=_fed (len (_fff )-_dac *_dbf ,_dbf );_deg =append (_deg ,_e .Sprintf ("\u0025\u0064\u0020\u0062\u0065\u0067\u0069\u006e\u0062f\u0063\u0068\u0061\u0072",_bcd ));for _bga :=0;_bga < _bcd ;_bga ++{_dec :=_fff [_dac *_dbf +_bga ];_adba :=cmap ._fd [_dec ];_deg =append (_deg ,_e .Sprintf ("\u003c%\u0030\u0034\u0078\u003e\u0020\u0025s",_dec ,_ea (_adba )));};_deg =append (_deg ,"\u0065n\u0064\u0062\u0066\u0063\u0068\u0061r");};};if len (_bf )> 0{_cbf :=(len (_bf )+_dbf -1)/_dbf ;for _ffe :=0;_ffe < _cbf ;_ffe ++{_cad :=_fed (len (_bf )-_ffe *_dbf ,_dbf );_deg =append (_deg ,_e .Sprintf ("\u0025d\u0020b\u0065\u0067\u0069\u006e\u0062\u0066\u0072\u0061\u006e\u0067\u0065",_cad ));for _abc :=0;_abc < _cad ;_abc ++{_ccbe :=_bf [_ffe *_dbf +_abc ];_deg =append (_deg ,_e .Sprintf ("\u003c%\u00304\u0078\u003e\u003c\u0025\u0030\u0034\u0078\u003e\u0020\u0025\u0073",_ccbe ._fa ,_ccbe ._eef ,_ea (_ccbe ._db )));};_deg =append (_deg ,"\u0065\u006e\u0064\u0062\u0066\u0072\u0061\u006e\u0067\u0065");};};return _b .Join (_deg ,"\u000a");};func _afdb (_cffd cmapHexString )CharCode {_dbaf :=CharCode (0);for _ ,_edae :=range _cffd ._fbg {_dbaf <<=8;_dbaf |=CharCode (_edae );};return _dbaf ;};type CharCode uint32 ;func (cmap *CMap )parseCIDRange ()error {for {_ebe ,_cae :=cmap .parseObject ();if _cae !=nil {if _cae ==_c .EOF {break ;};return _cae ;};_cfb ,_egg :=_ebe .(cmapHexString );if !_egg {if _bba ,_bcg :=_ebe .(cmapOperand );_bcg {if _bba .Operand ==_dde {return nil ;};return _da .New ("\u0063\u0069\u0064\u0020\u0069\u006e\u0074\u0065\u0072\u0076\u0061\u006c\u0020s\u0074\u0061\u0072\u0074\u0020\u006du\u0073\u0074\u0020\u0062\u0065\u0020\u0061\u0020\u0068\u0065\u0078\u0020\u0073t\u0072\u0069\u006e\u0067");};};_edff :=_afdb (_cfb );_ebe ,_cae =cmap .parseObject ();if _cae !=nil {if _cae ==_c .EOF {break ;};return _cae ;};_bfad ,_egg :=_ebe .(cmapHexString );if !_egg {return _da .New ("\u0063\u0069d\u0020\u0069\u006e\u0074e\u0072\u0076a\u006c\u0020\u0065\u006e\u0064\u0020\u006d\u0075s\u0074\u0020\u0062\u0065\u0020\u0061\u0020\u0068\u0065\u0078\u0020\u0073t\u0072\u0069\u006e\u0067");};if len (_cfb ._fbg )!=len (_bfad ._fbg ){return _da .New ("\u0075\u006e\u0065\u0071\u0075\u0061\u006c\u0020\u006e\u0075\u006d\u0062\u0065\u0072\u0020o\u0066 \u0062\u0079\u0074\u0065\u0073\u0020\u0069\u006e\u0020\u0072\u0061\u006e\u0067\u0065");};_eeg :=_afdb (_bfad );if _edff > _eeg {_dg .Log .Debug ("\u0045\u0052\u0052\u004f\u0052\u003a \u0069\u006e\u0076\u0061\u006c\u0069\u0064\u0020\u0043\u0049\u0044\u0020\u0072\u0061\u006e\u0067\u0065\u002e\u0020\u0073t\u0061\u0072\u0074\u003d\u0030\u0078\u0025\u0030\u0032\u0078\u0020\u0065\u006e\u0064=\u0030x\u0025\u0030\u0032\u0078",_edff ,_eeg );return ErrBadCMap ;};_ebe ,_cae =cmap .parseObject ();if _cae !=nil {if _cae ==_c .EOF {break ;};return _cae ;};_eba ,_egg :=_ebe .(cmapInt );if !_egg {return _da .New ("\u0063\u0069\u0064\u0020\u0073t\u0061\u0072\u0074\u0020\u0076\u0061\u006c\u0075\u0065\u0020\u006d\u0075\u0073t\u0020\u0062\u0065\u0020\u0061\u006e\u0020\u0064\u0065\u0063\u0069\u006d\u0061\u006c\u0020\u006e\u0075\u006d\u0062\u0065\u0072");};if _eba ._bfgd < 0{return _da .New ("\u0069\u006e\u0076al\u0069\u0064\u0020\u0063\u0069\u0064\u0020\u0073\u0074\u0061\u0072\u0074\u0020\u0076\u0061\u006c\u0075\u0065");};_bgb :=_eba ._bfgd ;for _caee :=_edff ;_caee <=_eeg ;_caee ++{cmap ._eefe [_caee ]=CharCode (_bgb );_bgb ++;};_dg .Log .Trace ("C\u0049\u0044\u0020\u0072\u0061\u006eg\u0065\u003a\u0020\u003c\u0030\u0078\u0025\u0058\u003e \u003c\u0030\u0078%\u0058>\u0020\u0025\u0064",_edff ,_eeg ,_eba ._bfgd );};return nil ;};