export default class CSSStyleDeclaration{constructor(cssModel,parentRule,payload,type){this._cssModel=cssModel;this.parentRule=parentRule;this._allProperties;this.styleSheetId;this.range;this.cssText;this._shorthandValues;this._shorthandIsImportant;this._activePropertyMap;this._leadingProperties;this._reinitialize(payload);this.type=type;} rebase(edit){if(this.styleSheetId!==edit.styleSheetId||!this.range){return;} if(edit.oldRange.equal(this.range)){this._reinitialize((edit.payload));}else{this.range=this.range.rebaseAfterTextEdit(edit.oldRange,edit.newRange);for(let i=0;i=0;--i){if(this.allProperties()[i].range){return i+1;}} return 0;} _insertionRange(index){const property=this.propertyAt(index);return property&&property.range?property.range.collapseToStart():this.range.collapseToEnd();} newBlankProperty(index){index=(typeof index==='undefined')?this.pastLastSourcePropertyIndex():index;const property=new SDK.CSSProperty(this,index,'','',false,false,true,false,'',this._insertionRange(index));return property;} setText(text,majorChange){if(!this.range||!this.styleSheetId){return Promise.resolve(false);} return this._cssModel.setStyleText(this.styleSheetId,this.range,text,majorChange);} insertPropertyAt(index,name,value,userCallback){this.newBlankProperty(index).setText(name+': '+value+';',false,true).then(userCallback);} appendProperty(name,value,userCallback){this.insertPropertyAt(this.allProperties().length,name,value,userCallback);}} export const Type={Regular:'Regular',Inline:'Inline',Attributes:'Attributes'};self.SDK=self.SDK||{};SDK=SDK||{};SDK.CSSStyleDeclaration=CSSStyleDeclaration;SDK.CSSStyleDeclaration.Type=Type;